https://kotlinlang.org logo
Join SlackCommunities
Powered by
# mvrx
  • g

    gpeal

    06/03/2020, 3:54 PM
    set the channel description: https://github.com/airbnb/mvrx/
  • e

    elihart

    06/03/2020, 4:07 PM
    👋
  • e

    elihart

    06/03/2020, 4:07 PM
    i am currently updating our detekt version and setup 😄
  • c

    Corey Lanier

    11/03/2020, 8:31 PM
    I have a data class that looks like this:
    Copy code
    data class FeaturedState(
            val hospitalData: HospitalsViewModel = HospitalsViewModel(),
            val dealsData: DealsViewModel = DealsViewModel(),
            val marketingType: MarketingType = MarketingType.generalHealth
    ) : MvRxState
    I’m attempting to morph both
    hospitalData
    and
    dealsData
    on two separate api calls. However when I try to change the value of
    dealsData
    , I receive this error:
    Change parameter hospitalData type primary constructor class of class FeaturedState to DealsViewModel
    Not sure what I’m doing wrong that it’s trying to set it on hospitalData instead of dealsData. Here is the function that runs the API calls: https://hatebin.com/owjqvhydaz
    e
    • 2
    • 1
  • m

    Mateusz Apacki

    11/27/2020, 1:30 PM
    Maybe not about mvrx,but what is a future of epoxy?
    e
    d
    • 3
    • 3
  • d

    David Rincon-Cruz

    12/29/2020, 7:25 PM
    This might be a dumb question, but I’m just curious about what’s considered best practice. I have a fragment that is supposed to display a QR code. It first queries a server for a token-string, generates a bitmap from the response, and then displays it in a view. Caveat is that drawing the bitmap from an input string takes about a second or two. My question is thus, what’s appropriate to store in the state? I’m thinking of just storing the tokenString in the state and having an asyncSubscribe to begin drawing the bitmap on success, but I could see how this impacts the ability to perform unit tests. I could also store the bitmap in the state, but that feels very heavy for the state.
    Copy code
    data class FooBarState(
        val token: Async<String> = Uninitialized
    ) : MvRxState
  • n

    Nimish Nandwana

    03/19/2021, 4:18 AM
    in Mavericks, how to pass action from viewModel to fragment that call is successful take user to next screen ? I think that state is only for the data, how to pass the action. ?
    e
    • 2
    • 1
  • k

    kenkyee

    10/19/2021, 3:11 PM
    Curious if Mavericks has any code coverage numbers for the library core code?
    e
    • 2
    • 10
  • j

    Jason Hartley

    03/22/2022, 9:37 PM
    Are there any open source Android apps using Mavericks I could look at to better understand how it's used?
  • j

    Jason Hartley

    03/22/2022, 9:39 PM
    fwiw I'm working on an app that uses Jetpack Navigation with a single activity. I've looked at the simple examples AirBnb has in the Mavericks repo, and a few Medium articles, but I'd really like to see how others are using it in a full-on app.
  • j

    Jason Hartley

    03/22/2022, 9:42 PM
    @Ryan Brooks I apologize for @-ing you, but I suspect if there's anyone here who can point me in the right direction it would be you.
  • j

    Jason Hartley

    03/22/2022, 9:44 PM
    I haven't worked with RxJava, or with other MVI frameworks, and very little with Android architecture components, so there's still a bit of learning curve for me with this.
  • j

    Jason Hartley

    03/22/2022, 9:47 PM
    @gpeal please forgive my @-ing, but I feel like you probably can help. Any good Mavericks open source projects out there?
  • g

    gpeal

    03/23/2022, 10:37 PM
    The Lottie ones are too. Maybe it'll be helpful to walk through a specific issue you're having?
  • g

    GurpreetSK

    03/31/2022, 9:35 AM
    Hey folks! I want to assisted inject the ViewModel using Hilt with more parameters along with the initial state. Is this provided by the framework? I can't really see a way to achieve this out of the box. This is what I want to achieve:
    Copy code
    class MemesViewModel @AssistedInject constructor(
        @Assisted initialState: MemesState,
        @Assisted viewRenderer: MemesViewRenderer,
        @Assisted sideEffectHandler: MemesSideEffectHandler,
        private val repository: MemesRepository,
        private val dispatcherProvider: DispatcherProvider
    ) : MavericksViewModel<MemesState>(initialState) {
        ...
    }
  • j

    Jason Hartley

    06/06/2022, 9:33 PM
    I'm using Jetpack Navigation with a single activity and fragments. If I need to navigate to another screen based on a property in MavericksState, should I call
    navigate()
    from within
    invalidate()
    in the fragment, or within
    onEach()
    in the view model?
  • j

    Jason Hartley

    06/06/2022, 9:33 PM
    Like, what's the best practice?
  • j

    Jason Hartley

    06/06/2022, 9:37 PM
    Or is having a state property determine if I need to navigate away the wrong approach altogether?
  • j

    Jason Hartley

    03/07/2023, 7:52 PM
    If I'm registering an
    OnSharedPreferenceChangeListener
    in a
    MavericksViewModel
    , what is the correct way to unregister that listener? Or should the registering/unregistering be done from the fragment/`MavericksView`?