• i

    Ink

    1 year ago
    Hot to inject class to my viewModel in @Composable? I use Koin and I tried to follow documentation but it doesn't work Module:
    val welcomeModule = module {
       single<MyService> { MyServiceImpl() }
    }
    ViewModel:
    class MyViewModel(private val myService: MyService) : ViewModel() {
    ...
    }
    @Composable function:
    @Composable
    fun Screen(){
       val myViewModel: MyViewModel= viewModel()
    }
    I tried:
    val myService = get<MyService>()
    and put it to viewModel() but it doesn't work
    i
    t
    +2
    6 replies
    Copy to Clipboard
  • Nat Strangerweather

    Nat Strangerweather

    1 year ago
    Hi, I have an animation but I don't understand why the boxes are not spaced evenly in it. Please see gif and code in thread. Any ideas?
    Nat Strangerweather
    s
    6 replies
    Copy to Clipboard
  • s

    Saiedmomen

    1 year ago
    Is there a way to the decide opening direction of Side Drawer in a Scaffold?
    s
    1 replies
    Copy to Clipboard
  • Archie

    Archie

    1 year ago
    Hi @Doris Liu, Is there a way to seek a Color Animation based on percentage? I essentially need to animate between Colors, ex.
    Color.Red -> Color.Yellow -> Color.Green
    . I wanted to be able to get the color given a certain percentage. I tried
    updateTransition(...)
    but it seems that it only applies to a targeted state but not the in-betweens. Any advice? Thanks in advance.
    Archie
    Doris Liu
    +1
    23 replies
    Copy to Clipboard
  • Paul Woitaschek

    Paul Woitaschek

    1 year ago
    Is there any way to skip code by checking if I'm currently in the preview? I have code that uses
    EmojiCompat.get()
    and that breaks the preview because EmojiCompat wasnt initialized because as we're inside the preview the application wasn't created. (sth like
    View.isInEditMode
    but statically available?)
    Paul Woitaschek
    Adam Powell
    +1
    8 replies
    Copy to Clipboard
  • b

    Bradleycorn

    1 year ago
    Does anyone know if there are plans to make
    SubComposeLayout
    and
    Intrinsics
    work together? For example something like the following:
    Row(modifier = Modifier.fillMaxWidth.height(IntrinsicSize.Min)) {
        BoxWithConstraints(...) {
            ...
        }
    }
    this currently crashes with an IllegalStateException with a message of
    Intrinsic measurements are not currently supported by SubcomposeLayout
    Any way to “fix” this?
    b
    Zach Klippenstein (he/him) [MOD]
    18 replies
    Copy to Clipboard
  • Colton Idle

    Colton Idle

    1 year ago
    Not directly compose related, but since we've been all using Arctic Fox for some time now. Have people noticed that they have deployed their app in studio, it builds, then installs, but the old build launches again? I've noticed this a handful of times, and a restart of Studio seems to resolve it... but I just hit it again and it killed like an hour of my time. I don't know how to repro, but curious if it's compose related or if someone has a bug tracker issue handy.
    Colton Idle
    Rafs
    +4
    8 replies
    Copy to Clipboard
  • henrikhorbovyi

    henrikhorbovyi

    1 year ago
    Hey everyone \o/ I'm trying to use airbnb lottie-compose, but not working 😕 any help?
    henrikhorbovyi
    k
    +2
    17 replies
    Copy to Clipboard
  • t

    Tin Tran

    1 year ago
    Hi guys! Is there a way to make bottom sheet have 3 level of expand? Eg. 60% -> 80% -> fully expanded
    t
    s
    9 replies
    Copy to Clipboard
  • vipulasri

    vipulasri

    1 year ago
    @Preview
    annotation not working in library module. Is this intentional? I am getting this issue:
    The following classes could not be instantiated:
    - androidx.compose.ui.tooling.preview.ComposeViewAdapter
    vipulasri
    Zach Klippenstein (he/him) [MOD]
    2 replies
    Copy to Clipboard