• c

    CLOVIS

    1 year ago
    Would it be correct to say: •
    remember
    is used to keep values across recomposition (with a normal variable it would be re-computed everytime) •
    State<T>
    is used to represent something that can change overtime (or not) The thing I don't understand is how Compose knows which state force a recompose, and which don't. I thought
    remember
    was used to tell Compose that the current
    Composable
    needed to ‘subscribe/observe' that state; however after reading other comments in this channel I'm confused whether I completely misunderstood something.
    c
    Dominaezzz
    +3
    22 replies
    Copy to Clipboard
  • Hachemi Hamadi

    Hachemi Hamadi

    1 year ago
    Is there a way to display SVG in Canvas and changing the SVG properties ?
    Hachemi Hamadi
    Dominaezzz
    +2
    12 replies
    Copy to Clipboard
  • s

    ste

    1 year ago
    Hi all! I noticed enum classes are getting converted into inline classes (e.g. here). I was wondering what are the benefits of this?
    s
    1 replies
    Copy to Clipboard
  • t

    taponidhi

    1 year ago
    Can we use
    remember{mutableStateOf(<data>)}
    for every type of data?
    t
    Halil Ozercan
    +1
    8 replies
    Copy to Clipboard
  • d

    dimsuz

    1 year ago
    I have a BottomSheetScaffold and I want to control its state externally. I do
    confirmStateChange = { notifyStateChangeRequest(it); false }
    where
    notifyStateChangeRequest()
    will decide what state to switch to and cause
    LaunchedEffect(newSheetState) { scaffoldState.bottomSheetState.animateTo(newSheetState) }
    . The problem is that
    confirmStateChange { false }
    causes
    Swipeable
    to start its own "rollback to previous state" animation which conflicts with mine and produces a visible jitter. Is there a way around this?
    d
    Vsevolod Ganin
    3 replies
    Copy to Clipboard
  • j

    julioromano

    1 year ago
    Why is there
    mutableStateListOf
    and 
    mutableStateMapOf
    but no
    mutableStateSetOf
    ?
    j
    Big Chungus
    +2
    6 replies
    Copy to Clipboard
  • rajesh

    rajesh

    1 year ago
    I'm building 2 different section on screen. both section load data from network (Like instagram profile page). What's wrong with below code? Expectation: ProfileView should be on upper part and PostView should be below it Reality: ProfileView Replace PostView and Postview is not showing up once data is loaded
    rajesh
    Erlan Amanatov
    3 replies
    Copy to Clipboard
  • Michał Diner

    Michał Diner

    1 year ago
    Hi everyone, did anyone came up with proper way of combining bottomSheet with bottomNavBar? My current scenario requires opening BottomSheet in several places with different content, so the solution has to be somewhat generic. Implementation I did looks like this:
    BottomSheet(navController) {
        BottomNavigationBar(
            navController,
            navHost)
    }
    ModalBottomSheetLayout(
        sheetState = bottomSheetScaffoldState,
        sheetContent = {...}
        content = {
            bottomNavigationBar()
    Unaccaptable alternatives:1. BottomSheet opened up by navigation -> replaces current screen and is above the BottomNavBar 2. BottomSheet initialised on currently displayed screen -> shows up above the BottomNavBar. Any ideas how to improve this or is this it?
    Michał Diner
    n
    4 replies
    Copy to Clipboard
  • a

    Andrey Nikanorov

    1 year ago
    Do we have any compose component to create expandable Card?
    a
    Vsevolod Ganin
    2 replies
    Copy to Clipboard
  • Chris Fillmore

    Chris Fillmore

    1 year ago
    Hi folks. Can anyone offer advice on best practice for constructing nested navigation in a use case like this? I have an activity which provides behaviour based on some user-selected plugins. So the user can navigate to a “plugin screen”, at which point the UI content is provided by a plugin. I would like to define some nested navigation within the plugin, and I’m trying to figure out the best way to do this. My idea so far is to do something roughly like this:
    @Composable
    fun MainNavHost(
      navController: NavHostController,
      plugin: Plugin,
    ) {
      NavHost(...) {
        // Define regular navigation within the activity
        composable(...) {
          ...
        }
        // Call this here to define nested navigation for plugin(s)
        plugin.navGraph(navController)
      }
    }
    
    interface Plugin {
      fun NavGraphBuilder.navGraph(navController: NavHostController)
      ...
    }
    This seems fine to me, though I don’t like passing
    navController
    down to the plugin. But it isn’t obvious to me how to avoid this, since there will be navigation to do within the plugin. But… does this seem sensible? Any risks stand out to you that I may not have considered? Any feedback is appreciated, thanks!
    Chris Fillmore
    pepos
    +1
    7 replies
    Copy to Clipboard