• a

    alorma

    1 year ago
    What is the best way to load a bitmap with a suspend function? I want to use Google Places sdk and it provide a
    Task
    that returns
    Bitmap
    ... I've added an
    await()
    method to convert it to Bitmap directly... but, how to load it onto Composable?
    a
    Adam Powell
    4 replies
    Copy to Clipboard
  • sen kumar

    sen kumar

    1 year ago
    Any idea - why this occurs ? - java.lang.IllegalArgumentException: Layer is redrawn for LayoutNode in state NeedsRelayout [LayoutNode@ef9e093 children: 1 measurePolicy: androidx.compose.ui.layout.SubcomposeLayoutState$createMeasurePolicy$1@2d98fc5]
    sen kumar
    1 replies
    Copy to Clipboard
  • g

    Gabriel

    1 year ago
    Should we be using something other than
    AppCompatActivity
    ? It's what's in the default when creating a new compose
    g
    John O'Reilly
    +2
    9 replies
    Copy to Clipboard
  • s

    Sam

    1 year ago
    Don’t know if this is the right place to discuss but my Compose project is telling me to remove
    jcenter
    but when i do, all hell breaks loose and i can no longer compile
    s
    s
    +6
    25 replies
    Copy to Clipboard
  • s

    Sam

    1 year ago
    Does anyone know if
    navigation-compose
    ever added transitions? Trying to catch up on the last several versions but I didn’t see anything in the release notes, and I swear there was an issue about it but nothing related in the issue tracker: https://issuetracker.google.com/issues?q=componentid:409828
    s
    i
    +5
    21 replies
    Copy to Clipboard
  • b

    Bradleycorn

    1 year ago
    Some questions around
    navigation-compose
    and ViewModels. For a time now, we've been able to get a viewmodel scoped to a backstack entry (at first by rolling our own factory, then using a HiltViewModelFactory, and now by using
    hiltNavGraphViewModel()
    ). I presume that means that as long as the backstack entry exists, then the VeiwModel will hang around, and won't be cleared until the backstack entry is popped, right? And if so, you might need to be careful in some cases when launching a coroutine using
    viewModelScope.launch
    , right? If your are just making a newtork call to fetch a piece of data or something, no big deal. But if it's a longer running operation, then it will not get canceled until the backstackentry is popped from the stack. So, if say you have Composables A, B, and C that are entries in your graph, and you navigate from A to B to C ... if the ViewModel for A launched a coroutine in its
    viewModelScope
    , it will still be running while the user is looking at C, correct? So if your intention is to launch a coroutine when the user is looking at A and have it get canceled when the user navigates to B, then you really need to use a different mechanism (like say
    LaunchedEffect
    ). Do I have that right?
    b
    i
    +2
    10 replies
    Copy to Clipboard
  • t

    Tlaster

    1 year ago
    Getting
    Fatal Exception: java.lang.IllegalStateException: LayoutCoordinate operations are only valid when isAttached is true
    from firebase in my app and not sure what was the issue since I may not able to create a reproduce sample, full stacktrace in thread
    t
    Andrey Kulikov
    4 replies
    Copy to Clipboard
  • k

    knthmn

    1 year ago
    Style issue regarding lazy lists. In my lazy lists (e.g.
    LazyColumn()
    ), I sometimes want to extract several items in a function. So I define
    fun LazyListScope.FooSection(...) { items....  }
    and use it in my lazy lists
    LazyColumn { FooSection(...) }
    However Android Studio complains the naming since
    FooSection
    is not a composable, I am wondering if this is not something I should do at the first place.
    k
    1 replies
    Copy to Clipboard
  • j

    Joost Klitsie

    1 year ago
    Now that Jetpack Compose is in Beta and I get lint errors about Composable functions that return Unit should start with an uppercase letterI am slowly starting to realize, after months of denial, the battle for lowercase + camelCase for function names (as per the kotlin coding conventions ) battle is over and lost. I just wanted to vent (I am now refactoring the names of the functions in my code for the upper case start) that it looks weird that within composable functions it looks like I am instantiating a bunch of objects instead of calling actual functions. For all the other rebels that share this thought, I want to give the opportunity to press
    F
    to pay your respects to this fallen topic, and move on to the world of uppercase CamelCase function naming with me.
    j
    Big Chungus
    +1
    7 replies
    Copy to Clipboard