All Projects → lenguyenthanh → nimble

lenguyenthanh / nimble

Licence: Apache-2.0 license
Nimble is a small, quick and flexible Model-View-Presenter(MVP) library for Android.

Programming Languages

java
68154 projects - #9 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to nimble

Reader
📚 MVP + Volley + Gson, 内容包含了糗事百科,煎蛋,和内涵段子
Stars: ✭ 60 (+150%)
Mutual labels:  mvp
Prevailer-orientation-support-library-for-Android
Prevailer is a simple android library that helps in preserving object instances across orientation change in android and is JAVA 8 and MVP ready.
Stars: ✭ 17 (-29.17%)
Mutual labels:  mvp
BookReader
📕 "任阅" 网络小说阅读器,3D翻页效果、txt/pdf/epub书籍阅读、Wifi传书~
Stars: ✭ 6,113 (+25370.83%)
Mutual labels:  mvp
MVPFrame
Android MVPFrame Simple Demo. and Recycler lazy load data
Stars: ✭ 72 (+200%)
Mutual labels:  mvp
Weather-Guru-MVP
Sample Material-design Android weather application build with MVP architectural approach using Dagger2, RxJava2, Retrofit2, Event-Bus, GreenDao, Butterknife, Lottie etc.
Stars: ✭ 15 (-37.5%)
Mutual labels:  mvp
idreminder
Simple reminder app build with Kotlin + Clean Architecture + RxJava + Dagger2 + MVP + Room
Stars: ✭ 29 (+20.83%)
Mutual labels:  mvp
nongbeer-mvp-android-demo
Showcase app that how to build an MVP app from scratch.
Stars: ✭ 25 (+4.17%)
Mutual labels:  mvp
WanAndroid
Kotlin版 玩Android 客户端
Stars: ✭ 37 (+54.17%)
Mutual labels:  mvp
EdgeMvp
一个MVP架构利器。自动生成接口文件,且不需要实现接口。
Stars: ✭ 56 (+133.33%)
Mutual labels:  mvp
Villains-and-Heroes
Android app built with MVP architectural approach and uses Marvel Comics API that allows developers everywhere to access information about Marvel's vast library of comics. ⚡
Stars: ✭ 53 (+120.83%)
Mutual labels:  mvp
WanAndroidMaster
根据 http://www.wanandroid.com 提供api ,编写 包含 Material Design + MVP + Rxjava2 + Retrofit + Glide项目
Stars: ✭ 74 (+208.33%)
Mutual labels:  mvp
ReadnBuyAndroidApp
Android app developed at the Vanhackathon for Shopify's challenge. Coded with Kotlin, RxJava and MVP.
Stars: ✭ 13 (-45.83%)
Mutual labels:  mvp
mvp4g
A framework to build a gwt application the right way
Stars: ✭ 29 (+20.83%)
Mutual labels:  mvp
MVPDemo
MVP 封装
Stars: ✭ 81 (+237.5%)
Mutual labels:  mvp
Fineract-CN-mobile
DEPRECATED project - Check the Apache fineract-cn-mobile project instead
Stars: ✭ 17 (-29.17%)
Mutual labels:  mvp
sirius
Modern coffeescript/javascript framework
Stars: ✭ 20 (-16.67%)
Mutual labels:  mvp
mvp-docs
The Unofficial MVP Contribution Guide:
Stars: ✭ 18 (-25%)
Mutual labels:  mvp
uv-index
This is a work-in-progress (🔧️) ultraviolet index viewer app for demonstrating Instant Apps + Kotlin + Dagger + MVP
Stars: ✭ 64 (+166.67%)
Mutual labels:  mvp
Clean Marvel Kotlin
This repository contains a detailed sample app that implements Clean architecture and MVP in Kotlin using RxJava2, Retrofit
Stars: ✭ 27 (+12.5%)
Mutual labels:  mvp
application
✨ Extra contrib to nette/application (@nette)
Stars: ✭ 23 (-4.17%)
Mutual labels:  mvp

Nimble Maven Central Build Status codecov.io

Nimble is a small, quick and flexible Model-View-Presenter library for Android

If you do not know much about MVP, please read MVP Definition and best practices. Or read more about Nimble.

Why Nimble

  • Nimble provides simple base classes to implement MVP simple. You can get it from maven center or copy and paste few lines of code.
  • Nimble is simple has less than 500 lines of code. So it is easy to read and understand. You cat get familiar with it in just 30 minutes.
  • Nimble has well tested code (more than 89% code coverage) so you can confident when using it.
  • Nimble is designed to be flexible. So you can use it any way you. It can be used perfectly with Dagger or you can manage it manually.
  • Nimble provides mechanism to manage the life cycle of the view for you.
  • Nimble provides mechanism to save data when activity/fragment/view is recreated throws Bundle class.

Example

Nimble has two simple examples in this repository: Nimble-exaple and Nimble example with Dagger 2. There is more complete example for Nimble is Snowball which is a well tested sample project.

Usage

Nimble has two basic interfaces NimbleView and NimblePresenter. They are base interfaces for ant views and presenters.

You should follow these steps to create a MVP component in your application:

  1. Create a View interface which must extents NimbleView:
public interface MainView extends NimbleView {
    void showUser(User user);
}
  1. Create a Presenter interface which must extent NimblePresenter with View generic like:
public interface MainPresenter extends NimblePresenter<MainView> {
    void getUser();
}
  1. Implement your Presenter which should extent BasePresenter:
public class MainPresenterImpl extends BasePresenter<MainView> implements MainPresenter {
    public void getUser(){
        User user = ...
        getView().showUser(user);
    }
}
  1. Implement your View which should extent base a Nimble Views such as NimbleActivity and implments your View interface:
public class MainActivity extends NimbleActivity<MainView> implements MainView {
    private MainPresenter presenter;
    
    @Override
    protected MainPresenter presenter() {
        if(presenter == null){
            presenter = new MainPresenter();
        }
        return presenter;
    }
  
    void onButtonClicked(){
        presenter().getUser();
    }
}

Congratulation!!! You have a MVP component now.

Inspiration

Nimble has a lot of inspiration from other great MVP libraries for Android:

Installation

compile 'com.lenguyenthanh.nimble:nimble:0.5.1'

License

Copyright (C) 2016 Thanh Le

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
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].