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

Commit 91baee8d authored by Yi-an Chen's avatar Yi-an Chen
Browse files

Fix back button circle style in expressive theme

According to BC25 style guideline, there should be circle around the
back button in setting screens. SC and PC didn't have this expressive
style because the action bar was returning null in
CollapsingToolbarBaseFragment. In this CL, change this behavior to be
returning the action bar object when expressive theme is enabled.

Test: manual and CtsPermissionUiTestCases
Flag: com.android.settingslib.widget.theme.flags.is_expressive_design_enabled
Bug: 419658752
Change-Id: Id9279cbfbde4b873b5a349f8ebe2c375e9f4aa16
parent 908799c4
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -30,6 +30,8 @@ import androidx.annotation.Nullable;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.fragment.app.Fragment;

import com.android.settingslib.widget.SettingsThemeHelper;

import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;

@@ -43,6 +45,12 @@ public abstract class CollapsingToolbarBaseFragment extends Fragment {
        @Override
        public ActionBar setActionBar(Toolbar toolbar) {
            requireActivity().setActionBar(toolbar);
            // In CollapsingToolbarDelegate we won't be setting the up indicator style if the action
            // bar being returned is null. Return the action bar object if the expressive theme is
            // enabled in order to set the up indication style correctly.
            if (SettingsThemeHelper.isExpressiveTheme(requireContext())) {
                return requireActivity().getActionBar();
            }
            return null;
        }