Code Monkey home page Code Monkey logo

appkit's Introduction

appkit

This is an extension for the mosby library from Hannes Dorfmann.

It contains a few default activities and fragments which are often used in android development (e.g. Activity with Toolbar, Activity with Tabs, Fragment with RecyclerView, ...)

CBActivityMvpToolbar

Displays a simple activity with a toolbar on top.
You have to implement only three methods:

  • createPresenter(): provide a presenter which loads the data
  • loadData(boolean isContentVisible): load the data (e.g. presenter.loadListData); isContentVisible helps to distinguish between the first load (no data visible) and for example a pull to refresh or click on an error view (data already visible)
  • setData(D data): is called when the presenter has loaded the data

CBActivityMvpToolbarTabs

Displays a simple activity with a toolbar and tabs on top.
Same as CBActivityMvpToolbar plus one additional method:

  • createAdapter(): provide a PagerAdapter which is responsible for displaying the tabs

CBActivityMvpToolbarFragment

Displays a simple activity which only contains a fragment.
Same as CBActivityMvpToolbar plus one additional method:

  • createFragmentToDisplay(): provide the fragment which should be displayed

CBAdapterRecyclerView

A simple RecyclerView.Adapter with a few helper methods to add, delete items. It also has a setter and getter for the data.

  • onCreateViewHolder(ViewGroup parent, int viewType): create the viewholder
  • onBindViewHolder(RecyclerView.ViewHolder viewHolder, int position, int viewType): bind the viewholder
  • getItemViewType(int position): (optional) only needed if you have different view types

CBFragmentMvpRecyclerView

A simple fragment with a recycler view.

  • createPresenter(): provide a presenter which loads the data
  • createAdapter(): provide a adapter which displays the data
  • loadData(boolean isContentVisible): load the data (e.g. presenter.loadListData); isContentVisible helps to distinguish between the first load (no data visible) and for example a pull to refresh or click on an error view (data already visible)
  • setData(D data): is called when the presenter has loaded the data

CBFragmentMvpRecyclerViewPtr

Excactly the same as CBFragmentMvpRecyclerView but with pull to refresh functionallity.
The default behavior for pull to refresh is to call the loadData(true) function but this can be overriden in onRefreshStarted()

All this activities and fragments also have a viewstate implementation. For further information see Mosby Framework

Dependency

Newest Version (Jitpack.io):

[Release] (https://jitpack.io/#Bodo1981/appkit)

dependencies {
    // complete library
    compile 'com.github.Bodo1981:appkit:1.1.5'

    // or submodules (java)
    compile 'com.github.Bodo1981.appkit:core:1.1.5'
    compile 'com.github.Bodo1981.appkit:viewstate:1.1.5'
    
    // or submodules (kotlin)
    compile 'com.github.Bodo1981.appkit:core-kotlin:1.1.5'
    compile 'com.github.Bodo1981.appkit:viewstate-kotlin:1.1.5'
}

The library contains submodules written in java and kotlin. Functionality is the same.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.2.3'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
    }
}

allprojects {
    repositories {
        jcenter()
        maven {
            // for icepick
            url 'https://clojars.org/repo/'
        }
        maven {
            // for appkit
            url 'https://jitpack.io'
        }
        maven {
            // for material design colors
            url 'http://raw.github.com/wada811/Android-Material-Design-Colors/master/repository/'
        }
    }
}

dependencies {
    apt 'frankiesardo:icepick-processor:3.0.2'
    apt 'com.hannesdorfmann.fragmentargs:processor:2.1.0'
}

#Changelog

The changelog can be found in the release section

appkit's People

Contributors

bodo1981 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.