Rename RadioButtonPreference -> SelectorWithWidgetPreference.
This change is to reduce ambiguity as we're adding the option to style the preference like a checkbox as well. Bug: 190180868 Test: SelectorWithWidgetPreferenceTest, RunSettingsLibRoboTests Change-Id: Ie414347bf67ed394ef495604890c5851fc42dbc7
This commit is contained in:
@@ -23,7 +23,7 @@ import android.os.SystemProperties;
|
||||
import android.os.UserHandle;
|
||||
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settingslib.widget.RadioButtonPreference;
|
||||
import com.android.settingslib.widget.SelectorWithWidgetPreference;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -39,14 +39,14 @@ public class OneHandedActionPullDownPrefControllerTest {
|
||||
private Context mContext;
|
||||
private OneHandedSettingsUtils mUtils;
|
||||
private OneHandedActionPullDownPrefController mController;
|
||||
private RadioButtonPreference mPreference;
|
||||
private SelectorWithWidgetPreference mPreference;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mContext = RuntimeEnvironment.application;
|
||||
mUtils = new OneHandedSettingsUtils(mContext);
|
||||
mController = new OneHandedActionPullDownPrefController(mContext, KEY);
|
||||
mPreference = new RadioButtonPreference(mContext);
|
||||
mPreference = new SelectorWithWidgetPreference(mContext);
|
||||
OneHandedSettingsUtils.setUserId(UserHandle.myUserId());
|
||||
}
|
||||
|
||||
|
@@ -23,7 +23,7 @@ import android.os.SystemProperties;
|
||||
import android.os.UserHandle;
|
||||
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settingslib.widget.RadioButtonPreference;
|
||||
import com.android.settingslib.widget.SelectorWithWidgetPreference;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -39,14 +39,14 @@ public class OneHandedActionShowNotificationPrefControllerTest {
|
||||
private Context mContext;
|
||||
private OneHandedSettingsUtils mUtils;
|
||||
private OneHandedActionShowNotificationPrefController mController;
|
||||
private RadioButtonPreference mPreference;
|
||||
private SelectorWithWidgetPreference mPreference;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mContext = RuntimeEnvironment.application;
|
||||
mUtils = new OneHandedSettingsUtils(mContext);
|
||||
mController = new OneHandedActionShowNotificationPrefController(mContext, KEY);
|
||||
mPreference = new RadioButtonPreference(mContext);
|
||||
mPreference = new SelectorWithWidgetPreference(mContext);
|
||||
OneHandedSettingsUtils.setUserId(UserHandle.myUserId());
|
||||
}
|
||||
|
||||
|
@@ -29,7 +29,7 @@ import android.provider.Settings;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceCategory;
|
||||
|
||||
import com.android.settingslib.widget.RadioButtonPreference;
|
||||
import com.android.settingslib.widget.SelectorWithWidgetPreference;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -58,8 +58,8 @@ public class PreventRingingGesturePreferenceControllerTest {
|
||||
.thenReturn(true);
|
||||
mController = new PreventRingingGesturePreferenceController(mContext, null);
|
||||
mController.mPreferenceCategory = new PreferenceCategory(mContext);
|
||||
mController.mVibratePref = new RadioButtonPreference(mContext);
|
||||
mController.mMutePref = new RadioButtonPreference(mContext);
|
||||
mController.mVibratePref = new SelectorWithWidgetPreference(mContext);
|
||||
mController.mMutePref = new SelectorWithWidgetPreference(mContext);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -122,7 +122,7 @@ public class PreventRingingGesturePreferenceControllerTest {
|
||||
|
||||
@Test
|
||||
public void testRadioButtonClicked_mute() {
|
||||
RadioButtonPreference rbPref = new RadioButtonPreference(mContext);
|
||||
SelectorWithWidgetPreference rbPref = new SelectorWithWidgetPreference(mContext);
|
||||
rbPref.setKey(PreventRingingGesturePreferenceController.KEY_MUTE);
|
||||
|
||||
Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.VOLUME_HUSH_GESTURE,
|
||||
@@ -136,7 +136,7 @@ public class PreventRingingGesturePreferenceControllerTest {
|
||||
|
||||
@Test
|
||||
public void testRadioButtonClicked_vibrate() {
|
||||
RadioButtonPreference rbPref = new RadioButtonPreference(mContext);
|
||||
SelectorWithWidgetPreference rbPref = new SelectorWithWidgetPreference(mContext);
|
||||
rbPref.setKey(PreventRingingGesturePreferenceController.KEY_VIBRATE);
|
||||
|
||||
Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.VOLUME_HUSH_GESTURE,
|
||||
|
Reference in New Issue
Block a user