mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user