Skip to content

Android MVVM Wrapper. Include two-way data binding, strict division between components....

Notifications You must be signed in to change notification settings

IlyaPavlovskii/Android-MVVM-Wrapper

Repository files navigation

Android MVVM Wrapper.

Package include more specified features of MVVM pattern for Android platform:

  1. Two-way binding
  2. More @BindingAdapter and @BindingConversion realization

MVVM scheme:

MVVM communication schema

Layout - it's used to describe layout in XML format. All view components are placed here.
Binding - bind data between IViewData and Layout. It provides complete information on all components of the layout for View.
IView - main component of MVVM pattern. Responsible for the visual component. All animations, transaction between activities/fragments and UI/UX realization processed by this component.
IViewModel - main component of MVVM pattern. Logical part. Receive and processing data from Model to IViewData
Model - main component of MVVM pattern. Data model. Describe fundamentals data for application. As then can be acted Services, DB Helper, HTTP Provider, Business logic e.t.c

BindingAdapter

Library has default realization most popular components for 2-way binding. More info.

Two-way binding for EditText

Required for rapid typed text acquisition into IViewData component

    <BindableEditText
        ...
        attr:binding="@{model.text}"/> 

Two-way binding for CompoundButton

Required for rapid CompoundButton state into IViewData component

    <ToggleButton
        ...
        attr:binding="@{model.state}"/> 

Two-way binding for SeekBar

Required for rapid SeekBar progress into IViewData component

    <SeekBar
        ...
        attr:binding="@{model.progress}"/> 

Custom typeface for TextView

Used for binding custom typeface into TextView widget

    <TextView
            ...
            attr:assetTypeface="@{model.pathToTypefaceInAssetsFolder}"/>
            <!--or-->
    <TextView
            ...
            attr:fileTypeface="@{model.pathToTypefaceFileOrTypefaceFile}"/>

FreeMarker template

If you doesn't wan't to spend much time for deployment single view into your project, you can use FreeMarker template for android. Just put the ..\templates\freemarker\* templates into ..\AndroidStudioFolder\plugins\android\lib\templates\* How to use template

Created on the basis of Fabio Collini tutorial.

About

Android MVVM Wrapper. Include two-way data binding, strict division between components....

Resources

Stars

Watchers

Forks

Packages

No packages published