Commit d613f1927d5e00059810502b785dc353a01f2a0a
1 parent
9ee528fa
区分MainActivity
Showing
13 changed files
with
322 additions
and
49 deletions
app/strike/build.gradle
| @@ -47,7 +47,6 @@ android { | @@ -47,7 +47,6 @@ android { | ||
| 47 | // resValue("string", "app_name", "网家家 内测") | 47 | // resValue("string", "app_name", "网家家 内测") |
| 48 | // buildConfigField("boolean", "VERSION_AS_DEBUG", "true") | 48 | // buildConfigField("boolean", "VERSION_AS_DEBUG", "true") |
| 49 | //测试版本2 | 49 | //测试版本2 |
| 50 | -// debuggable = false | ||
| 51 | applicationIdSuffix ".debug" | 50 | applicationIdSuffix ".debug" |
| 52 | resValue("string", "app_name", "网家家 内测") | 51 | resValue("string", "app_name", "网家家 内测") |
| 53 | buildConfigField("boolean", "VERSION_AS_DEBUG", "true") | 52 | buildConfigField("boolean", "VERSION_AS_DEBUG", "true") |
app/strike/src/main/AndroidManifest.xml
| @@ -4,8 +4,8 @@ | @@ -4,8 +4,8 @@ | ||
| 4 | 4 | ||
| 5 | <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | 5 | <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> |
| 6 | <uses-permission android:name="android.permission.INTERNET" /> | 6 | <uses-permission android:name="android.permission.INTERNET" /> |
| 7 | - <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> | ||
| 8 | - <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> | 7 | + <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> |
| 8 | + <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | ||
| 9 | 9 | ||
| 10 | <application | 10 | <application |
| 11 | android:name=".MyApp" | 11 | android:name=".MyApp" |
| @@ -16,6 +16,7 @@ | @@ -16,6 +16,7 @@ | ||
| 16 | android:roundIcon="@mipmap/ic_launcher_round" | 16 | android:roundIcon="@mipmap/ic_launcher_round" |
| 17 | android:supportsRtl="true" | 17 | android:supportsRtl="true" |
| 18 | android:theme="@style/AppTheme"> | 18 | android:theme="@style/AppTheme"> |
| 19 | + <activity android:name=".demo.activity.DemoActivity" /> | ||
| 19 | <activity android:name=".MyActivity"></activity> | 20 | <activity android:name=".MyActivity"></activity> |
| 20 | <activity android:name=".MainActivity"> | 21 | <activity android:name=".MainActivity"> |
| 21 | <intent-filter> | 22 | <intent-filter> |
app/strike/src/main/java/com/cnlive/strike/MainActivity.java
| @@ -8,6 +8,8 @@ import android.view.View; | @@ -8,6 +8,8 @@ import android.view.View; | ||
| 8 | 8 | ||
| 9 | import com.cnlive.core.libs.base.frame.activity.BaseActivity; | 9 | import com.cnlive.core.libs.base.frame.activity.BaseActivity; |
| 10 | import com.cnlive.core.libs.base.interfaces.OnPermissionResponseListener; | 10 | import com.cnlive.core.libs.base.interfaces.OnPermissionResponseListener; |
| 11 | +import com.cnlive.core.libs.base.util.AppManager; | ||
| 12 | +import com.cnlive.strike.demo.activity.DemoActivity; | ||
| 11 | import com.cnlive.strike.user.ui.activity.LoginActivity; | 13 | import com.cnlive.strike.user.ui.activity.LoginActivity; |
| 12 | 14 | ||
| 13 | public class MainActivity extends BaseActivity { | 15 | public class MainActivity extends BaseActivity { |
| @@ -21,46 +23,14 @@ public class MainActivity extends BaseActivity { | @@ -21,46 +23,14 @@ public class MainActivity extends BaseActivity { | ||
| 21 | @Override | 23 | @Override |
| 22 | protected void initView() { | 24 | protected void initView() { |
| 23 | super.initView(); | 25 | super.initView(); |
| 26 | +// setOpenSwipBack(true); | ||
| 24 | findViewById(R.id.go_to).setOnClickListener(new View.OnClickListener() { | 27 | findViewById(R.id.go_to).setOnClickListener(new View.OnClickListener() { |
| 25 | @Override | 28 | @Override |
| 26 | public void onClick(View v) { | 29 | public void onClick(View v) { |
| 27 | -// startActivity(new Intent(MainActivity.this, MyActivity.class)); | ||
| 28 | - LoginActivity.start(MainActivity.this); | ||
| 29 | - | ||
| 30 | - } | ||
| 31 | - }); | ||
| 32 | - findViewById(R.id.go_to1).setOnClickListener(new View.OnClickListener() { | ||
| 33 | - @Override | ||
| 34 | - public void onClick(View v) { | ||
| 35 | - requestPermission(new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, new OnPermissionResponseListener() { | ||
| 36 | - @Override | ||
| 37 | - public void onSuccess(String[] permissions) { | ||
| 38 | - Log.e(TAG, "onSuccess: "); | ||
| 39 | - } | ||
| 40 | - | ||
| 41 | - @Override | ||
| 42 | - public void onFail() { | ||
| 43 | - Log.e(TAG, "onFail: "); | ||
| 44 | - } | ||
| 45 | - }); | 30 | + startActivity(new Intent(MainActivity.this, DemoActivity.class)); |
| 46 | } | 31 | } |
| 47 | }); | 32 | }); |
| 48 | - findViewById(R.id.go_to2).setOnClickListener(new View.OnClickListener() { | ||
| 49 | - @Override | ||
| 50 | - public void onClick(View v) { | ||
| 51 | - requestPermission(10010, "拒绝我了", new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, new OnPermissionResponseListener() { | ||
| 52 | - @Override | ||
| 53 | - public void onSuccess(String[] permissions) { | ||
| 54 | - Log.e(TAG, "onSuccess: "); | ||
| 55 | - } | ||
| 56 | 33 | ||
| 57 | - @Override | ||
| 58 | - public void onFail() { | ||
| 59 | - Log.e(TAG, "onFail: "); | ||
| 60 | - } | ||
| 61 | - }); | ||
| 62 | - } | ||
| 63 | - }); | ||
| 64 | } | 34 | } |
| 65 | 35 | ||
| 66 | 36 |
app/strike/src/main/java/com/cnlive/strike/MyApp.java
| @@ -4,8 +4,9 @@ import android.app.Application; | @@ -4,8 +4,9 @@ import android.app.Application; | ||
| 4 | 4 | ||
| 5 | import com.alibaba.android.arouter.launcher.ARouter; | 5 | import com.alibaba.android.arouter.launcher.ARouter; |
| 6 | import com.cnlive.core.libs.base.application.AppConfig; | 6 | import com.cnlive.core.libs.base.application.AppConfig; |
| 7 | +import com.cnlive.core.libs.base.application.BaseApplication; | ||
| 7 | 8 | ||
| 8 | -public class MyApp extends Application { | 9 | +public class MyApp extends BaseApplication { |
| 9 | @Override | 10 | @Override |
| 10 | public void onCreate() { | 11 | public void onCreate() { |
| 11 | super.onCreate(); | 12 | super.onCreate(); |
app/strike/src/main/java/com/cnlive/strike/demo/activity/DemoActivity.java
0 → 100644
| 1 | +package com.cnlive.strike.demo.activity; | ||
| 2 | + | ||
| 3 | +import android.Manifest; | ||
| 4 | +import android.util.Log; | ||
| 5 | +import android.view.View; | ||
| 6 | + | ||
| 7 | +import com.cnlive.core.libs.base.frame.activity.BaseActivity; | ||
| 8 | +import com.cnlive.core.libs.base.interfaces.OnPermissionResponseListener; | ||
| 9 | +import com.cnlive.core.libs.base.util.StatusBarConfig; | ||
| 10 | +import com.cnlive.strike.R; | ||
| 11 | + | ||
| 12 | +/** | ||
| 13 | + * 继承BaseActivity | ||
| 14 | + * 会自动管理网络请求,默认在Destory中解除订阅 | ||
| 15 | + */ | ||
| 16 | +public class DemoActivity extends BaseActivity { | ||
| 17 | + /** | ||
| 18 | + * 设置成普通view视图与getBindLayoutId()选一个即可 | ||
| 19 | + * | ||
| 20 | + * @return | ||
| 21 | + */ | ||
| 22 | + @Override | ||
| 23 | + protected int getViewLayoutId() { | ||
| 24 | + return R.layout.activity_demo_main; | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + /** | ||
| 28 | + * 设置binding布局 | ||
| 29 | + * 使用该布局,一定要设置自己的binding | ||
| 30 | + * | ||
| 31 | + * @return | ||
| 32 | + */ | ||
| 33 | + @Override | ||
| 34 | + protected int getBindLayoutId() { | ||
| 35 | + return super.getBindLayoutId(); | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + @Override | ||
| 39 | + protected void initBindingData() { | ||
| 40 | + super.initBindingData(); | ||
| 41 | +// binding=(你的bingding)baseBinding; | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + /** | ||
| 45 | + * 初始化intent传递参数 | ||
| 46 | + */ | ||
| 47 | + @Override | ||
| 48 | + protected void initParam() { | ||
| 49 | + super.initParam(); | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + /** | ||
| 53 | + * 初始化视图 | ||
| 54 | + */ | ||
| 55 | + @Override | ||
| 56 | + protected void initView() { | ||
| 57 | + super.initView(); | ||
| 58 | + //是指是否可以侧滑返回,默认禁用 | ||
| 59 | + setOpenSwipBack(true); | ||
| 60 | + //设置状态栏字体颜色 | ||
| 61 | + setStatusBarTextColor(StatusBarConfig.WHITE); | ||
| 62 | + //设置状态栏颜色 | ||
| 63 | + setStatusBarColor(R.color.green, 0); | ||
| 64 | + //判断字符串是否为空 | ||
| 65 | + String s = "123"; | ||
| 66 | + isNull(s); | ||
| 67 | + //是否显示状态栏,默认显示 | ||
| 68 | + setShowStatusBar(true); | ||
| 69 | + //隐藏键盘 | ||
| 70 | + hideSoftInput(); | ||
| 71 | + //显示键盘 | ||
| 72 | + showSoftInput(); | ||
| 73 | + //dp2px | ||
| 74 | + dp2px(10); | ||
| 75 | + //px2dp | ||
| 76 | + px2dp(10); | ||
| 77 | + | ||
| 78 | +// String[] permissions = new String[]{Manifest.permission.ACCESS_FINE_LOCATION, | ||
| 79 | +// Manifest.permission.ACCESS_COARSE_LOCATION}; | ||
| 80 | +// //请求权限(默认提示语的) | ||
| 81 | +// requestPermission(permissions, new OnPermissionResponseListener() { | ||
| 82 | +// @Override | ||
| 83 | +// public void onSuccess(String[] permissions) { | ||
| 84 | +// | ||
| 85 | +// } | ||
| 86 | +// | ||
| 87 | +// @Override | ||
| 88 | +// public void onFail() { | ||
| 89 | +// | ||
| 90 | +// } | ||
| 91 | +// }); | ||
| 92 | +// //请求权限,自定义状态码,使用默认提示语 | ||
| 93 | +// requestPermission(1001, permissions, new OnPermissionResponseListener() { | ||
| 94 | +// @Override | ||
| 95 | +// public void onSuccess(String[] permissions) { | ||
| 96 | +// | ||
| 97 | +// } | ||
| 98 | +// | ||
| 99 | +// @Override | ||
| 100 | +// public void onFail() { | ||
| 101 | +// | ||
| 102 | +// } | ||
| 103 | +// }); | ||
| 104 | +// //请求权限,自定义状态码,自定义拒绝提示语 | ||
| 105 | +// requestPermission(1001, "拒绝提示语", permissions, new OnPermissionResponseListener() { | ||
| 106 | +// @Override | ||
| 107 | +// public void onSuccess(String[] permissions) { | ||
| 108 | +// | ||
| 109 | +// } | ||
| 110 | +// | ||
| 111 | +// @Override | ||
| 112 | +// public void onFail() { | ||
| 113 | +// | ||
| 114 | +// } | ||
| 115 | +// }); | ||
| 116 | + | ||
| 117 | + findViewById(R.id.go_to1).setOnClickListener(new View.OnClickListener() { | ||
| 118 | + @Override | ||
| 119 | + public void onClick(View v) { | ||
| 120 | + logError("Ada"); | ||
| 121 | + requestPermission(new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, new OnPermissionResponseListener() { | ||
| 122 | + @Override | ||
| 123 | + public void onSuccess(String[] permissions) { | ||
| 124 | + Log.e(TAG, "onSuccess: "); | ||
| 125 | + } | ||
| 126 | + | ||
| 127 | + @Override | ||
| 128 | + public void onFail() { | ||
| 129 | + Log.e(TAG, "onFail: "); | ||
| 130 | + } | ||
| 131 | + }); | ||
| 132 | + } | ||
| 133 | + }); | ||
| 134 | + findViewById(R.id.go_to2).setOnClickListener(new View.OnClickListener() { | ||
| 135 | + @Override | ||
| 136 | + public void onClick(View v) { | ||
| 137 | + requestPermission(10010, "拒绝我了", new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, new OnPermissionResponseListener() { | ||
| 138 | + @Override | ||
| 139 | + public void onSuccess(String[] permissions) { | ||
| 140 | + Log.e(TAG, "onSuccess: "); | ||
| 141 | + } | ||
| 142 | + | ||
| 143 | + @Override | ||
| 144 | + public void onFail() { | ||
| 145 | + Log.e(TAG, "onFail: "); | ||
| 146 | + } | ||
| 147 | + }); | ||
| 148 | + } | ||
| 149 | + }); | ||
| 150 | + } | ||
| 151 | + | ||
| 152 | + /** | ||
| 153 | + * 设置数据 | ||
| 154 | + */ | ||
| 155 | + @Override | ||
| 156 | + protected void initData() { | ||
| 157 | + super.initData(); | ||
| 158 | + } | ||
| 159 | + | ||
| 160 | + | ||
| 161 | +} |
app/strike/src/main/java/com/cnlive/strike/demo/activity/DemoMvpActivity.java
0 → 100644
| 1 | +package com.cnlive.strike.demo.activity; | ||
| 2 | + | ||
| 3 | +import com.cnlive.core.libs.base.frame.activity.BaseActivity; | ||
| 4 | +import com.cnlive.strike.demo.activity.presenter.DemoActivityPresenter; | ||
| 5 | +import com.cnlive.strike.demo.activity.view.DemoActivityView; | ||
| 6 | + | ||
| 7 | +public class DemoMvpActivity extends BaseActivity<DemoActivityView, DemoActivityPresenter> { | ||
| 8 | + @Override | ||
| 9 | + protected void initView() { | ||
| 10 | + super.initView(); | ||
| 11 | +// 方法同DemoActivity | ||
| 12 | + if (null != getMvpView()) { | ||
| 13 | + getMvpView().initView(); | ||
| 14 | + } | ||
| 15 | + } | ||
| 16 | +} |
app/strike/src/main/java/com/cnlive/strike/demo/activity/presenter/DemoActivityPresenter.java
0 → 100644
| 1 | +package com.cnlive.strike.demo.activity.presenter; | ||
| 2 | + | ||
| 3 | +import com.cnlive.core.libs.base.frame.presenter.BasePresenter; | ||
| 4 | +import com.cnlive.strike.demo.activity.view.DemoActivityView; | ||
| 5 | + | ||
| 6 | +public class DemoActivityPresenter extends BasePresenter<DemoActivityView> { | ||
| 7 | + public void test() { | ||
| 8 | + //使用view中的方法 | ||
| 9 | + ifViewAttached(view -> view.initData()); | ||
| 10 | + } | ||
| 11 | +} |
app/strike/src/main/java/com/cnlive/strike/demo/activity/view/DemoActivityView.java
0 → 100644
| 1 | +package com.cnlive.strike.demo.activity.view; | ||
| 2 | + | ||
| 3 | +import com.cnlive.core.libs.base.frame.view.BaseView; | ||
| 4 | +import com.cnlive.strike.demo.activity.DemoMvpActivity; | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * 继承BaseView | ||
| 8 | + */ | ||
| 9 | +public class DemoActivityView extends BaseView { | ||
| 10 | + private DemoMvpActivity activity; | ||
| 11 | + | ||
| 12 | + /** | ||
| 13 | + * 如果写了需要传递参数的构造方法, | ||
| 14 | + * 会自动赋值,只限在,Activity或者fragment<V,P>,V为DemoActivityView时才生效 | ||
| 15 | + * | ||
| 16 | + * @param activity | ||
| 17 | + */ | ||
| 18 | + public DemoActivityView(DemoMvpActivity activity) { | ||
| 19 | + this.activity = activity; | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | + @Override | ||
| 23 | + public void initView() { | ||
| 24 | + super.initView(); | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + @Override | ||
| 28 | + public void initData() { | ||
| 29 | + super.initData(); | ||
| 30 | + } | ||
| 31 | +} |
app/strike/src/main/res/layout/activity_demo_main.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<layout> | ||
| 3 | + | ||
| 4 | + <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 5 | + xmlns:app="http://schemas.android.com/apk/res-auto" | ||
| 6 | + xmlns:tools="http://schemas.android.com/tools" | ||
| 7 | + android:layout_width="match_parent" | ||
| 8 | + android:layout_height="match_parent" | ||
| 9 | + android:orientation="vertical" | ||
| 10 | + tools:context=".ui.activity.AllDeviceActivity"> | ||
| 11 | + | ||
| 12 | + <Button | ||
| 13 | + android:id="@+id/go_to" | ||
| 14 | + android:layout_width="wrap_content" | ||
| 15 | + android:layout_height="wrap_content" | ||
| 16 | + android:text="跳转" /> | ||
| 17 | + | ||
| 18 | + | ||
| 19 | + <Button | ||
| 20 | + android:id="@+id/go_to1" | ||
| 21 | + android:layout_width="wrap_content" | ||
| 22 | + android:layout_height="wrap_content" | ||
| 23 | + android:text="请求权限默认提示语" /> | ||
| 24 | + | ||
| 25 | + <Button | ||
| 26 | + android:id="@+id/go_to2" | ||
| 27 | + android:layout_width="wrap_content" | ||
| 28 | + android:layout_height="wrap_content" | ||
| 29 | + android:text="请求权限自定义提示语" /> | ||
| 30 | + </LinearLayout> | ||
| 31 | +</layout> | ||
| 0 | \ No newline at end of file | 32 | \ No newline at end of file |
app/strike/src/main/res/layout/activity_main.xml
| @@ -15,17 +15,6 @@ | @@ -15,17 +15,6 @@ | ||
| 15 | android:layout_height="wrap_content" | 15 | android:layout_height="wrap_content" |
| 16 | android:text="跳转" /> | 16 | android:text="跳转" /> |
| 17 | 17 | ||
| 18 | - <Button | ||
| 19 | - android:id="@+id/go_to1" | ||
| 20 | - android:layout_width="wrap_content" | ||
| 21 | - android:layout_height="wrap_content" | ||
| 22 | - android:text="请求权限默认提示语" /> | ||
| 23 | - | ||
| 24 | - <Button | ||
| 25 | - android:id="@+id/go_to2" | ||
| 26 | - android:layout_width="wrap_content" | ||
| 27 | - android:layout_height="wrap_content" | ||
| 28 | - android:text="请求权限自定义提示语" /> | ||
| 29 | 18 | ||
| 30 | </LinearLayout> | 19 | </LinearLayout> |
| 31 | </layout> | 20 | </layout> |
| 32 | \ No newline at end of file | 21 | \ No newline at end of file |
config.gradle
| @@ -47,6 +47,7 @@ ext { | @@ -47,6 +47,7 @@ ext { | ||
| 47 | ] | 47 | ] |
| 48 | 48 | ||
| 49 | library = [ | 49 | library = [ |
| 50 | + logger : 'com.orhanobut:logger:2.2.0', | ||
| 50 | // //空祖对话框 https://github.com/kongzue/DialogV3 | 51 | // //空祖对话框 https://github.com/kongzue/DialogV3 |
| 51 | // kongzueDailog : 'com.kongzue.dialog_v3x:dialog:3.1.6', | 52 | // kongzueDailog : 'com.kongzue.dialog_v3x:dialog:3.1.6', |
| 52 | //视讯云加密 | 53 | //视讯云加密 |
| @@ -100,6 +101,7 @@ ext { | @@ -100,6 +101,7 @@ ext { | ||
| 100 | // ] | 101 | // ] |
| 101 | //基础三方库 | 102 | //基础三方库 |
| 102 | base_librarys = [ | 103 | base_librarys = [ |
| 104 | + library.logger, | ||
| 103 | //对话框 | 105 | //对话框 |
| 104 | // library.kongzueDailog, | 106 | // library.kongzueDailog, |
| 105 | //视讯云加密库 | 107 | //视讯云加密库 |
core/base/src/main/java/com/cnlive/core/libs/base/application/BaseApplication.java
0 → 100644
| 1 | +package com.cnlive.core.libs.base.application; | ||
| 2 | + | ||
| 3 | +import android.app.Application; | ||
| 4 | + | ||
| 5 | +import com.cnlive.strike.base.BuildConfig; | ||
| 6 | +import com.orhanobut.logger.AndroidLogAdapter; | ||
| 7 | +import com.orhanobut.logger.Logger; | ||
| 8 | + | ||
| 9 | +public class BaseApplication extends Application { | ||
| 10 | + private static BaseApplication instance; | ||
| 11 | + | ||
| 12 | + @Override | ||
| 13 | + public void onCreate() { | ||
| 14 | + super.onCreate(); | ||
| 15 | + instance = this; | ||
| 16 | + Logger.addLogAdapter(new AndroidLogAdapter() { | ||
| 17 | + @Override | ||
| 18 | + public boolean isLoggable(int priority, String tag) { | ||
| 19 | + return AppConfig.isDebug(); | ||
| 20 | + } | ||
| 21 | + }); | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + public static BaseApplication getInstance() { | ||
| 25 | + return instance; | ||
| 26 | + } | ||
| 27 | +} |
core/base/src/main/java/com/cnlive/core/libs/base/frame/activity/BaseActivity.java
| @@ -42,6 +42,7 @@ import com.cnlive.core.libs.base.util.swipeback.util.SwipeBackActivityHelper; | @@ -42,6 +42,7 @@ import com.cnlive.core.libs.base.util.swipeback.util.SwipeBackActivityHelper; | ||
| 42 | import com.cnlive.core.libs.base.util.swipeback.util.SwipeBackLayout; | 42 | import com.cnlive.core.libs.base.util.swipeback.util.SwipeBackLayout; |
| 43 | import com.cnlive.core.libs.base.util.swipeback.util.SwipeBackUtil; | 43 | import com.cnlive.core.libs.base.util.swipeback.util.SwipeBackUtil; |
| 44 | import com.hannesdorfmann.mosby3.mvp.MvpActivity; | 44 | import com.hannesdorfmann.mosby3.mvp.MvpActivity; |
| 45 | +import com.orhanobut.logger.Logger; | ||
| 45 | 46 | ||
| 46 | import java.lang.reflect.Field; | 47 | import java.lang.reflect.Field; |
| 47 | import java.util.ArrayList; | 48 | import java.util.ArrayList; |
| @@ -75,6 +76,7 @@ public abstract class BaseActivity<V extends BaseView, P extends BasePresenter<V | @@ -75,6 +76,7 @@ public abstract class BaseActivity<V extends BaseView, P extends BasePresenter<V | ||
| 75 | private String userSetDefinePermissionTip = "";//用户设置的权限提示语 | 76 | private String userSetDefinePermissionTip = "";//用户设置的权限提示语 |
| 76 | private SwipeBackActivityHelper mHelper;//侧滑返回 | 77 | private SwipeBackActivityHelper mHelper;//侧滑返回 |
| 77 | private boolean isOpenSwipBack = false; | 78 | private boolean isOpenSwipBack = false; |
| 79 | + private AlertDialog alertDialog; | ||
| 78 | 80 | ||
| 79 | @Override | 81 | @Override |
| 80 | protected void onCreate(@Nullable Bundle savedInstanceState) { | 82 | protected void onCreate(@Nullable Bundle savedInstanceState) { |
| @@ -237,6 +239,9 @@ public abstract class BaseActivity<V extends BaseView, P extends BasePresenter<V | @@ -237,6 +239,9 @@ public abstract class BaseActivity<V extends BaseView, P extends BasePresenter<V | ||
| 237 | @Override | 239 | @Override |
| 238 | protected void onDestroy() { | 240 | protected void onDestroy() { |
| 239 | super.onDestroy(); | 241 | super.onDestroy(); |
| 242 | + if (null != alertDialog) { | ||
| 243 | + alertDialog.dismiss(); | ||
| 244 | + } | ||
| 240 | //activity管理 | 245 | //activity管理 |
| 241 | AppManager.getInstance().deleteActivity(me); | 246 | AppManager.getInstance().deleteActivity(me); |
| 242 | //清除所有订阅 | 247 | //清除所有订阅 |
| @@ -610,4 +615,33 @@ public abstract class BaseActivity<V extends BaseView, P extends BasePresenter<V | @@ -610,4 +615,33 @@ public abstract class BaseActivity<V extends BaseView, P extends BasePresenter<V | ||
| 610 | getSwipeBackLayout().scrollToFinishActivity(); | 615 | getSwipeBackLayout().scrollToFinishActivity(); |
| 611 | } | 616 | } |
| 612 | } | 617 | } |
| 618 | + | ||
| 619 | + | ||
| 620 | + public void logError(Object info) { | ||
| 621 | + Logger.e(TAG, info); | ||
| 622 | + } | ||
| 623 | + | ||
| 624 | + public void logDebug(Object info) { | ||
| 625 | + Logger.d(TAG, info); | ||
| 626 | + } | ||
| 627 | + | ||
| 628 | + public void logWarn(Object info) { | ||
| 629 | + Logger.w(TAG, info); | ||
| 630 | + } | ||
| 631 | + | ||
| 632 | + public void logInfo(Object info) { | ||
| 633 | + Logger.i(TAG, info); | ||
| 634 | + } | ||
| 635 | + | ||
| 636 | + public void logVerbose(Object info) { | ||
| 637 | + Logger.v(TAG, info); | ||
| 638 | + } | ||
| 639 | + | ||
| 640 | + public void logJson(String json) { | ||
| 641 | + Logger.json(json); | ||
| 642 | + } | ||
| 643 | + | ||
| 644 | + public void logXml(String xml) { | ||
| 645 | + Logger.xml(xml); | ||
| 646 | + } | ||
| 613 | } | 647 | } |
| 614 | \ No newline at end of file | 648 | \ No newline at end of file |