mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 10:48:19 +00:00
Fix the cutout of magnification border
If the window is unmagnifiable, it might cause the cutout of
magnification region.
To fix it, we set the flag when the touchable region is not the
entier window frame.
To fix NexusLauncherTests, we add a flag to avoid updateViewLayout
too frequently that would impact memory test and have the performance
issue.
Bug: 196510717
Test: manual test on gestural and 3-button navigation
presumbit test pass
run atest NexusLauncherTests with foldables
Change-Id: Ifef81640fe6c08ee1b0dcd3915227fba3002ea43
Merged-In: Ifef81640fe6c08ee1b0dcd3915227fba3002ea43
(cherry picked from commit c8d588cff6)
This commit is contained in:
@@ -61,7 +61,6 @@ import com.android.launcher3.folder.FolderIcon;
|
||||
import com.android.launcher3.logger.LauncherAtom;
|
||||
import com.android.launcher3.model.data.FolderInfo;
|
||||
import com.android.launcher3.model.data.WorkspaceItemInfo;
|
||||
import com.android.launcher3.testing.TestProtocol;
|
||||
import com.android.launcher3.touch.ItemClickHandler;
|
||||
import com.android.launcher3.util.PackageManagerHelper;
|
||||
import com.android.launcher3.util.SettingsCache;
|
||||
@@ -108,6 +107,8 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
|
||||
private final boolean mIsSafeModeEnabled;
|
||||
private final boolean mIsUserSetupComplete;
|
||||
private boolean mIsDestroyed = false;
|
||||
// The flag to know if the window is excluded from magnification region computation.
|
||||
private boolean mIsExcludeFromMagnificationRegion = false;
|
||||
|
||||
public TaskbarActivityContext(Context windowContext, DeviceProfile dp,
|
||||
TaskbarNavButtonController buttonController, ScopedUnfoldTransitionProgressProvider
|
||||
@@ -520,4 +521,25 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
|
||||
protected boolean isUserSetupComplete() {
|
||||
return mIsUserSetupComplete;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when we determine the touchable region.
|
||||
*
|
||||
* @param exclude {@code true} then the magnification region computation will omit the window.
|
||||
*/
|
||||
public void excludeFromMagnificationRegion(boolean exclude) {
|
||||
if (mIsExcludeFromMagnificationRegion == exclude) {
|
||||
return;
|
||||
}
|
||||
|
||||
mIsExcludeFromMagnificationRegion = exclude;
|
||||
if (exclude) {
|
||||
mWindowLayoutParams.privateFlags |=
|
||||
WindowManager.LayoutParams.PRIVATE_FLAG_EXCLUDE_FROM_SCREEN_MAGNIFICATION;
|
||||
} else {
|
||||
mWindowLayoutParams.privateFlags &=
|
||||
~WindowManager.LayoutParams.PRIVATE_FLAG_EXCLUDE_FROM_SCREEN_MAGNIFICATION;
|
||||
}
|
||||
mWindowManager.updateViewLayout(mDragLayer, mWindowLayoutParams);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user