mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 03:08:19 +00:00
Hide launcher when freeform tasks are visible
This CL introduces a new controller to manage the visibility of the
launcher workspace when desktop mode is active and freeform tasks
are visible.
This controller will be notified when the sysui state flag related
to freeform task visibility is changed.
The controller will modify the workspace visibility as well as
the flags on the activity indicating if it's been paused / resumed
based on freeform tasks being visible or not.
Bug: 245569277
Test: manual - enable desktop mode and open some freeform tasks
=> observe that the contents of launcher is hidden and
taskbar shows
- remove all of the freeform tasks
=> observe that the contents of launcher reappears along
with the hotseat.
Change-Id: I378ab97b40cbb954a06f4e2426b195efddad905c
This commit is contained in:
@@ -196,8 +196,7 @@ public abstract class BaseActivity extends Activity implements AppLauncher,
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
addActivityFlags(ACTIVITY_STATE_RESUMED | ACTIVITY_STATE_USER_ACTIVE);
|
||||
removeActivityFlags(ACTIVITY_STATE_USER_WILL_BE_ACTIVE);
|
||||
setResumed();
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
@@ -228,7 +227,7 @@ public abstract class BaseActivity extends Activity implements AppLauncher,
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
removeActivityFlags(ACTIVITY_STATE_RESUMED | ACTIVITY_STATE_DEFERRED_RESUMED);
|
||||
setPaused();
|
||||
super.onPause();
|
||||
|
||||
// Reset the overridden sysui flags used for the task-swipe launch animation, we do this
|
||||
@@ -260,6 +259,21 @@ public abstract class BaseActivity extends Activity implements AppLauncher,
|
||||
return (mActivityFlags & ACTIVITY_STATE_RESUMED) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the activity to appear as paused.
|
||||
*/
|
||||
public void setPaused() {
|
||||
removeActivityFlags(ACTIVITY_STATE_RESUMED | ACTIVITY_STATE_DEFERRED_RESUMED);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the activity to appear as resumed.
|
||||
*/
|
||||
public void setResumed() {
|
||||
addActivityFlags(ACTIVITY_STATE_RESUMED | ACTIVITY_STATE_USER_ACTIVE);
|
||||
removeActivityFlags(ACTIVITY_STATE_USER_WILL_BE_ACTIVE);
|
||||
}
|
||||
|
||||
public boolean isUserActive() {
|
||||
return (mActivityFlags & ACTIVITY_STATE_USER_ACTIVE) != 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user