electrolobzik
01/30/2024, 7:33 PMArchie
01/31/2024, 11:03 AMChildSlot
vs a ChildStack
. So far it feels like anything that could be a ChildStack
could be implemented by using a ChildSlot
. When is it a good idea to use a ChildSlot
vs ChildStack
? Any specific usecase you have in mind? Thanks in advance.Ali haider
02/01/2024, 10:47 AMDragos Rachieru
02/01/2024, 3:48 PMViewModel
is being migrated to multiplatform, will future decompose versions add support for this?
https://issuetracker.google.com/issues/214568825#comment3Benjamin Deroche
02/02/2024, 3:42 PMChildSlot
for a "static" child? All I want is to split my code into more components because the level of complexity of this particular screen is way too highFyodor Danilov
02/07/2024, 10:52 AMcomponent1
I have implemented the following:
fun DoubleBackCallback(
backHandler: BackHandler,
scope: CoroutineScope,
onBackClicked: () -> Unit,
onDoubleBackClicked: () -> Unit,
) {
var job: Job? = null
var doubleBackPressed = false
var backCallback: BackCallback? = null
backCallback = BackCallback {
if (doubleBackPressed) {
onDoubleBackClicked()
} else {
onBackClicked()
doubleBackPressed = true
job?.cancel()
job = scope.launch(Dispatchers.Default) {
delay(DELAY)
doubleBackPressed = false
}
}
}
backHandler.register(backCallback)
}
DoubleBackCallback(
backHandler = backHandler,
scope = scope,
onBackClicked = {
/* Show snackbar "Click again to exit" */
},
onDoubleBackClicked = {
output(Output.Exit)
}
)
Output.Exit
goes to tab1
where it is processed. However I can't close app when I call navigation.pop()
, even though component1
is the only component inside tab1
. How can I close my app correctly on Output.Exit
? When I don't use BackCallback app closes correctly in component1
on back button press.Sean Proctor
02/08/2024, 2:57 PMinstanceKeeper
. When the component leaves the stack, onDestroyed
is called on the data. When the component is re-added to the stack, the same data is returned by instanceKeeper.getOrCreate
that had been previously destroyed. This is with 3.0.0-alpha05.Ali haider
02/08/2024, 4:13 PM@Serializable
sealed class Configuration {
@Serializable
data class ProductDetailScreen(val product: ProductModel) : Configuration()
}
Then How can I make childStack? because it giving me an error?
val childStack = _childStack_(
source = navigation,
initialConfiguration = Configuration.ProductDetailScreen,
serializer = Configuration.serializer(),
handleBackButton = true,
childFactory = ::createChild
)
Arkadii Ivanov
02/09/2024, 9:40 AMUzMbApps
02/09/2024, 4:05 PMVaibhav Jaiswal
02/10/2024, 1:32 PMArkadii Ivanov
02/10/2024, 10:25 PM3.0.0-alpha06
is released!
👉 Animate predictive back gesture cancellation
👉 Added edgeWidth
, startingOffsetThreshold
and confirmationProgressThreshold
parameters for PredictiveBackGestureOverlay
👉 Removed StackNavigationSource
, SlotNavigationSource
and PagesNavigationSource
interfaces
👉 Fixed animation on hardware back button click with predictive back gesture enabled
⚠️ Important release notes: https://github.com/arkivanov/Decompose/releases/tag/3.0.0-alpha06Vaibhav Jaiswal
02/11/2024, 10:32 AMinit
block run again, which is resulting to API calls being made againelectrolobzik
02/13/2024, 12:33 PMelectrolobzik
02/15/2024, 2:44 PMinit {
lifecycle.doOnResume {
log(" lifecycle.doOnResume")
store.accept(Intent.RefreshLocationStatus)
store.accept(Intent.RefreshSelfieStatus)
}
}
Djuro
02/20/2024, 9:23 AM1.6.0-beta01
versions be available?Arkadii Ivanov
02/20/2024, 9:32 PM3.0.0-alpha07
is released!
👉 Don't remove the first configuration on popWhile
👉 Inlined the rest of navigation extensions with lambdas
👉 Updated Kotlin to 1.9.22
, Compose to 1.6.0-rc02
, also updated Pages
Composable API
👉 Buffer navigation events during initialisation
👉 Added androidPredictiveBackAnimatable
👉 Updated Essenty to 2.0.0-alpha07
👉 Removed ApplicationLifecycle
and used the new one from Essenty
👉 Fixed predictive back gesture not working when started during normal transition
Release notes: https://github.com/arkivanov/Decompose/releases/tag/3.0.0-alpha07Djuro
02/23/2024, 9:04 AM3.0.0-alpha07
It has nothing to do with decompose but Android Studio IDE gives errors like
unresolved kotlinx.coroutines
for example.
This is also present on a bunch of other places and gives weird errors
I am using Kotlin 1.9.21
and jetbrains-compose 1.6.0-alpha01
due limitations imposed by another library.
Did anyone have a similar issue?Abdul Basit
02/24/2024, 1:38 PMEssenty
ribesg
02/26/2024, 2:54 PMComposeUIViewController
just does not seem to start or somethingelectrolobzik
02/29/2024, 3:57 PMChildren
block in the ProfileRoot function and change the navigation (once) from “Profile” to “Replace Selfie” I get a lot of calls and the most weird part is that the children alternate. I tried to find a source of this problem, but with no luck. Do you have any idea why it may happen? (logs in the thread)Djuro
03/01/2024, 10:42 AMMutableValue
or similar that doesn't reemit the same value. I am interested if there is something provided by the lib that has this behaviour.
I noticed that `MutableValue`'s compareAndSet
reemit the same values. Is there if not that, then at least an atomic get
that uses a mutex/lock so that I could perform a check before I update
my MutableValue
?Vaibhav Jaiswal
03/01/2024, 1:13 PMFeedPostItem(
post = it,
modifier = Modifier.fillMaxWidth(),
onAction = component::handlePostAction
)
Arkadii Ivanov
03/02/2024, 4:14 PM3.0.0-alpha08
is released!
👉 Fixed predictive back animation not working sometimes (regression in 3.0.0-alpha07
)
👉 Fixed screen corners blinking when the predictive back gesture starts
👉 Fixed screen corner animations in androidPredictiveBackAnimatable
👉 Minor fixes and changes
Release notes: https://github.com/arkivanov/Decompose/releases/tag/3.0.0-alpha08Nicholas Tietje
03/04/2024, 4:59 AMVaibhav Jaiswal
03/07/2024, 3:16 PMAnum Amin
03/11/2024, 7:11 PMVaibhav Jaiswal
03/12/2024, 11:07 AMRootComponent
|-> ScreenAComponent
|-> ScreenBComponent
............
I want to have a parent component only for ScreenA and ScreenB,
Which is alive till either of the component is alive, and should destroy when none of the two component is in the StackArkadii Ivanov
03/14/2024, 9:46 PM3.0.0-alpha09
is released!
👉 Improved component context API for easier custom component contexts
👉 Monitor window focused state in desktop LifecycleController
👉 Updated Kotlin to 1.9.23
, Compose to 1.6.1
and other dependencies
Release notes: https://github.com/arkivanov/Decompose/releases/tag/3.0.0-alpha09s3rius
03/19/2024, 8:19 AMchildContext()
function to shadow ComponentContext.childContext().
interface AppContext : ComponentContext {
val parentContext: AppContext?
}
private class DefaultAppContext(override val parentContext: AppContext?, baseContext: ComponentContext) :
AppContext,
ComponentContext by baseContext
fun AppContext.childContext(key: String) = DefaultAppContext(this, childContext(key)) // <- this actually resolves fine
All-in-all this actually works quite nicely; most details are abstracted away and I can easily provide some functionality to all components. With the proper TestContext testing is no problem too.
With the new factory, I think it would change into this:
private class DefaultAppContext(
override val parentContext: AppContext?,
override val lifecycle: Lifecycle,
override val stateKeeper: StateKeeper
override val instanceKeeper: InstanceKeeper
override val backHandler: BackHandler
) : AppContext, ComponentContext {
override val componentContextFactory = AppComponentContextFactory(this)
}
class AppComponentContextFactory(val self: AppContext) : ComponentContextFactory<AppContext> {
operator fun invoke(
lifecycle: Lifecycle,
stateKeeper: StateKeeper,
instanceKeeper: InstanceKeeper,
backHandler: BackHandler,
) = DefaultAppContext(self, lifecycle, StateKeeper, instanceKeeper, backHandler)
}
Basically the same; probably a little nicer due to the removal of the childContext override.
If you have an idea for a more elegant solution, I'd love to hear it!