Sam
12/03/2020, 1:16 PMjean pokou
12/03/2020, 3:14 PMSanbosayDev
12/03/2020, 3:19 PMluke_c
12/03/2020, 4:31 PMSam
12/03/2020, 10:13 PMgradle info com.googlecode.libphonenumber:libphonenumber
?Goose
12/04/2020, 5:15 AMInitializer is not allowed here because this property has no backing field
Yuri Drigin
12/04/2020, 5:30 AMval word: Live<String> = _word
coroutinedispatcher
12/05/2020, 10:41 AMLiveData
and I want to make an extension function that transforms it to Flow
(since I am using Flow
all over the App)
https://gist.github.com/chibatching/9fdd23d0d41980980a1c1af2e1803e01Charlie Christensen
12/05/2020, 5:38 PMDataStore
if I want to access a value synchronously the documentation says to use runBlocking
like so runBlocking { dataStore.data.first() }
Would I be able to instead use something like
withContext(<http://Dispatchers.IO|Dispatchers.IO>) { dataStore.data.first() }
What is the difference between those two approaches?Florian
12/06/2020, 8:56 AMtylerwilson
12/07/2020, 4:31 PMSlackbot
12/07/2020, 7:40 PMLilly
12/08/2020, 2:22 AMdata class Test(val test1: Int, val test2: Int)
This would be the base and if a specific condition is satisfied:
data class Test(val test1: Int, val test2: Int, val test3: Int)
I could create 2 separate data classes but then I always have to pass both and I'd like to deal only with one data class. Does someone has an idea?Kshitij Patil
12/08/2020, 6:22 AMFragmentContainerView
to its child fragments (which are part of the navigation graph used by FragmentContainerView)Erik
12/08/2020, 6:35 AMgsala
12/08/2020, 8:53 AMStateFlow
. Does it make sense to do so? Is there another library that is doing that?Slackbot
12/08/2020, 7:48 PMNav Singh
12/08/2020, 11:29 PMKshitij Patil
12/09/2020, 1:38 PMCoroutineWorker
with foregroundInfo
isn't working in my case. I've opened up a websocket connection and want to listen for messages in background forever.Sagar Suri
12/10/2020, 5:50 AMMuhammad Aqib
12/10/2020, 7:58 AModay
12/11/2020, 1:00 PMfirstOrNull
or find
on it produces exception index out of bounds?Arkangel
12/11/2020, 5:22 PMgowthamgts
12/12/2020, 6:03 AMChetan Tuteja
12/12/2020, 7:08 AMheisenberg
12/12/2020, 9:42 AMChetan Tuteja
12/12/2020, 11:32 AMKshitij Patil
12/12/2020, 3:35 PMmoshi-sealed
extension might help in this scenario but I'm afraid I won't be having any "type" parameter in the json which is required for moshi-sealed
. Any tutorial hinting different approaches would also work.Daniel
12/13/2020, 12:20 PMreified
in this mehod?
I want to have a method which loads a value from the firebase database and the value needs to be properly typed when returned
class OnlinePersistence {
suspend inline fun <reified T> loadValue(path: OnlinePersistencePath, default: T) =
withContext(IO) {
suspendCancellableCoroutine<T> { continuation ->
FirebaseDatabase
.getInstance()
.getReference(path.rawPath)
.addListenerForSingleValueEvent(object : ValueEventListener {
override fun onDataChange(snapshot: DataSnapshot) {
if(continuation.isActive) {
val value = snapshot.getValue<T>()
if(value != null) {
continuation.resume(value)
} else {
continuation.resume(default)
}
}
}
override fun onCancelled(error: DatabaseError) {
if(continuation.isActive) {
continuation.resume(default)
}
}
})
}
}
}
All well and good now, but when I extract
FirebaseDatabase.getInstance()
into the constructor I cannot make it private like it should be. (Since the method is inline because of reified)sbeve
12/13/2020, 4:25 PM