@@ -71,6 +71,7 @@ static class NavbarViewInfo {
71
71
View originalView ;
72
72
KeyButtonView appLauncherView ;
73
73
int position ;
74
+ boolean visible ;
74
75
}
75
76
76
77
private static BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver () {
@@ -261,7 +262,7 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
261
262
XposedHelpers .findAndHookMethod (navbarViewClass , "setDisabledFlags" ,
262
263
int .class , boolean .class , new XC_MethodHook () {
263
264
@ Override
264
- protected void beforeHookedMethod (MethodHookParam param ) throws Throwable {
265
+ protected void afterHookedMethod (MethodHookParam param ) throws Throwable {
265
266
boolean visible = mAppLauncherEnabled ;
266
267
View v = (View ) XposedHelpers .callMethod (param .thisObject , "getRecentsButton" );
267
268
if (v != null ) {
@@ -346,6 +347,8 @@ private static void prepareNavbarViewInfo(ViewGroup navButtons, int index, KeyBu
346
347
private static void setAppKeyVisibility (boolean visible ) {
347
348
try {
348
349
for (int i = 0 ; i <= 1 ; i ++) {
350
+ if (mNavbarViewInfo [i ].visible == visible ) continue ;
351
+
349
352
if (mNavbarViewInfo [i ].originalView != null ) {
350
353
mNavbarViewInfo [i ].navButtons .removeViewAt (mNavbarViewInfo [i ].position );
351
354
mNavbarViewInfo [i ].navButtons .addView (visible ?
@@ -359,6 +362,9 @@ private static void setAppKeyVisibility(boolean visible) {
359
362
mNavbarViewInfo [i ].navButtons .removeView (mNavbarViewInfo [i ].appLauncherView );
360
363
}
361
364
}
365
+ mNavbarViewInfo [i ].visible = visible ;
366
+ mNavbarViewInfo [i ].navButtons .requestLayout ();
367
+ if (DEBUG ) log ("setAppKeyVisibility: visible=" + visible );
362
368
}
363
369
} catch (Throwable t ) {
364
370
log ("Error setting app key visibility: " + t .getMessage ());
0 commit comments