use of com.android.settings.widget.SwitchBar in project android_packages_apps_Settings by LineageOS.
the class WifiTetherSettings method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
// Assume we are in a SettingsActivity. This is only safe because we currently use
// SettingsActivity as base for all preference fragments.
final SettingsActivity activity = (SettingsActivity) getActivity();
final SwitchBar switchBar = activity.getSwitchBar();
mSwitchBarController = new WifiTetherSwitchBarController(activity, new SwitchBarController(switchBar));
getLifecycle().addObserver(mSwitchBarController);
switchBar.show();
}
use of com.android.settings.widget.SwitchBar in project android_packages_apps_Settings by LineageOS.
the class BatterySaverSettingsTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = RuntimeEnvironment.application;
mBatterySaverSettings = new BatterySaverSettings();
mBatterySaverSettings.mSwitchBar = new SwitchBar(mContext);
}
use of com.android.settings.widget.SwitchBar in project android_packages_apps_Settings by LineageOS.
the class DevelopmentSwitchBarControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mLifecycle = new Lifecycle();
mSwitchBar = new SwitchBar(RuntimeEnvironment.application);
}
use of com.android.settings.widget.SwitchBar in project android_packages_apps_Settings by omnirom.
the class WifiTetherSettings method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
// Assume we are in a SettingsActivity. This is only safe because we currently use
// SettingsActivity as base for all preference fragments.
final SettingsActivity activity = (SettingsActivity) getActivity();
final SwitchBar switchBar = activity.getSwitchBar();
mSwitchBarController = new WifiTetherSwitchBarController(activity, new SwitchBarController(switchBar));
getLifecycle().addObserver(mSwitchBarController);
switchBar.show();
}
use of com.android.settings.widget.SwitchBar in project android_packages_apps_Settings by crdroidandroid.
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