All Projects → ezhome → Android Rxpresenter

ezhome / Android Rxpresenter

Licence: apache-2.0
A Reactive Presenter library for MVP pattern for modern Android Apps

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Android Rxpresenter

Android Kotlin Mvp Architecture
This repository contains a detailed sample app that implements MVP architecture in Kotlin using Dagger2, Room, RxJava2, FastAndroidNetworking and PlaceholderView
Stars: ✭ 615 (+2828.57%)
Mutual labels:  rxjava-android, mvp-architecture, mvp-android
MVPArchitecture
Android MVP architecture in Kotlin using Dagger2, RxJava2, Retrofit2 and so on
Stars: ✭ 27 (+28.57%)
Mutual labels:  mvp-architecture, mvp-android
Android Mvp Architecture
This repository contains a detailed sample app that implements MVP architecture using Dagger2, GreenDao, RxJava2, FastAndroidNetworking and PlaceholderView
Stars: ✭ 4,360 (+20661.9%)
Mutual labels:  rxjava-android, mvp-architecture
Android Mvp Mvvm Flytour
🔥🔥🔥 FlyTour是Android MVVM+MVP+Dagger2+Retrofit+RxJava+组件化+插件组成的双编码架构+双工程架构+双语言Android应用开发框架,通过不断的升级迭代该框架已经有了十个不同的版本,5.0之前工程架构采用gradle配置实现组件化,5.0之后的工程架构采用VirtualAPK实现了插件化,5.0之前采用Java编码实现,5.0之后采用Kotlin编码实现,编码架构由MVVM和MVP组成,工程架构和编码架构及编码语言开发者可根据自己具体的项目实际需求去决定选择使用,该框架是Android组件化、Android插件化、Android MVP架构、Android MVVM架构的集大成者,帮助你快速的搭建自己的App项目开发框架,以便把主要的精…
Stars: ✭ 2,948 (+13938.1%)
Mutual labels:  mvp-architecture, mvp-android
Supermvp
MVP“美”图+新闻+天气预报+Material+RxJava3+Retrofit2+Glide4+AndroidX+Leakcanary+Butterknife
Stars: ✭ 763 (+3533.33%)
Mutual labels:  mvp-architecture, mvp-android
uv-index
This is a work-in-progress (🔧️) ultraviolet index viewer app for demonstrating Instant Apps + Kotlin + Dagger + MVP
Stars: ✭ 64 (+204.76%)
Mutual labels:  mvp-architecture, mvp-android
visum
Android reactive MVP stack
Stars: ✭ 19 (-9.52%)
Mutual labels:  mvp-architecture, mvp-android
android-template
Template for android development at Tiki
Stars: ✭ 17 (-19.05%)
Mutual labels:  mvp-architecture, mvp-android
Geeknews
📚A pure reading App based on Material Design + MVP + RxJava2 + Retrofit + Dagger2 + Realm + Glide
Stars: ✭ 3,496 (+16547.62%)
Mutual labels:  mvp-architecture, mvp-android
Cleanarchitecturemanifest
Description of the main principles and rules for building an Android application using Clean Architecture approach
Stars: ✭ 444 (+2014.29%)
Mutual labels:  rxjava-android, mvp-android
Android-Model-View-Presenter
No description or website provided.
Stars: ✭ 26 (+23.81%)
Mutual labels:  mvp-architecture, mvp-android
Fasthub
FastHub the ultimate GitHub client for Android.
Stars: ✭ 5,543 (+26295.24%)
Mutual labels:  mvp-architecture, mvp-android
XYZReader
A simple news reader app with elements of Material Design.
Stars: ✭ 17 (-19.05%)
Mutual labels:  mvp-architecture, rxjava-android
mvp-android-template
MVP Android Template to give you a Quick Head Start for your next Android Project. It implements MVP Architecture using Dagger2, Room, RxJava2 , Retrofit2
Stars: ✭ 20 (-4.76%)
Mutual labels:  mvp-architecture, mvp-android
mvp-architecture-kotlin-dagger-2-retrofit-android
Android Application MVP (Model-View-Presenter) architecture example using Dagger2 Dependency Injection (DI) and Retrofit Tutorial using Kotlin programming language.
Stars: ✭ 15 (-28.57%)
Mutual labels:  mvp-architecture, mvp-android
KotlinMvpTemplateGenerator
Android Studio template for Kotlin with MVP + Dagger2 + Retrofit2
Stars: ✭ 65 (+209.52%)
Mutual labels:  mvp-architecture, mvp-android
MVPDemo
MVP+动态代理的模式框架例子
Stars: ✭ 12 (-42.86%)
Mutual labels:  mvp-architecture, mvp-android
clutch
No description or website provided.
Stars: ✭ 14 (-33.33%)
Mutual labels:  mvp-architecture, mvp-android
Componentizationarch
Stars: ✭ 265 (+1161.9%)
Mutual labels:  mvp-architecture, mvp-android
Mvpart
🎨 A new Android MVP architecture (此框架旨在解决传统 MVP 类和接口太多, 并且 Presenter 和 View 通过接口通信过于繁琐, 重用 Presenter 代价太大等问题).
Stars: ✭ 776 (+3595.24%)
Mutual labels:  mvp-architecture, mvp-android

Hex.pm Platform Download Build Status Android Arsenal

RxPresenter

A Reactive Presenter library for MVP pattern for modern Android Apps. This library follows the lifecycle of an android app component (Activity,AppCompatActivity,Fragment, DialogFragment). Specifically relies on RxLifecycle by Trello.


Contents

Usage

This library supports only the support Activity,AppCompatActivity, Fragment and DialogFragment. In order to be able to use the library, these app components must inherit one of the followings, MvpActivity, MvpFragment

Activity

bind(activity);

Fragment

bind(fragment);

Dialog Fragment

bind(dialogFragment);

Firstly you need to define an interface which representing a View in a MVP pattern and there is a 1-to-1 relationship and two way communication between View & Presenter. In our case this interface must extends MvpView eg.

interface DemoView extends MvpView {

}

Then you need to create a Presenter in the MVP pattern. In this library the Presenter must extend RxPresenter<V> where V is the View interface which we defined above. eg.

class DemoPresenter extends RxPresenter<DemoView> {

  DemoPresenter() {
  }
 }

The corresponding android app component must implements the View interface! After that you need just to initialise the presenter and bind(component) it to Fragment or DialogFragment. eg.

Without Dependency Injection

public class DemoFragment extends MvpFragment implements DemoView {

  private Presenter presenter = new DemoPresenter();

  @Override public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    this.presenter.bind(this);
  }
}

With Dependency Injection - Dagger2

public class DemoFragment extends MvpFragment implements DemoView {

  @Inject Presenter presenter;

  @Override public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    //Dagger2 injection code

    this.presenter.bind(this);
  }
}

After the line this.presenter.bind(this) the Presenter starts following the Android App Component's lifecycle and specifically on onViewCreated we bound the corresponding interface View automatically without the need to do it explicitly. Then the Presenter follows the typical lifecycle methods onResume, onPause, onDestroy.

RxPresenter exposes also helper methods which will help your RxJava observables to follow the Android App Component's lifecycle (with the use of RxLifecycle by Trello).

  1. By default stops emitting in FragmentEvent.DESTROY_VIEW and use a Subscriber<T> to "react"
bindLifecycle(@NonNull Observable<T> observable, Subscriber<T>... subscribers)
  1. By default stops emitting in FragmentEvent.DESTROY_VIEW and use an Action1<T> to "react"
bindLifecycle(@NonNull Observable<T> observable, Action1<T> action)
  1. Stops emitting on the provided FragmentEvent and use a Subscriber<T> to "react"
 bindUntilEvent(@NonNull Observable<T> observable, @NonNull FragmentEvent event, Subscriber<T>... subscribers)
  1. Stops emitting on the provided FragmentEvent and use an Action1<T> to "react"
 bindUntilEvent(@NonNull Observable<T> observable, @NonNull FragmentEvent event, Action1<T> action)

Download

The project is available on jCenter. In your app build.gradle (or explicit module) you must add this:

dependencies {
  //java
  compile 'com.ezhome:rxpresenter:1.3.0'

  //kotlin
  compile 'com.ezhome:rxpresenter-kotlin:1.3.0'
}

Tests

./gradlew :rxpresenter:test

Code style

Code style used in the project is called SquareAndroid from Java Code Styles repository by Square available at: https://github.com/square/java-code-styles.

License

See the LICENSE file for license rights and limitations (Apache license 2.0).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].