Skip to content
MVP-based Architecture Framework for Android
Java Other
  1. Java 99.8%
  2. Other 0.2%
Branch: develop
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea
android-dagger
annotation-processor-core
annotation-processor-ucs
annotation-processor-uistatepreservation
gradle/wrapper
smvp-android
smvp-dagger-android
testapp-svmp-dagger
testapp-ucs-dagger
ucs-android
ucs-core
ucs-dagger-android
ucs-noinject-android
ucstest-android
uistatepreserve-android
uistatepreserve-core
uistatepreserve-dagger-android
ul-android
ul-core
.gitignore
LICENSE
README.md
build.gradle
debugapttestappucsdagger
debugapttestappucsdagger.bat
gradle.properties
gradlew
gradlew.bat
maven-publish.gradle
settings.gradle
ucsFramework.iml

README.md

ucsFramework

A series of layered frameworks implementing two user interface architecture patterns for Android.

The frameworks are implemented as a set of libraries and two annotation processors.

Key Points:

  • Each layer is intended to add a specific characteristic
  • Dependency injection is considered a branching feature with one branch using dagger and the other not using injection (to allow you to implement it yourself)

The Layers

ul-android: Unified Lifecycle

  • Intended to eliminate most of the differences between Fragment and Activity lifecycle for development.
  • Using this framework it is possible to interchange a UI component from Activity and Fragment by simply changing the class it extends.
  • Introduces the Object Registry (a simple mechanisim for preserving complex objects and "live" code) across UI component configuration changes (Rotation).

uistatepreserve-android: User Interface Preservation

  • Adds User Interface State preservation to the Unified Lifecycle library
  • Uses the Ui State Preservation annotation processor
  • Fields in UI components can be automatically preserved and restored between configuration changes (Rotation).
  • This is the branching layer that introduces Dagger Dependency Injection. All layers from here down offer two variants, Dagger injection or No Injection. The Dagger variant of this layer is an extension of this layer named "uistatepreserve-dagger-android".

smvp-android: Simple Model View Presenter

  • Included mainly for backwards compatibility with some of my projects
  • Preserves the presenter and model during Activity configuration change (Rotation)
  • Requires explicit restore of state following configuration change (redraw of view - which can be a pain)
  • Currently does not include UI state preservation - I might change this in the future. For now it is to avoid confusion around state responsibilities.

ucs-android: User Interface, Coordinator and Statemanager (MVP with different names to encourage you to think more about the roles of those components)

  • An evolution of SMVP based on what proved to be painful when implementing applications using SMVP
  • Has mechanisms to preserve presenter, model and last state of view during Activity configuration change (Rotation)
  • Applies updated state following configuration change automatically
  • Automatically shifts calls from ui to coordinator onto a background thread
  • Automatically shifts calls from coordinator to ui onto the UI thread
  • Fairly productive once you get used to it, but like anything.. there are some inconveniences (no function return values. All async).

Ultimately they will all hopefully be published to maven central, but for now they can be installed to mavenLocal()

Quickstart / TLDR;

To Install:

  1. run the "Clean, Build and Install Framework" configuration or run "gradlew clean build install" from command line.

  2. See the (very simple) examples: testapp-ucs-dagger

testapp-smvp-dagger example has nothing in it at this point. Nor are there any unit tests. Sorry. Progress is slow due to spare time availability.

Debugging the Annotation Processors

From a command line, run debugapttestappucsdagger (bat file or bash script) then attach to the "remote" process. A run configuration "Debug Annotation Processor" is included for convenience.

You can’t perform that action at this time.