Search in sources :

Example 6 with PreferenceFragmentCompat

use of androidx.preference.PreferenceFragmentCompat in project collect by opendatakit.

the class ServerPreferencesAdderTest method whenPreferencesAreAdded_returnsTrue.

@Test
public void whenPreferencesAreAdded_returnsTrue() {
    PreferenceFragmentCompat fragment = mock(PreferenceFragmentCompat.class);
    ServerPreferencesAdder loader = new ServerPreferencesAdder(fragment);
    boolean result = loader.add();
    assertTrue(result);
}
Also used : PreferenceFragmentCompat(androidx.preference.PreferenceFragmentCompat) Test(org.junit.Test)

Example 7 with PreferenceFragmentCompat

use of androidx.preference.PreferenceFragmentCompat in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class SeekBarPreferenceTest method isSelectable_default_returnFalse.

@Test
@Config(qualifiers = "mcc998")
public void isSelectable_default_returnFalse() {
    final PreferenceFragmentCompat fragment = FragmentController.of(new TestFragment(), new Bundle()).create().start().resume().get();
    final SeekBarPreference seekBarPreference = fragment.findPreference("seek_bar");
    assertThat(seekBarPreference.isSelectable()).isFalse();
}
Also used : Bundle(android.os.Bundle) PreferenceFragmentCompat(androidx.preference.PreferenceFragmentCompat) Test(org.junit.Test) Config(org.robolectric.annotation.Config)

Aggregations

PreferenceFragmentCompat (androidx.preference.PreferenceFragmentCompat)7 Test (org.junit.Test)4 Bundle (android.os.Bundle)3 Config (org.robolectric.annotation.Config)2 Intent (android.content.Intent)1 ImageView (android.widget.ImageView)1 FragmentActivity (androidx.fragment.app.FragmentActivity)1 WifiDataUsageSummaryPreferenceController (com.android.settings.datausage.WifiDataUsageSummaryPreferenceController)1 LayoutPreference (com.android.settingslib.widget.LayoutPreference)1 DeviceCoordinator (nodomain.freeyourgadget.gadgetbridge.devices.DeviceCoordinator)1