🚀What is Yamvil

Yamvil is a runtime library and compiler plugin to help Android Developers write Screens that adhere to the MVI Pattern.

⚠️ This is a Work in Progress

The Runtime Library is totally usable as it is just a "normal" Android Library.

The Compiler Plugin works in terms of compilation errors shown in the Build output, but as K2 IDE Plugin doesn't work yet on Android Studio, the errors or warnings thrown by Yamvil doesn't show up in Android Studio, yet.

The Runtime Library

The runtime Library brings you three main base classes:

  • MVIViewModel<UiState, UiEvent>

  • MVIFragment<UiState, UiEvent, UiAction>

  • Actionable (one-time actions)

The Compiler Plugin

The Compiler Plugin checks a few pitfalls for us so we'll implement MVI without creating any bugs.

Fragments

MVIFragment as a base class brings all the infrastructure needed to use MVI properly, besides one detail.

The Compiler plugin will throw an error (or a warning instead if you choose to) if you've implemented Actionable on your UiState but forgot to call state.onAction in observeUiState().

Composable functions

The compiler plugin will validate that a Composable is written correctly, meaning it has

  • an uiState parameter of the type of its ViewModel (matched by name)

  • an handleEvent() parameter function getting the Action Type of its ViewModel

Last updated