|
@@ -6,6 +6,7 @@ import android.view.View;
|
|
|
import androidx.annotation.Nullable;
|
|
import androidx.annotation.Nullable;
|
|
|
import androidx.appcompat.widget.Toolbar;
|
|
import androidx.appcompat.widget.Toolbar;
|
|
|
|
|
|
|
|
|
|
+import com.jude.swipbackhelper.SwipeBackHelper;
|
|
|
import com.miekir.eden.R;
|
|
import com.miekir.eden.R;
|
|
|
import com.miekir.mvp.view.BaseMVPActivity;
|
|
import com.miekir.mvp.view.BaseMVPActivity;
|
|
|
|
|
|
|
@@ -19,9 +20,33 @@ import com.miekir.mvp.view.BaseMVPActivity;
|
|
|
public abstract class BaseBeiActivity extends BaseMVPActivity {
|
|
public abstract class BaseBeiActivity extends BaseMVPActivity {
|
|
|
private View iv_done;
|
|
private View iv_done;
|
|
|
|
|
|
|
|
|
|
+ protected boolean canSwipeBack() {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ protected void onPostCreate(@Nullable Bundle savedInstanceState) {
|
|
|
|
|
+ super.onPostCreate(savedInstanceState);
|
|
|
|
|
+ if (canSwipeBack()) {
|
|
|
|
|
+ SwipeBackHelper.onPostCreate(this);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ protected void onDestroy() {
|
|
|
|
|
+ super.onDestroy();
|
|
|
|
|
+ if (canSwipeBack()) {
|
|
|
|
|
+ SwipeBackHelper.onDestroy(this);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
|
super.onCreate(savedInstanceState);
|
|
super.onCreate(savedInstanceState);
|
|
|
|
|
+ if (canSwipeBack()) {
|
|
|
|
|
+ SwipeBackHelper.onCreate(this);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 状态栏深色模式,改变状态栏文字颜色(白底黑字)
|
|
// 状态栏深色模式,改变状态栏文字颜色(白底黑字)
|
|
|
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
|
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
|
|
// getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN|View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
|
|
// getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN|View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
|