Refine the UI of the text reading page across SuW.

Actions:
1) Customize pages and use the components from SuW lib to align SuW consistent style.
2) Add the done button in the Anything Else page.

Bug: 232771631
Bug: 222419452
Test: make RunSettingsRoboTests ROBOTEST_FILTER=TextReadingResetControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=TextReadingPreferenceFragmentForSetupWizardTest
Change-Id: Ie3f3513ceee7c40d6286335dce91979df0d27f02
This commit is contained in:
Peter Liang
2022-12-11 12:04:58 +08:00
parent 2c2a826c3f
commit 5e931b2c23
7 changed files with 92 additions and 82 deletions

View File

@@ -20,15 +20,11 @@ import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import androidx.annotation.IntDef;
import androidx.preference.Preference;
import androidx.preference.PreferenceViewHolder;
import com.android.settings.R;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* The preference which is used for resetting the status of all preferences in the display size
* and text page.
@@ -36,20 +32,10 @@ import java.lang.annotation.RetentionPolicy;
public class TextReadingResetPreference extends Preference {
private View.OnClickListener mOnResetClickListener;
@Retention(RetentionPolicy.SOURCE)
@IntDef({
ButtonStyle.DEFAULT,
ButtonStyle.SUW,
})
@interface ButtonStyle {
int DEFAULT = 0;
int SUW = 1;
}
public TextReadingResetPreference(Context context, AttributeSet attrs) {
super(context, attrs);
setSetupWizardStyle(ButtonStyle.DEFAULT);
setLayoutResource(R.layout.accessibility_text_reading_reset_button);
}
@Override
@@ -60,13 +46,6 @@ public class TextReadingResetPreference extends Preference {
view.setOnClickListener(mOnResetClickListener);
}
void setSetupWizardStyle(@ButtonStyle int style) {
final int layoutResId = (style == ButtonStyle.SUW)
? R.layout.accessibility_text_reading_reset_button_suw
: R.layout.accessibility_text_reading_reset_button;
setLayoutResource(layoutResId);
}
void setOnResetClickListener(View.OnClickListener resetClickListener) {
mOnResetClickListener = resetClickListener;
}