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

Commit 27d1033e authored by Wesley.CW Wang's avatar Wesley.CW Wang
Browse files

Fix A11y tools focus on blocked component 1/2

 - Add a callback to BottomActionBar, let the registrant receive BottomActionBar's state and disable the a11y param when expended
 video: https://drive.google.com/file/d/1T1w1bnAoQYvgpdSa7eYsFPOspjWV4hEP/view?usp=sharing

 Bug: 157871987
 Test: manually

Change-Id: Idb7e49377782e7e2f8b382c8c26aa1388cbe8e58
parent 42cf9daa
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ import com.android.wallpaper.module.CurrentWallpaperInfoFactory;
import com.android.wallpaper.module.InjectorProvider;
import com.android.wallpaper.picker.AppbarFragment;
import com.android.wallpaper.widget.BottomActionBar;
import com.android.wallpaper.widget.BottomActionBar.AccessibilityCallback;

import java.util.List;

@@ -166,6 +167,22 @@ public class ThemeFragment extends AppbarFragment {
                R.layout.theme_info_view, /* root= */ null);
        mBottomActionBar.attachViewToBottomSheetAndBindAction(mThemeInfoView, INFORMATION);
        mBottomActionBar.setActionClickListener(CUSTOMIZE, this::onCustomizeClicked);

        // Update target view's accessibility param since it will be blocked by the bottom sheet
        // when expanded.
        mBottomActionBar.setAccessibilityCallback(new AccessibilityCallback() {
            @Override
            public void onBottomSheetCollapsed() {
                mOptionsContainer.setImportantForAccessibility(
                        View.IMPORTANT_FOR_ACCESSIBILITY_YES);
            }

            @Override
            public void onBottomSheetExpanded() {
                mOptionsContainer.setImportantForAccessibility(
                        View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS);
            }
        });
    }

    @Override