Joseph Hawkes-Cates
11/16/2022, 9:36 PMremember
in a few of our screens. Essentially I have multiple “Screen” level composables which store a remembered value in a val and the val has the same name in all of those composables. This results in the remembered value actually being shared across these screens as I navigate between them. Is this expected? 🧵stack
11/17/2022, 4:38 AMAldi Kitta
11/17/2022, 4:44 AMJoseph Hawkes-Cates
11/17/2022, 5:01 AMsingleTask
so that our app does not have multiple instances running in different tasks. When we open a task we are seeing two instances of our Activity being created which has lead to some issues. More in 🧵xxfast
11/17/2022, 6:40 AMmattinger
11/17/2022, 6:56 AMElio Maroun
11/17/2022, 7:35 AMElio Maroun
11/17/2022, 7:35 AMElio Maroun
11/17/2022, 7:36 AMElio Maroun
11/17/2022, 8:06 AM@Composable
fun OnBoardingGraph(navController: NavHostController) {
NavHost(
navController = navController,
route = NavGraph.AuthGraph,
startDestination = Login.route
) {
composable(Login.route) {
LoginPage(viewModel = getViewModel { parametersOf(navController) })
}
composable(ForgotPassword.route) {
ForgotPasswordPage()
}
composable(ResetPassword.route) {
ResetPasswordPage()
}
}
}
Elio Maroun
11/17/2022, 8:06 AMfun NavGraphBuilder.mainPagesNavGraph(
navController: NavHostController
) {
navigation(
startDestination = Appointments.route,
route = NavGraph.MainPagesGraph
) {
composable(
route = Appointments.route
) {
AppointmentsPage(viewModel = getViewModel { parametersOf(navController) })
}
composable(route = Agenda.route) {
AgendaPage()
}
composable(route = Patients.route) {
PatientListPage(viewModel = getViewModel { parametersOf(navController) })
}
composable(route = Search.route) {
SearchPage()
}
}
}
czuckie
11/17/2022, 8:28 AMLaunchedEffect
but I can't find a way to emphasise that with a test.KotlinLeaner
11/17/2022, 9:23 AMval isBluetoothEnabled = MutableStateFlow(false)
whenever I tried to use the value of variable like this
.value
i.e. isBluetoothEnabled.value
. So I am trying to use delegate property to avoid using .value
val isBluetoothEnabled by MutableStateFlow(false)
but I am getting weird error
Type 'MutableStateFlow<TypeVariable(T)>' has no method 'getValue(PairViewModel, KProperty<*>)' and thus it cannot serve as a delegate
PHondogo
11/17/2022, 9:32 AMAlexandru Hadăr
11/17/2022, 10:01 AM@Composable
fun <T> CardList(
items: List<T>,
) {
// TODO Draw your list here.
}
Lisandro Di Meo
11/17/2022, 12:12 PMAmrJyniat
11/17/2022, 2:13 PMonPageChangedListener()
in HorizontalPager
Accompanist? I want to trigger some function when the user swiping to another page.Othman El Jazouli
11/17/2022, 2:27 PMvar selectedUser: String? by remember {
mutableStateOf(null)
}
ModalBottomSheetLayout(
sheetState = sheetState,
sheetContent = {
selectedUser?.let {
UserDetail(
id = selectedUser,
onCloseClick = {
coroutineScope.launch {
sheetState.hide()
selectedUser = null
}
}
)
} ?: Box(modifier = Modifier.fillMaxSize())
},
) {
...
coroutineScope.launch {
selectedUser = "userid"
sheetState.show()
}
}
I added the default Box
because otherwise there is an exception
java.lang.IllegalArgumentException: The initial value must have an associated anchor.
so my questions is do you guys think this is the right way of making a dynamic modal bottom sheet or is there a better way without going through the Box?
(I know I could use scaffold but I don’t want interaction with the main screen)Oliver.O
11/17/2022, 3:00 PMSnapshot
multi-threading: "_Reading a state that was created after the snapshot was taken or in a snapshot that has not yet been applied_". Details in 🧵.Gabriele Lizzos
11/17/2022, 8:07 PMKotlin: [Internal Error] java.lang.IllegalStateException: The provided plugin androidx.compose.compiler.plugins.kotlin.ComposeComponentRegistrar is not compatible with this version of compiler
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.registerExtensionsFromPlugins$cli(KotlinCoreEnvironment.kt:664)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$ProjectEnvironment.registerExtensionsFromPlugins(KotlinCoreEnvironment.kt:169)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.configureProjectEnvironment(KotlinCoreEnvironment.kt:566)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:199)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:108)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createForProduction(KotlinCoreEnvironment.kt:445)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.createCoreEnvironment(K2JVMCompiler.kt:192)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:143)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:53)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:99)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:47)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:101)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1571)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.AbstractMethodError: Receiver class androidx.compose.compiler.plugins.kotlin.ComposeComponentRegistrar does not define or inherit an implementation of the resolved method 'abstract void registerProjectComponents(com.intellij.mock.MockProject, org.jetbrains.kotlin.config.CompilerConfiguration)' of interface org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar.
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.registerExtensionsFromPlugins$cli(KotlinCoreEnvironment.kt:656)
... 29 moreMehdi Haghgoo
11/17/2022, 8:39 PMAndrea
11/17/2022, 10:05 PMwck
11/18/2022, 3:41 AMFragmentScenario
so there is no concept of an Activity
so I guess createAndroidComposeRule
won’t be useful as it only takes activity.gowtham 6674
11/18/2022, 6:30 AModay
11/18/2022, 10:15 AMitems
, and when something happens to one of the items’ onClick (defined in itemContent), I want the items
value to change, the list to be shuffled, re-ordered, etc.. how can I do that ?loloof64
11/18/2022, 12:55 PMclipAsMinimumSquare
, but in the preview it seems that the composable to which I'm calling this modifier is still a rectangle, whereas its content is a square.
As you can see from the code, I'm calling layout
on the Modifier
, but it seems that I've not defined it well.czuckie
11/18/2022, 2:18 PManimateColorAsState
break my @Preview
in Flamingo?zt
11/18/2022, 2:42 PMJoseph Hawkes-Cates
11/18/2022, 3:45 PMDavid Corrado
11/18/2022, 3:51 PMDavid Corrado
11/18/2022, 3:51 PMKirill Grouchnikov
11/18/2022, 4:07 PMDavid Corrado
11/18/2022, 4:25 PMBoxWithConstraints(
modifier = Modifier
.fillMaxWidth()
) {
val maxWidth = with(LocalDensity.current) {
constraints.maxWidth.toDp()
}
Column {
Text(
modifier = Modifier.padding(bottom = 2.dp),
text = "Test",
)
}
}
Kirill Grouchnikov
11/18/2022, 4:33 PMDavid Corrado
11/18/2022, 4:36 PMZach Klippenstein (he/him) [MOD]
11/18/2022, 7:56 PMKirill Grouchnikov
11/18/2022, 7:58 PMBox
.David Corrado
11/18/2022, 8:55 PMKirill Grouchnikov
11/18/2022, 8:58 PM