ribesg
11/17/2020, 4:34 PMSlackbot
11/17/2020, 4:41 PMSerhii K
11/17/2020, 5:07 PMcom.android.tools.build:gradle:4.1.1 // And I updated gradle
Kshitij Patil
11/18/2020, 3:48 AMRemoteMediator
? Especially the cases where we decide the page based on loadType
and state
.
Also, where can I ask more Paging 3 related questions?Elnur Jeksenov
11/18/2020, 4:47 AMSlackbot
11/18/2020, 3:41 PMMitch
11/19/2020, 12:32 AMSlackbot
11/19/2020, 2:49 AMRengu N
11/19/2020, 2:53 AMriflockle
11/19/2020, 8:01 AMgithub actions
now? My kotlin style test, dependencyTest, Unit Test are very slow....Tim Malseed
11/19/2020, 10:45 AMkenkyee
11/19/2020, 12:46 PMEric Ampire [MOD]
11/19/2020, 2:22 PMapply plugin: 'kotlin-android-extensions'
I tried to add Kotlin parcelize plugin apply plugin: 'kotlin-parcelize'
but after adding parcelize plugin a got this error message
Plugin [id: 'kotlin-parcelize'] was not found in any of the following sources:
Can someone explain why?Ryan
11/19/2020, 3:43 PMOrhan Tozan
11/19/2020, 4:08 PMlifecycleScope.launchWhenStarted {}
misleading?
lifecycleScope.launch { ... }
-> launches the coroutine immediatly, gets canceled when lifecycle is destroyed.
Now I would expect lifecycleScope.launchWhenStarted { ... }
to behave the same as the above, except it being different in the timing of the coroutine launching: coroutine gets launched when the lifecycle is started, and gets canceled when lifecycle is destroyed.
But what it actually does, is also suspend the coroutine after it is launched, when the lifecycle is stopped.
Maybe I've misunderstood it, but if not, I think a more fitting name would be something like lifecycleScope.runWhileStarted {...}
? Or maybe perhaps a whole new scope? (lifecycleStartedScope
), It feels like these launchWhen
methods try to emulate sub-coroutinescopes that could be replaced by introducing new lifecyclescopes that are different instances of CoroutineScope, an API that exists for handling the lifecycles of coroutines.
Curious to hear your thoughts about this.Brady Aiello
11/19/2020, 5:18 PMCorey Lanier
11/20/2020, 2:29 AMSlackbot
11/20/2020, 7:03 AMAlexa_Gal
11/20/2020, 7:34 PMGabriel Brollo
11/20/2020, 11:50 PMVal Salamakha
11/21/2020, 12:08 AMRahul Mishra
11/22/2020, 12:41 AMPriyank Jain
11/22/2020, 11:00 AMAlessandro Toninelli
11/22/2020, 12:24 PMJonny
11/22/2020, 1:39 PM@Provides
@MainScope
fun contributeViewModel(isSignedInUseCase: IsSignedInUseCase, signOutUseCase:SignOutUseCase, toolbarViewConfig: ToolbarViewConfig): MainActivityViewModel =
MainActivityViewModel(isSignedInUseCase, signOutUseCase, toolbarViewConfig)
and then I build it in MainActivity using my builder, and then I can access the viewmodel there.
interface MainComponent {
fun mainViewModel(): MainActivityViewModel
fun navController(): NavController
@Component.Builder
interface Builder {
fun build(): MainComponent
@BindsInstance
fun activity(activity: AppCompatActivity): Builder
fun coreComponent(coreComponent: CoreComponent): Builder
}
}
Am I missing something? Will the viewmodel not be provided to me in the same way using this method? Here's how I use it in MainActivity:
mainComponent = DaggerMainComponent
.builder()
.coreComponent(coreComponent)
.activity(this)
.build()
mainActivityViewModel = mainComponent.mainViewModel()
Slackbot
11/22/2020, 3:23 PMLilly
11/23/2020, 2:43 AMActivity
belongs to which screen. Is there a faster way than setting break points arbitrarily to determine this?dammy_abayomi
11/23/2020, 1:11 PMStateFlow
🤝 DataBinding
in a similar way as LiveData
do. It seems there isn’t a default implementation at the moment that supports it.
I found an example online which seems quite “burdensome” if one needs to implement it for a bigger project https://github.com/STAR-ZERO/sample-stateflow-databinding
Do you use StateFlow
🤝 DataBinding
? How do you connect them?Nikita Khlebushkin
11/23/2020, 1:48 PMBen Butterworth
11/23/2020, 5:17 PMmyMapObject.asSequence().map {
yield Pair(it.key, processValue(it.value))
}
but the iterator method override fun next(): Pair<String, OutputType> {}
doesn't return sequences, but the actual value. My understanding of yield is that it needs to be inside a coroutine, so yield isn't really what im looking for? (im taking cues from the python yield keyword, which is very different)Ben Butterworth
11/23/2020, 5:17 PMmyMapObject.asSequence().map {
yield Pair(it.key, processValue(it.value))
}
but the iterator method override fun next(): Pair<String, OutputType> {}
doesn't return sequences, but the actual value. My understanding of yield is that it needs to be inside a coroutine, so yield isn't really what im looking for? (im taking cues from the python yield keyword, which is very different)Vampire
11/23/2020, 5:33 PMyield
is not necessary here, it would allow you to produce values for an arbitrary sequence.
It is a suspending function, so it has to be called from a suspending function: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.sequences/-sequence-scope/yield.html
If you for example use the sequence
function, the lambda you give it is a suspending function, so you can call yield
in it: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.sequences/sequence.html
But as you just want to map the elements of an existing sequence, yield
is not what you are after, just omit it and you have what you want.Ben Butterworth
11/23/2020, 5:36 PMoverride fun next(): Pair<String, ObjectType> {}
it cant return a sequence, which is why it wont work. I want it to be an iterator so clients can call each item independently. Unless this is also possible with sequences?Vampire
11/23/2020, 5:39 PMBen Butterworth
11/23/2020, 5:42 PMVampire
11/23/2020, 5:49 PMmyMapObject.asSequence().map { Pair(it.key, processValue(it.value)) }.iterator()
Ben Butterworth
11/23/2020, 5:51 PM