Search in sources :

Example 16 with SettingsMainSwitchBar

use of com.android.settings.widget.SettingsMainSwitchBar in project android_packages_apps_Settings by omnirom.

the class LocationSettings method onActivityCreated.

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    final SettingsActivity activity = (SettingsActivity) getActivity();
    final SettingsMainSwitchBar switchBar = activity.getSwitchBar();
    switchBar.setTitle(getContext().getString(R.string.location_settings_primary_switch_title));
    switchBar.show();
    mSwitchBarController = new LocationSwitchBarController(activity, switchBar, getSettingsLifecycle());
    mLocationEnabler = new LocationEnabler(getContext(), this, getSettingsLifecycle());
}
Also used : SettingsMainSwitchBar(com.android.settings.widget.SettingsMainSwitchBar) SettingsActivity(com.android.settings.SettingsActivity)

Aggregations

SettingsMainSwitchBar (com.android.settings.widget.SettingsMainSwitchBar)16 SettingsActivity (com.android.settings.SettingsActivity)8 Before (org.junit.Before)6 MainSwitchBarController (com.android.settings.widget.MainSwitchBarController)4 Context (android.content.Context)2 BluetoothAdapter (android.bluetooth.BluetoothAdapter)1 ContentResolver (android.content.ContentResolver)1 Intent (android.content.Intent)1 ResolveInfo (android.content.pm.ResolveInfo)1 ServiceInfo (android.content.pm.ServiceInfo)1 Bundle (android.os.Bundle)1 PersistableBundle (android.os.PersistableBundle)1 TextView (android.widget.TextView)1 VisibleForTesting (androidx.annotation.VisibleForTesting)1 Preference (androidx.preference.Preference)1 LocationSwitchBarController (com.android.settings.location.LocationSwitchBarController)1 BluetoothTetherPreferenceController (com.android.settings.network.BluetoothTetherPreferenceController)1 EthernetTetherPreferenceController (com.android.settings.network.EthernetTetherPreferenceController)1 TetherEnabler (com.android.settings.network.TetherEnabler)1 UsbTetherPreferenceController (com.android.settings.network.UsbTetherPreferenceController)1