Search in sources :

Example 1 with BluetoothSwitchPreferenceController

use of com.android.settings.bluetooth.BluetoothSwitchPreferenceController in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class BluetoothDashboardFragment method onActivityCreated.

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    SettingsActivity activity = (SettingsActivity) getActivity();
    mSwitchBar = activity.getSwitchBar();
    mController = new BluetoothSwitchPreferenceController(activity, new SwitchBarController(mSwitchBar), mFooterPreference);
    Lifecycle lifecycle = getSettingsLifecycle();
    if (lifecycle != null) {
        lifecycle.addObserver(mController);
    }
}
Also used : BluetoothSwitchPreferenceController(com.android.settings.bluetooth.BluetoothSwitchPreferenceController) Lifecycle(com.android.settingslib.core.lifecycle.Lifecycle) SettingsActivity(com.android.settings.SettingsActivity) SwitchBarController(com.android.settings.widget.SwitchBarController)

Example 2 with BluetoothSwitchPreferenceController

use of com.android.settings.bluetooth.BluetoothSwitchPreferenceController in project android_packages_apps_Settings by omnirom.

the class BluetoothDashboardFragment method onActivityCreated.

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    SettingsActivity activity = (SettingsActivity) getActivity();
    mSwitchBar = activity.getSwitchBar();
    mSwitchBar.setTitle(getContext().getString(R.string.bluetooth_main_switch_title));
    mController = new BluetoothSwitchPreferenceController(activity, new MainSwitchBarController(mSwitchBar), mFooterPreference);
    Lifecycle lifecycle = getSettingsLifecycle();
    if (lifecycle != null) {
        lifecycle.addObserver(mController);
    }
}
Also used : MainSwitchBarController(com.android.settings.widget.MainSwitchBarController) BluetoothSwitchPreferenceController(com.android.settings.bluetooth.BluetoothSwitchPreferenceController) Lifecycle(com.android.settingslib.core.lifecycle.Lifecycle) SettingsActivity(com.android.settings.SettingsActivity)

Aggregations

SettingsActivity (com.android.settings.SettingsActivity)2 BluetoothSwitchPreferenceController (com.android.settings.bluetooth.BluetoothSwitchPreferenceController)2 Lifecycle (com.android.settingslib.core.lifecycle.Lifecycle)2 MainSwitchBarController (com.android.settings.widget.MainSwitchBarController)1 SwitchBarController (com.android.settings.widget.SwitchBarController)1