Commit 7c5bdd749cd7d266ba887f326042c2f2ce78c572

Authored by 朱显松
1 parent 71af6396

add signing configs

app/CNLiveLibsSimple.jks 0 → 100644
No preview for this file type
app/build.gradle
... ... @@ -17,10 +17,19 @@ android {
17 17 versionCode 1
18 18 versionName "1.0"
19 19 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
20   -
  20 + }
  21 + signingConfigs {
  22 + myConfig {
  23 + v2SigningEnabled false
  24 + storeFile file('CNLiveLibsSimple.jks')
  25 + storePassword '000000'
  26 + keyAlias 'simple'
  27 + keyPassword '000000'
  28 + }
21 29 }
22 30 buildTypes {
23 31 release {
  32 + signingConfig signingConfigs.myConfig
24 33 minifyEnabled false
25 34 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
26 35 }
... ...
app/src/main/java/com/cnlive/libs/demo/App.java
1 1 package com.cnlive.libs.demo;
2 2  
3   -import android.app.Application;
  3 +
  4 +import com.cnlive.libs.base.application.Application;
4 5  
5 6 /**
6 7 * Created by xiansong on 2017/8/22.
... ...
app/src/main/java/com/cnlive/libs/demo/mvptest/frame/presenter/SimpleCountriesPresenter.java
1 1 package com.cnlive.libs.demo.mvptest.frame.presenter;
2 2  
3 3 import android.content.Context;
4   -import android.util.Log;
5 4  
6 5 import com.cnlive.libs.base.data.network.Subscriber;
7 6 import com.cnlive.libs.demo.data.network.testapi.ApiRequest;
... ... @@ -13,6 +12,8 @@ import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter;
13 12  
14 13 import io.reactivex.disposables.Disposable;
15 14  
  15 +import static com.cnlive.libs.demo.RequestTest.subscriberBuild;
  16 +
16 17  
17 18 /**
18 19 * Created by Lynn on 2017/8/29.
... ... @@ -31,7 +32,7 @@ public class SimpleCountriesPresenter extends MvpBasePresenter<CountriesView> im
31 32  
32 33 subscription = ApiRequest.subscribe(
33 34 ApiRequest.service(ApiService.class).questionsExperts(),
34   - new Subscriber<ExpertLibraryListBean>(context) {
  35 + new Subscriber<ExpertLibraryListBean>(context,subscriberBuild) {
35 36 @Override
36 37 public void onCompleted(String code, String message, ExpertLibraryListBean data) {
37 38 getView().setData(data.getData());
... ... @@ -45,22 +46,22 @@ public class SimpleCountriesPresenter extends MvpBasePresenter&lt;CountriesView&gt; im
45 46 });
46 47 }
47 48  
48   - @Override
49   - public void detachView(boolean retainInstance) {
50   - super.detachView(retainInstance);
51   -
52   - StringBuilder builder = new StringBuilder("---- detachView(" + retainInstance + ") ");
53   - if (!retainInstance) {
54   - builder.append(" --> cancel Loader");
55   - }
56   -
57   - builder.append(" ----");
58   - Log.d(TAG, builder.toString());
59   - }
60   -
61   - @Override
62   - public void attachView(CountriesView view) {
63   - super.attachView(view);
64   - Log.d(TAG, "attach view " + view.toString());
65   - }
  49 +// @Override
  50 +// public void detachView(boolean retainInstance) {
  51 +// super.detachView(retainInstance);
  52 +//
  53 +// StringBuilder builder = new StringBuilder("---- detachView(" + retainInstance + ") ");
  54 +// if (!retainInstance) {
  55 +// builder.append(" --> cancel Loader");
  56 +// }
  57 +//
  58 +// builder.append(" ----");
  59 +// Log.d(TAG, builder.toString());
  60 +// }
  61 +//
  62 +// @Override
  63 +// public void attachView(CountriesView view) {
  64 +// super.attachView(view);
  65 +// Log.d(TAG, "attach view " + view.toString());
  66 +// }
66 67 }
... ...
cnlive/src/main/java/com/cnlive/libs/base/application/Application.java 0 → 100644
  1 +package com.cnlive.libs.base.application;
  2 +
  3 +import android.content.pm.ApplicationInfo;
  4 +
  5 +/**
  6 + * Created by xiansong on 2017/9/4.
  7 + */
  8 +
  9 +public class Application extends android.app.Application {
  10 +
  11 + private static boolean debug = false;
  12 +
  13 + @Override
  14 + public void onCreate() {
  15 + super.onCreate();
  16 + debug = (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
  17 + }
  18 +
  19 + public static boolean isDebug() {
  20 + return debug;
  21 + }
  22 +}
... ...
cnlive/src/main/java/com/cnlive/libs/base/frame/activity/MvpLceActivity.java
... ... @@ -49,12 +49,6 @@ public abstract class MvpLceActivity&lt;CV extends View, M, V extends MvpLceView&lt;M&gt;
49 49 "Error view is null! Have you specified an error view in your layout xml file?");
50 50 }
51 51  
52   -// errorView.setOnClickListener(new View.OnClickListener() {
53   -// @Override
54   -// public void onClick(View v) {
55   -// onErrorViewClicked();
56   -// }
57   -// });
58 52 }
59 53  
60 54 @NonNull
... ... @@ -74,10 +68,6 @@ public abstract class MvpLceActivity&lt;CV extends View, M, V extends MvpLceView&lt;M&gt;
74 68 return null;
75 69 }
76 70  
77   -// protected void onErrorViewClicked() {
78   -// loadData(false);
79   -// }
80   -
81 71 @Override
82 72 public void showLoading(boolean pullToRefresh) {
83 73  
... ...
cnlive/src/main/java/com/cnlive/libs/base/util/LogUtil.java
... ... @@ -2,12 +2,14 @@ package com.cnlive.libs.base.util;
2 2  
3 3 import android.util.Log;
4 4  
  5 +import com.cnlive.libs.base.application.Application;
  6 +
5 7 /**
6 8 * Log output tool
7 9 */
8 10 public class LogUtil {
9 11  
10   - private static boolean ENABLED = true;
  12 + private static boolean ENABLED = Application.isDebug();
11 13  
12 14 public static void setDebug(boolean debug){
13 15 LogUtil.ENABLED = debug;
... ...