Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
lianglei committed Aug 7, 2019
1 parent c8032c4 commit 799fafa
Showing 1 changed file with 2 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
* @data:2018/3/28 下午1:00
* @描述: Activity基类
*/
public class PictureBaseActivity extends FragmentActivity implements LifecycleOwner {
public class PictureBaseActivity extends FragmentActivity {
protected Context mContext;
protected PictureSelectionConfig config;
protected boolean openWhiteStatusBar, numComplete;
Expand All @@ -61,7 +61,6 @@ public class PictureBaseActivity extends FragmentActivity implements LifecycleOw
protected PictureDialog dialog;
protected PictureDialog compressDialog;
protected List<LocalMedia> selectionMedias;
private LifecycleRegistry mLifecycleRegistry = new LifecycleRegistry(this);
/**
* 是否使用沉浸式,子类复写该方法来确定是否采用沉浸式
*
Expand All @@ -84,12 +83,11 @@ public void immersive() {

@Override
public Lifecycle getLifecycle() {
return mLifecycleRegistry;
return super.getLifecycle();
}

@Override
protected void onCreate(Bundle savedInstanceState) {
mLifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_CREATE);
if (savedInstanceState != null) {
config = savedInstanceState.getParcelable(PictureConfig.EXTRA_CONFIG);
cameraPath = savedInstanceState.getString(PictureConfig.BUNDLE_CAMERA_PATH);
Expand Down Expand Up @@ -134,7 +132,6 @@ private void initConfig() {

@Override
protected void onSaveInstanceState(Bundle outState) {
mLifecycleRegistry.markState(Lifecycle.State.CREATED);
super.onSaveInstanceState(outState);
outState.putString(PictureConfig.BUNDLE_CAMERA_PATH, cameraPath);
outState.putString(PictureConfig.BUNDLE_ORIGINAL_PATH, originalPath);
Expand Down Expand Up @@ -465,7 +462,6 @@ protected void closeActivity() {

@Override
protected void onDestroy() {
mLifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_DESTROY);
super.onDestroy();
dismissCompressDialog();
dismissDialog();
Expand Down Expand Up @@ -575,28 +571,4 @@ protected String getAudioFilePathFromUri(Uri uri) {
}
return path;
}

@Override
protected void onStart() {
mLifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_START);
super.onStart();
}

@Override
protected void onStop() {
mLifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_STOP);
super.onStop();
}

@Override
protected void onResume() {
mLifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_RESUME);
super.onResume();
}

@Override
protected void onPause() {
mLifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_PAUSE);
super.onPause();
}
}

0 comments on commit 799fafa

Please sign in to comment.