File tree Expand file tree Collapse file tree 4 files changed +51
-10
lines changed
debug/java/com/loopeer/codereader
main/java/com/loopeer/codereader
release/java/com/loopeer/codereader Expand file tree Collapse file tree 4 files changed +51
-10
lines changed Original file line number Diff line number Diff 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
4963dependencies {
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 11package com .loopeer .codereader ;
22
3- import android .app .Application ;
43import android .content .Context ;
54import android .support .v7 .app .AppCompatDelegate ;
65
7- import com .facebook .stetho .Stetho ;
86import 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
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments