use of com.android.settings.widget.SettingsMainSwitchBar in project android_packages_apps_crDroidSettings by crdroidandroid.
the class UdfpsAnimation method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
final SettingsActivity activity = (SettingsActivity) getActivity();
final SettingsMainSwitchBar switchBar = activity.getSwitchBar();
mSwitch = switchBar.getSwitch();
mEnabled = Settings.System.getInt(getActivity().getContentResolver(), Settings.System.UDFPS_ANIM, 0) == 1;
mSwitch.setChecked(mEnabled);
setEnabled(mEnabled);
switchBar.setTitle(getActivity().getString(R.string.enable));
switchBar.addOnSwitchChangeListener(this);
switchBar.show();
}
use of com.android.settings.widget.SettingsMainSwitchBar in project android_packages_apps_Settings by omnirom.
the class GraphicsDriverDashboard method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
final SettingsActivity activity = (SettingsActivity) getActivity();
final SettingsMainSwitchBar switchBar = activity.getSwitchBar();
final GraphicsDriverGlobalSwitchBarController switchBarController = new GraphicsDriverGlobalSwitchBarController(activity, new MainSwitchBarController(switchBar));
getSettingsLifecycle().addObserver(switchBarController);
switchBar.setTitle(getContext().getString(R.string.graphics_driver_main_switch_title));
switchBar.show();
}
use of com.android.settings.widget.SettingsMainSwitchBar in project android_packages_apps_Settings by omnirom.
the class WirelessDebuggingFragment 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.wireless_debugging_main_switch_title));
mWifiDebuggingEnabler = new WirelessDebuggingEnabler(activity, new MainSwitchBarController(switchBar), this, getSettingsLifecycle());
}
use of com.android.settings.widget.SettingsMainSwitchBar in project android_packages_apps_Settings by omnirom.
the class SmartAutoRotatePreferenceFragment method createHeader.
@VisibleForTesting
void createHeader(SettingsActivity activity) {
if (isRotationResolverServiceAvailable(activity)) {
final SettingsMainSwitchBar switchBar = activity.getSwitchBar();
switchBar.setTitle(getContext().getString(R.string.auto_rotate_settings_primary_switch_title));
switchBar.show();
mSwitchBarController = new AutoRotateSwitchBarController(activity, switchBar, getSettingsLifecycle());
findPreference(AUTO_ROTATE_SWITCH_PREFERENCE_ID).setVisible(false);
}
}
use of com.android.settings.widget.SettingsMainSwitchBar in project android_packages_apps_Settings by omnirom.
the class WifiTetherSwitchBarControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = spy(RuntimeEnvironment.application);
mSwitchBar = new SettingsMainSwitchBar(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, mSwitchBar);
}
Aggregations