mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 08:16:49 +00:00
Add variable to check if button should apply keyboard insets
bug: 251460671 test: manual Change-Id: I90045c96c0fbf385ad8dd5978089491f3f106dd8
This commit is contained in:
@@ -52,6 +52,7 @@ public class WorkModeSwitch extends Button implements Insettable, View.OnClickLi
|
||||
private int mFlags;
|
||||
private boolean mWorkEnabled;
|
||||
private boolean mOnWorkTab;
|
||||
private boolean mApplyWindowInset;
|
||||
|
||||
public WorkModeSwitch(Context context) {
|
||||
this(context, null, 0);
|
||||
@@ -168,7 +169,7 @@ public class WorkModeSwitch extends Button implements Insettable, View.OnClickLi
|
||||
|
||||
@Override
|
||||
public WindowInsets onApplyWindowInsets(WindowInsets insets) {
|
||||
if (!Utilities.ATLEAST_R) {
|
||||
if (!Utilities.ATLEAST_R || !mApplyWindowInset) {
|
||||
return insets;
|
||||
}
|
||||
if (insets.isVisible(WindowInsets.Type.ime())) {
|
||||
@@ -197,4 +198,8 @@ public class WorkModeSwitch extends Button implements Insettable, View.OnClickLi
|
||||
private void removeFlag(int flag) {
|
||||
mFlags &= ~flag;
|
||||
}
|
||||
|
||||
public void setApplyWindowInset(boolean applyWindowInset){
|
||||
mApplyWindowInset = applyWindowInset;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user