Shivam Kumar Jha
08/27/2021, 7:01 AMziv kesten
08/27/2021, 7:30 AMpackagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}' // ???
}
}
Does anyone know what this means?Marco
08/27/2021, 8:38 AMnavigation(startDestination = "step1", route = "signup") {
composable(route = "step1") {
Step1Screen(hiltViewModel<SignUpViewModel>())
}
composable(route = "step2") {
Step2Screen(hiltViewModel<SignUpViewModel>())
}
composable(route = "step3") {
Step2Screen(hiltViewModel<SignUpViewModel>())
}
}
composable(MainRoutes.ConfirmEmail) {
...
}
my goal is to have the same SignUpViewModel
instance in the three composable. With the current implementation each screens have a different instance (so I lost previous steps states). Any idea to handle this scenario? Because a different solution is to use another NavHost with a different NavigatrionController, but I would avoid itadjpd
08/27/2021, 11:06 AMText(
"this is not shown",
color = MaterialTheme.colors.onSurface,
)
Text(
"but this is shown,
color = MaterialTheme.colors.onSurface.copy(alpha = 0.6f),
)
rajesh
08/27/2021, 11:44 AMrsktash
08/27/2021, 1:10 PMrsktash
08/27/2021, 1:22 PMCsaba Kozák
08/27/2021, 1:45 PMrajesh
08/27/2021, 3:07 PMCompositionLocal
for this to pass userId?mattinger
08/27/2021, 3:27 PMScott Kruse
08/27/2021, 3:50 PMrsktash
08/27/2021, 5:40 PMNikita
08/27/2021, 5:42 PMAshu
08/27/2021, 8:17 PMPreviewActivity 404
issue. And after that, each run requires me to first clean and rebuild the project and then run it. Seriously any help would be greatly appreciated.Ricardo García
08/27/2021, 8:38 PMChachako
08/27/2021, 10:01 PMclickable
use runBlocking
to allow the click callback to be suspend internallySlackbot
08/27/2021, 10:09 PMrsktash
08/27/2021, 10:17 PMBradleycorn
08/27/2021, 11:52 PMMapView
(or maybe really a question about the LocalLifecycleOwner
Composition Local) that is used in the *Crane Sample app*….
The app uses a separate activity for the Details screen which contains the MapView
. The MapView
follows the lifecycle of the LocalLifecycleOwner
(by setting up an observer on the owner’s lifecycle and calling the corresponding MapView method when the lifecycle’s state changes). I guess my question is whether that setup is “binding” the MapView to the lifecycle of the Activity, or the lifecycle of the composition in which it’s used?
For example, in the (parent) DetailsContent
composable, say I were to setup a boolean state value that gets toggled when clicking on one of the Text composables. And then I wrap the call to the CityMapView
composable to only get called when the state value is true (thus creating the ability to toggle the map display on an off). If I then click on the text and toggle the map display off (CityMapView
leaves the composition), will the MapView have it’s onStop and onDestroy methods called? Or is it “bound” to the activity, and it will continue to exist (and be resumed) since the activity’s lifecycle still exists and is resumed? if that is the case, it seems like toggling it on and off would be problematic.Florian
08/28/2021, 7:45 AMadjpd
08/28/2021, 10:26 AMNonSdkApiUsedViolation
, I'd like to know too. Thanks.Florian
08/28/2021, 12:32 PMorangy
08/28/2021, 2:13 PMShakil Karim
08/28/2021, 3:23 PMJan Skrasek
08/28/2021, 4:24 PMbottomSheet() {}
navigation implemented the same way as the dialog {}
one -> i.e. via the Window API?
https://github.com/google/accompanist/tree/main/navigation-materialtheapache64
08/28/2021, 4:35 PMThis value is not likely to be unique but is not guaranteed uniqueOR
This value is likely to be unique but is not guaranteed unique?? 🤔 Source
Florian
08/28/2021, 7:36 PM@AndroidEntryPoint
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
val selectedTheme by appPreferencesViewModel.selectedTheme.collectAsState(null)
selectedTheme?.let { selectedTheme ->
val darkTheme = when (selectedTheme) {
ThemeSelectionValues.LIGHT -> false
ThemeSelectionValues.DARK -> true
ThemeSelectionValues.SYSTEM -> isSystemInDarkTheme()
}
MyAppTheme(darkTheme = darkTheme) {
// ActivityBody with NavHost
}
}
}
}
}
rsktash
08/28/2021, 10:05 PMSanendak
08/28/2021, 10:59 PMadjpd
08/28/2021, 11:32 PMremember
. But they don't mention that, if you want the content to persist after configuration changes (screen rotation), you need rememberSaveable
The docs do mention it, of course. But the pathway doesn't. If anyone from Google reads this, it may be worth mentioning it in the pathway. I completely forgot about it and released an app.adjpd
08/28/2021, 11:32 PMremember
. But they don't mention that, if you want the content to persist after configuration changes (screen rotation), you need rememberSaveable
The docs do mention it, of course. But the pathway doesn't. If anyone from Google reads this, it may be worth mentioning it in the pathway. I completely forgot about it and released an app.Albert Chang
08/29/2021, 10:49 AMadjpd
08/29/2021, 11:16 AMAlbert Chang
08/29/2021, 11:22 AMcompose will react and update granularly for any of them
adjpd
08/29/2021, 11:23 AMAlbert Chang
08/29/2021, 11:25 AMrememberSaveable
, yes.adjpd
08/29/2021, 11:27 AMrememberSaveable
really. In apps which aren't compose first, or apps which the system kills, then the user will be confused why their text field text, or whatever, has been obliterated.configChanges="orientation"
etc in compose-first apps then `AndroidView`s won't get alternative XML styles, and I've found I need to use those for things like CalendarView
which demands certain styling be done via the theming system alone.