use of com.android.settings.widget.SwitchBarController in project android_packages_apps_Settings by SudaMod.
the class BluetoothSettings method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
final SettingsActivity activity = (SettingsActivity) getActivity();
mSwitchBar = activity.getSwitchBar();
mBluetoothEnabler = new BluetoothEnabler(activity, new SwitchBarController(mSwitchBar), mMetricsFeatureProvider, Utils.getLocalBtManager(activity), MetricsEvent.ACTION_BLUETOOTH_TOGGLE);
mBluetoothEnabler.setupSwitchController();
if (mLocalAdapter != null) {
mAlwaysDiscoverable = new AlwaysDiscoverable(getContext(), mLocalAdapter);
}
}
use of com.android.settings.widget.SwitchBarController in project platform_packages_apps_Settings by BlissRoms.
the class BluetoothSettings method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
final SettingsActivity activity = (SettingsActivity) getActivity();
mSwitchBar = activity.getSwitchBar();
mBluetoothEnabler = new BluetoothEnabler(activity, new SwitchBarController(mSwitchBar), mMetricsFeatureProvider, Utils.getLocalBtManager(activity), MetricsEvent.ACTION_BLUETOOTH_TOGGLE);
mBluetoothEnabler.setupSwitchController();
if (mLocalAdapter != null) {
mAlwaysDiscoverable = new AlwaysDiscoverable(getContext(), mLocalAdapter);
}
}
use of com.android.settings.widget.SwitchBarController in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class GameDriverDashboard method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
final SettingsActivity activity = (SettingsActivity) getActivity();
final SwitchBar switchBar = activity.getSwitchBar();
final GameDriverGlobalSwitchBarController switchBarController = new GameDriverGlobalSwitchBarController(activity, new SwitchBarController(switchBar));
getSettingsLifecycle().addObserver(switchBarController);
switchBar.show();
}
use of com.android.settings.widget.SwitchBarController in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class UserSettings 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 MultiUserSwitchBarController(activity, new SwitchBarController(switchBar), this);
getSettingsLifecycle().addObserver(mSwitchBarController);
switchBar.show();
}
use of com.android.settings.widget.SwitchBarController in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class BluetoothEnablerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = spy(RuntimeEnvironment.application);
mRestrictedSwitchPreference = new RestrictedSwitchPreference(mContext);
mSwitchController = spy(new SwitchBarController(new SwitchBar(mContext)));
mBluetoothEnabler = new BluetoothEnabler(mContext, mSwitchController, mMetricsFeatureProvider, 123, mRestrictionUtils);
mHolder = PreferenceViewHolder.createInstanceForTests(mock(View.class));
mRestrictedSwitchPreference.onBindViewHolder(mHolder);
mBluetoothEnabler.setToggleCallback(mCallback);
mShadowBluetoothAdapter = Shadow.extract(BluetoothAdapter.getDefaultAdapter());
}
Aggregations