Convert more pages to use ActionButtonPreference

- text to speech page
- blue tooth detail page
- installed app page

Change-Id: Ib743a144cc6025055cd496ec077f13fce4db0c69
Bug: 63991885
Test: robotests
This commit is contained in:
Fan Zhang
2017-07-28 17:18:44 -07:00
parent 3eb22656eb
commit 1105a1a465
11 changed files with 248 additions and 296 deletions

View File

@@ -48,7 +48,7 @@ public class LayoutPreferenceTest {
@Before
public void setUp() {
mContext = RuntimeEnvironment.application;
mPreference = new LayoutPreference(mContext, R.layout.app_action_buttons);
mPreference = new LayoutPreference(mContext, R.layout.two_action_buttons);
mRootView = mPreference.mRootView;
mHolder = PreferenceViewHolder.createInstanceForTests(LayoutInflater.from(mContext)
.inflate(R.layout.layout_preference_frame, null, false));
@@ -79,12 +79,12 @@ public class LayoutPreferenceTest {
@Test
public void disableSomeView_shouldMaintainStateAfterBind() {
mPreference.findViewById(R.id.left_button).setEnabled(false);
mPreference.findViewById(R.id.right_button).setEnabled(true);
mPreference.findViewById(R.id.button1_positive).setEnabled(false);
mPreference.findViewById(R.id.button2_positive).setEnabled(true);
mPreference.onBindViewHolder(mHolder);
assertThat(mPreference.findViewById(R.id.left_button).isEnabled()).isFalse();
assertThat(mPreference.findViewById(R.id.right_button).isEnabled()).isTrue();
assertThat(mPreference.findViewById(R.id.button1_positive).isEnabled()).isFalse();
assertThat(mPreference.findViewById(R.id.button2_positive).isEnabled()).isTrue();
}
}