Skip to content

Files

Latest commit

1d484a5 · Feb 14, 2020

History

History
29 lines (23 loc) · 776 Bytes

README.md

File metadata and controls

29 lines (23 loc) · 776 Bytes

Android--MVVMLib with LiveData

Base classes for easier handling MVVM in android/Kotlin

Contains

  • android.arch.lifecycle:extensions:2.2.0
  • androidx.appcompat:appcompat:1.1.0
 maven { url 'https://jitpack.io' }
 implementation 'com.github.Luteoos:Android--MVVMLib:4.0.0'

Library implements simple 'event bus' between VM and View able to transfer Event to listening classes

override fun onVMMessage(msg: Event<Int>){
	when(msg.peek())
 ...
}
  • after initialization viewModel invoke connectToVMMessage()
  • using Event<T>.get() returns null after one use, use peek() for multiple uses

changes in 4.0.0

  • added Event<T>
  • added BaseActivityWithoutVM
  • updated appcompat and lifecycle-extensions
  • simplified unused imports