use of com.android.settings.widget.SwitchBar in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class MultiUserSwitchBarControllerTest method setUp.
@Before
public void setUp() {
mContext = RuntimeEnvironment.application;
mUserManager = ShadowUserManager.getShadow();
mSwitchBarController = spy(new SwitchBarController(new SwitchBar(mContext)));
mUserManager.setSupportsMultipleUsers(true);
}
use of com.android.settings.widget.SwitchBar in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class WifiTetherSwitchBarControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = spy(RuntimeEnvironment.application);
mSwitchBar = new SwitchBar(mContext);
when(mContext.getSystemService(Context.WIFI_SERVICE)).thenReturn(mWifiManager);
when(mContext.getSystemService(Context.CONNECTIVITY_SERVICE)).thenReturn(mConnectivityManager);
when(mContext.getSystemService(Context.NETWORK_POLICY_SERVICE)).thenReturn(mNetworkPolicyManager);
mController = new WifiTetherSwitchBarController(mContext, new SwitchBarController(mSwitchBar));
}
use of com.android.settings.widget.SwitchBar in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class LocationSettings method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
final SettingsActivity activity = (SettingsActivity) getActivity();
final SwitchBar switchBar = activity.getSwitchBar();
switchBar.setSwitchBarText(R.string.location_settings_master_switch_title, R.string.location_settings_master_switch_title);
mSwitchBarController = new LocationSwitchBarController(activity, switchBar, getSettingsLifecycle());
switchBar.show();
}
use of com.android.settings.widget.SwitchBar in project android_packages_apps_Settings by LineageOS.
the class AutomaticStorageManagerSwitchBarControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = spy(RuntimeEnvironment.application);
mSwitchBar = new SwitchBar(mContext);
Context fakeContextForFakeProvider = mock(Context.class, RETURNS_DEEP_STUBS);
FakeFeatureFactory.setupForTest(fakeContextForFakeProvider);
FeatureFactory featureFactory = FakeFeatureFactory.getFactory(fakeContextForFakeProvider);
mMetricsFeatureProvider = featureFactory.getMetricsFeatureProvider();
mPreference = new Preference(mContext);
mController = new AutomaticStorageManagerSwitchBarController(mContext, mSwitchBar, mMetricsFeatureProvider, mPreference, mFragmentManager);
}
use of com.android.settings.widget.SwitchBar in project android_packages_apps_Settings by omnirom.
the class AutomaticStorageManagerSwitchBarControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = spy(RuntimeEnvironment.application);
mSwitchBar = new SwitchBar(mContext);
Context fakeContextForFakeProvider = mock(Context.class, RETURNS_DEEP_STUBS);
FakeFeatureFactory.setupForTest(fakeContextForFakeProvider);
FeatureFactory featureFactory = FakeFeatureFactory.getFactory(fakeContextForFakeProvider);
mMetricsFeatureProvider = featureFactory.getMetricsFeatureProvider();
mPreference = new Preference(mContext);
mController = new AutomaticStorageManagerSwitchBarController(mContext, mSwitchBar, mMetricsFeatureProvider, mPreference, mFragmentManager);
}
Aggregations