Skip to content

Commit

Permalink
优化: 优化FastManager初始化init逻辑,FastLib自动初始化;解决多进程异常问题
Browse files Browse the repository at this point in the history
优化: 将eventbus、bga-swipebacklayout、UIWidget:tab-layout 使用compileOnly开发者根据需要导入
  • Loading branch information
[email protected] authored and [email protected] committed Sep 19, 2019
1 parent 1eb4b39 commit 5d8526a
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ Demo中使用到的网络请求api来源于[豆瓣API V2](https://developers.dou

## 重大更新日志 其它版本参看[Release](https://github.com/AriesHoo/FastLib/releases)

* 2.3.1
* 2.3.2

* 优化: 优化FastManager初始化init逻辑,FastLib自动初始化
* 优化: 优化FastManager初始化init逻辑,FastLib自动初始化解决多进程异常问题
* 优化: 将eventbus、bga-swipebacklayout、UIWidget:tab-layout 使用compileOnly开发者根据需要导入

* 2.2.13
Expand Down Expand Up @@ -167,7 +167,7 @@ allprojects {

```
dependencies {
implementation 'com.github.AriesHoo:FastLib:2.3.1'
implementation 'com.github.AriesHoo:FastLib:2.3.2'
}
```

Expand All @@ -186,7 +186,7 @@ dependencies {
<dependency>
<groupId>com.github.AriesHoo</groupId>
<artifactId>FastLib</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
</dependency>
```

Expand Down
Binary file modified apk/sample.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions apk/update
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"versionCode": 245,
"versionName": "2.3.1",
"versionCode": 246,
"versionName": "2.3.2",
"url": "https://raw.githubusercontent.com/AriesHoo/FastLib/dev/apk/sample.apk",
"force": false,
"size": "3.74M",
Expand Down
13 changes: 6 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
apply plugin: 'com.android.application'

def ext = rootProject.ext
android {
compileSdkVersion ext.compileSdkVersion
compileSdkVersion rootProject.compileSdkVersion
defaultConfig {
applicationId "com.aries.library.fast.demo"
minSdkVersion ext.minSdkVersion
targetSdkVersion ext.targetSdkVersion
versionCode ext.versionCode
versionName ext.versionName
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
versionCode rootProject.versionCode
versionName rootProject.versionName
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
buildConfigField "Boolean", "LOG_ENABALE", "true"
Expand Down Expand Up @@ -77,7 +76,7 @@ android {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':library')
// implementation 'com.github.AriesHoo:FastLib:2.3.1'
// implementation 'com.github.AriesHoo:FastLib:2.3.2'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.3'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.3'
testImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.3'
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ ext{
targetSdkVersion = 28
supportVersion = "1.0.0"
widgetVersion = "3.2.24"
versionCode = 245
versionName = "2.3.1"
versionCode = 246
versionName = "2.3.2"
}
19 changes: 10 additions & 9 deletions library/src/main/java/com/aries/library/fast/FastManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@
*/
public class FastManager {

// 通过FastFileProvider进行初始化
// static {
// Application application = FastUtil.getApplication();
// if (application != null) {
// LoggerManager.i("FastManager", "initSuccess");
// init(application);
// }
// }
//原本在Provider中默认进行初始化,如果app出现多进程使用该模式可避免调用异常出现
static {
Application application = FastUtil.getApplication();
if (application != null) {
LoggerManager.i("FastManager", "initSuccess");
init(application);
}
}

private static volatile FastManager sInstance;

private FastManager() {
Expand Down Expand Up @@ -136,7 +137,7 @@ public Application getApplication() {
* @return
*/
static FastManager init(Application application) {
LoggerManager.i("init");
LoggerManager.i("init_mApplication:" + mApplication + ";application;" + application);
//保证只执行一次初始化属性
if (mApplication == null && application != null) {
mApplication = application;
Expand Down

0 comments on commit 5d8526a

Please sign in to comment.