Colton Idle
05/22/2021, 4:14 AMerrorModalShowing: Boolean
Not sure if I'm missing some kind of best practice here, but let's take a quick poll!
Do you treat modals as:
1️⃣ State
2️⃣ EventKyant
05/22/2021, 4:34 AMKulwinder Singh
05/22/2021, 7:31 AMnavController
in main or root Composable and then we either have to pass this to other Composable or we have to get callback in root for navigation(please correct me if i’m wrong here) , so we are not sure how much scalable it is for bigger apps with many screens ? so that’s why i want to check if there is any good implementation of navigation component in compose ?Ink
05/22/2021, 11:38 AMval welcomeModule = module {
single<MyService> { MyServiceImpl() }
}
ViewModel:
class MyViewModel(private val myService: MyService) : ViewModel() {
...
}
@Composable function:
@Composable
fun Screen(){
val myViewModel: MyViewModel= viewModel()
}
I tried:
val myService = get<MyService>()
and put it to viewModel() but it doesn't workNat Strangerweather
05/22/2021, 3:23 PMSaiedmomen
05/22/2021, 6:57 PMArchie
05/22/2021, 7:09 PMColor.Red -> Color.Yellow -> Color.Green
. I wanted to be able to get the color given a certain percentage. I tried updateTransition(...)
but it seems that it only applies to a targeted state but not the in-betweens. Any advice? Thanks in advance.Paul Woitaschek
05/22/2021, 7:33 PMEmojiCompat.get()
and that breaks the preview because EmojiCompat wasnt initialized because as we're inside the preview the application wasn't created.
(sth like View.isInEditMode
but statically available?)Bradleycorn
05/22/2021, 7:46 PMSubComposeLayout
and Intrinsics
work together? For example something like the following:
Row(modifier = Modifier.fillMaxWidth.height(IntrinsicSize.Min)) {
BoxWithConstraints(...) {
...
}
}
this currently crashes with an IllegalStateException with a message of
Intrinsic measurements are not currently supported by SubcomposeLayoutAny way to “fix” this?
Colton Idle
05/22/2021, 7:47 PMhenrikhorbovyi
05/23/2021, 12:41 AMTin Tran
05/23/2021, 7:25 AMvipulasri
05/23/2021, 7:41 AM@Preview
annotation not working in library module. Is this intentional? I am getting this issue:
The following classes could not be instantiated:
- androidx.compose.ui.tooling.preview.ComposeViewAdapter
Shakil Karim
05/23/2021, 3:36 PMchansek
05/23/2021, 5:10 PMandroid:minLines
Nacho Ruiz Martin
05/23/2021, 5:51 PMThreeTenABP
library to manage dates in Android? As soon as a Date is used in the composables, the Preview fires an error because the timezone data is not registered. Is there anyway to initialize this kind of libraries in Preview mode?ste
05/23/2021, 6:52 PMjava.lang.IllegalStateException: function = <anonymous>, count = 4, index = 4
.
beta06
was working fine. I also upgraded navigation to 2.4.0-alpha01
, but didn't help. Full error in thread.Nat Strangerweather
05/23/2021, 8:55 PMmattinger
05/23/2021, 10:10 PMmattinger
05/23/2021, 10:19 PMmattinger
05/23/2021, 10:23 PMxxfast
05/24/2021, 12:47 AMDaniele B
05/24/2021, 6:06 AMRow
or Column
are defined as inline
. What is the purpose? and does it ever make sense for custom composables to be defined as inline?Tigran Galstyan
05/24/2021, 7:11 AMBino
05/24/2021, 8:27 AMCard(modifier = Modifier.background(linear))
Will set the background behind the card
Card(backgroundColor = cardBackground)
will only accept Color
and no Brush
Daniele B
05/24/2021, 8:59 AMiconComposable
and textComposable
based on the selected
flag. How should I do this correct?Ravi
05/24/2021, 9:07 AMSpaceHeight(16.dp)
, SpacerWidth(16.dp)
. After rolling out to beta channel we are observing crashes on some devices, more in the thread
@Composable
fun SpacerHeight(size: Dp) {
Spacer(modifier = Modifier.height(size))
}
@Composable
fun SpacerWidth(size: Dp) {
Spacer(modifier = Modifier.width(size))
}
alorma
05/24/2021, 9:10 AMLazyListScope.stickyHeader { ... }
to know when it's being sticked to the top? For example to make it different color, or have some elevationShakil Karim
05/24/2021, 11:21 AMSlackbot
05/24/2021, 12:08 PMSlackbot
05/24/2021, 12:08 PMursus
05/24/2021, 12:54 PM