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

Commit e664cbeb authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix a Talkback problem of BottomActionBar and BottomNavigationView" into ub-launcher3-master

parents 5e8ccd2b 20aabaf2
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;
    }

    /**