Ankit Dubey
08/01/2021, 2:52 PMvar mProgress by remember { mutableStateOf(0F) }
val transition = updateTransition(targetState = mProgress, label = "")
Currently, On Button Click, I can easily change mProgress value and view will be animated
But
I’ve don’t want to animate on Button Clicked, rather the view should be animated as soon as it is displayed in screen. Tried a lot of things but no luck 😞
Any suggestion ?Daniel Weidensdörfer
08/01/2021, 3:32 PMScaffold
and I show a snackbar by calling scaffoldState.snackbarHostState.showSnackbar(...)
. The snackbar is shown above the fab. What can I do to make the snackbar move the fab up when it is shown and down when it disappears?K Merle
08/01/2021, 6:45 PMOutlinedTextField
and
var email by rememberSaveable { mutableStateOf("") }
inside single compose function. Upon rotating screen, email state value resets to ""
. Shouldn't rememberSaveable
actually keep value of an email and not reset it?Abdalla Hassanin
08/02/2021, 4:37 AMSudhir Singh Khanger
08/02/2021, 4:55 AMrkeazor
08/02/2021, 5:41 AMDaniel Weidensdörfer
08/02/2021, 9:33 AMDaniele Segato
08/02/2021, 9:45 AMAnimatedVisibility
how can I make the container scroll to show the item being expanded? (say I'm at the end of the scroll and there's an expandable itemMaxUt
08/02/2021, 10:14 AMJulianK
08/02/2021, 10:32 AMAnastasia Rozovskaya
08/02/2021, 10:32 AMOutlinedTextField
elevation with shadow? I tried to apply Modifier.shadow(elevation = 8.dp, shape = RoundedCornerShape(8.dp))
directly to OutlinedTextField, but the result was horrible. Should I use BasicTextField
instead? I see some decorationBox
parameter in there, which might help.Tin Tran
08/02/2021, 10:43 AMHorizontalPager
. If each page have difference height then the HorizontalPager
will match the size of the largest page is that correct?Mehdi Haghgoo
08/02/2021, 10:46 AMRow(Modifier.fillMaxSize().background(Color.Yellow)) {
val pics = listOf(R.drawable.professor, R.drawable.woman,
R.drawable.daughter, R.drawable.son)
for (pic in pics)
Image(painterResource(id = pic), null, Modifier.fillMaxWidth(0.25f).align(Alignment.Bottom))
}
muthuraj
08/02/2021, 11:24 AMTextField
?
I'm having a list screen with a search option and showing either list or error screen below the search box based on search results. It roughly looks like this for list state
Column{
SearchBox()
List()
}
and like this for error state
Column{
SearchBox()
Text("No results")
}
SearchBox
has BasicTextField
and other decorations around it.
Now when I start typing in the search box, the keyboard state and cursor position is retained for recompositions of the list screen update, but when the error state is shown, the keyboard is being closed and the TextField
loses focus.
The same happens when transitioning from error state to list screen.emmanuelvinas
08/02/2021, 12:03 PMimport androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.BlendMode
@Composable
fun TestBlendMode(
blendMode: BlendMode = BlendMode.Multiply
) {
// Comment this line and compilation should work as expected
val mode = blendMode
}
If i use a blendmode inside a composable, i get a crash. Anyone getting the same error with the 1.0.0 version?
: java.lang.AssertionError: Assertion failed
at org.jetbrains.kotlin.ir.util.AdditionalIrUtilsKt.getPropertyGetter(AdditionalIrUtils.kt:236)
at androidx.compose.compiler.plugins.kotlin.lower.AbstractComposeLowering.unboxValueIfInline(AbstractComposeLowering.kt:311)
Mohamed Ibrahim
08/02/2021, 12:10 PMAndrey Kulikov
08/02/2021, 12:20 PMAkram Bensalem
08/02/2021, 1:05 PMAnders Kielsholm
08/02/2021, 1:50 PMLaunchedEffect
, but can't really wrap my head around it 🙂 I'm using keys so the list is in general keeping the same position when adding items 🙂Magomedov Abakar
08/02/2021, 2:38 PMInk
08/02/2021, 2:42 PMTextField(
value = titleState.value,
onValueChange = { titleState.value = it },
colors = TextFieldDefaults.textFieldColors(
textColor = MaterialTheme.colors.primary,
disabledTextColor = Color.Transparent,
backgroundColor = Color.Transparent,
focusedIndicatorColor = Color.Transparent,
unfocusedIndicatorColor = Color.Transparent,
disabledIndicatorColor = Color.Transparent
)
)
The problem is when I want to put down text there is a text instead of hint and I have to delete text before typing the proper wordMBegemot
08/02/2021, 3:20 PMColton Idle
08/02/2021, 5:53 PM<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.MyApp" parent="android:Theme.Material.Light.NoActionBar">
<item name="android:statusBarColor">@color/purple_700</item>
</style>
</resources>
zsperske
08/02/2021, 7:24 PMdata class
which represents my UI state contains a var
and that var changes?
data class EventListState(val events: List<EventUiModel> = emptyList(),
var eventDestination: String = "", //Changes to this var do not cause recomposition
val pastEventsSelected: Boolean = false,
val isLoading: Boolean = true)
Jason Inbody
08/02/2021, 8:01 PM@Composable
fun Navigation(user: FinUser, navController: NavHostController) {
NavHost(navController, startDestination = NavigationItem.MapScreen.route) {
composable(NavigationItem.Account.route) {
Account(user = user)
}
composable(NavigationItem.History.route) {
History(user = user)
}
composable(NavigationItem.MapScreen.route) {
MapScreen(user = user)
}
composable(NavigationItem.Promo.route) {
Promo(user = user)
}
composable(NavigationItem.Help.route) {
Help(user = user)
}
}
}
@Composable
fun BottomNavigationBar(user: FinUser, navController: NavController) {
val items = listOf(
NavigationItem.Account,
NavigationItem.History,
NavigationItem.MapScreen,
NavigationItem.Promo,
<http://NavigationItem.Help|NavigationItem.Help>
)
BottomNavigation(
backgroundColor = MaterialTheme.colors.primary,
contentColor = Color.White
) {
val navBackStackEntry by navController.currentBackStackEntryAsState()
val currentRoute = navBackStackEntry?.destination?.route
items.forEach { item ->
BottomNavigationItem(
icon = { Icon(item.icon, contentDescription = item.iconName) },
label = { Text(text = item.title) },
selectedContentColor = Color.White,
unselectedContentColor = Color.White.copy(0.4f),
alwaysShowLabel = true,
selected = currentRoute == item.route,
onClick = {
navController.navigate(item.route) {
// Pop up to the start destination of the graph to
// avoid building up a large stack of destinations
// on the back stack as users select items
navController.graph.startDestinationRoute?.let { route ->
popUpTo(route) {
saveState = true
}
}
// Avoid multiple copies of the same destination when
// reselecting the same item
launchSingleTop = true
// Restore state when reselecting a previously selected item
restoreState = true
}
}
)
}
}
}
Jason Inbody
08/02/2021, 8:02 PMcomposable(NavigationItem.Help.route) {
Help(user = user)
}
makes sense for doing top level routing but what about nested routing?Alexander Karkossa
08/02/2021, 8:55 PMrsktash
08/03/2021, 12:03 AMZach Klippenstein (he/him) [MOD]
08/03/2021, 12:05 AMSwipeableState.offset
when the layout direction is Rtl to draw the thumb on the right side. The gesture direction is correct though. Should SwipeableState.offset
return inverted values in Rtl mode? If so, I can file a bug.Ink
08/03/2021, 12:53 AMInk
08/03/2021, 12:53 AMColton Idle
08/03/2021, 2:05 AM