• Andrey Kulikov

    Andrey Kulikov

    1 year ago
    Added a simple demo on how to implement a fullscreen tutorial overlay which highlights one of the buttons on the screen. In case someone was curious how to implement that in Compose. The code is here
    Andrey Kulikov
    Colton Idle
    3 replies
    Copy to Clipboard
  • Akram Bensalem

    Akram Bensalem

    1 year ago
    In animation between screens (navigation) is available now ?!
    Akram Bensalem
    Colton Idle
    +4
    8 replies
    Copy to Clipboard
  • Anders Kielsholm

    Anders Kielsholm

    1 year ago
    Hi! 🙂 I have a usecase where I would like my LazyColumn to scroll to the top if I add a new item to the start of the list - but only if the list was scrolled to top before. Anyone knows how to do that? Think it's something like using a
    LaunchedEffect
    , 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 🙂
    Anders Kielsholm
    mcpiroman
    6 replies
    Copy to Clipboard
  • m

    Magomedov Abakar

    1 year ago
    Hello everyone !) Can I use styles from xml with Text() composable function ?) Or I should rewrite all my style system ?
    m
    1 replies
    Copy to Clipboard
  • i

    Ink

    1 year ago
    Hi! How can I create TextFild like that? I try:
    TextField(
        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 word
    i
    Landry Norris
    +3
    12 replies
    Copy to Clipboard
  • m

    MBegemot

    1 year ago
    What this message means 'Modifier factory functions must use the receiver Modifier instance' When writing a modifier like fun Modifier.myModifier(i:Int):Modifier{ return Modifier.border(BorderStroke(1.dp,Color.Blue),RoundedCornerShape(6.dp))} It works as expected ...
    m
    Zach Klippenstein (he/him) [MOD]
    4 replies
    Copy to Clipboard
  • Colton Idle

    Colton Idle

    1 year ago
    Not strictly compose related... but I created a new app using the Compose template in Android studio. Does the status bar seem weirdly tall to you? I have NoActionBar, and only a statusBarColor set. Should I be doing something different in the theme for a strictly compose app?
    <?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>
    Colton Idle
    s
    +1
    5 replies
    Copy to Clipboard
  • z

    zsperske

    1 year ago
    Is it expected that recomposition will not happen if the
    data 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)
    z
    c
    +1
    7 replies
    Copy to Clipboard
  • j

    Jason Inbody

    1 year ago
    I'm trying to wrap my head around the navigation and I've got a bottom Nav bar that's working great so far and can switch between screens from the bottom. I need to implement stack views with back buttons inside each bottom nav bar tab. So when a user starts switching views inside a tab the current screen sticks if they click on another tab the state of the other tab is remembered. I'm reading over this (https://medium.com/google-developer-experts/navigating-in-jetpack-compose-78c78d365c6a) and it looks like kind of like what I need but unsure how it jives with a bottom nav bar. And this is my bottom nav bar that I pulled out of a demo app
    @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
                        }
                    }
                )
            }
        }
    }
    j
    Colton Idle
    +1
    5 replies
    Copy to Clipboard
  • j

    Jason Inbody

    1 year ago
    This
    composable(NavigationItem.Help.route) {
                Help(user = user)
            }
    makes sense for doing top level routing but what about nested routing?
    j
    1 replies
    Copy to Clipboard