Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20aabaf2 authored by chihhangchuang's avatar chihhangchuang
Browse files

Fix a Talkback problem of BottomActionBar and BottomNavigationView

Problem: Talkback will navigate to BottomNavigationView when BottomActionBar is visible. Video: https://drive.google.com/a/google.com/file/d/1ednveuPqoRovWduPEKWjykeDu46EA6QA/view?usp=sharing

Fix: Hide the BottomNavigationView when BottomActionBar is visible. Video: https://drive.google.com/a/google.com/file/d/1OVjVbwQY4NlJvHYd5wwg6mtsrAFTmfmk/view?usp=sharing

Test: Manually
Bug: 151892004
Change-Id: I874dd10190d0e5b0b4e3f9d57f273c15ec28e97b
parent addb7f3d
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.util.Log;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;

import androidx.annotation.IdRes;
import androidx.annotation.NonNull;
@@ -101,6 +102,7 @@ public class CustomizationPickerActivity extends FragmentActivity implements Wal

    private static final Map<Integer, CustomizationSection> mSections = new HashMap<>();
    private CategoryFragment mWallpaperCategoryFragment;
    private BottomActionBar mBottomActionBar;

    private boolean mWallpaperCategoryInitialized;

@@ -137,6 +139,15 @@ public class CustomizationPickerActivity extends FragmentActivity implements Wal
                                ? R.id.nav_wallpaper : R.id.nav_theme);
            }
        }

        mBottomActionBar = findViewById(R.id.bottom_actionbar);
        mBottomActionBar.getViewTreeObserver().addOnGlobalLayoutListener(() -> {
            // Only update the visibility of mBottomNav when mBottomActionBar visibility changes.
            // Since the listener will be triggered by mBottomActionBar and its child views.
            if (mBottomActionBar.getVisibility() == mBottomNav.getVisibility()) {
                mBottomNav.setVisibility(mBottomActionBar.isVisible() ? View.GONE : View.VISIBLE);
            }
        });
    }

    @Override
@@ -413,7 +424,7 @@ public class CustomizationPickerActivity extends FragmentActivity implements Wal

    @Override
    public BottomActionBar getBottomActionBar() {
        return findViewById(R.id.bottom_actionbar);
        return mBottomActionBar;
    }

    /**