• a

    Aram Sheroyan

    11 months ago
    If I want the text color be different for light and dark mode, should I replace my typography for both modes like it is done for colors, or there is a way to just reference theme's color so it changes automatically? I was thinking that I could do something like this
    @Immutable
    data class CustomTypography(
        val title_s: TextStyle = TextStyle(fontSize = 32.sp, color = CustomTheme.colors.customPrymaryColor)
    )
    but it says that
    Composable invocations can only happen from the context of composable function
    a
    c
    +1
    7 replies
    Copy to Clipboard
  • Spikey Sanju

    Spikey Sanju

    11 months ago
    Hi Team 👋, How can I add a
    stickyHeader
    to
    LazyVerticalGrid
    ? Is there any workaround solution for this?
    Spikey Sanju
    Colton Idle
    +2
    6 replies
    Copy to Clipboard
  • Mohammad Jahidul Islam

    Mohammad Jahidul Islam

    11 months ago
    Hi, I am a beginner. Cay you give me a road map how can I learn android development with jetpack compose. I already know kotlin basics.
    Mohammad Jahidul Islam
    gildor
    2 replies
    Copy to Clipboard
  • carbaj0

    carbaj0

    11 months ago
    How to do partial and full swipe on a list of items? I would like to implement this behavior.https://github.com/rambler-digital-solutions/swipe-layout-android
    carbaj0
    Colton Idle
    2 replies
    Copy to Clipboard
  • c

    Clament John

    11 months ago
    Q: How to share a viewmodel between NavGraph components (only) I would like to share a viewmodel between many composables. Just like how we share a viewmodel between fragments within an Activity. But when I try this
    setContent {
        val navController = rememberNavController()
    
        NavHost(navController = navController, startDestination = "home") {
            navigation(startDestination = "username", route = "login") {
                // FIXME: I get an error here
                val viewModel: LoginViewModel = viewModel()
                composable("username") { ... }
                composable("password") { ... }
                composable("registration") { ... }
            }
        }
    }
    I get an error
    @Composable invocations can only happen from the context of a @Composable function
    Need • The viewmodel should only be active in the NavGraph Scope. • When I go to a different route and come back I should initialize a new viewmodel (this is why I'm calling it in the NavGraph)Almost similar solution 1. Answer by [Philip Dukhov](https://stackoverflow.com/users/3585796/philip-dukhov) for the question [How to share a viewmodel between two or more Jetpack composables inside a Compose NavGraph?](https://stackoverflow.com/a/68857871/5698740) a. But in this approach the viewmodel stays in the scope of the activity that launched it and so is never garbage collected.
    c
    Csaba Kozák
    +1
    17 replies
    Copy to Clipboard
  • Colton Idle

    Colton Idle

    11 months ago
    How can I blur the persons legs? Code in thread
    Colton Idle
    Sarankumar N
    +4
    31 replies
    Copy to Clipboard
  • Zoltan Demant

    Zoltan Demant

    11 months ago
    I always run into
    NoSuchMethodError
    after making tweaks to composables in my design system - cleaning & rebuilding the project fixes it (the design system is in a separate module). Any ideas on what I can do to narrow the issue down before I post a bug-report? 🧵👀
    Zoltan Demant
    1 replies
    Copy to Clipboard
  • Mehdi Haghgoo

    Mehdi Haghgoo

    11 months ago
    I don't find anything in Compose docs regarding how to request Android permissions? ...
    Mehdi Haghgoo
    Damian Zawadzki
    +1
    7 replies
    Copy to Clipboard
  • j

    Jonas Frid

    11 months ago
    I have a LazyColumn with a template defined for each item. Is there a way to have a container composable around those items that scrolls with the items?
    j
    m
    +1
    5 replies
    Copy to Clipboard