Search in sources :

Example 1 with SettingsSpinnerPreference

use of com.android.settingslib.widget.SettingsSpinnerPreference in project android_packages_apps_Settings by omnirom.

the class StorageSelectionPreferenceControllerTest method setUp.

@Before
public void setUp() throws Exception {
    if (Looper.myLooper() == null) {
        Looper.prepare();
    }
    mContext = ApplicationProvider.getApplicationContext();
    mStorageManager = mContext.getSystemService(StorageManager.class);
    mController = new StorageSelectionPreferenceController(mContext, PREFERENCE_KEY);
    final PreferenceManager preferenceManager = new PreferenceManager(mContext);
    final PreferenceScreen preferenceScreen = preferenceManager.createPreferenceScreen(mContext);
    final SettingsSpinnerPreference spinnerPreference = new SettingsSpinnerPreference(mContext);
    spinnerPreference.setKey(PREFERENCE_KEY);
    preferenceScreen.addPreference(spinnerPreference);
    mController.displayPreference(preferenceScreen);
}
Also used : PreferenceScreen(androidx.preference.PreferenceScreen) StorageManager(android.os.storage.StorageManager) SettingsSpinnerPreference(com.android.settingslib.widget.SettingsSpinnerPreference) PreferenceManager(androidx.preference.PreferenceManager) Before(org.junit.Before)

Aggregations

StorageManager (android.os.storage.StorageManager)1 PreferenceManager (androidx.preference.PreferenceManager)1 PreferenceScreen (androidx.preference.PreferenceScreen)1 SettingsSpinnerPreference (com.android.settingslib.widget.SettingsSpinnerPreference)1 Before (org.junit.Before)1