{
10 |
11 | }
12 |
13 | interface BaseView {
14 |
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/activity_webviewjavascript.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/sample/src/main/assets/HttpRequestCallbackString.md:
--------------------------------------------------------------------------------
1 | ##StringHttpRequestCallback
2 |
3 | RequestParams params = new RequestParams(this);
4 | params.addFormDataPart("page", 1);
5 | params.addFormDataPart("limit", 12);
6 | HttpRequest.post(Api.NEW_GAME, params, new StringHttpRequestCallback() {
7 | @Override
8 | protected void onSuccess(String s) {
9 | super.onSuccess(s);
10 | mTvResult.setText(JsonFormatUtils.formatJson(s));
11 | }
12 | });
13 |
--------------------------------------------------------------------------------
/sample/src/main/assets/css-themes/FactoryFragment.md:
--------------------------------------------------------------------------------
1 | ##StringHttpRequestCallback
2 |
3 | RequestParams params = new RequestParams(this);
4 | params.addFormDataPart("page", 1);
5 | params.addFormDataPart("limit", 12);
6 | HttpRequest.post(Api.NEW_GAME, params, new StringHttpRequestCallback() {
7 | @Override
8 | protected void onSuccess(String s) {
9 | super.onSuccess(s);
10 | mTvResult.setText(JsonFormatUtils.formatJson(s));
11 | }
12 | });
13 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/function/annotation/ByColor.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.function.annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | @Target(ElementType.FIELD)
9 | @Retention(RetentionPolicy.RUNTIME)
10 | public @interface ByColor {
11 | int value();
12 | }
13 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/function/annotation/ByView.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.function.annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | @Target(ElementType.FIELD)
9 | @Retention(RetentionPolicy.RUNTIME)
10 | public @interface ByView {
11 | int value();
12 | }
13 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/function/annotation/ByString.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.function.annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | @Target(ElementType.FIELD)
9 | @Retention(RetentionPolicy.RUNTIME)
10 | public @interface ByString {
11 | int value();
12 | }
13 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/function/annotation/aspect/CheckNetwork.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.function.annotation.aspect;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | @Target(ElementType.METHOD)
9 | @Retention(RetentionPolicy.RUNTIME)
10 | public @interface CheckNetwork {
11 | }
12 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/architecture/segment/type1/Page2.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.architecture.segment.type1;
2 |
3 | /**
4 | * @author ddnosh
5 | * @website http://blog.csdn.net/ddnosh
6 | */
7 |
8 | public class Page2 extends PageController {
9 | public Page2(BasePageFragment fragment) {
10 | super(fragment);
11 | }
12 |
13 | @Override
14 | protected void initView() {
15 |
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/function/annotation/ByContentView.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.function.annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | @Target(ElementType.TYPE)
9 | @Retention(RetentionPolicy.RUNTIME)
10 | public @interface ByContentView {
11 | int value();
12 | }
13 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/module/network/retrofit/Gank2Apis.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.module.network.retrofit;
2 |
3 | import java.util.List;
4 |
5 | import retrofit2.Call;
6 | import retrofit2.http.GET;
7 |
8 | /**
9 | * @author ddnosh
10 | * @website http://blog.csdn.net/ddnosh
11 | */
12 | public interface Gank2Apis {
13 |
14 | @GET("day/history")
15 | Call>> getHistoryDate();
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/item_multiviewtype_img.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/module/ioc/dagger2/Test1Component.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.module.ioc.dagger2;
2 |
3 | /**
4 | * @author ddnosh
5 | * @website http://blog.csdn.net/ddnosh
6 | */
7 |
8 | import dagger.Component;
9 | import com.androidwind.androidquick.demo.injector.FragmentScope;
10 |
11 | @FragmentScope
12 | @Component
13 | public interface Test1Component {
14 |
15 | // void inject(Dagger2Fragment dagger2Fragment);
16 | }
17 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/module/network/retrofit/GankApis.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.module.network.retrofit;
2 |
3 | import java.util.List;
4 |
5 | import io.reactivex.Observable;
6 | import retrofit2.http.GET;
7 |
8 | /**
9 | * @author ddnosh
10 | * @website http://blog.csdn.net/ddnosh
11 | */
12 | public interface GankApis {
13 |
14 | @GET("day/history")
15 | Observable>> getHistoryDate();
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/fragment_example3.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/thirdparty/treeview/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | My Library
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/injector/ActivityScope.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.injector;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 |
6 | import javax.inject.Scope;
7 |
8 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
9 |
10 | /**
11 | * @author ddnosh
12 | * @website http://blog.csdn.net/ddnosh
13 | */
14 | @Scope
15 | @Documented
16 | @Retention(RUNTIME)
17 | public @interface ActivityScope {
18 | }
19 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/injector/FragmentScope.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.injector;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 |
6 | import javax.inject.Scope;
7 |
8 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
9 |
10 | /**
11 | * @author ddnosh
12 | * @website http://blog.csdn.net/ddnosh
13 | */
14 | @Scope
15 | @Documented
16 | @Retention(RUNTIME)
17 | public @interface FragmentScope {
18 | }
19 |
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/item_selector_corner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
11 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/fragment_network2.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/base/mvp/BaseContract.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.base.mvp;
2 |
3 | /**
4 | * @author ddnosh
5 | * @website http://blog.csdn.net/ddnosh
6 | */
7 | public interface BaseContract {
8 |
9 | interface BasePresenter {
10 |
11 | void attachView(T view);
12 |
13 | void detachView();
14 | }
15 |
16 |
17 | interface BaseView {
18 |
19 | }
20 |
21 | interface BaseModel {
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/architecture/segment/type3/LoadJsCallback.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.architecture.segment.type3;
2 |
3 | import android.content.Context;
4 | import android.webkit.WebView;
5 |
6 | /**
7 | * @author ddnosh
8 | * @website http://blog.csdn.net/ddnosh
9 | */
10 | public interface LoadJsCallback {
11 |
12 | void loadJavaScript(String js);
13 |
14 | Context getContext();
15 |
16 | WebView getCurrentWebView();
17 | }
18 |
--------------------------------------------------------------------------------
/aop-core/src/test/java/com/androidwind/demo/mylibrary/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.demo.mylibrary;
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 | }
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/design_patterns/adapter/ChineseCharger.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.design_patterns.adapter;
2 |
3 | import com.androidwind.androidquick.util.LogUtil;
4 |
5 | /**
6 | * @author ddnosh
7 | * @website http://blog.csdn.net/ddnosh
8 | */
9 | public class ChineseCharger implements IChineseCharger {
10 | @Override
11 | public void charge4Chinese() {
12 | LogUtil.i("AmericanCharger", "do Chinese charge");
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/activity_function_ui_refresh_smartrefreshlayout_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
11 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/design_patterns/adapter/AmericanCharger.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.design_patterns.adapter;
2 |
3 | import com.androidwind.androidquick.util.LogUtil;
4 |
5 | /**
6 | * @author ddnosh
7 | * @website http://blog.csdn.net/ddnosh
8 | */
9 | public class AmericanCharger implements IAmericanCharger {
10 | @Override
11 | public void charge4American() {
12 | LogUtil.i("AmericanCharger", "do American charge");
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/item_multiviewtype_text.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/module/ioc/dagger2/Test2Component.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.module.ioc.dagger2;
2 |
3 | /**
4 | * @author ddnosh
5 | * @website http://blog.csdn.net/ddnosh
6 | */
7 |
8 | import dagger.Component;
9 | import com.androidwind.androidquick.demo.injector.FragmentScope;
10 |
11 | @FragmentScope
12 | @Component(modules = TestModule.class)
13 | public interface Test2Component {
14 |
15 | void inject(Dagger2Fragment dagger2Fragment);
16 | }
17 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/fragment_banner.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/architecture/segment/type3/JsInterface.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.architecture.segment.type3;
2 |
3 | import com.alibaba.fastjson.JSONObject;
4 |
5 | /**
6 | * @author ddnosh
7 | * @website http://blog.csdn.net/ddnosh
8 | */
9 | public interface JsInterface {
10 |
11 | /**
12 | * js调用native的接口
13 | *
14 | * @param name
15 | * @param request
16 | */
17 | void invoke(String name, JSONObject request);
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/aop-compiler/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'java-library'
2 |
3 | dependencies {
4 | implementation fileTree(dir: 'libs', include: ['*.jar'])
5 |
6 | annotationProcessor 'com.google.auto.service:auto-service:1.0-rc6'
7 | implementation 'com.google.auto.service:auto-service:1.0-rc6'
8 | implementation 'com.squareup:javapoet:1.10.0'
9 |
10 | implementation project(':aop-annotation')
11 | }
12 |
13 | sourceCompatibility = "8"
14 | targetCompatibility = "8"
15 |
16 | tasks.withType(JavaCompile) {
17 | options.encoding = "UTF-8"
18 | }
19 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/activity_host.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/design_patterns/factory/CarFactory.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.design_patterns.factory;
2 |
3 | /**
4 | * @author ddnosh
5 | * @website http://blog.csdn.net/ddnosh
6 | */
7 | public class CarFactory {
8 | public static ICar createCar(Class extends ICar> c) {
9 | try {
10 | return (ICar) c.newInstance();
11 | } catch (Exception e) {
12 | System.out.println("初始化失败");
13 | }
14 | return null;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/fragment_other_lambda.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/fragment_function_reflection.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
--------------------------------------------------------------------------------
/aop-annotation/src/main/java/com/androidwind/annotation/annotation/BindTag.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.annotation.annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * @author ddnosh
10 | * @website http://blog.csdn.net/ddnosh
11 | */
12 | @Retention(RetentionPolicy.CLASS)
13 | @Target(ElementType.TYPE)
14 | public @interface BindTag {
15 | TagInfo.Type type();
16 | String[] tags();
17 | String description();
18 | }
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/architecture/segment/type2/module3/Module3Contract.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.architecture.segment.type2.module3;
2 |
3 | import com.androidwind.androidquick.demo.features.architecture.segment.type2.mvp.BaseContract;
4 |
5 | public interface Module3Contract {
6 |
7 | interface View extends BaseContract.BaseView {
8 | void toastSomething();
9 | }
10 |
11 | interface Presenter extends BaseContract.BasePresenter {
12 | void tryToPrintSomething();
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/module/ioc/dagger2/TestModule.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.module.ioc.dagger2;
2 |
3 | import dagger.Module;
4 | import dagger.Provides;
5 |
6 | /**
7 | * @author ddnosh
8 | * @website http://blog.csdn.net/ddnosh
9 | */
10 | @Module
11 | public class TestModule {//module is only used when the class couldn't be marked as @Inject, such as the third library class
12 |
13 | @Provides
14 | public Dagger2Test2Bean getBean() {
15 | return new Dagger2Test2Bean("Mike");
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/activity_architecture_mvp_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/activity_architecture_mvp_fragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/activity_immersion.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/fragment_commontoolbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/item_adapter_expandable_child.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
13 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/architecture/segment/type2/mvp/BasePresenter.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.architecture.segment.type2.mvp;
2 |
3 | import android.content.Context;
4 |
5 | /**
6 | * @author ddnosh
7 | * @website http://blog.csdn.net/ddnosh
8 | */
9 | public abstract class BasePresenter {
10 | public Context context;
11 | public V mView;
12 |
13 | public void initV(V v) {
14 | this.mView = v;
15 | }
16 |
17 | public void unInitV() {
18 | this.mView = null;
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/bean/HomeBean.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.bean;
2 |
3 | public class HomeBean {
4 | private String title;
5 | private int imageResource;
6 |
7 | public int getImageResource() {
8 | return imageResource;
9 | }
10 |
11 | public void setImageResource(int imageResource) {
12 | this.imageResource = imageResource;
13 | }
14 |
15 | public String getTitle() {
16 | return title;
17 | }
18 |
19 | public void setTitle(String title) {
20 | this.title = title;
21 | }
22 | }
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/bean/MenuBean.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.bean;
2 |
3 | import com.unnamed.b.atv.model.TreeNode;
4 |
5 | import java.io.Serializable;
6 |
7 | public class MenuBean implements Serializable {
8 |
9 | public TreeNode treeNode;
10 | public long currentId;
11 | public String name;
12 | public long upperId;
13 |
14 | public MenuBean() {
15 |
16 | }
17 | public MenuBean(long currentId, String name, long upperId) {
18 | this.currentId = currentId;
19 | this.name = name;
20 | this.upperId = upperId;
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/fragment_ioc_dagger2.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/design_patterns/adapter/Adapter.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.design_patterns.adapter;
2 |
3 | /**
4 | * @author ddnosh
5 | * @website http://blog.csdn.net/ddnosh
6 | */
7 | public class Adapter implements IAmericanCharger {
8 | private IChineseCharger mIChineseCharger;
9 | public Adapter(IChineseCharger iChineseCharger) {
10 | mIChineseCharger = iChineseCharger;
11 | }
12 |
13 | @Override
14 | public void charge4American() {
15 | mIChineseCharger.charge4Chinese();
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/architecture/segment/type2/module3/Module3Presenter.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.architecture.segment.type2.module3;
2 |
3 | import com.androidwind.androidquick.demo.features.architecture.segment.type2.mvp.BasePresenter;
4 |
5 | /**
6 | * @author ddnosh
7 | * @website http://blog.csdn.net/ddnosh
8 | */
9 | public class Module3Presenter extends BasePresenter implements Module3Contract.Presenter {
10 | @Override
11 | public void tryToPrintSomething() {
12 | mView.toastSomething();
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/design_patterns/responsibilitychain/DateFilter.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.design_patterns.responsibilitychain;
2 |
3 | import com.androidwind.androidquick.util.LogUtil;
4 |
5 | /**
6 | * @author ddnosh
7 | * @website http://blog.csdn.net/ddnosh
8 | */
9 | public class DateFilter extends BaseFilter {
10 | @Override
11 | public void doDetailFilter(String name) {
12 | if (name.contains("2019")) {
13 | LogUtil.d("WeightFilter", "the product's date is 2019, pass!");
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/fragment_bus_rxbus.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/fragment_ioc_butterknife.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/design_patterns/responsibilitychain/WeightFilter.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.design_patterns.responsibilitychain;
2 |
3 | import com.androidwind.androidquick.util.LogUtil;
4 |
5 | /**
6 | * @author ddnosh
7 | * @website http://blog.csdn.net/ddnosh
8 | */
9 | public class WeightFilter extends BaseFilter {
10 | @Override
11 | public void doDetailFilter(String name) {
12 | if (name.contains("5kg")) {
13 | LogUtil.d("WeightFilter", "the product's weight is 5kg, pass!");
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/fragment_bus_eventbus.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/design_patterns/responsibilitychain/ShapeFilter.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.design_patterns.responsibilitychain;
2 |
3 | import com.androidwind.androidquick.util.LogUtil;
4 |
5 | /**
6 | * @author ddnosh
7 | * @website http://blog.csdn.net/ddnosh
8 | */
9 | public class ShapeFilter extends BaseFilter {
10 | @Override
11 | public void doDetailFilter(String name) {
12 | if (name.contains("circle")) {
13 | LogUtil.d("ShapeFilter", "the product's shape is circle, pass!");
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/item_headerview.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
14 |
15 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/base/databinding/BaseTActivity.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.base.databinding;
2 |
3 | import com.androidwind.androidquick.demo.base.BaseActivity;
4 |
5 | import androidx.databinding.ViewDataBinding;
6 |
7 | /**
8 | * 集成databinding
9 | *
10 | * @author ddnosh
11 | * @website http://blog.csdn.net/ddnosh
12 | */
13 | public abstract class BaseTActivity extends BaseActivity {
14 |
15 | protected String TAG = "BaseTActivity";
16 |
17 | public T getViewBinding() {
18 | return (T) getBinding();
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/base/databinding/BaseTFragment.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.base.databinding;
2 |
3 | import com.androidwind.androidquick.demo.base.BaseFragment;
4 |
5 | import androidx.databinding.ViewDataBinding;
6 |
7 | /**
8 | * 集成databinding
9 | *
10 | * @author ddnosh
11 | * @website http://blog.csdn.net/ddnosh
12 | */
13 | public abstract class BaseTFragment extends BaseFragment {
14 |
15 | protected String TAG = "BaseTFragment";
16 |
17 | public T getViewBinding() {
18 | return (T) getBinding();
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/fragment_example2.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/item_footerview.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
14 |
15 |
--------------------------------------------------------------------------------
/config.gradle:
--------------------------------------------------------------------------------
1 | ext {
2 | android = [
3 | compileSdkVersion : 29,
4 | buildToolsVersion : "29.0.2",
5 | minSdkVersion : 21,
6 | targetSdkVersion : 29,
7 | versionCode : 1,
8 | versionName : "2.0.0",
9 | ]
10 |
11 | dependencies = [
12 | //support
13 | appcompatv4 : 'com.android.support:support-v4:24.2.0',
14 | appcompatv7 : 'com.android.support:appcompat-v7:28.0.0',
15 | design : 'com.android.support:design:28.0.0'
16 | ]
17 | }
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/design_patterns/observer/Server.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.design_patterns.observer;
2 |
3 | import java.util.Observable;
4 |
5 | /**
6 | * @author ddnosh
7 | * @website http://blog.csdn.net/ddnosh
8 | */
9 | public class Server extends Observable {
10 |
11 | private int time;
12 |
13 | public Server(int time) {
14 | this.time = time;
15 | }
16 |
17 | public void setTime(int time) {
18 | if (this.time == time) {
19 | setChanged();//一定要标注, 表明有数据变更, 需要通知订阅者
20 | notifyObservers(time);
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/module/network/retrofit/DownloadApis.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.module.network.retrofit;
2 |
3 | import io.reactivex.Observable;
4 | import okhttp3.ResponseBody;
5 | import retrofit2.http.GET;
6 | import retrofit2.http.Streaming;
7 | import retrofit2.http.Url;
8 |
9 | /**
10 | * @author ddnosh
11 | * @website http://blog.csdn.net/ddnosh
12 | */
13 | public interface DownloadApis {
14 |
15 | /**
16 | * 下载文件
17 | * @param fileUrl
18 | * @return
19 | */
20 | @Streaming
21 | @GET
22 | Observable downloadFile(@Url String fileUrl);
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/fragment_sp.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
18 |
19 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/function/permission/AfterPermissionGranted.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.function.permission;
2 |
3 | /**
4 | * @author ddnosh
5 | * @website http://blog.csdn.net/ddnosh
6 | */
7 | import java.lang.annotation.ElementType;
8 | import java.lang.annotation.Retention;
9 | import java.lang.annotation.RetentionPolicy;
10 | import java.lang.annotation.Target;
11 |
12 | /**
13 | * @author ddnosh
14 | * @website http://blog.csdn.net/ddnosh
15 | */
16 | @Retention(RetentionPolicy.RUNTIME)
17 | @Target(ElementType.METHOD)
18 | public @interface AfterPermissionGranted {
19 |
20 | int value();
21 |
22 | }
--------------------------------------------------------------------------------
/sample/src/main/res/layout/item_adapter_expandable_parent.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
14 |
15 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/base/mvvm/BaseRepository.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.base.mvvm;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.lifecycle.MutableLiveData;
6 |
7 | /**
8 | * @author ddnosh
9 | * @website http://blog.csdn.net/ddnosh
10 | */
11 | public class BaseRepository {
12 |
13 | protected Context context;
14 | protected final MutableLiveData liveData;
15 |
16 | public BaseRepository(Context context) {
17 | this.context = context;
18 | liveData = new MutableLiveData<>();
19 | }
20 |
21 | public MutableLiveData getData() {
22 | return liveData;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/design_patterns/template/Car.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.design_patterns.template;
2 |
3 | /**
4 | * @author ddnosh
5 | * @website http://blog.csdn.net/ddnosh
6 | */
7 | public abstract class Car {
8 | void startUp() {
9 | System.out.println("启动!");
10 | }
11 |
12 | abstract void move();//强制要求实现
13 |
14 | void stop() {
15 | System.out.println("熄火!");
16 | }
17 |
18 | public final void operation(){//定义成final, 防止被重写
19 | //第一步:启动
20 | startUp();
21 | //第二步:驾驶
22 | move();
23 | //第三步:停止
24 | stop();
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/design_patterns/proxy/IRequestAPI.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.design_patterns.proxy;
2 |
3 | import java.util.List;
4 |
5 | import io.reactivex.Observable;
6 | import com.androidwind.androidquick.demo.features.module.network.retrofit.GankRes;
7 | import retrofit2.http.GET;
8 | import retrofit2.http.Query;
9 |
10 | /**
11 | * @author ddnosh
12 | * @website http://blog.csdn.net/ddnosh
13 | */
14 | public interface IRequestAPI {
15 |
16 | @GET("day/history")
17 | Observable>> getHistory(@Query("param") String param);
18 |
19 | @GET("day/new")
20 | String getNew();
21 | }
22 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/item_multiviewtype_text_img.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
17 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/design_patterns/adapter/AmericanDevice.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.design_patterns.adapter;
2 |
3 | import com.androidwind.androidquick.util.LogUtil;
4 |
5 | /**
6 | * @author ddnosh
7 | * @website http://blog.csdn.net/ddnosh
8 | */
9 | public class AmericanDevice {
10 |
11 | private IAmericanCharger mIAmericanCharger;
12 |
13 | public AmericanDevice(IAmericanCharger IAmericanCharger) {
14 | mIAmericanCharger = IAmericanCharger;
15 | }
16 |
17 | public void work() {
18 | mIAmericanCharger.charge4American();
19 | LogUtil.i("AmericanDevice", "美规电器开始运行!");
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/injector/module/ActivityModule.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.injector.module;
2 |
3 | import android.app.Activity;
4 |
5 | import dagger.Module;
6 | import dagger.Provides;
7 | import com.androidwind.androidquick.demo.injector.ActivityScope;
8 |
9 | /**
10 | * @author ddnosh
11 | * @website http://blog.csdn.net/ddnosh
12 | */
13 | @Module
14 | public class ActivityModule {
15 | private Activity mActivity;
16 |
17 | public ActivityModule(Activity activity) {this.mActivity = activity;}
18 |
19 | @Provides
20 | @ActivityScope
21 | public Activity provideActivity() {
22 | return mActivity;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/activity_module_image.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/activity_module_bus.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/activity_module_database.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/activity_toolbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/activity_network.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/base/mvvm/BaseMVVMActivity.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.base.mvvm;
2 |
3 | import android.os.Bundle;
4 |
5 | import com.androidwind.androidquick.demo.base.BaseActivity;
6 |
7 | /**
8 | * @author ddnosh
9 | * @website http://blog.csdn.net/ddnosh
10 | */
11 | public abstract class BaseMVVMActivity extends BaseActivity {
12 |
13 | protected T viewModel;
14 |
15 | @Override
16 | protected void onCreate(Bundle savedInstanceState) {
17 | super.onCreate(savedInstanceState);
18 | if (viewModel == null) {
19 | viewModel = getViewModel();
20 | }
21 | }
22 |
23 | protected abstract T getViewModel();
24 | }
25 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/base/mvvm/BaseMVVMFragment.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.base.mvvm;
2 |
3 | import android.os.Bundle;
4 |
5 | import com.androidwind.androidquick.demo.base.BaseFragment;
6 |
7 | /**
8 | * @author ddnosh
9 | * @website http://blog.csdn.net/ddnosh
10 | */
11 | public abstract class BaseMVVMFragment extends BaseFragment {
12 |
13 | protected T viewModel;
14 |
15 | @Override
16 | public void onCreate(Bundle savedInstanceState) {
17 | super.onCreate(savedInstanceState);
18 |
19 | if (viewModel == null) {
20 | viewModel = getViewModel();
21 | }
22 | }
23 |
24 | protected abstract T getViewModel();
25 | }
26 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/architecture/segment/type3/JsApiHandler.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.architecture.segment.type3;
2 |
3 | import androidx.annotation.Nullable;
4 |
5 | /**
6 | * js -> native
7 | *
8 | * @author ddnosh
9 | * @website http://blog.csdn.net/ddnosh
10 | */
11 | public interface JsApiHandler {
12 |
13 | String name();
14 |
15 | /**
16 | * js 调用native的接口
17 | *
18 | * @param params
19 | * @param jsCallback
20 | * @param isPending
21 | */
22 | void handle(@Nullable Object params, @Nullable String jsCallback, boolean isPending);
23 |
24 | void release();
25 |
26 | void setLoadJsCallback(LoadJsCallback callback);
27 | }
28 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/other/rxlifecycle/RxJavaLifecycleContract.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.other.rxlifecycle;
2 |
3 | import com.androidwind.androidquick.demo.base.mvp.BaseContract;
4 |
5 | /**
6 | * @author ddnosh
7 | * @website http://blog.csdn.net/ddnosh
8 | */
9 | public interface RxJavaLifecycleContract {
10 | interface Model extends BaseContract.BaseModel {
11 |
12 | }
13 |
14 | interface View extends BaseContract.BaseView {
15 | void updateView(String result);
16 | }
17 |
18 | interface Presenter extends BaseContract.BasePresenter {
19 | void initDataRxLifecycle();
20 | void initDataCompositeDisposable();
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/thirdparty/treeview/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/bogdan/Library/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/architecture/mvp/activity/MVPContract.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.architecture.mvp.activity;
2 |
3 | import com.androidwind.androidquick.demo.base.mvp.BaseContract;
4 | import com.androidwind.androidquick.demo.base.mvp.BasePresenter;
5 |
6 | /**
7 | * @author ddnosh
8 | * @website http://blog.csdn.net/ddnosh
9 | */
10 | public interface MVPContract {
11 | interface Model extends BaseContract.BaseModel {
12 |
13 | }
14 |
15 | interface View extends BaseContract.BaseView {
16 | void refreshView(String result);
17 | }
18 |
19 | abstract class Presenter extends BasePresenter {
20 | public abstract void initData();
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/design_patterns/observer/Client.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.design_patterns.observer;
2 |
3 | import java.util.Observable;
4 | import java.util.Observer;
5 |
6 | import com.androidwind.androidquick.util.ToastUtil;
7 |
8 | /**
9 | * @author ddnosh
10 | * @website http://blog.csdn.net/ddnosh
11 | */
12 | public class Client implements Observer {
13 | private String name;
14 | public Client(String name) {
15 | this.name = name;
16 | }
17 |
18 | @Override
19 | public void update(Observable o, Object arg) {
20 | if (o instanceof Server) {
21 | ToastUtil.showToast(name + "say: time is up!" + arg);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/module/network/retrofit/network3/TSSCResult.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.module.network.retrofit.network3;
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * @author ddnosh
7 | * @website http://blog.csdn.net/ddnosh
8 | */
9 | public class TSSCResult implements Serializable {
10 |
11 | private String id;
12 | private String name;
13 |
14 | public String getId() {
15 | return id;
16 | }
17 |
18 | public void setId(String id) {
19 | this.id = id;
20 | }
21 |
22 | public String getName() {
23 | return name;
24 | }
25 |
26 | public void setName(String name) {
27 | this.name = name;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/activity_frame.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/fragment_image_glide.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
19 |
20 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/module/network/retrofit/GankRes.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.module.network.retrofit;
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * @author ddnosh
7 | * @website http://blog.csdn.net/ddnosh
8 | */
9 | public class GankRes implements Serializable {
10 |
11 | private boolean error;
12 | private T results;
13 |
14 | public boolean isError() {
15 | return error;
16 | }
17 |
18 | public void setError(boolean error) {
19 | this.error = error;
20 | }
21 |
22 | public T getResults() {
23 | return results;
24 | }
25 |
26 | public void setResults(T results) {
27 | this.results = results;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/tool/BitmapUtil.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.tool;
2 |
3 | import android.graphics.Bitmap;
4 | import android.graphics.BitmapFactory;
5 | import android.util.Base64;
6 |
7 | /**
8 | * @author ddnosh
9 | * @website http://blog.csdn.net/ddnosh
10 | */
11 | public class BitmapUtil {
12 |
13 | public static Bitmap stringToBitmap(String string) {
14 | Bitmap bitmap = null;
15 | try {
16 | byte[] bitmapArray = Base64.decode(string, Base64.URL_SAFE);
17 | bitmap = BitmapFactory.decodeByteArray(bitmapArray, 0, bitmapArray.length);
18 | } catch (Exception e) {
19 | e.printStackTrace();
20 | }
21 | return bitmap;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/injector/module/ApplicationModule.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.injector.module;
2 |
3 | import android.content.Context;
4 |
5 | import com.androidwind.androidquick.demo.MyApplication;
6 |
7 | import javax.inject.Singleton;
8 |
9 | import dagger.Module;
10 | import dagger.Provides;
11 |
12 | /**
13 | * @author ddnosh
14 | * @website http://blog.csdn.net/ddnosh
15 | */
16 | @Module
17 | public class ApplicationModule {
18 | private final Context context;
19 |
20 | public ApplicationModule(MyApplication context) {
21 | this.context = context;
22 | }
23 |
24 | @Provides
25 | @Singleton
26 | Context provideApplicationContext() {
27 | return context;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/architecture/mvp/activity_dagger/MVPDaggerContract.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.architecture.mvp.activity_dagger;
2 |
3 | import com.androidwind.androidquick.demo.base.mvp.BaseContract;
4 | import com.androidwind.androidquick.demo.base.mvp.BasePresenter;
5 |
6 | /**
7 | * @author ddnosh
8 | * @website http://blog.csdn.net/ddnosh
9 | */
10 | public interface MVPDaggerContract {
11 | interface Model extends BaseContract.BaseModel {
12 |
13 | }
14 |
15 | interface View extends BaseContract.BaseView {
16 | void refreshView(String result);
17 | }
18 |
19 | abstract class Presenter extends BasePresenter {
20 | public abstract void initData();
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/injector/module/FragmentModule.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.injector.module;
2 |
3 | import android.app.Activity;
4 |
5 | import com.androidwind.androidquick.demo.injector.FragmentScope;
6 |
7 | import androidx.fragment.app.Fragment;
8 | import dagger.Module;
9 | import dagger.Provides;
10 |
11 | /**
12 | * @author ddnosh
13 | * @website http://blog.csdn.net/ddnosh
14 | */
15 | @Module
16 | public class FragmentModule {
17 | private Fragment fragment;
18 |
19 | public FragmentModule(Fragment fragment) {
20 | this.fragment = fragment;
21 | }
22 |
23 | @Provides
24 | @FragmentScope
25 | public Activity provideActivity() {
26 | return fragment.getActivity();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/architecture/segment/type3/GetAppInfoHandler.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.architecture.segment.type3;
2 |
3 | import com.alibaba.fastjson.JSONObject;
4 |
5 |
6 | /**
7 | * @author ddnosh
8 | * @website http://blog.csdn.net/ddnosh
9 | */
10 |
11 | public class GetAppInfoHandler extends BaseJsApiHandler {
12 |
13 | @Override
14 | public String name() {
15 | return "getAppInfo";
16 | }
17 |
18 | @Override
19 | protected void handelInBackground(JsRequest jsRequest) {
20 | JSONObject jsonObject = new JSONObject();
21 | jsonObject.put("os", "android");
22 |
23 | setResponse(jsRequest, JsResponse.success(jsonObject));
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/fragment_other_rxlifecycle.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
19 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/architecture/mvp/fragment_dagger/MVPDaggerContract.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.architecture.mvp.fragment_dagger;
2 |
3 | import com.androidwind.androidquick.demo.base.mvp.BaseContract;
4 | import com.androidwind.androidquick.demo.base.mvp.BasePresenter;
5 |
6 | /**
7 | * @author ddnosh
8 | * @website http://blog.csdn.net/ddnosh
9 | */
10 | public interface MVPDaggerContract {
11 | interface Model extends BaseContract.BaseModel {
12 |
13 | }
14 |
15 | interface View extends BaseContract.BaseView {
16 | void refreshView(String result);
17 | }
18 |
19 | abstract class Presenter extends BasePresenter {
20 | public abstract void initData(String data);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/base/mvvm/BaseViewModel.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.base.mvvm;
2 |
3 | import android.app.Application;
4 | import android.content.Context;
5 |
6 | import androidx.annotation.NonNull;
7 | import androidx.lifecycle.AndroidViewModel;
8 |
9 | /**
10 | * @author ddnosh
11 | * @website http://blog.csdn.net/ddnosh
12 | */
13 | public abstract class BaseViewModel extends AndroidViewModel {
14 |
15 | protected Context context;
16 |
17 | protected T repository;
18 |
19 | public BaseViewModel(@NonNull Application application) {
20 | super(application);
21 | context = application;
22 | repository = getRepository();
23 | }
24 |
25 | protected abstract T getRepository();
26 | }
27 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/architecture/mvvm/activity/MVVMViewModel2.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.architecture.mvvm.activity;
2 |
3 | import com.androidwind.androidquick.demo.bean.NameBean;
4 |
5 | import java.util.List;
6 |
7 | import androidx.lifecycle.MutableLiveData;
8 | import androidx.lifecycle.ViewModel;
9 |
10 | /**
11 | * @author ddnosh
12 | * @website http://blog.csdn.net/ddnosh
13 | */
14 | public class MVVMViewModel2 extends ViewModel {
15 |
16 | private MVVMRepository2 repository;
17 |
18 | public MVVMViewModel2(MVVMRepository2 repository) {
19 | this.repository = repository;
20 | }
21 |
22 | public MutableLiveData> getTestData() {
23 | return repository.getTestData();
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/view_stub_page2.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
19 |
20 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/constant/Constants.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.constant;
2 |
3 | /**
4 | * @author ddnosh
5 | * @website http://blog.csdn.net/ddnosh
6 | */
7 |
8 | public class Constants {
9 |
10 | public final static int HTTP_TIME_OUT = 30 * 1000;
11 |
12 | public final static int HTTP_MAX_CACHE_SIZE = 30 * 1024 * 1024;
13 |
14 | public final static String GANK_API_URL = "http://gank.io/api/";
15 |
16 | public static final int RC_PERMISSION_BASE = 1000;
17 | public static final int RC_PERMISSION_PERMISSION_ACTIVITY = RC_PERMISSION_BASE + 1;
18 | public static final int RC_PERMISSION_PERMISSION_FRAGMENT = RC_PERMISSION_BASE + 2;
19 |
20 | public static String EXCEPTION_MVP_VIEW_NOT_ATTACHED = "view is not attached!";
21 | }
22 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/activity_webview.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
11 |
12 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/view_stub_page1.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
19 |
20 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/architecture/mvp/activity/MVPPresenter.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.architecture.mvp.activity;
2 |
3 | /**
4 | * @author ddnosh
5 | * @website http://blog.csdn.net/ddnosh
6 | */
7 | public class MVPPresenter extends MVPContract.Presenter {
8 |
9 | @Override
10 | public void initData() {
11 | new Thread(new Runnable() {
12 | @Override
13 | public void run() {
14 | try {
15 | Thread.sleep(3000);
16 | } catch (InterruptedException e) {
17 | e.printStackTrace();
18 | }
19 | getView().refreshView("do in background after 3 seconds");
20 | }
21 | }).start();
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/module/network/retrofit/network1/Network1Contract.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.module.network.retrofit.network1;
2 |
3 | import com.androidwind.androidquick.demo.base.mvp.BaseContract;
4 |
5 | /**
6 | * @author ddnosh
7 | * @website http://blog.csdn.net/ddnosh
8 | */
9 | public interface Network1Contract {
10 | interface Model extends BaseContract.BaseModel {
11 |
12 | }
13 |
14 | interface View extends BaseContract.BaseView {
15 | void updateView(String result);
16 | // void refreshAppUpdateProgress(int progress);
17 | void downloadCompleted(String path);
18 | }
19 |
20 | interface Presenter extends BaseContract.BasePresenter {
21 | void initData(String type);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/androidwind/androidquick/demo/features/design_patterns/strategy/TinyLogProcessor.java:
--------------------------------------------------------------------------------
1 | package com.androidwind.androidquick.demo.features.design_patterns.strategy;
2 |
3 | import com.androidwind.log.TinyLog;
4 |
5 | /**
6 | * @author ddnosh
7 | * @website http://blog.csdn.net/ddnosh
8 | */
9 | public class TinyLogProcessor implements ILogProcessor {
10 | @Override
11 | public void v(String vLog) {
12 | TinyLog.v("tinylog:" + vLog);
13 | }
14 |
15 | @Override
16 | public void d(String dLog) {
17 | TinyLog.d("tinylog:" + dLog);
18 | }
19 |
20 | @Override
21 | public void i(String iLog) {
22 | TinyLog.i("tinylog:" + iLog);
23 | }
24 |
25 | @Override
26 | public void e(String eLog) {
27 | TinyLog.e("tinylog:" + eLog);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/fragment_tab_tablayout.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
18 |
--------------------------------------------------------------------------------
/thirdparty/treeview/src/main/java/com/unnamed/b/atv/holder/SimpleViewHolder.java:
--------------------------------------------------------------------------------
1 | package com.unnamed.b.atv.holder;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 | import android.widget.TextView;
6 |
7 | import com.unnamed.b.atv.model.TreeNode;
8 |
9 | /**
10 | * Created by Bogdan Melnychuk on 2/11/15.
11 | */
12 | public class SimpleViewHolder extends TreeNode.BaseNodeViewHolder