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

Commit fc481ece authored by PETER LIANG's avatar PETER LIANG Committed by Android (Google) Code Review
Browse files

Merge "Updates the padding of the reset button to meet for SetupWizard style." into tm-dev

parents ae1d7d3e 5bdc11a0
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -27,8 +27,11 @@ import androidx.recyclerview.widget.RecyclerView;

import com.android.settings.R;
import com.android.settingslib.Utils;
import com.android.settingslib.widget.LayoutPreference;

import com.google.android.setupdesign.GlifPreferenceLayout;
import com.google.android.setupdesign.util.LayoutStyler;


/**
 * A {@link androidx.preference.PreferenceFragmentCompat} that displays the settings page related
@@ -47,6 +50,8 @@ public class TextReadingPreferenceFragmentForSetupWizard extends TextReadingPref
        icon.setTintList(Utils.getColorAttr(getContext(), android.R.attr.colorPrimary));
        AccessibilitySetupWizardUtils.updateGlifPreferenceLayout(getContext(), layout, title,
                /* description= */ null, icon);

        updateResetButtonPadding();
    }

    @Override
@@ -66,4 +71,14 @@ public class TextReadingPreferenceFragmentForSetupWizard extends TextReadingPref
        // Hides help center in action bar and footer bar in SuW
        return 0;
    }

    /**
     * Updates the padding of the reset button to meet for SetupWizard style.
     */
    private void updateResetButtonPadding() {
        final LayoutPreference resetPreference = (LayoutPreference) findPreference(RESET_KEY);
        final ViewGroup parentView =
                (ViewGroup) resetPreference.findViewById(R.id.reset_button).getParent();
        LayoutStyler.applyPartnerCustomizationLayoutPaddingStyle(parentView);
    }
}
+6 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.settings.accessibility;

import static com.android.settings.accessibility.TextReadingPreferenceFragment.RESET_KEY;

import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
@@ -25,6 +27,7 @@ import android.content.Context;
import androidx.test.core.app.ApplicationProvider;

import com.android.settings.R;
import com.android.settingslib.widget.LayoutPreference;

import com.google.android.setupdesign.GlifPreferenceLayout;

@@ -51,6 +54,9 @@ public class TextReadingPreferenceFragmentForSetupWizardTest {
        MockitoAnnotations.initMocks(this);

        mFragment = spy(new TextReadingPreferenceFragmentForSetupWizard());
        final LayoutPreference resetPreference =
                new LayoutPreference(mContext, R.layout.accessibility_text_reading_reset_button);
        doReturn(resetPreference).when(mFragment).findPreference(RESET_KEY);
    }

    @Test