8000 GitHub - GlueHome/common-android: Common android classes/utils for clean architecture with MVVM + Coroutines/RxKotlin
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Common android classes/utils for clean architecture with MVVM + Coroutines/RxKotlin

Notifications You must be signed in to change notification settings

GlueHome/common-android

Repository files navigation

common-android

Common android/poko classes/utils for clean architecture with MVVM + Coroutines/RxKotlin

Installation

main build.gradle:

allprojects { repositories { maven { url 'https://jitpack.io' } } }

main build.gradle:

dependencies {
  implementation "com.github.gluehome.common-android:data:${Versions.common}"
  implementation "com.github.gluehome.common-android:firestore:${Versions.common}"
  implementation "com.github.gluehome.common-android:domain:${Versions.common}"
  implementation "com.github.gluehome.common-android:rx-threads:${Versions.common}"
  implementation "com.github.gluehome.common-android:rx-threads-android:${Versions.common}"
  implementation "com.github.gluehome.common-android:presentation:${Versions.common}"
}

Presentation

ViewModel and Observable extensions

import com.gluehome.common.presentation.extensions.*

class HomeFragment : BaseFragment() {

    override fun layoutId() = R.layout.delivery_list_fragment
    
    @Inject lateinit var viewModelFactory: ViewModelProvider.Factory
    private lateinit var viewModel: HomeViewModel

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        appComponent.inject(this)

        viewModel = viewModel(viewModelFactory) {
            observe(deliveriesState, ::onDeliveriesStateChanged)
            observe(setupCompletionState, ::onSetupCompletionChanged)
            observe(failure, ::onFailure)
        }
    }
}

About

Common android classes/utils for clean architecture with MVVM + Coroutines/RxKotlin

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages

0