├── app
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── values
│ │ │ │ ├── strings.xml
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── layout
│ │ │ │ └── activity_main.xml
│ │ │ ├── drawable-v24
│ │ │ │ └── ic_launcher_foreground.xml
│ │ │ └── drawable
│ │ │ │ └── ic_launcher_background.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── bigkoo
│ │ │ │ └── kata
│ │ │ │ └── MainActivity.java
│ │ └── AndroidManifest.xml
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── bigkoo
│ │ │ └── kata
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── bigkoo
│ │ └── kata
│ │ └── ExampleInstrumentedTest.java
├── proguard-rules.pro
└── build.gradle
├── katafoundation
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── values
│ │ │ │ ├── strings.xml
│ │ │ │ └── colors.xml
│ │ │ └── layout
│ │ │ │ ├── include_list.xml
│ │ │ │ └── include_listram.xml
│ │ ├── .DS_Store
│ │ ├── java
│ │ │ ├── .DS_Store
│ │ │ └── com
│ │ │ │ ├── .DS_Store
│ │ │ │ └── bigkoo
│ │ │ │ ├── .DS_Store
│ │ │ │ ├── katafoundation
│ │ │ │ ├── activity
│ │ │ │ │ ├── BaseDetailActivity.java
│ │ │ │ │ ├── BaseListActivity.java
│ │ │ │ │ ├── BaseDataActivity.java
│ │ │ │ │ ├── BaseActivity.java
│ │ │ │ │ └── BaseListRAMActivity.java
│ │ │ │ ├── fragment
│ │ │ │ │ ├── BaseDetailFragment.java
│ │ │ │ │ ├── BaseListFragment.java
│ │ │ │ │ ├── BaseDataFragment.java
│ │ │ │ │ ├── BaseLazyFragment.java
│ │ │ │ │ ├── BaseFragment.java
│ │ │ │ │ └── BaseListRAMFragment.java
│ │ │ │ ├── mvpview
│ │ │ │ │ └── BaseListRAMView.java
│ │ │ │ ├── presenter
│ │ │ │ │ └── BaseListRAMPresenter.java
│ │ │ │ └── manager
│ │ │ │ │ └── AppManager.java
│ │ │ │ └── utils
│ │ │ │ ├── OSUtils.java
│ │ │ │ ├── StatusBarUtil.java
│ │ │ │ └── SystemBarTintManager.java
│ │ └── AndroidManifest.xml
│ ├── .DS_Store
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── bigkoo
│ │ │ └── katafoundation
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── bigkoo
│ │ └── katafoundation
│ │ └── ExampleInstrumentedTest.java
├── .DS_Store
├── build.gradle
└── proguard-rules.pro
├── kataframework
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── values
│ │ │ │ └── strings.xml
│ │ │ └── .DS_Store
│ │ ├── .DS_Store
│ │ ├── java
│ │ │ ├── .DS_Store
│ │ │ └── com
│ │ │ │ ├── .DS_Store
│ │ │ │ └── bigkoo
│ │ │ │ ├── .DS_Store
│ │ │ │ └── kataframework
│ │ │ │ ├── mvpview
│ │ │ │ ├── IBaseView.java
│ │ │ │ ├── BaseDetailView.java
│ │ │ │ ├── BaseListView.java
│ │ │ │ └── BaseDataView.java
│ │ │ │ ├── http
│ │ │ │ ├── constants
│ │ │ │ │ └── HttpStatusConstants.java
│ │ │ │ └── observer
│ │ │ │ │ └── HttpResultObserver.java
│ │ │ │ ├── mvppresenter
│ │ │ │ ├── BasePresenter.java
│ │ │ │ ├── BaseAppPresenter.java
│ │ │ │ ├── BaseDetailPresenter.java
│ │ │ │ ├── BaseDataPresenter.java
│ │ │ │ └── BaseListPresenter.java
│ │ │ │ ├── bean
│ │ │ │ └── HttpResult.java
│ │ │ │ ├── rx
│ │ │ │ ├── RxBus.java
│ │ │ │ └── MainThread.java
│ │ │ │ └── utils
│ │ │ │ └── TUtil.java
│ │ └── AndroidManifest.xml
│ ├── .DS_Store
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── bigkoo
│ │ │ └── kataframework
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── bigkoo
│ │ └── kataframework
│ │ └── ExampleInstrumentedTest.java
├── .DS_Store
├── build.gradle
└── proguard-rules.pro
├── settings.gradle
├── .DS_Store
├── .gitattributes
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .idea
├── vcs.xml
├── misc.xml
├── runConfigurations.xml
├── modules.xml
└── codeStyles
│ └── Project.xml
├── README.md
├── gradle.properties
├── .gitignore
├── gradlew.bat
├── gradlew
└── LICENSE
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/katafoundation/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/kataframework/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':kataframework', ':katafoundation'
2 |
--------------------------------------------------------------------------------
/kataframework/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saiwu-bigkoo/Android-Kata/HEAD/.DS_Store
--------------------------------------------------------------------------------
/katafoundation/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/kataframework/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saiwu-bigkoo/Android-Kata/HEAD/kataframework/.DS_Store
--------------------------------------------------------------------------------
/katafoundation/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saiwu-bigkoo/Android-Kata/HEAD/katafoundation/.DS_Store
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Kata
3 |
4 |
--------------------------------------------------------------------------------
/katafoundation/src/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saiwu-bigkoo/Android-Kata/HEAD/katafoundation/src/.DS_Store
--------------------------------------------------------------------------------
/kataframework/src/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saiwu-bigkoo/Android-Kata/HEAD/kataframework/src/.DS_Store
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saiwu-bigkoo/Android-Kata/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/katafoundation/src/main/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saiwu-bigkoo/Android-Kata/HEAD/katafoundation/src/main/.DS_Store
--------------------------------------------------------------------------------
/kataframework/src/main/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saiwu-bigkoo/Android-Kata/HEAD/kataframework/src/main/.DS_Store
--------------------------------------------------------------------------------
/kataframework/src/main/res/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saiwu-bigkoo/Android-Kata/HEAD/kataframework/src/main/res/.DS_Store
--------------------------------------------------------------------------------
/katafoundation/src/main/java/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saiwu-bigkoo/Android-Kata/HEAD/katafoundation/src/main/java/.DS_Store
--------------------------------------------------------------------------------
/kataframework/src/main/java/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saiwu-bigkoo/Android-Kata/HEAD/kataframework/src/main/java/.DS_Store
--------------------------------------------------------------------------------
/kataframework/src/main/java/com/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saiwu-bigkoo/Android-Kata/HEAD/kataframework/src/main/java/com/.DS_Store
--------------------------------------------------------------------------------
/katafoundation/src/main/java/com/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saiwu-bigkoo/Android-Kata/HEAD/katafoundation/src/main/java/com/.DS_Store
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saiwu-bigkoo/Android-Kata/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saiwu-bigkoo/Android-Kata/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saiwu-bigkoo/Android-Kata/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saiwu-bigkoo/Android-Kata/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saiwu-bigkoo/Android-Kata/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/kataframework/src/main/java/com/bigkoo/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saiwu-bigkoo/Android-Kata/HEAD/kataframework/src/main/java/com/bigkoo/.DS_Store
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saiwu-bigkoo/Android-Kata/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saiwu-bigkoo/Android-Kata/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saiwu-bigkoo/Android-Kata/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/katafoundation/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
--------------------------------------------------------------------------------
/katafoundation/src/main/java/com/bigkoo/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saiwu-bigkoo/Android-Kata/HEAD/katafoundation/src/main/java/com/bigkoo/.DS_Store
--------------------------------------------------------------------------------
/kataframework/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saiwu-bigkoo/Android-Kata/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saiwu-bigkoo/Android-Kata/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/katafoundation/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #6EB7DC
4 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/kataframework/src/main/java/com/bigkoo/kataframework/mvpview/IBaseView.java:
--------------------------------------------------------------------------------
1 | package com.bigkoo.kataframework.mvpview;
2 |
3 | /**
4 | * Created by Sai on 2018/3/15.
5 | */
6 |
7 | public interface IBaseView {
8 | }
9 |
--------------------------------------------------------------------------------
/kataframework/src/main/java/com/bigkoo/kataframework/mvpview/BaseDetailView.java:
--------------------------------------------------------------------------------
1 | package com.bigkoo.kataframework.mvpview;
2 |
3 | /**
4 | * Created by Sai on 2018/3/15.
5 | */
6 |
7 | public interface BaseDetailView extends BaseDataView {
8 | }
9 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Mar 16 20:16:34 CST 2019
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
7 |
--------------------------------------------------------------------------------
/kataframework/src/main/java/com/bigkoo/kataframework/mvpview/BaseListView.java:
--------------------------------------------------------------------------------
1 | package com.bigkoo.kataframework.mvpview;
2 |
3 | /**
4 | * Created by sai on 2018/3/17.
5 | */
6 |
7 | public interface BaseListView extends BaseDataView {
8 | void onLoadingMore(boolean isLoadingMore);
9 | }
10 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/kataframework/src/main/java/com/bigkoo/kataframework/http/constants/HttpStatusConstants.java:
--------------------------------------------------------------------------------
1 | package com.bigkoo.kataframework.http.constants;
2 |
3 | /**
4 | * Created by Sai on 2018/3/15.
5 | */
6 |
7 | public class HttpStatusConstants {
8 | public final static int CODE_SUCCESS = 0;
9 | public final static int CODE_DEFAULT = -1;
10 | }
11 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/katafoundation/src/main/java/com/bigkoo/katafoundation/activity/BaseDetailActivity.java:
--------------------------------------------------------------------------------
1 | package com.bigkoo.katafoundation.activity;
2 |
3 | import com.bigkoo.kataframework.mvppresenter.BaseDetailPresenter;
4 |
5 | /**
6 | * Created by Sai on 2018/3/16.
7 | */
8 |
9 | public abstract class BaseDetailActivity
extends BaseDataActivity
{
10 |
11 | @Override
12 | protected void initData() {
13 |
14 | }
15 |
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/app/src/test/java/com/bigkoo/kata/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.bigkoo.kata;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/katafoundation/src/main/java/com/bigkoo/katafoundation/fragment/BaseDetailFragment.java:
--------------------------------------------------------------------------------
1 | package com.bigkoo.katafoundation.fragment;
2 |
3 | import com.bigkoo.kataframework.mvppresenter.BaseDetailPresenter;
4 |
5 | /**
6 | * Created by sai on 2018/3/18.
7 | */
8 | public abstract class BaseDetailFragment
extends BaseDataFragment
{
9 |
10 | @Override
11 | protected void initData() {
12 | getPresenter().onLoadData();
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/katafoundation/src/main/res/layout/include_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
--------------------------------------------------------------------------------
/app/src/main/java/com/bigkoo/kata/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.bigkoo.kata;
2 |
3 | import android.os.Bundle;
4 |
5 | import com.bigkoo.katafoundation.activity.BaseActivity;
6 |
7 | public class MainActivity extends BaseActivity {
8 |
9 |
10 | @Override
11 | protected int getLayoutResID() {
12 | return R.layout.activity_main;
13 | }
14 |
15 | @Override
16 | protected void initView() {
17 |
18 | }
19 |
20 | @Override
21 | protected void initData() {
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/katafoundation/src/test/java/com/bigkoo/katafoundation/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.bigkoo.katafoundation;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/kataframework/src/test/java/com/bigkoo/kataframework/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.bigkoo.kataframework;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/katafoundation/src/main/res/layout/include_listram.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/katafoundation/src/main/java/com/bigkoo/katafoundation/mvpview/BaseListRAMView.java:
--------------------------------------------------------------------------------
1 | package com.bigkoo.katafoundation.mvpview;
2 |
3 | import android.view.View;
4 |
5 | import com.chad.library.adapter.base.BaseQuickAdapter;
6 | import com.bigkoo.kataframework.mvpview.BaseListView;
7 |
8 | /**
9 | * Created by sai on 2018/3/18.
10 | */
11 |
12 | public interface BaseListRAMView extends BaseListView {
13 | void onItemClick(BaseQuickAdapter adapter, View view, int position);
14 | boolean onItemChildClick(BaseQuickAdapter adapter, View view, int position);
15 | }
16 |
--------------------------------------------------------------------------------
/kataframework/src/main/java/com/bigkoo/kataframework/mvpview/BaseDataView.java:
--------------------------------------------------------------------------------
1 | package com.bigkoo.kataframework.mvpview;
2 |
3 | /**
4 | * Created by Sai on 2018/3/15.
5 | */
6 |
7 | public interface BaseDataView extends IBaseView {
8 | void onRefreshing(boolean refreshing);
9 |
10 | void onStatusEmpty(String msg);
11 |
12 | void onStatusLoading();
13 |
14 | void onStatusError(int code, String msg);
15 |
16 | void onStatusNetworkError(String msg);
17 |
18 | void onDataSetChange(Object data, String msg);
19 |
20 | void onLoadComplete();
21 | }
22 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Android-Kata
2 | 大多数app其实都是可以通过套路快速搭建的,其中无非分为联网与不联网,而联网可以延展分为列表、详情、提交表单。我曾经写了MVVM的框架,可是DataBinding至今都没普及,比较多的都是用MVP,但实际上MVP模式写起来也略为复杂,基于MVP和MVVM我重新定义了把P作为伪M,加上一些套路,总结了这个框架,我称它为Kata。
3 |
4 | 一年前就写好了一直没开源都是自己用,经过实践一个应用即使单干,使用Kata一个月之内不加班轻轻松松也能完成,速度快的话只需一周。
5 |
6 | 用到的其他库有:
7 | BaseRecyclerViewAdapterHelper
8 | ultra-ptr
9 | rxjava
10 | rxlifecycle
11 |
12 | 感谢他们
13 |
14 | Demo如下:
15 |
16 | [KataDemo-账房先生](https://github.com/saiwu-bigkoo/KataDemo-androidlite)
17 |
18 | 实战如下,一个月一个人在不加班情况下完成80%功能,后加入团队的小伙伴三分钟上手一个月零一周完成所有功能进入测试阶段,提前完成妥妥的等着品牌发布会当天进行上线:
19 | [广汽蔚来新能源汽车app-合创](https://a.app.qq.com/o/simple.jsp?pkgname=com.gac.nioapp)
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/kataframework/src/main/java/com/bigkoo/kataframework/mvppresenter/BasePresenter.java:
--------------------------------------------------------------------------------
1 | package com.bigkoo.kataframework.mvppresenter;
2 |
3 | import android.content.Context;
4 |
5 | /**
6 | * T-MVP Presenter基类
7 | * Created by Sai on 2018/3/15.
8 | */
9 |
10 | public abstract class BasePresenter {
11 | protected Context context;
12 | protected V view;
13 |
14 | public void setVM(V v, Context mContext) {
15 | this.context = mContext;
16 | this.view = v;
17 | }
18 |
19 | public void onDestroy() {
20 | context = null;
21 | view = null;
22 | }
23 |
24 | public Context getContext() {
25 | return context;
26 | }
27 |
28 | public V getView() {
29 | return view;
30 | }
31 |
32 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | android.enableJetifier=true
10 | android.useAndroidX=true
11 | org.gradle.jvmargs=-Xmx1536m
12 | # When configured, Gradle will run in incubating parallel mode.
13 | # This option should only be used with decoupled projects. More details, visit
14 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
15 | # org.gradle.parallel=true
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/bigkoo/kata/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.bigkoo.kata;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.bigkoo.kata", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/kataframework/src/androidTest/java/com/bigkoo/kataframework/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.bigkoo.kataframework;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.bigkoo.kataframework.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/katafoundation/src/androidTest/java/com/bigkoo/katafoundation/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.bigkoo.katafoundation;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.bigkoo.katafoundation.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/katafoundation/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 28
5 |
6 |
7 |
8 | defaultConfig {
9 | minSdkVersion 15
10 | targetSdkVersion 28
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
15 |
16 | }
17 |
18 | buildTypes {
19 | release {
20 | minifyEnabled false
21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
22 | }
23 | }
24 |
25 | }
26 |
27 | dependencies {
28 | api project(':kataframework')
29 | api 'androidx.appcompat:appcompat:1.0.0-beta01'
30 | // implementation 'com.android.support:cardview-v7:28.0.0'
31 | api 'com.google.android.material:material:1.0.0-beta01'
32 | api 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.46'
33 | api 'in.srain.cube:ultra-ptr:1.0.11'
34 | }
35 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 28
5 | defaultConfig {
6 | applicationId "com.bigkoo.kata"
7 | minSdkVersion 15
8 | targetSdkVersion 28
9 | versionCode 1
10 | versionName "1.0"
11 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | //网络
23 | implementation 'com.squareup.retrofit2:retrofit:2.5.0'
24 | implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
25 | implementation 'com.squareup.retrofit2:adapter-rxjava2:2.5.0'
26 | implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
27 | implementation project(':katafoundation')
28 | implementation project(':kataframework')
29 | }
30 |
--------------------------------------------------------------------------------
/katafoundation/src/main/java/com/bigkoo/katafoundation/activity/BaseListActivity.java:
--------------------------------------------------------------------------------
1 | package com.bigkoo.katafoundation.activity;
2 |
3 | import androidx.recyclerview.widget.RecyclerView;
4 |
5 | import com.chad.library.adapter.base.BaseQuickAdapter;
6 | import com.bigkoo.katafoundation.R;
7 | import com.bigkoo.kataframework.mvppresenter.BaseListPresenter;
8 |
9 | /**
10 | * Created by sai on 2018/3/18.
11 | */
12 |
13 | public abstract class BaseListActivity extends BaseDataActivity
{
14 | protected RecyclerView recyclerView;
15 | protected BaseQuickAdapter adapter;
16 |
17 | @Override
18 | protected void initView() {
19 | recyclerView = findViewById(R.id.recyclerView);
20 | adapter = getAdapter();
21 | adapter.bindToRecyclerView(recyclerView);
22 | recyclerView.setAdapter(adapter);
23 | }
24 |
25 |
26 | @Override
27 | protected void initData() {
28 |
29 | }
30 |
31 |
32 | protected abstract BaseQuickAdapter getAdapter();
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/kataframework/src/main/java/com/bigkoo/kataframework/bean/HttpResult.java:
--------------------------------------------------------------------------------
1 | package com.bigkoo.kataframework.bean;
2 |
3 | import com.bigkoo.kataframework.http.constants.HttpStatusConstants;
4 |
5 | /**
6 | * Created by Sai on 2018/3/15.
7 | */
8 |
9 | public class HttpResult {
10 | /**
11 | * 默认约定返回 格式 : {"code":0,"msg":"提示消息","data":{}}
12 | * status : 0
13 | * msg : 提示消息
14 | * data : {}
15 | */
16 | private int code = HttpStatusConstants.CODE_DEFAULT;//防止返回格式不给code
17 | private T data;
18 | private String msg;
19 |
20 | public int getCode() {
21 | return code;
22 | }
23 |
24 | public void setCode(int code) {
25 | this.code = code;
26 | }
27 |
28 | public T getData() {
29 | return data;
30 | }
31 |
32 | public void setData(T data) {
33 | this.data = data;
34 | }
35 |
36 | public String getMsg() {
37 | return msg;
38 | }
39 |
40 | public void setMsg(String msg) {
41 | this.msg = msg;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/katafoundation/src/main/java/com/bigkoo/katafoundation/fragment/BaseListFragment.java:
--------------------------------------------------------------------------------
1 | package com.bigkoo.katafoundation.fragment;
2 |
3 | import androidx.recyclerview.widget.RecyclerView;
4 |
5 | import com.chad.library.adapter.base.BaseQuickAdapter;
6 | import com.bigkoo.katafoundation.R;
7 | import com.bigkoo.kataframework.mvppresenter.BaseListPresenter;
8 |
9 | /**
10 | * Created by sai on 2018/3/18.
11 | */
12 |
13 | public abstract class BaseListFragment extends BaseDataFragment
{
14 | protected RecyclerView recyclerView;
15 | protected BaseQuickAdapter adapter;
16 |
17 | @Override
18 | protected void initView() {
19 | recyclerView = findViewById(R.id.recyclerView);
20 | adapter = getAdapter();
21 | adapter.bindToRecyclerView(recyclerView);
22 | recyclerView.setAdapter(adapter);
23 | }
24 |
25 |
26 | @Override
27 | protected void initData() {
28 | getPresenter().onLoadData();
29 | }
30 |
31 |
32 | protected abstract BaseQuickAdapter getAdapter();
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/kataframework/src/main/java/com/bigkoo/kataframework/rx/RxBus.java:
--------------------------------------------------------------------------------
1 | package com.bigkoo.kataframework.rx;
2 |
3 | import io.reactivex.Observable;
4 | import io.reactivex.subjects.PublishSubject;
5 | import io.reactivex.subjects.Subject;
6 |
7 | /**
8 | * Created by Sai on 2018/3/15.
9 | */
10 |
11 | public class RxBus {
12 | private final Subject