use of com.android.settingslib.widget.FooterPreferenceMixinCompat in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class EnterpriseDisclosurePreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = RuntimeEnvironment.application;
mController = spy(new EnterpriseDisclosurePreferenceController(mContext));
mFragment = spy(new ChooseAccountFragment());
mFooterPreferenceMixin = new FooterPreferenceMixinCompat(mFragment, mFragment.getSettingsLifecycle());
mPreferenceManager = new PreferenceManager(mContext);
mPreferenceScreen = mPreferenceManager.createPreferenceScreen(mContext);
}
use of com.android.settingslib.widget.FooterPreferenceMixinCompat in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class BillingCycleSettingsTest method onCreate_emptyArguments_shouldSetDefaultNetworkTemplate.
@Test
public void onCreate_emptyArguments_shouldSetDefaultNetworkTemplate() {
final BillingCycleSettings billingCycleSettings = spy(new BillingCycleSettings());
when(billingCycleSettings.getContext()).thenReturn(mContext);
when(billingCycleSettings.getArguments()).thenReturn(Bundle.EMPTY);
final FragmentActivity activity = mock(FragmentActivity.class);
when(billingCycleSettings.getActivity()).thenReturn(activity);
final Resources.Theme theme = mContext.getTheme();
when(activity.getTheme()).thenReturn(theme);
doNothing().when(billingCycleSettings).onCreatePreferences(any(Bundle.class), nullable(String.class));
when(mContext.getSystemService(Context.NETWORK_POLICY_SERVICE)).thenReturn(mNetworkPolicyManager);
when(mContext.getSystemService(Context.CONNECTIVITY_SERVICE)).thenReturn(mConnectivityManager);
when(mConnectivityManager.isNetworkSupported(anyInt())).thenReturn(true);
final SwitchPreference preference = mock(SwitchPreference.class);
when(billingCycleSettings.findPreference(anyString())).thenReturn(preference);
final FooterPreferenceMixinCompat footer = mock(FooterPreferenceMixinCompat.class);
ReflectionHelpers.setField(billingCycleSettings, "mFooterPreferenceMixin", footer);
when(footer.createFooterPreference()).thenReturn(mock(FooterPreference.class));
billingCycleSettings.onCreate(Bundle.EMPTY);
assertThat(billingCycleSettings.mNetworkTemplate).isNotNull();
}
use of com.android.settingslib.widget.FooterPreferenceMixinCompat in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class UsbDefaultFragment method onCreatePreferences.
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
super.onCreatePreferences(savedInstanceState, rootKey);
FooterPreferenceMixinCompat footer = new FooterPreferenceMixinCompat(this, this.getSettingsLifecycle());
FooterPreference pref = footer.createFooterPreference();
pref.setTitle(R.string.usb_default_info);
}
Aggregations