alter view root visibility only when screen-lock is enabled. this is for performance and general compatibility reasons, no special screenlock-code should run if screen-lock is disalbed..

This commit is contained in:
B. Petersen
2019-02-22 15:29:47 +01:00
parent d649f74a6e
commit 8df079eaf8
@@ -28,6 +28,7 @@ public abstract class BaseActionBarActivity extends AppCompatActivity {
private Timer timer;
private boolean isWaitingForResult;
private boolean isHiddenByScreenLock;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -41,8 +42,9 @@ public abstract class BaseActionBarActivity extends AppCompatActivity {
protected void onStart() {
if (ScreenLockUtil.isScreenLockEnabled(this) && ScreenLockUtil.getShouldLockApp() && !isWaitingForResult) {
ScreenLockUtil.applyScreenLock(this);
} else {
} else if (isHiddenByScreenLock) {
findViewById(android.R.id.content).setVisibility(View.VISIBLE);
isHiddenByScreenLock = false;
}
super.onStart();
}
@@ -51,6 +53,7 @@ public abstract class BaseActionBarActivity extends AppCompatActivity {
protected void onStop() {
if (ScreenLockUtil.isScreenLockEnabled(this)) {
findViewById(android.R.id.content).setVisibility(View.GONE);
isHiddenByScreenLock = true;
}
super.onStop();
}