AndroidMvvm
Library describes experience how to implement and use MVVM pattern provided by Google.
Project include example of usage.
Library integration
This library is available in JitPack.io repository.
- make sure to add the below inside root
build.gradle
file
allprojects {
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
}
}
- add library dependency to the app's
build.gradle
file.
dependencies {
implementation 'com.github.AlexanderShniperson:AndroidMvvm:1.1'
}
How to use
- Copy Template files from
AndroidMvvmFragment
into
a) WindowsC:\Program Files\Android\Android Studio\plugins\android\lib\templates\other\
b) MacOS/Applications/Android Studio.app/Contents/plugins/android/lib/templates/other/
- Restart
Android Studio
if it was launched before - Create
AndroidMvvm Fragment + ViewModel
from Menu
File > Fragment > AndroidMvvm Fragment + ViewModel
- Fill
Template name
field and clickFinish
- You are done, do any implementations at your
ViewModel
as described at Sample project