├── .gitignore
├── README.md
├── basemodule
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── wustor
│ │ └── basemodule
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── wustor
│ │ │ └── basemodule
│ │ │ ├── BaseActivity.java
│ │ │ ├── BaseFragment.java
│ │ │ ├── CommonUtils.java
│ │ │ ├── EmptyUtils.java
│ │ │ └── ModuleApplication.java
│ └── res
│ │ ├── drawable
│ │ ├── selector_message.xml
│ │ ├── selector_mine.xml
│ │ ├── selector_shop_cart.xml
│ │ ├── selector_sort.xml
│ │ └── selector_text_color_black.xml
│ │ ├── layout
│ │ ├── bottom.xml
│ │ ├── layout_common.xml
│ │ └── widget_toolbar.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ ├── arrow_back.png
│ │ ├── ic_launcher.png
│ │ ├── iv_find_checked.png
│ │ ├── iv_find_unchecked.png
│ │ ├── iv_message_checked.png
│ │ ├── iv_message_unchecked.png
│ │ ├── iv_mine_checked.png
│ │ ├── iv_mine_unchecked.png
│ │ ├── iv_shop_checked.png
│ │ └── iv_shop_unchecked.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ └── values
│ │ ├── arrays.xml
│ │ ├── attr_header_progress.xml
│ │ ├── attrs.xml
│ │ ├── color.xml
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── ids.xml
│ │ ├── integers.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── wustor
│ └── basemodule
│ └── ExampleUnitTest.java
├── build.gradle
├── cartmodule
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── wustor
│ │ └── cartmodule
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── debug
│ │ └── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── wustor
│ │ │ └── cartmodule
│ │ │ ├── CartActivity.java
│ │ │ ├── CartFragment.java
│ │ │ ├── CartServiceImpl.java
│ │ │ └── debug
│ │ │ └── CartApplication.java
│ └── res
│ │ ├── layout
│ │ ├── activity_cart.xml
│ │ └── fragment_cart.xml
│ │ └── values
│ │ └── strings.xml
│ └── test
│ └── java
│ └── com
│ └── wustor
│ └── cartmodule
│ └── ExampleUnitTest.java
├── component.jks
├── config.gradle
├── goodsmodule
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── wustor
│ │ └── goodsmodule
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── debug
│ │ └── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── wustor
│ │ │ └── goodsmodule
│ │ │ ├── GoodsDetailActivity.java
│ │ │ ├── GoodsServiceImpl.java
│ │ │ ├── HomeFragment.java
│ │ │ ├── SortFragment.java
│ │ │ └── debug
│ │ │ └── GoodsApplication.java
│ └── res
│ │ ├── layout
│ │ ├── activity_goods_detail.xml
│ │ ├── fragment_home.xml
│ │ └── fragment_sort.xml
│ │ └── values
│ │ └── strings.xml
│ └── test
│ └── java
│ └── com
│ └── wustor
│ └── goodsmodule
│ └── ExampleUnitTest.java
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── librarymodule
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── wustor
│ │ └── librarymodule
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ └── res
│ │ └── values
│ │ └── strings.xml
│ └── test
│ └── java
│ └── com
│ └── wustor
│ └── librarymodule
│ └── ExampleUnitTest.java
├── local.properties
├── mainModule
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── wustor
│ │ └── androidcomponent
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── debug
│ │ └── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── wustor
│ │ │ └── androidcomponent
│ │ │ ├── AppServiceImpl.java
│ │ │ ├── MainActivity.java
│ │ │ ├── MainApplication.java
│ │ │ └── debug
│ │ │ ├── MainDebugActivity.java
│ │ │ └── MainDebugApplication.java
│ └── res
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ └── activity_main_debug.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
│ │ └── values
│ │ ├── colors.xml
│ │ └── strings.xml
│ └── test
│ └── java
│ └── com
│ └── wustor
│ └── androidcomponent
│ └── ExampleUnitTest.java
├── ordermodule
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── wustor
│ │ └── ordermodule
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── debug
│ │ └── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── wustor
│ │ │ └── ordermodule
│ │ │ ├── OrderActivity.java
│ │ │ ├── OrderFragment.java
│ │ │ ├── OrderModuleService.java
│ │ │ └── debug
│ │ │ └── OrderApplication.java
│ └── res
│ │ ├── layout
│ │ ├── activity_order.xml
│ │ └── fragment_order.xml
│ │ └── values
│ │ └── strings.xml
│ └── test
│ └── java
│ └── com
│ └── wustor
│ └── ordermodule
│ └── ExampleUnitTest.java
├── routermodule
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── wustor
│ │ └── routermodule
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── wustor
│ │ │ └── routermodule
│ │ │ ├── AppService.java
│ │ │ ├── CartModuleService.java
│ │ │ ├── GoodsModuleService.java
│ │ │ ├── ModuleCall.java
│ │ │ ├── OrderModuleService.java
│ │ │ ├── ReflectUtils.java
│ │ │ └── UserModuleService.java
│ └── res
│ │ └── values
│ │ └── strings.xml
│ └── test
│ └── java
│ └── com
│ └── wustor
│ └── routermodule
│ └── ExampleUnitTest.java
├── settings.gradle
└── usermodule
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
├── androidTest
└── java
│ └── com
│ └── wustor
│ └── usermodule
│ └── ExampleInstrumentedTest.java
├── main
├── AndroidManifest.xml
├── debug
│ └── AndroidManifest.xml
├── java
│ └── com
│ │ └── wustor
│ │ └── usermodule
│ │ ├── MineFragment.java
│ │ ├── UserActivity.java
│ │ ├── UserServiceImpl.java
│ │ └── debug
│ │ └── UserApplication.java
└── res
│ ├── layout
│ ├── activity_user.xml
│ └── fragment_user.xml
│ └── values
│ └── strings.xml
└── test
└── java
└── com
└── wustor
└── usermodule
└── ExampleUnitTest.java
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # AndroidComponent
2 | Androdid组件化
3 |
4 | 
5 |
--------------------------------------------------------------------------------
/basemodule/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/basemodule/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | def cfg = rootProject.ext.android
4 |
5 | android {
6 | compileSdkVersion cfg.compileSdkVersion
7 | buildToolsVersion cfg.buildToolsVersion
8 |
9 | defaultConfig {
10 | minSdkVersion cfg.minSdkVersion
11 | targetSdkVersion cfg.targetSdkVersion
12 | versionCode cfg.versionCode//更新次数
13 | versionName cfg.versionName//版本号
14 | if (isDebug.toBoolean()) {
15 | //debug模式
16 | buildConfigField "String", "AlphaUrl", "\"${url["debug"]}\""
17 |
18 | } else {
19 | //release模式
20 | buildConfigField "String", "AlphaUrl", "\"${url["release"]}\""
21 |
22 | }
23 |
24 |
25 | }
26 |
27 | }
28 |
29 | dependencies {
30 | compile fileTree(include: ['*.jar'], dir: 'libs')
31 | testCompile 'junit:junit:4.12'
32 | compile project(':librarymodule')
33 | }
34 |
--------------------------------------------------------------------------------
/basemodule/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/chmyy/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 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/basemodule/src/androidTest/java/com/wustor/basemodule/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.wustor.basemodule;
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 | * Instrumentation 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() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.wustor.basemodule.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/basemodule/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/basemodule/src/main/java/com/wustor/basemodule/BaseActivity.java:
--------------------------------------------------------------------------------
1 | package com.wustor.basemodule;
2 |
3 | import android.content.Context;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.support.v7.widget.Toolbar;
7 | import android.view.View;
8 | import android.widget.TextView;
9 |
10 | public abstract class BaseActivity extends AppCompatActivity {
11 | protected Toolbar mToolbar;
12 | protected TextView mTitle;
13 | protected Context mContext;
14 |
15 | @Override
16 | protected void onCreate(Bundle savedInstanceState) {
17 | super.onCreate(savedInstanceState);
18 | mContext = this;
19 | setContentView(getLayoutId());
20 | initToolbar();
21 | initView();
22 | }
23 |
24 | protected abstract int getLayoutId();
25 |
26 | protected abstract void initView();
27 |
28 |
29 | protected void initToolbar() {
30 | mToolbar = findViewById(R.id.toolbar);
31 | mTitle = findViewById(R.id.tv_title);
32 | if (mToolbar != null) {
33 | if (mToolbar.getVisibility() == View.GONE)
34 | mToolbar.setVisibility(View.VISIBLE);
35 | mToolbar.setNavigationIcon(R.mipmap.arrow_back);
36 | mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
37 | @Override
38 | public void onClick(View v) {
39 | onLeftClick();
40 | }
41 | });
42 | }
43 |
44 | }
45 |
46 | //点击事件
47 | private void onLeftClick() {
48 | finish();
49 |
50 | }
51 |
52 | //设置标题
53 | protected void setTitle(String title) {
54 | mTitle.setText(title);
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/basemodule/src/main/java/com/wustor/basemodule/BaseFragment.java:
--------------------------------------------------------------------------------
1 | package com.wustor.basemodule;
2 |
3 | import android.content.Context;
4 | import android.os.Bundle;
5 | import android.support.annotation.Nullable;
6 | import android.support.v4.app.Fragment;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.view.ViewGroup;
10 |
11 | /**
12 | * author chmyy
13 | * created on 2018/1/22
14 | * email fat_chao@163.com.
15 | */
16 |
17 | public abstract class BaseFragment extends Fragment {
18 | protected Context mContext;
19 |
20 | @Nullable
21 | @Override
22 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
23 | mContext = getActivity();
24 | ViewGroup view = (ViewGroup) inflater.inflate(getLayoutId(), container, false);
25 | return initView(view);
26 | }
27 |
28 | protected abstract int getLayoutId();
29 |
30 | protected abstract View initView(View parent);
31 |
32 |
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/basemodule/src/main/java/com/wustor/basemodule/CommonUtils.java:
--------------------------------------------------------------------------------
1 | package com.wustor.basemodule;
2 |
3 | import android.content.Context;
4 | import android.content.pm.ApplicationInfo;
5 | import android.content.pm.PackageManager;
6 | import android.os.Looper;
7 | import android.text.TextUtils;
8 | import android.view.Gravity;
9 | import android.widget.Toast;
10 |
11 | /**
12 | * author chmyy
13 | * created on 2018/1/21
14 | * email fat_chao@163.com.
15 | */
16 |
17 | public class CommonUtils {
18 |
19 |
20 | public static boolean isDebug(Context context) {
21 | if (TextUtils.isEmpty(context.getPackageName()))
22 | return false;
23 | try {
24 | PackageManager pm = context.getPackageManager();
25 | ApplicationInfo ai = pm.getApplicationInfo(context.getPackageName(), 0);
26 | return ai != null && (ai.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
27 | } catch (PackageManager.NameNotFoundException e) {
28 | e.printStackTrace();
29 | return false;
30 | }
31 | }
32 |
33 | //弹出消息
34 | public static void showToast(final Context context, final String msg) {
35 | if (EmptyUtils.isEmpty(msg) || EmptyUtils.isNull(context)) {
36 | return;
37 | }
38 | new Thread(new Runnable() {
39 | @Override
40 | public void run() {
41 | Looper.prepare();
42 | Toast toast = Toast.makeText(context, msg, Toast.LENGTH_SHORT);
43 | toast.setGravity(Gravity.CENTER, 0, 0);
44 | toast.show();
45 | Looper.loop();
46 | }
47 | }).start();
48 | }
49 |
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/basemodule/src/main/java/com/wustor/basemodule/EmptyUtils.java:
--------------------------------------------------------------------------------
1 | package com.wustor.basemodule;
2 |
3 | import android.text.TextUtils;
4 |
5 |
6 | public class EmptyUtils {
7 | public static boolean isEmpty(String target) {
8 | if (target != null && !TextUtils.isEmpty(target)) {
9 | return false;
10 | } else {
11 | return true;
12 | }
13 | }
14 |
15 | public static boolean isNotEmpty(String target) {
16 | if (target != null && !TextUtils.isEmpty(target)) {
17 | return true;
18 | } else {
19 | return false;
20 | }
21 | }
22 |
23 | public static boolean isNull(Object obj) {
24 | return null == obj;
25 | }
26 |
27 | public static String NullToEmpty(String obj) {
28 | if (isNull(obj))
29 | return "";
30 | else
31 | return obj;
32 | }
33 |
34 |
35 | public static String getNullString() {
36 | return "暂无";
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/basemodule/src/main/java/com/wustor/basemodule/ModuleApplication.java:
--------------------------------------------------------------------------------
1 | package com.wustor.basemodule;
2 |
3 | import android.app.Application;
4 | import android.content.Context;
5 | import android.support.multidex.MultiDex;
6 |
7 | public class ModuleApplication extends Application {
8 |
9 | private static ModuleApplication instance;
10 |
11 | @Override
12 | public void onCreate() {
13 | super.onCreate();
14 |
15 |
16 | }
17 |
18 | public static ModuleApplication getInstance() {
19 | return instance;
20 | }
21 |
22 | @Override
23 | protected void attachBaseContext(Context base) {
24 | super.attachBaseContext(base);
25 | // 65535
26 | MultiDex.install(this);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/basemodule/src/main/res/drawable/selector_message.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 | -
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/basemodule/src/main/res/drawable/selector_mine.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 | -
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/basemodule/src/main/res/drawable/selector_shop_cart.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/basemodule/src/main/res/drawable/selector_sort.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 | -
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/basemodule/src/main/res/drawable/selector_text_color_black.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/basemodule/src/main/res/layout/bottom.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
14 |
15 |
22 |
23 |
36 |
37 |
49 |
50 |
62 |
63 |
64 |
77 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/basemodule/src/main/res/layout/layout_common.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
16 |
17 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/basemodule/src/main/res/layout/widget_toolbar.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
16 |
17 |
28 |
29 |
30 |
31 |
36 |
37 |
--------------------------------------------------------------------------------
/basemodule/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wustor/AndroidComponent/bb7d2dc042ec3426da0c7f68532501f427c855dc/basemodule/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/basemodule/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wustor/AndroidComponent/bb7d2dc042ec3426da0c7f68532501f427c855dc/basemodule/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/basemodule/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wustor/AndroidComponent/bb7d2dc042ec3426da0c7f68532501f427c855dc/basemodule/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/basemodule/src/main/res/mipmap-xxhdpi/arrow_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wustor/AndroidComponent/bb7d2dc042ec3426da0c7f68532501f427c855dc/basemodule/src/main/res/mipmap-xxhdpi/arrow_back.png
--------------------------------------------------------------------------------
/basemodule/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wustor/AndroidComponent/bb7d2dc042ec3426da0c7f68532501f427c855dc/basemodule/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/basemodule/src/main/res/mipmap-xxhdpi/iv_find_checked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wustor/AndroidComponent/bb7d2dc042ec3426da0c7f68532501f427c855dc/basemodule/src/main/res/mipmap-xxhdpi/iv_find_checked.png
--------------------------------------------------------------------------------
/basemodule/src/main/res/mipmap-xxhdpi/iv_find_unchecked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wustor/AndroidComponent/bb7d2dc042ec3426da0c7f68532501f427c855dc/basemodule/src/main/res/mipmap-xxhdpi/iv_find_unchecked.png
--------------------------------------------------------------------------------
/basemodule/src/main/res/mipmap-xxhdpi/iv_message_checked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wustor/AndroidComponent/bb7d2dc042ec3426da0c7f68532501f427c855dc/basemodule/src/main/res/mipmap-xxhdpi/iv_message_checked.png
--------------------------------------------------------------------------------
/basemodule/src/main/res/mipmap-xxhdpi/iv_message_unchecked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wustor/AndroidComponent/bb7d2dc042ec3426da0c7f68532501f427c855dc/basemodule/src/main/res/mipmap-xxhdpi/iv_message_unchecked.png
--------------------------------------------------------------------------------
/basemodule/src/main/res/mipmap-xxhdpi/iv_mine_checked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wustor/AndroidComponent/bb7d2dc042ec3426da0c7f68532501f427c855dc/basemodule/src/main/res/mipmap-xxhdpi/iv_mine_checked.png
--------------------------------------------------------------------------------
/basemodule/src/main/res/mipmap-xxhdpi/iv_mine_unchecked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wustor/AndroidComponent/bb7d2dc042ec3426da0c7f68532501f427c855dc/basemodule/src/main/res/mipmap-xxhdpi/iv_mine_unchecked.png
--------------------------------------------------------------------------------
/basemodule/src/main/res/mipmap-xxhdpi/iv_shop_checked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wustor/AndroidComponent/bb7d2dc042ec3426da0c7f68532501f427c855dc/basemodule/src/main/res/mipmap-xxhdpi/iv_shop_checked.png
--------------------------------------------------------------------------------
/basemodule/src/main/res/mipmap-xxhdpi/iv_shop_unchecked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wustor/AndroidComponent/bb7d2dc042ec3426da0c7f68532501f427c855dc/basemodule/src/main/res/mipmap-xxhdpi/iv_shop_unchecked.png
--------------------------------------------------------------------------------
/basemodule/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wustor/AndroidComponent/bb7d2dc042ec3426da0c7f68532501f427c855dc/basemodule/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/basemodule/src/main/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - 年
5 | - 月
6 | - 日
7 |
8 |
9 | - 0
10 | - 1
11 | - 2
12 | - 3
13 | - 4
14 | - 5
15 | - 6
16 | - 7
17 | - 8
18 | - 9
19 | - 10
20 | - 11
21 |
22 |
23 |
24 | - 广东
25 | - 北京
26 | - 福建
27 | - 浙江
28 | - 佛山
29 | - 山东
30 | - 江苏
31 | - 河南
32 | - 重庆
33 | - 湖北
34 | - 湖南
35 | - 河北
36 | - 四川
37 | - 天津
38 | - 吉林
39 | - 黑龙江
40 | - 江西
41 | - 辽宁
42 | - 内蒙古
43 | - 宁夏
44 | - 青海
45 | - 山西
46 | - 陕西
47 | - 上海
48 | - 新疆
49 | - 西藏
50 | - 云南
51 | - 甘肃
52 | - 贵州
53 | - 广西
54 | - 海南
55 | - 安阳
56 | - 安庆
57 | - 大连
58 | - 随州
59 | - 武昌
60 | - 上海
61 |
62 |
63 | - 1
64 | - 2
65 | - 3
66 |
67 |
68 |
69 | - 验证手机
70 | - 重设密码
71 | - 重设成功
72 |
73 |
--------------------------------------------------------------------------------
/basemodule/src/main/res/values/attr_header_progress.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/basemodule/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
--------------------------------------------------------------------------------
/basemodule/src/main/res/values/color.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | #ffffff
6 | #d9d9d9
7 | #f0f0f0
8 | #333333
9 | #333333
10 | #ff3a32
11 | #666666
12 | #00000000
13 | #dddddd
14 | #cccccc
15 | #ffd2d2d2
16 |
17 |
18 | #666666
19 | #eeeeee
20 | #ffffff
21 | #333333
22 | #1E1D1D
23 | #2C66AD
24 | #ff3a32
25 | #9B9B9B
26 | #F2f3f3f3
27 |
28 |
29 | #ffdddddd
30 | #1e1d1d
31 |
32 |
33 | #8A000000
34 | @color/blue
35 | #CC0068cf
36 |
37 | #0068cf
38 | #cf0000
39 | #EE0000
40 | #ff9402
41 | #fef501
42 | #39000000
43 |
44 | #FFFFFF
45 | #d9d9d9
46 |
47 |
48 | #BBBBBB
49 | #535353
50 | #000000
51 | #a6000000
52 |
53 | #666666
54 | #7f000000
55 |
56 | #99ffffff
57 | #53c41a
58 | #5b5b5b
59 | #f4f4f4
60 | #b0000000
61 | #00000000
62 | #f1f1f1
63 | #fff7f7
64 |
65 |
--------------------------------------------------------------------------------
/basemodule/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #ffcece
4 | #999999
5 |
--------------------------------------------------------------------------------
/basemodule/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 1dp
5 | 3dp
6 | 4dp
7 | 5dp
8 | 6dp
9 | 7dp
10 | 8dp
11 | 9dp
12 | 10dp
13 | 12dp
14 | 13dp
15 | 14dp
16 | 15dp
17 | 17dp
18 | 19dp
19 | 20dp
20 | 22dp
21 | 30dp
22 | 40dp
23 | 40dp
24 | 50dp
25 | 60dp
26 | 27dp
27 | 23dp
28 | 34dp
29 |
30 |
31 |
32 | 9sp
33 | 10sp
34 | 11sp
35 | 12sp
36 | 13sp
37 | 14sp
38 | 15sp
39 | 16sp
40 | 17sp
41 | 18sp
42 |
43 | 43dp
44 | 38dp
45 | 72dp
46 | 66dp
47 |
48 |
49 |
50 | 16dp
51 | 16dp
52 |
53 |
54 |
55 |
56 | 21dp
57 |
58 |
59 |
60 |
61 |
62 | 10sp
63 |
64 |
65 | 12sp
66 |
67 | 13sp
68 |
69 | 14sp
70 |
71 | 15sp
72 |
73 | 16sp
74 |
75 | 17sp
76 |
77 |
78 |
79 | 20sp
80 | 1px
81 | 74dp
82 | 11dp
83 | 25dp
84 | 20sp
85 | 26dp
86 |
87 |
88 |
89 |
90 |
91 | 2dp
92 | 30sp
93 | 28sp
94 | 28dp
95 | 2px
96 | 88dp
97 | 175dp
98 | 48dp
99 | 45dp
100 | 168dp
101 | 80dp
102 | 68dp
103 | 53dp
104 | 16dp
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
--------------------------------------------------------------------------------
/basemodule/src/main/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/basemodule/src/main/res/values/integers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/basemodule/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | download
4 | d
5 | pause
6 | cancel
7 | pause all
8 | recover all
9 | 创美e药
10 |
11 | Hello blank fragment
12 |
13 | 身份认证过期,请重新登录
14 |
15 | 登\t录
16 | 将二维码放入框内, 即可自动扫描
17 | 搜索品路商品/品牌/旗舰店
18 | 上海市
19 | 应用需要必要的运行权限
20 |
21 | 设置
22 | 帮助
23 | 当前应用缺少必要权限。\n\n请点击\"设置\"-\"权限\"-打开所需权限。\n\n最后点击两次后退按钮,即可返回。
24 | 退出
25 | 忘记密码
26 | 请输入手机号码
27 | 短信校验码
28 | 获取验证码
29 | 下一步
30 | 手机注册
31 | 设置密码
32 | 请输入密码
33 | 请再次输入密码
34 | 确认
35 | 登录
36 | 联\t系\t人:
37 | 联系电话:
38 | 收货地址:
39 | 请选择区域
40 | 请输入详细地址
41 | 18017847277
42 | XiaoRui
43 | 上海市金沙江西路慧创国际
44 | 默认地址
45 | 删除
46 | \t设为默认地址
47 | 编辑
48 | 所在区域:
49 | 详细地址:
50 | 手机号码:
51 | 邮政编码:
52 | 设置
53 | 我的收藏
54 | 可采购的店铺
55 | 浏览记录
56 | 我的订单
57 | 查看全部订单
58 | 待付款
59 | 待发货
60 | 待收货
61 | 待评价
62 | 已取消
63 | 退出登录
64 |
65 | 卖出的订单
66 | 门店用户
67 | 用户:
68 | 13795433021
69 | 验证并绑定信息后才能前往采购
70 | 可采购的品牌:
71 | 可销售的品牌:
72 |
73 | 返回
74 | 账户
75 | 免费注册
76 | 手机号
77 | 登录密码
78 | 60秒后重发
79 | 注册
80 | 新密码
81 | 提交
82 |
83 | 商品
84 | 旗舰店
85 | 编辑
86 |
87 | 修改商品数量
88 | 我的购物车
89 | 修改地址
90 | -
91 | +
92 | 商品总价(不含运费)
93 | 结算
94 | 收藏
95 |
96 |
97 | 确定
98 | 确认订单
99 | 给卖家留言
100 | 请输入留言内容,可输入160字
101 | 全部
102 | \t注册代表同意
103 | 《用户服务协议》
104 | 姓名
105 | 手机号码
106 | 取消\n收藏
107 | 原密码
108 | 请输入手机号或邮箱账号
109 | 删除
110 | 发送成功
111 | 发送取消
112 | 发送被拒绝
113 | 发送返回
114 |
115 | 在线支付
116 |
117 |
118 | 下拉可以刷新
119 | 松开可以刷新
120 | 最近更新:%s
121 | 已加载全部
122 | 暂无数据
123 | 加载中
124 |
125 |
126 | 图片描述
127 | 暂无评论
128 | stay4it.com\n\n有心课堂,传递给你的不仅仅是技术
129 | 快速搭建项目(MD版)
130 | 我在Activity
131 | 我在Fragment
132 | SectionRecyclerActivity
133 | SectionRecyclerFragment
134 |
135 | 新闻
136 | 阅读
137 | 试听
138 | 话题
139 | 我
140 | The Header
141 | The Footer
142 |
143 |
144 | 正在加载中…
145 | 点击重新加载
146 | 已经为你展示所有数据
147 |
148 |
149 | 正在登录中,请稍候
150 | LoginActivity
151 | RegisterActivity
152 | 用户名登录
153 | 用户名注册
154 |
155 | settings
156 |
157 |
158 | 拍照
159 | 从手机相册选择
160 | 返回首页
161 | 返回
162 | 保存
163 | 取消
164 | 拒绝
165 | 同意
166 | 确定
167 | 关闭
168 |
169 |
170 | 错误码:
171 |
172 |
173 |
174 | 未知
175 | 最新直播
176 | 邀请互动连线(最多可与三个成员进行互动直播)
177 |
178 |
179 |
180 | 发送
181 | 主播邀请您与他进行互动直播
182 | 确定结束直播?
183 | 直播结束啦
184 | 直播时长
185 | 观看人数
186 | 获赞数量
187 |
188 | 请选择您的举报原因
189 | 垃圾营销
190 | 不实信息
191 | 有害信息
192 | 违法信息
193 | 淫秽信息
194 |
195 | 主播可能暂时离开
196 |
197 | par
198 | 录制
199 | 开启推流
200 | 关闭推流
201 | 停录
202 |
203 |
204 | 点击地址复制到黏贴版
205 | 地址复制到黏贴版上了
206 |
207 |
208 |
209 |
210 |
211 |
212 | profile
213 |
214 |
215 | 条形码扫描
216 | 二维码扫描
217 | 二维码或条形码扫描
218 | 将条形码对入取景框,即可自动扫描
219 | 将二维码对入取景框,即可自动扫描
220 | 将条形码/二维码放入框内
221 | SaoMaoActivity
222 |
223 | JumpToActivity
224 | MyOrdersActivity
225 | 热门搜索:
226 | 换一组
227 | 专享优惠
228 | 活动买赠
229 | 赠品多多,根本拿不完
230 | 新品上线
231 | 这是空数据
232 | 我们是有底线的
233 | 限时优惠
234 | 抢购中 距结束
235 |
236 | 创美e药
237 | 购物车
238 | 商品
239 | 用户
240 | 订单
241 | BaseActivity
242 |
243 |
244 |
245 |
--------------------------------------------------------------------------------
/basemodule/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
15 |
16 |
22 |
23 |
29 |
30 |
36 |
37 |
41 |
42 |
43 |
44 |
48 |
49 |
53 |
54 |
63 |
64 |
74 |
75 |
79 |
80 |
84 |
85 |
89 |
90 |
91 |
96 |
97 |
98 |
102 |
103 |
104 |
111 |
112 |
122 |
123 |
133 |
134 |
141 |
142 |
143 |
144 |
149 |
150 |
155 |
156 |
157 |
165 |
166 |
167 |
168 |
173 |
174 |
184 |
185 |
189 |
190 |
193 |
194 |
195 |
198 |
199 |
200 |
210 |
211 |
220 |
221 |
230 |
231 |
240 |
241 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
--------------------------------------------------------------------------------
/basemodule/src/test/java/com/wustor/basemodule/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.wustor.basemodule;
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() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | apply from: "config.gradle"
4 |
5 | buildscript {
6 | repositories {
7 | jcenter()
8 | google()
9 |
10 | }
11 | dependencies {
12 | classpath 'com.android.tools.build:gradle:3.0.1'
13 |
14 | // NOTE: Do not place your application dependencies here; they belong
15 | // in the individual module build.gradle files
16 | }
17 | }
18 |
19 | allprojects {
20 | repositories {
21 | jcenter()
22 | google()
23 |
24 | }
25 | }
26 |
27 | task clean(type: Delete) {
28 | delete rootProject.buildDir
29 | }
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/cartmodule/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/cartmodule/build.gradle:
--------------------------------------------------------------------------------
1 | if (isModuleRun.toBoolean()) {
2 | apply plugin: 'com.android.application'
3 | } else {
4 | apply plugin: 'com.android.library'
5 | }
6 | def cfg = rootProject.ext.android
7 | def appId = rootProject.ext.appId
8 | android {
9 | packagingOptions {
10 | exclude 'META-INF/rxjava.properties'
11 | }
12 | compileSdkVersion cfg.compileSdkVersion
13 | println cfg.compileSdkVersion
14 | buildToolsVersion cfg.buildToolsVersion
15 |
16 | dexOptions {
17 | jumboMode = true
18 | }
19 |
20 | defaultConfig {
21 | ndk {
22 | abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
23 | }
24 | if (isModuleRun.toBoolean()) {
25 | applicationId appId["cart"]
26 | }
27 | multiDexEnabled true
28 | minSdkVersion cfg.minSdkVersion
29 | targetSdkVersion cfg.targetSdkVersion
30 | versionCode cfg.versionCode//更新次数
31 | versionName cfg.versionName//版本号
32 | //resourcePrefix "cartmoudle_"
33 | }
34 | lintOptions {
35 | checkReleaseBuilds false
36 | abortOnError false
37 | }
38 | configurations.all {
39 | resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
40 | }
41 |
42 | sourceSets {
43 | main {
44 | if (isModuleRun.toBoolean()) {
45 | manifest.srcFile 'src/main/debug/AndroidManifest.xml'
46 | } else {
47 | manifest.srcFile 'src/main/AndroidManifest.xml'
48 | java {
49 | //release 时 debug 目录下文件不需要合并到主工程
50 | exclude '**/debug/**'
51 | }
52 | }
53 | }
54 | }
55 | }
56 |
57 |
58 | dependencies {
59 | compile fileTree(include: ['*.jar'], dir: 'libs')
60 | compile project(':routermodule')
61 | }
62 |
63 |
64 |
--------------------------------------------------------------------------------
/cartmodule/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/chmyy/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 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/cartmodule/src/androidTest/java/com/wustor/cartmodule/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.wustor.cartmodule;
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 | * Instrumentation 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() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.wustor.cartmodule.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/cartmodule/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/cartmodule/src/main/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/cartmodule/src/main/java/com/wustor/cartmodule/CartActivity.java:
--------------------------------------------------------------------------------
1 | package com.wustor.cartmodule;
2 |
3 | import com.wustor.basemodule.BaseActivity;
4 |
5 | public class CartActivity extends BaseActivity {
6 |
7 |
8 | @Override
9 | protected int getLayoutId() {
10 | return R.layout.activity_cart;
11 | }
12 |
13 | @Override
14 | protected void initView() {
15 | setTitle("购物车");
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/cartmodule/src/main/java/com/wustor/cartmodule/CartFragment.java:
--------------------------------------------------------------------------------
1 | package com.wustor.cartmodule;
2 |
3 |
4 | import android.view.View;
5 | import android.widget.Button;
6 | import android.widget.TextView;
7 |
8 | import com.wustor.basemodule.BaseFragment;
9 | import com.wustor.routermodule.ReflectUtils;
10 |
11 | public class CartFragment extends BaseFragment {
12 | private TextView tvModule;
13 | private Button btnButton;
14 |
15 | @Override
16 | protected int getLayoutId() {
17 | return R.layout.fragment_cart;
18 | }
19 |
20 | @Override
21 | protected View initView(View parent) {
22 | tvModule = parent.findViewById(R.id.tv_module);
23 | btnButton = parent.findViewById(R.id.btn_jump);
24 | tvModule.setText("购物车\nCartModule");
25 | btnButton.setText("跳转商品详情");
26 | btnButton.setOnClickListener(new View.OnClickListener() {
27 | @Override
28 | public void onClick(View view) {
29 | ReflectUtils.startActivityWithName(mContext, "com.wustor.goodsmodule.GoodsDetailActivity");
30 |
31 | }
32 | });
33 | return parent;
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/cartmodule/src/main/java/com/wustor/cartmodule/CartServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.wustor.cartmodule;
2 |
3 | import android.content.Context;
4 |
5 | import com.wustor.basemodule.CommonUtils;
6 | import com.wustor.routermodule.CartModuleService;
7 |
8 | /**
9 | * author chmyy
10 | * created on 2018/1/21
11 | * email fat_chao@163.com.
12 | */
13 |
14 | public class CartServiceImpl implements CartModuleService {
15 | private Context context;
16 |
17 | @Override
18 | public void initContext(Context context) {
19 | this.context = context;
20 | }
21 |
22 | @Override
23 | public void getCartAmount() {
24 | //TODO 此处应该为异步操作,如果需要获取网络数据,则需要开启线程,拿到数据之后再回调数据给调用者
25 | CommonUtils.showToast(context, " 购物车没有商品");
26 |
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/cartmodule/src/main/java/com/wustor/cartmodule/debug/CartApplication.java:
--------------------------------------------------------------------------------
1 | package com.wustor.cartmodule.debug;
2 |
3 |
4 | import com.wustor.basemodule.ModuleApplication;
5 |
6 | /**
7 | * author chmyy
8 | * created on 2017/12/18
9 | * email fat_chao@163.com.
10 | */
11 |
12 | public class CartApplication extends ModuleApplication {
13 |
14 | @Override
15 | public void onCreate() {
16 | super.onCreate();
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/cartmodule/src/main/res/layout/activity_cart.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
20 |
21 |
--------------------------------------------------------------------------------
/cartmodule/src/main/res/layout/fragment_cart.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/cartmodule/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | cartModule
3 |
4 |
5 | Hello blank fragment
6 |
7 |
--------------------------------------------------------------------------------
/cartmodule/src/test/java/com/wustor/cartmodule/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.wustor.cartmodule;
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() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/component.jks:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wustor/AndroidComponent/bb7d2dc042ec3426da0c7f68532501f427c855dc/component.jks
--------------------------------------------------------------------------------
/config.gradle:
--------------------------------------------------------------------------------
1 | /**
2 | * 在主项目的根目录下创建config.gradle文件
3 | * 在这里单独处理统一依赖问题
4 | * 注意需要在根目录的build.gradle中进行引入
5 | */
6 | ext {
7 | android = [
8 | compileSdkVersion: 26,
9 | minSdkVersion : 16,
10 | targetSdkVersion : 26,
11 | buildToolsVersion: "26.0.2",
12 | versionCode : 1,
13 | versionName : "1.6.6"
14 |
15 | ]
16 |
17 | appId = ["app" : "com.wustor.androidcomponent",
18 | "goods": "com.wustor.goodsmoudle",
19 | "cart" : "com.wustor.cartmoudle",
20 | "order": "com.wustor.ordermoudle",
21 | "user" : "com.wustor.usermoudle"]
22 | url = [
23 | "debug" : "debugUrl",
24 | "release": "releaseUrl"
25 | ]
26 |
27 | //Version
28 | supportLibrary = "26.1.0"
29 | dependencies = [
30 | "multidex" : "com.android.support:multidex:1.0.1",
31 | "cardview" : "com.android.support:cardview-v7:${supportLibrary}",
32 | "constraint" : "com.android.support.constraint:constraint-layout:1.0.2",
33 | "recyclerview" : "com.android.support:recyclerview-v7:${supportLibrary}",
34 | "suppoutDesign": "com.android.support:design:${supportLibrary}"
35 |
36 | ]
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/goodsmodule/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/goodsmodule/build.gradle:
--------------------------------------------------------------------------------
1 | if (isModuleRun.toBoolean()) {
2 | apply plugin: 'com.android.application'
3 | } else {
4 | apply plugin: 'com.android.library'
5 | }
6 |
7 |
8 | def cfg = rootProject.ext.android
9 | def keystoreProperties = new Properties()
10 | android {
11 |
12 | packagingOptions {
13 | exclude 'META-INF/rxjava.properties'
14 | }
15 | compileSdkVersion cfg.compileSdkVersion
16 | buildToolsVersion cfg.buildToolsVersion
17 |
18 | dexOptions {
19 | jumboMode = true
20 | }
21 |
22 | defaultConfig {
23 | ndk {
24 | abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
25 | }
26 | if (isModuleRun.toBoolean()) {
27 | applicationId 'com.wustor.goodsmoudle'
28 | }
29 | multiDexEnabled true
30 |
31 | minSdkVersion cfg.minSdkVersion
32 | targetSdkVersion cfg.targetSdkVersion
33 | versionCode cfg.versionCode//更新次数
34 | versionName cfg.versionName//版本号
35 | //resourcePrefix "goodsmodule_"
36 | }
37 | lintOptions {
38 | checkReleaseBuilds false
39 | abortOnError false
40 | }
41 | configurations.all {
42 | resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
43 | }
44 |
45 | sourceSets {
46 | main {
47 | if (isModuleRun.toBoolean()) {
48 | manifest.srcFile 'src/main/debug/AndroidManifest.xml'
49 | } else {
50 | manifest.srcFile 'src/main/AndroidManifest.xml'
51 | java {
52 | //release 时 debug 目录下文件不需要合并到主工程
53 | exclude '**/debug/**'
54 | }
55 | }
56 | }
57 | }
58 | }
59 |
60 |
61 |
62 | dependencies {
63 | compile fileTree(include: ['*.jar'], dir: 'libs')
64 | compile project(':routermodule')
65 | }
66 |
--------------------------------------------------------------------------------
/goodsmodule/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/chmyy/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 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/goodsmodule/src/androidTest/java/com/wustor/goodsmodule/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.wustor.goodsmodule;
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 | * Instrumentation 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() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.wustor.goodsmodule.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/goodsmodule/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/goodsmodule/src/main/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/goodsmodule/src/main/java/com/wustor/goodsmodule/GoodsDetailActivity.java:
--------------------------------------------------------------------------------
1 | package com.wustor.goodsmodule;
2 |
3 | import android.view.View;
4 | import android.widget.Button;
5 | import android.widget.TextView;
6 |
7 | import com.wustor.basemodule.BaseActivity;
8 | import com.wustor.basemodule.CommonUtils;
9 | import com.wustor.routermodule.CartModuleService;
10 | import com.wustor.routermodule.ReflectUtils;
11 |
12 | public class GoodsDetailActivity extends BaseActivity {
13 |
14 | private TextView tvModule;
15 | private Button btnButton;
16 | private Button btnCall;
17 |
18 | @Override
19 | protected int getLayoutId() {
20 | return R.layout.activity_goods_detail;
21 | }
22 |
23 | @Override
24 | protected void initView() {
25 | setTitle("商品详情");
26 | tvModule = findViewById(R.id.tv_module);
27 | btnButton = findViewById(R.id.btn_jump);
28 | tvModule.setText("GoodsModule");
29 | btnButton.setText("跳转到购物车");
30 | btnButton.setOnClickListener(new View.OnClickListener() {
31 | @Override
32 | public void onClick(View view) {
33 | ReflectUtils.startActivityWithName(mContext, "com.wustor.cartmodule.CartActivity");
34 | }
35 | });
36 | btnCall = findViewById(R.id.btn_call);
37 | btnCall.setOnClickListener(new View.OnClickListener() {
38 | @Override
39 | public void onClick(View view) {
40 | CartModuleService moduleCall = (CartModuleService) ReflectUtils.getModuleCall("com.wustor.cartmodule.CartServiceImpl");
41 | if (moduleCall != null) {
42 | moduleCall.initContext(mContext);
43 | moduleCall.getCartAmount();
44 | } else
45 | CommonUtils.showToast(mContext, "业务组件单独调试不应该跟其他业务Module产生交互,如果你依然想要在运行期依赖其它组件,那么请参考MainModule");
46 |
47 | }
48 | });
49 |
50 |
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/goodsmodule/src/main/java/com/wustor/goodsmodule/GoodsServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.wustor.goodsmodule;
2 |
3 | import android.content.Context;
4 |
5 | import com.wustor.routermodule.GoodsModuleService;
6 |
7 | /**
8 | * author chmyy
9 | * created on 2018/1/21
10 | * email fat_chao@163.com.
11 | */
12 |
13 | public class GoodsServiceImpl implements GoodsModuleService {
14 |
15 |
16 | @Override
17 | public void initContext(Context context) {
18 |
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/goodsmodule/src/main/java/com/wustor/goodsmodule/HomeFragment.java:
--------------------------------------------------------------------------------
1 | package com.wustor.goodsmodule;
2 |
3 |
4 | import android.view.View;
5 | import android.widget.Button;
6 | import android.widget.TextView;
7 |
8 | import com.wustor.basemodule.BaseFragment;
9 | import com.wustor.routermodule.ReflectUtils;
10 |
11 | public class HomeFragment extends BaseFragment {
12 |
13 | private TextView tvModule;
14 | private Button btnButton;
15 |
16 | @Override
17 | protected int getLayoutId() {
18 | return R.layout.fragment_home;
19 | }
20 |
21 | @Override
22 | protected View initView(View parent) {
23 | tvModule = parent.findViewById(R.id.tv_module);
24 | btnButton = parent.findViewById(R.id.btn_jump);
25 | tvModule.setText("首页\nGoodsModule");
26 | btnButton.setText("跳转到商品详情");
27 | btnButton.setOnClickListener(new View.OnClickListener() {
28 | @Override
29 | public void onClick(View view) {
30 | ReflectUtils.startActivityWithName(mContext, "com.wustor.goodsmodule.GoodsDetailActivity");
31 | }
32 | });
33 | return parent;
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/goodsmodule/src/main/java/com/wustor/goodsmodule/SortFragment.java:
--------------------------------------------------------------------------------
1 | package com.wustor.goodsmodule;
2 |
3 |
4 | import android.support.v4.app.Fragment;
5 | import android.view.View;
6 | import android.widget.Button;
7 | import android.widget.TextView;
8 |
9 | import com.wustor.basemodule.BaseFragment;
10 | import com.wustor.routermodule.ReflectUtils;
11 |
12 |
13 | /**
14 | * A simple {@link Fragment} subclass.
15 | */
16 |
17 | public class SortFragment extends BaseFragment {
18 |
19 | private TextView tvModule;
20 | private Button btnButton;
21 |
22 | @Override
23 | protected int getLayoutId() {
24 | return R.layout.fragment_sort;
25 | }
26 |
27 | @Override
28 | protected View initView(View parent) {
29 | tvModule = parent.findViewById(R.id.tv_module);
30 | btnButton = parent.findViewById(R.id.btn_jump);
31 | tvModule.setText("分类\nGoodsModule");
32 | btnButton.setText("跳转到商品详情");
33 | btnButton.setOnClickListener(new View.OnClickListener() {
34 | @Override
35 | public void onClick(View view) {
36 | ReflectUtils.startActivityWithName(mContext, "com.wustor.goodsmodule.GoodsDetailActivity");
37 | }
38 | });
39 | return parent;
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/goodsmodule/src/main/java/com/wustor/goodsmodule/debug/GoodsApplication.java:
--------------------------------------------------------------------------------
1 | package com.wustor.goodsmodule.debug;
2 |
3 |
4 | import com.wustor.basemodule.ModuleApplication;
5 |
6 | /**
7 | * author chmyy
8 | * created on 2017/12/18
9 | * email fat_chao@163.com.
10 | */
11 |
12 | public class GoodsApplication extends ModuleApplication {
13 | @Override
14 | public void onCreate() {
15 | super.onCreate();
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/goodsmodule/src/main/res/layout/activity_goods_detail.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/goodsmodule/src/main/res/layout/fragment_home.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/goodsmodule/src/main/res/layout/fragment_sort.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/goodsmodule/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | goodsModule
3 |
4 |
5 | Hello blank fragment
6 |
7 |
--------------------------------------------------------------------------------
/goodsmodule/src/test/java/com/wustor/goodsmodule/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.wustor.goodsmodule;
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() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/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 | org.gradle.jvmargs=-Xmx1536m
10 | android.enableAapt2=false
11 | isDebug=false
12 | isModuleRun=true
13 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wustor/AndroidComponent/bb7d2dc042ec3426da0c7f68532501f427c855dc/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Dec 28 10:00:20 PST 2015
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.1-all.zip
7 |
--------------------------------------------------------------------------------
/librarymodule/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/librarymodule/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | def cfg = rootProject.ext.android
4 | def librarys = rootProject.ext.dependencies
5 | android {
6 | compileSdkVersion cfg.compileSdkVersion
7 | buildToolsVersion cfg.buildToolsVersion
8 |
9 |
10 | defaultConfig {
11 | minSdkVersion cfg.minSdkVersion
12 | targetSdkVersion cfg.targetSdkVersion
13 | multiDexEnabled true
14 | versionCode cfg.versionCode//更新次数
15 | versionName cfg.versionName//版本号
16 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
17 | }
18 |
19 |
20 | }
21 | dependencies {
22 | compile fileTree(include: ['*.jar'], dir: 'libs')
23 | librarys.each { k, v -> compile v }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/librarymodule/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/chmyy/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 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/librarymodule/src/androidTest/java/com/wustor/librarymodule/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.wustor.librarymodule;
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 | * Instrumentation 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() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.wustor.librarymodule.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/librarymodule/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/librarymodule/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | libraryModule
3 |
4 |
--------------------------------------------------------------------------------
/librarymodule/src/test/java/com/wustor/librarymodule/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.wustor.librarymodule;
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() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/local.properties:
--------------------------------------------------------------------------------
1 | ## This file is automatically generated by Android Studio.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must *NOT* be checked into Version Control Systems,
5 | # as it contains information specific to your local configuration.
6 | #
7 | # Location of the SDK. This is only used by Gradle.
8 | # For customization when using a Version Control System, please read the
9 | # header note.
10 | #Wed Jan 24 12:47:44 CST 2018
11 | sdk.dir=/Users/chmyy/Library/Android/sdk
12 |
--------------------------------------------------------------------------------
/mainModule/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/mainModule/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | def cfg = rootProject.ext.android
4 | def appId = rootProject.ext.appId
5 |
6 | android {
7 | packagingOptions {
8 | exclude 'META-INF/rxjava.properties'
9 | }
10 | compileSdkVersion cfg.compileSdkVersion
11 | buildToolsVersion cfg.buildToolsVersion
12 | dexOptions {
13 | jumboMode = true
14 | }
15 |
16 | defaultConfig {
17 | ndk {
18 | abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
19 | }
20 | multiDexEnabled true
21 | applicationId appId["app"]
22 | minSdkVersion cfg.minSdkVersion
23 | targetSdkVersion cfg.targetSdkVersion
24 | versionCode cfg.versionCode//更新次数
25 | versionName cfg.versionName//版本号
26 | //resourcePrefix "app_"
27 |
28 | }
29 |
30 | lintOptions {
31 |
32 |
33 | checkReleaseBuilds false
34 | abortOnError false
35 | }
36 | configurations.all {
37 | resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
38 | }
39 | sourceSets {
40 | main {
41 | if (isModuleRun.toBoolean()) {
42 | manifest.srcFile 'src/main/debug/AndroidManifest.xml'
43 | } else {
44 | manifest.srcFile 'src/main/AndroidManifest.xml'
45 | java {
46 | //release 时 debug 目录下文件不需要合并到主工程
47 | exclude '**/debug/**'
48 | }
49 | }
50 | }
51 | }
52 | }
53 |
54 | //编译期组件隔离,运行期组件按需依赖
55 | //mainModule需要跟cartModule,goodsModule,usersModule进行交互,所以在运行期添加了依赖
56 | if (!isModuleRun.toBoolean()) {
57 | //获取当前运行的task
58 | def tasks = project.gradle.startParameter.taskNames
59 | for (String task : tasks) {
60 | def upperName = task.toUpperCase()
61 | //判断task是编译期还是运行期
62 | if (upperName.contains("ASSEMBLE") || upperName.contains("INSTALL")) {
63 | dependencies.add("compile", project.project(':' + 'cartmodule'))
64 | dependencies.add("compile", project.project(':' + 'goodsmodule'))
65 | dependencies.add("compile", project.project(':' + 'usermodule'))
66 | dependencies.add("compile", project.project(':' + 'ordermodule'))
67 | }
68 |
69 |
70 | }
71 | }
72 |
73 |
74 | dependencies {
75 | compile fileTree(include: ['*.jar'], dir: 'libs')
76 | compile project(':routermodule')
77 |
78 | }
79 |
80 |
--------------------------------------------------------------------------------
/mainModule/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/chmyy/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 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/mainModule/src/androidTest/java/com/wustor/androidcomponent/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.wustor.androidcomponent;
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 | * Instrumentation 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() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.wustor.androidcomponent", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/mainModule/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/mainModule/src/main/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/mainModule/src/main/java/com/wustor/androidcomponent/AppServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.wustor.androidcomponent;
2 |
3 | import android.content.Context;
4 |
5 | import com.wustor.routermodule.AppService;
6 |
7 | public class AppServiceImpl implements AppService {
8 |
9 | @Override
10 | public void showHome() {
11 |
12 | }
13 |
14 | @Override
15 | public void finish() {
16 |
17 | }
18 |
19 |
20 | @Override
21 | public void initContext(Context context) {
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/mainModule/src/main/java/com/wustor/androidcomponent/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.wustor.androidcomponent;
2 |
3 | import android.support.v4.app.Fragment;
4 | import android.support.v4.app.FragmentTransaction;
5 | import android.widget.RadioButton;
6 | import android.widget.RadioGroup;
7 |
8 | import com.wustor.basemodule.BaseActivity;
9 | import com.wustor.basemodule.CommonUtils;
10 | import com.wustor.routermodule.ReflectUtils;
11 |
12 | public class MainActivity extends BaseActivity {
13 | RadioButton bottomHome;
14 | RadioGroup radioGroup;
15 | private Fragment[] list;
16 |
17 |
18 | @Override
19 | protected int getLayoutId() {
20 | return R.layout.activity_main;
21 | }
22 |
23 | @Override
24 | protected void initView() {
25 | bottomHome = findViewById(R.id.bottom_home);
26 | radioGroup = findViewById(R.id.radioGroup);
27 | radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
28 | @Override
29 | public void onCheckedChanged(RadioGroup group, int checkedId) {
30 | switch (checkedId) {
31 | case R.id.bottom_home:
32 | changeFragment(1);
33 | break;
34 | case R.id.bottom_sort:
35 | changeFragment(2);
36 | break;
37 | case R.id.bottom_cart:
38 | changeFragment(3);
39 | break;
40 | case R.id.bottom_user:
41 | changeFragment(4);
42 | break;
43 | }
44 | }
45 | });
46 | Fragment fragmentHome = ReflectUtils.getFragment("com.wustor.goodsmodule.HomeFragment");
47 | Fragment fragmentSort = ReflectUtils.getFragment("com.wustor.goodsmodule.SortFragment");
48 | Fragment fragmentCart = ReflectUtils.getFragment("com.wustor.cartmodule.CartFragment");
49 | Fragment fragmentMine = ReflectUtils.getFragment("com.wustor.usermodule.MineFragment");
50 | if (fragmentHome == null || fragmentSort == null || fragmentCart == null || fragmentMine == null) {
51 | CommonUtils.showToast(mContext, "业务组件单独调试不应该跟其他业务Module产生交互,如果你依然想要在运行期依赖其它组件,那么请参考MainModule");
52 |
53 | } else {
54 | list = new Fragment[]{fragmentHome, fragmentSort, fragmentCart, fragmentMine};
55 | FragmentTransaction beginTransaction = getSupportFragmentManager().beginTransaction();
56 | beginTransaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
57 | beginTransaction.add(R.id.main, fragmentHome);
58 | beginTransaction.add(R.id.main, fragmentSort);
59 | beginTransaction.add(R.id.main, fragmentCart);
60 | beginTransaction.add(R.id.main, fragmentMine);
61 | beginTransaction.commit();
62 | showHome();
63 | }
64 |
65 |
66 | }
67 |
68 |
69 | public void showHome() {
70 | bottomHome.setChecked(true);
71 | changeFragment(1);
72 | }
73 |
74 | public void changeFragment(int index) {
75 | FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
76 | for (int i = 0; i < list.length; i++) {
77 | if (i + 1 != index) {
78 | // 隐藏选项卡
79 | fragmentTransaction.hide(list[i]);
80 | } else {
81 | // 显示选项卡
82 | fragmentTransaction.show(list[i]);
83 |
84 | }
85 | }
86 | fragmentTransaction.commitAllowingStateLoss();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/mainModule/src/main/java/com/wustor/androidcomponent/MainApplication.java:
--------------------------------------------------------------------------------
1 | package com.wustor.androidcomponent;
2 |
3 | import com.wustor.basemodule.ModuleApplication;
4 |
5 | /**
6 | * author chmyy
7 | * created on 2018/1/21
8 | * email fat_chao@163.com.
9 | */
10 |
11 | public class MainApplication extends ModuleApplication {
12 | @Override
13 | public void onCreate() {
14 | super.onCreate();
15 | //注册各种组件间的回调接口
16 |
17 |
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/mainModule/src/main/java/com/wustor/androidcomponent/debug/MainDebugActivity.java:
--------------------------------------------------------------------------------
1 | package com.wustor.androidcomponent.debug;
2 |
3 | import com.wustor.androidcomponent.R;
4 | import com.wustor.basemodule.BaseActivity;
5 |
6 | public class MainDebugActivity extends BaseActivity {
7 |
8 |
9 | @Override
10 | protected int getLayoutId() {
11 | return R.layout.activity_main_debug;
12 | }
13 |
14 | @Override
15 | protected void initView() {
16 | setTitle("主页面");
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/mainModule/src/main/java/com/wustor/androidcomponent/debug/MainDebugApplication.java:
--------------------------------------------------------------------------------
1 | package com.wustor.androidcomponent.debug;
2 |
3 | import com.wustor.basemodule.ModuleApplication;
4 |
5 | /**
6 | * Created by fatchao
7 | * 日期 2018-01-23.
8 | * 邮箱 fat_chao@163.com
9 | */
10 |
11 | public class MainDebugApplication extends ModuleApplication {
12 |
13 | @Override
14 | public void onCreate() {
15 | super.onCreate();
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/mainModule/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
17 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/mainModule/src/main/res/layout/activity_main_debug.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
19 |
20 |
--------------------------------------------------------------------------------
/mainModule/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wustor/AndroidComponent/bb7d2dc042ec3426da0c7f68532501f427c855dc/mainModule/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/mainModule/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wustor/AndroidComponent/bb7d2dc042ec3426da0c7f68532501f427c855dc/mainModule/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/mainModule/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wustor/AndroidComponent/bb7d2dc042ec3426da0c7f68532501f427c855dc/mainModule/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/mainModule/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wustor/AndroidComponent/bb7d2dc042ec3426da0c7f68532501f427c855dc/mainModule/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/mainModule/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wustor/AndroidComponent/bb7d2dc042ec3426da0c7f68532501f427c855dc/mainModule/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/mainModule/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wustor/AndroidComponent/bb7d2dc042ec3426da0c7f68532501f427c855dc/mainModule/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/mainModule/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wustor/AndroidComponent/bb7d2dc042ec3426da0c7f68532501f427c855dc/mainModule/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/mainModule/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wustor/AndroidComponent/bb7d2dc042ec3426da0c7f68532501f427c855dc/mainModule/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/mainModule/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wustor/AndroidComponent/bb7d2dc042ec3426da0c7f68532501f427c855dc/mainModule/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/mainModule/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wustor/AndroidComponent/bb7d2dc042ec3426da0c7f68532501f427c855dc/mainModule/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/mainModule/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/mainModule/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | AndroidComponent
3 |
4 |
5 | Hello blank fragment
6 |
7 |
--------------------------------------------------------------------------------
/mainModule/src/test/java/com/wustor/androidcomponent/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.wustor.androidcomponent;
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() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/ordermodule/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/ordermodule/build.gradle:
--------------------------------------------------------------------------------
1 | if (isModuleRun.toBoolean()) {
2 | apply plugin: 'com.android.application'
3 | } else {
4 | apply plugin: 'com.android.library'
5 | }
6 | //apply from: "package.gradle"
7 |
8 | def cfg = rootProject.ext.android
9 | def appId = rootProject.ext.appId
10 | android {
11 | packagingOptions {
12 | exclude 'META-INF/rxjava.properties'
13 | }
14 | compileSdkVersion cfg.compileSdkVersion
15 | buildToolsVersion cfg.buildToolsVersion
16 |
17 | dexOptions {
18 | jumboMode = true
19 | }
20 |
21 | defaultConfig {
22 | multiDexEnabled true
23 | ndk {
24 | abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
25 | }
26 | if (isModuleRun.toBoolean()) {
27 | applicationId appId["order"]
28 | }
29 | minSdkVersion cfg.minSdkVersion
30 | targetSdkVersion cfg.targetSdkVersion
31 | versionCode cfg.versionCode//更新次数
32 | versionName cfg.versionName//版本号
33 | // resourcePrefix "ordermodule_"
34 | }
35 | lintOptions {
36 | checkReleaseBuilds false
37 | abortOnError false
38 | }
39 | configurations.all {
40 | resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
41 | }
42 |
43 | sourceSets {
44 | main {
45 | if (isModuleRun.toBoolean()) {
46 | manifest.srcFile 'src/main/debug/AndroidManifest.xml'
47 | } else {
48 | manifest.srcFile 'src/main/AndroidManifest.xml'
49 | java {
50 | //release 时 debug 目录下文件不需要合并到主工程
51 | exclude '**/debug/**'
52 | }
53 | }
54 | }
55 | }
56 | }
57 | dependencies {
58 | compile fileTree(include: ['*.jar'], dir: 'libs')
59 | compile project(':routermodule')
60 | }
61 |
62 |
--------------------------------------------------------------------------------
/ordermodule/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/chmyy/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 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/ordermodule/src/androidTest/java/com/wustor/ordermodule/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.wustor.ordermodule;
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 | * Instrumentation 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() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.wustor.ordermodule.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/ordermodule/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/ordermodule/src/main/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/ordermodule/src/main/java/com/wustor/ordermodule/OrderActivity.java:
--------------------------------------------------------------------------------
1 | package com.wustor.ordermodule;
2 |
3 | import com.wustor.basemodule.BaseActivity;
4 |
5 | public class OrderActivity extends BaseActivity {
6 |
7 |
8 | @Override
9 | protected int getLayoutId() {
10 | return R.layout.activity_order;
11 | }
12 |
13 | @Override
14 | protected void initView() {
15 | setTitle("订单");
16 |
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/ordermodule/src/main/java/com/wustor/ordermodule/OrderFragment.java:
--------------------------------------------------------------------------------
1 | package com.wustor.ordermodule;
2 |
3 |
4 | import android.view.View;
5 |
6 | import com.wustor.basemodule.BaseFragment;
7 |
8 | public class OrderFragment extends BaseFragment {
9 |
10 | @Override
11 | protected int getLayoutId() {
12 | return R.layout.fragment_order;
13 | }
14 |
15 | @Override
16 | protected View initView(View parent) {
17 |
18 |
19 | return parent;
20 | }
21 |
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/ordermodule/src/main/java/com/wustor/ordermodule/OrderModuleService.java:
--------------------------------------------------------------------------------
1 | package com.wustor.ordermodule;
2 |
3 | import android.content.Context;
4 |
5 | /**
6 | * author chmyy
7 | * created on 2018/1/21
8 | * email fat_chao@163.com.
9 | */
10 |
11 | public class OrderModuleService implements com.wustor.routermodule.OrderModuleService {
12 |
13 |
14 | @Override
15 | public void initContext(Context context) {
16 |
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/ordermodule/src/main/java/com/wustor/ordermodule/debug/OrderApplication.java:
--------------------------------------------------------------------------------
1 | package com.wustor.ordermodule.debug;
2 |
3 |
4 | import com.wustor.basemodule.ModuleApplication;
5 |
6 | /**
7 | * author chmyy
8 | * created on 2017/12/18
9 | * email fat_chao@163.com.
10 | */
11 |
12 | public class OrderApplication extends ModuleApplication {
13 | @Override
14 | public void onCreate() {
15 | super.onCreate();
16 |
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/ordermodule/src/main/res/layout/activity_order.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
20 |
21 |
--------------------------------------------------------------------------------
/ordermodule/src/main/res/layout/fragment_order.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ordermodule/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | orderModule
3 |
4 |
5 | Hello blank fragment
6 |
7 |
--------------------------------------------------------------------------------
/ordermodule/src/test/java/com/wustor/ordermodule/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.wustor.ordermodule;
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() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/routermodule/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/routermodule/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | def cfg = rootProject.ext.android
3 | android {
4 | compileSdkVersion cfg.compileSdkVersion
5 | buildToolsVersion cfg.buildToolsVersion
6 |
7 |
8 | defaultConfig {
9 | minSdkVersion cfg.minSdkVersion
10 | targetSdkVersion cfg.targetSdkVersion
11 | versionCode cfg.versionCode//更新次数
12 | versionName cfg.versionName//版本号
13 | //resourcePrefix "modulerouter_"
14 |
15 | }
16 |
17 |
18 | }
19 |
20 | dependencies {
21 | compile fileTree(include: ['*.jar'], dir: 'libs')
22 | compile project(':basemodule')
23 | }
24 |
--------------------------------------------------------------------------------
/routermodule/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 |
--------------------------------------------------------------------------------
/routermodule/src/androidTest/java/com/wustor/routermodule/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.wustor.routermodule;
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() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.wustor.routermodule.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/routermodule/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
--------------------------------------------------------------------------------
/routermodule/src/main/java/com/wustor/routermodule/AppService.java:
--------------------------------------------------------------------------------
1 | package com.wustor.routermodule;
2 |
3 |
4 | public interface AppService extends ModuleCall {
5 | //T调用方法自定义
6 | void showHome();
7 |
8 | void finish();
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/routermodule/src/main/java/com/wustor/routermodule/CartModuleService.java:
--------------------------------------------------------------------------------
1 | package com.wustor.routermodule;
2 |
3 |
4 | public interface CartModuleService extends ModuleCall {
5 | //TODO 调用方法自定义
6 |
7 | void getCartAmount();
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/routermodule/src/main/java/com/wustor/routermodule/GoodsModuleService.java:
--------------------------------------------------------------------------------
1 | package com.wustor.routermodule;
2 |
3 |
4 |
5 | public interface GoodsModuleService extends ModuleCall {
6 | //TODO 调用方法自定义
7 |
8 | }
9 |
--------------------------------------------------------------------------------
/routermodule/src/main/java/com/wustor/routermodule/ModuleCall.java:
--------------------------------------------------------------------------------
1 | package com.wustor.routermodule;
2 |
3 | import android.content.Context;
4 |
5 | /**
6 | * author chmyy
7 | * created on 2018/1/21
8 | * email fat_chao@163.com.
9 | */
10 |
11 | public interface ModuleCall {
12 |
13 | void initContext(Context context);
14 | }
15 |
--------------------------------------------------------------------------------
/routermodule/src/main/java/com/wustor/routermodule/OrderModuleService.java:
--------------------------------------------------------------------------------
1 | package com.wustor.routermodule;
2 |
3 |
4 | public interface OrderModuleService extends ModuleCall {
5 | //TODO 调用方法自定义
6 |
7 | }
8 |
--------------------------------------------------------------------------------
/routermodule/src/main/java/com/wustor/routermodule/ReflectUtils.java:
--------------------------------------------------------------------------------
1 | package com.wustor.routermodule;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.support.v4.app.Fragment;
6 | import android.util.Log;
7 |
8 | import com.wustor.basemodule.CommonUtils;
9 |
10 | /**
11 | * author chmyy
12 | * created on 2018/1/21
13 | * email fat_chao@163.com.
14 | */
15 |
16 | public class ReflectUtils {
17 |
18 | public static Fragment getFragment(String name) {
19 | Fragment fragment;
20 | try {
21 | Class fragmentClass = Class.forName(name);
22 | fragment = (Fragment) fragmentClass.newInstance();
23 | } catch (Exception e) {
24 | Log.d("error--->", e.toString());
25 | return null;
26 | }
27 | return fragment;
28 | }
29 |
30 |
31 | public static Object getModuleCall(String name) {
32 | Object object;
33 | try {
34 | Class aClass = Class.forName(name);
35 | object = aClass.newInstance();
36 | } catch (Exception e) {
37 | Log.d("error--->", e.toString());
38 | return null;
39 | }
40 |
41 | return object;
42 | }
43 |
44 | public static void startActivityWithName(Context context, String name) {
45 | try {
46 | Class clazz = Class.forName(name);
47 | startActivity(context, clazz);
48 | } catch (ClassNotFoundException e) {
49 | CommonUtils.showToast(context, "业务组件单独调试不应该跟其他业务Module产生交互,如果你依然想要在运行期依赖其它组件,那么请参考MainModul");
50 | Log.d("error--->", e.toString());
51 | }
52 | }
53 |
54 |
55 | public static void startActivity(Context context, Class clazz) {
56 | context.startActivity(getIntent(context, clazz));
57 | }
58 |
59 | public static Intent getIntent(Context context, Class clazz) {
60 | return new Intent(context, clazz);
61 | }
62 |
63 |
64 | }
65 |
--------------------------------------------------------------------------------
/routermodule/src/main/java/com/wustor/routermodule/UserModuleService.java:
--------------------------------------------------------------------------------
1 | package com.wustor.routermodule;
2 |
3 | public interface UserModuleService extends ModuleCall {
4 | //TODO 调用方法自定义
5 |
6 | void finish();
7 |
8 | }
9 |
--------------------------------------------------------------------------------
/routermodule/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | RouterModule
3 |
4 |
--------------------------------------------------------------------------------
/routermodule/src/test/java/com/wustor/routermodule/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.wustor.routermodule;
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() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':mainModule', ':cartmodule', ':goodsmodule', ':basemodule', ':librarymodule', ':ordermodule', ':usermodule', ':routermodule'
2 |
--------------------------------------------------------------------------------
/usermodule/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/usermodule/build.gradle:
--------------------------------------------------------------------------------
1 | if (isModuleRun.toBoolean()) {
2 | apply plugin: 'com.android.application'
3 | } else {
4 | apply plugin: 'com.android.library'
5 | }
6 |
7 | def cfg = rootProject.ext.android
8 | def appId = rootProject.ext.appId
9 | android {
10 |
11 | packagingOptions {
12 | exclude 'META-INF/rxjava.properties'
13 | }
14 | compileSdkVersion cfg.compileSdkVersion
15 | buildToolsVersion cfg.buildToolsVersion
16 |
17 | dexOptions {
18 | jumboMode = true
19 | }
20 |
21 | defaultConfig {
22 | ndk {
23 | abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
24 | }
25 | if (isModuleRun.toBoolean()) {
26 | applicationId appId["user"]
27 | }
28 | multiDexEnabled true
29 |
30 | minSdkVersion cfg.minSdkVersion
31 | targetSdkVersion cfg.targetSdkVersion
32 | versionCode cfg.versionCode//更新次数
33 | versionName cfg.versionName//版本号
34 | //resourcePrefix "usermodule_"
35 | //arouter
36 | javaCompileOptions {
37 | annotationProcessorOptions {
38 | arguments = [moduleName: project.getName()]
39 | }
40 | }
41 | }
42 | lintOptions {
43 | checkReleaseBuilds false
44 | abortOnError false
45 | }
46 | configurations.all {
47 | resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
48 | }
49 |
50 | sourceSets {
51 | main {
52 | if (isModuleRun.toBoolean()) {
53 | manifest.srcFile 'src/main/debug/AndroidManifest.xml'
54 | } else {
55 | manifest.srcFile 'src/main/AndroidManifest.xml'
56 | java {
57 | //release 时 debug 目录下文件不需要合并到主工程
58 | exclude '**/debug/**'
59 | }
60 | }
61 | }
62 | }
63 | }
64 | dependencies {
65 | compile fileTree(include: ['*.jar'], dir: 'libs')
66 | compile project(':routermodule')
67 | }
68 |
69 |
--------------------------------------------------------------------------------
/usermodule/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/chmyy/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 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/usermodule/src/androidTest/java/com/wustor/usermodule/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.wustor.usermodule;
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 | * Instrumentation 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() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.wustor.usermodule.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/usermodule/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/usermodule/src/main/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/usermodule/src/main/java/com/wustor/usermodule/MineFragment.java:
--------------------------------------------------------------------------------
1 | package com.wustor.usermodule;
2 |
3 |
4 | import android.support.v4.app.Fragment;
5 | import android.view.View;
6 | import android.widget.Button;
7 | import android.widget.TextView;
8 |
9 | import com.wustor.basemodule.BaseFragment;
10 | import com.wustor.routermodule.ReflectUtils;
11 |
12 |
13 | /**
14 | * A simple {@link Fragment} subclass.
15 | */
16 | public class MineFragment extends BaseFragment {
17 | private TextView tvModule;
18 | private Button btnButton;
19 |
20 | @Override
21 | protected int getLayoutId() {
22 | return R.layout.fragment_user;
23 | }
24 |
25 | @Override
26 | protected View initView(View parent) {
27 | tvModule = parent.findViewById(R.id.tv_module);
28 | btnButton = parent.findViewById(R.id.btn_jump);
29 | tvModule.setText("用户中心\nUserModule");
30 | btnButton.setText("跳转订单");
31 | btnButton.setOnClickListener(new View.OnClickListener() {
32 | @Override
33 | public void onClick(View view) {
34 | ReflectUtils.startActivityWithName(mContext, "com.wustor.ordermodule.OrderActivity");
35 | }
36 | });
37 | return parent;
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/usermodule/src/main/java/com/wustor/usermodule/UserActivity.java:
--------------------------------------------------------------------------------
1 | package com.wustor.usermodule;
2 |
3 | import com.wustor.basemodule.BaseActivity;
4 |
5 | public class UserActivity extends BaseActivity {
6 |
7 |
8 | @Override
9 | protected int getLayoutId() {
10 | return R.layout.activity_user;
11 | }
12 |
13 | @Override
14 | protected void initView() {
15 |
16 | setTitle("用户");
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/usermodule/src/main/java/com/wustor/usermodule/UserServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.wustor.usermodule;
2 |
3 | import android.content.Context;
4 |
5 | import com.wustor.routermodule.UserModuleService;
6 |
7 | /**
8 | * author chmyy
9 | * created on 2018/1/21
10 | * email fat_chao@163.com.
11 | */
12 |
13 | public class UserServiceImpl implements UserModuleService {
14 |
15 |
16 | @Override
17 | public void finish() {
18 |
19 | }
20 |
21 |
22 |
23 | @Override
24 | public void initContext(Context context) {
25 |
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/usermodule/src/main/java/com/wustor/usermodule/debug/UserApplication.java:
--------------------------------------------------------------------------------
1 | package com.wustor.usermodule.debug;
2 |
3 |
4 | import com.wustor.basemodule.ModuleApplication;
5 |
6 | /**
7 | * author chmyy
8 | * created on 2017/12/18
9 | * email fat_chao@163.com.
10 | */
11 |
12 | public class UserApplication extends ModuleApplication {
13 |
14 | @Override
15 | public void onCreate() {
16 | super.onCreate();
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/usermodule/src/main/res/layout/activity_user.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/usermodule/src/main/res/layout/fragment_user.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/usermodule/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | userModule
3 |
4 |
5 | Hello blank fragment
6 |
7 |
--------------------------------------------------------------------------------
/usermodule/src/test/java/com/wustor/usermodule/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.wustor.usermodule;
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() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------