Skip to content

Commit 4fea823

Browse files
committed
add release and app
1 parent 9b8c9d7 commit 4fea823

File tree

4 files changed

+51
-10
lines changed

4 files changed

+51
-10
lines changed

app/build.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ android {
3434
}
3535

3636
buildTypes {
37+
debug{}
3738
release {
3839
minifyEnabled false
3940
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
@@ -44,6 +45,19 @@ android {
4445
targetCompatibility 1.8
4546
sourceCompatibility 1.8
4647
}
48+
49+
productFlavors {
50+
develop {
51+
}
52+
developV21 {
53+
minSdkVersion 21
54+
}
55+
fir {
56+
}
57+
loopeer{
58+
59+
}
60+
}
4761
}
4862

4963
dependencies {
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.loopeer.codereader;
2+
3+
import android.app.Application;
4+
5+
import com.facebook.stetho.Stetho;
6+
7+
public class BaseApp extends Application {
8+
9+
@Override
10+
public void onCreate() {
11+
super.onCreate();
12+
if (BuildConfig.DEBUG) {
13+
Stetho.initialize(
14+
Stetho.newInitializerBuilder(this)
15+
.enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
16+
.enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this))
17+
.build());
18+
}
19+
}
20+
21+
22+
}

app/src/main/java/com/loopeer/codereader/CodeReaderApplication.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,27 @@
11
package com.loopeer.codereader;
22

3-
import android.app.Application;
43
import android.content.Context;
54
import android.support.v7.app.AppCompatDelegate;
65

7-
import com.facebook.stetho.Stetho;
86
import com.loopeer.codereader.utils.ThemeUtils;
97

10-
public class CodeReaderApplication extends Application {
11-
private static CodeReaderApplication mInstance;
8+
public class CodeReaderApplication extends BaseApp {
9+
private static BaseApp mInstance;
1210
private static Context sAppContext;
1311

1412
@Override
1513
public void onCreate() {
1614
super.onCreate();
1715
mInstance = this;
1816
sAppContext = getApplicationContext();
19-
Stetho.initialize(
20-
Stetho.newInitializerBuilder(this)
21-
.enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
22-
.enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this))
23-
.build());
2417
AppCompatDelegate.setDefaultNightMode(ThemeUtils.getCurrentNightMode(this));
2518
}
2619

2720
public static Context getAppContext() {
2821
return sAppContext;
2922
}
3023

31-
public static CodeReaderApplication getInstance() {
24+
public static BaseApp getInstance() {
3225
return mInstance;
3326
}
3427

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.loopeer.codereader;
2+
3+
import android.app.Application;
4+
5+
public class BaseApp extends Application {
6+
7+
@Override
8+
public void onCreate() {
9+
super.onCreate();
10+
}
11+
12+
}

0 commit comments

Comments
 (0)