Vsevolod Ganin
06/13/2021, 3:11 PMSlider
in scrollable list. When I start to scroll the list and hit slider’s track in the way, the thumb jumps to that position immediately and scroll also happens. Is there a way to workaround this problem? For example, for buttons such problem doesn’t exist. When I hit button when starting to drag, it doesn’t actually trigger onClick
(the ripple effect is rendered anyway though).andriydruk
06/13/2021, 6:22 PMchansek
06/13/2021, 6:30 PMInk
06/13/2021, 7:35 PMinit {
viewModelScope.launch {
try {
actions.receiveAsFlow().collect { action ->
when (action) {
//handle actions here
}
}
}
}
In Home screen
I have list with post. The problem is when I select post and navigate user to PostDetails screen
I can choose another post though list with post is underhood. I think it's related to Home viewModel
and that action flow works in the background. Any solution what should I change?Daniel
06/13/2021, 9:58 PMval trackSettingsState = repo.trackSettings().collectAsState(initialValue = null)
val trackSettings = trackSettingsState.value
if (trackSettings == null) {
Spinner()
}
TextField(trackSettings.frequency, /* ... */)
Text(trackSettings.name)
I could also use a with statement or an else branch, but I prefer handling the null-case up front and then being able to assume it isn't null laterNicolas Acart
06/14/2021, 12:23 AMViewCompat.setOnApplyWindowInsetsListener(window.decorView) { _, insets ->
val isKeyboardVisible = insets.isVisible(WindowInsetsCompat.Type.ime())
onSoftKeyboardVisibilityChange(isKeyboardVisible)// own method which notifies me of changes
insets
}
This way worked in the emulator (Pixel 3a API 30) but not on my phone (Galaxy S8 API 28)
On top of that after launching my app, I noticed that my statusBarColor and navigationBarColor from themes.xml no longer work (status and nav bars are white or dark according to the theme instead of my own colors set in themes.xml)
I tried to change window.navigationBarColor
and window.statusBarColor
in the setContent without success
I don't understand what's going on. Is it possible to have an explanation ?YASAN
06/14/2021, 1:56 AMAutoMirror
for my own vector drawables but cant find a way to do that for Material IconsRyan Simon
06/14/2021, 3:41 AMScaffold
to a child Composable
isn’t very obvious
More info in the thread…gitai
06/14/2021, 10:31 AMAlexander Sitnikov
06/14/2021, 11:27 AMadauguet
06/14/2021, 12:14 PMdivid3d
06/14/2021, 12:30 PMModalBottomSheetLayout
? I'm looking for solution that would allow to hide bottom sheet only programmatically.Erlan Amanatov
06/14/2021, 12:54 PMColumn
with an image but with a limit of its height.
My code looks like
Column{
item1()
item2()
Image(Modifier.weight(1f))
item3()
..
)
For small screens it works fine, but on bigger screens it takes too much space. So I need to limit the height of the image somehow.Richard Z
06/14/2021, 1:54 PMVinícius Santos
06/14/2021, 2:16 PMadauguet
06/14/2021, 3:45 PMarguments
is null when I use putParcelable
so I first have to instantiate it with Bundle()
. Am I doing something wrong? I do not see any example with this mention ...Chris Johnson
06/14/2021, 4:27 PMDisposableEffect(Unit) {
focusRequester.requestFocus()
onDispose { }
}
Jesse Hill
06/14/2021, 6:26 PMActivity androidx.compose.ui.tooling.preview.PreviewActivity is not protected [android:exported=true]
. I was trying to find out why it’s important for the PreviewActivity
to be exported or if I can make it not exported for my project. As far as I can tell setting android:exported=false
for the PreviewActivity
only affects deploying a @Preview
to the device. Will making this change have any negative effects on a release build of the app? If this is a non-issue, is there a link to release notes/documentation as to why it isn’t an issue?Mohamed Ibrahim
06/14/2021, 8:07 PMCan
06/15/2021, 7:45 AMfirstBaselineToTopHeight
in the compose world. I would’ve expected it near lineHeight
in a TextStyle
. Is it currently missing and is there any chance this will be supported any time soon? 🙂Akram Bensalem
06/15/2021, 7:56 AMnitrog42
06/15/2021, 9:21 AMval pagerState = rememberPagerState(pageCount = 2)
can we write
val selectedTabIndex = pagerState.currentPage
TabRow(selectedTabIndex = selectedTabIndex,...)
or do we have to do :
val selectedTabIndex = remember(pagerState) { pagerState.currentPage }
?dimsuz
06/15/2021, 2:09 PMremember
's which are initialized with values of State<T>
, will they be re-memoized on state changes? This sounds quite entangled, that's because I need some clarity on this 🙂 Please see thread, with bottom-sheet related example.nglauber
06/15/2021, 2:19 PMRelocationRequester
here in the channel 😄
I have a Column
with several TextField
. When I tap on a TextField
at the bottom of the screen, the keyboard is opened and I want that field be positioned just above the keyboard.
I thought that RelocationRequester
resolves this problem…Hachemi Hamadi
06/15/2021, 3:20 PMclass ProjectsViewModel : ViewModel()
and i already called it in a component using :
val projectsViewModel: ProjectsViewModel = viewModel()
and when i navigate (using Navigation Component) and try to get the model using the same viewModel through different components ?
Or should i declare the instance in the top of my code and pass it to different component that need access to it ?rajesh
06/15/2021, 4:50 PMval user by remember(profileViewModel) { profileViewModel.user }.collectAsState()
val posts by remember(profileViewModel) { profileViewModel.posts }.collectAsState()
when (user) {
is UiState.Loading -> {
CircularProgressIndicator(
modifier = Modifier.wrapContentWidth(CenterHorizontally)
)
}
is UiState.Success -> {
(user as UiState.Success).data?.let {
ProfileView(user = it)
}
}
}
when (posts) {
is UiState.Loading -> {
CircularProgressIndicator(
modifier = Modifier.wrapContentWidth(CenterHorizontally)
)
}
is UiState.Success -> {
(posts as UiState.Success).data?.let {
PostView(post = it)
}
}
}
How do i make sure that PostView()
is drawn below ProfileView()
?Zun
06/15/2021, 4:55 PMKaustubh Patange
06/15/2021, 5:23 PMrememberSaveable
values after process death when it is wrapped with a CrossFade
animation - https://issuetracker.google.com/issues/191059138
Can anyone verify this?ms
06/15/2021, 5:39 PMViewModel
as a param to the composable
• use Koin
to inject ViewModel
Can you point out pros & cons also because I don't see much of a differenceZach Klippenstein (he/him) [MOD]
06/15/2021, 5:58 PMderivedStateOf
since I haven’t seen a lot of content about this particular function yet.