Skip to content

Commit a78b904

Browse files
author
wangyongsheng
committed
update
1 parent 494e7de commit a78b904

12 files changed

Lines changed: 327 additions & 14 deletions

File tree

‎build.gradle‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ buildscript {
1010
// NOTE: Do not place your application dependencies here; they belong
1111
// in the individual module build.gradle files
1212
}
13+
repositories {
14+
google()
15+
}
1316
}
1417

1518
allprojects {

‎gradle.properties‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
11
# Project-wide Gradle settings.
2-
32
# IDE (e.g. Android Studio) users:
43
# Gradle settings configured through the IDE *will override*
54
# any settings specified in this file.
6-
75
# For more details on how to configure your build environment visit
86
# http://www.gradle.org/docs/current/userguide/build_environment.html
9-
107
# Specifies the JVM arguments used for the daemon process.
118
# The setting is particularly useful for tweaking memory settings.
129
org.gradle.jvmargs=-Xmx2048m
13-
1410
# When configured, Gradle will run in incubating parallel mode.
1511
# This option should only be used with decoupled projects. More details, visit
1612
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17-
1813
org.gradle.daemon=true
1914
org.gradle.configureondemand=true
2015
org.gradle.parallel=true
21-
# 这个值一般跟你的AndroidStudio版本号一致
16+
# ���ֵһ������AndroidStudio�汾��һ��
2217
localGradlePluginVersion=3.0.1
23-
24-
# 每次更改“isModule”的值后,需要点击 "Sync Project" 按钮
25-
# isModule是“集成开发模式”和“组件开发模式”的切换开关
18+
# ÿ�θ��ġ�isModule����ֵ����Ҫ��� "Sync Project" ��ť
19+
# isModule�ǡ����ɿ���ģʽ���͡��������ģʽ�����л�����
20+
#统一配置 不用每个module一个变量
2621
isModule=false

‎gradle/wrapper/gradle-wrapper.jar‎

53.1 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Thu Mar 19 10:19:24 CST 2020
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-5.6.4-all.zip

‎gradlew‎

Lines changed: 172 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎gradlew.bat‎

Lines changed: 84 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib_common/build.gradle‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apply plugin: 'com.android.library'
1+
apply plugin: 'com.android.library'//功能组件 类似第三方库 始终是库
22

33
android {
44
compileSdkVersion build_versions.target_sdk

‎lib_common/src/main/AndroidManifest.xml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
22
package="com.guiying.module.common">
33

4+
5+
<!-- 权限声明为什么不放在壳工程中? 因为组件单独运行时也需要权限-->
46
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
57
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
68
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

‎module_app/src/main/AndroidManifest.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
android:supportsRtl="true"
1111
android:theme="@style/AppTheme">
1212

13-
<!--发送崩溃日志界面-->
13+
<!--发送崩溃日志界面 注意:没有启动页 所以组件模式下不能运行 启动页也是个组件在module_main-->
1414
<activity
1515
android:name="org.acra.CrashReportDialog"
1616
android:excludeFromRecents="true"

‎module_app/src/main/java/com/guiying/module/MyApplication.java‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,53 @@
4141
public class MyApplication extends BaseApplication {
4242

4343

44+
//------------------------------------------------------------------------------
45+
46+
//优化1:全局配置组件是否启用集成或组件模式 不用每个组件都写
47+
//优化2:组件中自定义application并在菜单文件中配置好 单个组件运行可以出做一些初始化
48+
49+
//------------------------------------------------------------------------------
50+
51+
//问题1:集成模式下 各个组件不能使用自己的application 什么情况下使用?集成模式下组件代码中
52+
// getApplicationContext获取的不应该是统一的壳工程的application呢
53+
54+
//如何使用全局的application 还是靠共同依赖作为中间桥梁
55+
56+
57+
//------------------------------------------------------------------------------
58+
59+
60+
//问题2:组件化工程模型的构成?
61+
//在组件化工程模型中主要有:app壳工程、业务组件和功能组件3种类型,
62+
// 而业务组件中的Main组件和功能组件中的Common组件比较特殊
63+
64+
65+
//------------------------------------------------------------------------------
66+
67+
68+
//疑问:功能组件 例如做一个sdk 需要不需要单独搞个功能组件 还是直接在common组件中依赖或写代码?
69+
//个人理解:功能一般是没有界面的那种做成第三库比较好。没必要搞个组件项目。
70+
71+
//------------------------------------------------------------------------------
72+
73+
74+
//问题3:Fragment或View如何支持组件化 就是如何拿到组件中的view或Fragment
75+
76+
// 跟上一个demo中的一样 都是通过底层依赖实现
77+
//不同:DexFile查找包下面的所有类 isAssignableFrom找出所有实现类 然后反射注册
78+
79+
80+
//------------------------------------------------------------------------------
81+
//------------------------------------------------------------------------------
82+
//------------------------------------------------------------------------------
83+
//------------------------------------------------------------------------------
84+
//------------------------------------------------------------------------------
85+
//------------------------------------------------------------------------------
86+
//------------------------------------------------------------------------------
87+
//------------------------------------------------------------------------------
88+
//------------------------------------------------------------------------------
89+
90+
4491
@Override
4592
public void onCreate() {
4693
super.onCreate();

0 commit comments

Comments
 (0)