use of com.android.settings.SettingsActivity in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class BluetoothSettings method setOffMessage.
private void setOffMessage() {
final TextView emptyView = getEmptyTextView();
if (emptyView == null) {
return;
}
final CharSequence briefText = getText(R.string.bluetooth_empty_list_bluetooth_off);
final ContentResolver resolver = getActivity().getContentResolver();
final boolean bleScanningMode = Settings.Global.getInt(resolver, Settings.Global.BLE_SCAN_ALWAYS_AVAILABLE, 0) == 1;
if (!bleScanningMode) {
// Show only the brief text if the scanning mode has been turned off.
emptyView.setText(briefText, TextView.BufferType.SPANNABLE);
} else {
final StringBuilder contentBuilder = new StringBuilder();
contentBuilder.append(briefText);
contentBuilder.append("\n\n");
contentBuilder.append(getText(R.string.ble_scan_notify_text));
LinkifyUtils.linkify(emptyView, contentBuilder, new LinkifyUtils.OnClickListener() {
@Override
public void onClick() {
final SettingsActivity activity = (SettingsActivity) BluetoothSettings.this.getActivity();
activity.startPreferencePanel(ScanningSettings.class.getName(), null, R.string.location_scanning_screen_title, null, null, 0);
}
});
}
getPreferenceScreen().removeAll();
}
use of com.android.settings.SettingsActivity in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class PowerUsageSummary method onOptionsItemSelected.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
final SettingsActivity sa = (SettingsActivity) getActivity();
switch(item.getItemId()) {
case MENU_STATS_RESET:
resetStats();
return true;
case MENU_STATS_TYPE:
if (mStatsType == BatteryStats.STATS_SINCE_CHARGED) {
mStatsType = BatteryStats.STATS_SINCE_UNPLUGGED;
} else {
mStatsType = BatteryStats.STATS_SINCE_CHARGED;
}
refreshStats();
return true;
case MENU_BATTERY_SAVER:
sa.startPreferencePanel(BatterySaverSettings.class.getName(), null, R.string.battery_saver, null, null, 0);
return true;
case MENU_HIGH_POWER_APPS:
Bundle args = new Bundle();
args.putString(ManageApplications.EXTRA_CLASSNAME, HighPowerApplicationsActivity.class.getName());
sa.startPreferencePanel(ManageApplications.class.getName(), args, R.string.high_power_apps, null, null, 0);
return true;
case MENU_ADDITIONAL_BATTERY_INFO:
startActivity(FeatureFactory.getFactory(getContext()).getPowerUsageFeatureProvider(getContext()).getAdditionalBatteryInfoIntent());
return true;
default:
return super.onOptionsItemSelected(item);
}
}
use of com.android.settings.SettingsActivity in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class PrintServiceSettingsFragment method initComponents.
private void initComponents() {
mPrintersAdapter = new PrintersAdapter();
mPrintersAdapter.registerDataSetObserver(mDataObserver);
final SettingsActivity activity = (SettingsActivity) getActivity();
mSwitchBar = activity.getSwitchBar();
mSwitchBar.addOnSwitchChangeListener(this);
mSwitchBar.show();
mToggleSwitch = mSwitchBar.getSwitch();
mToggleSwitch.setOnBeforeCheckedChangeListener(new ToggleSwitch.OnBeforeCheckedChangeListener() {
@Override
public boolean onBeforeCheckedChanged(ToggleSwitch toggleSwitch, boolean checked) {
onPreferenceToggled(mPreferenceKey, checked);
return false;
}
});
getBackupListView().setSelector(new ColorDrawable(Color.TRANSPARENT));
getBackupListView().setAdapter(mPrintersAdapter);
getBackupListView().setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
PrinterInfo printer = (PrinterInfo) mPrintersAdapter.getItem(position);
if (printer.getInfoIntent() != null) {
try {
getActivity().startIntentSender(printer.getInfoIntent().getIntentSender(), null, 0, 0, 0);
} catch (SendIntentException e) {
Log.e(LOG_TAG, "Could not execute info intent: %s", e);
}
}
}
});
}
use of com.android.settings.SettingsActivity in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class AppInfoBase method setIntentAndFinish.
protected void setIntentAndFinish(boolean finish, boolean appChanged) {
if (localLOGV)
Log.i(TAG, "appChanged=" + appChanged);
Intent intent = new Intent();
intent.putExtra(ManageApplications.APP_CHG, appChanged);
SettingsActivity sa = (SettingsActivity) getActivity();
sa.finishPreferencePanel(this, Activity.RESULT_OK, intent);
mFinishing = true;
}
use of com.android.settings.SettingsActivity in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class AppOpsCategory method startApplicationDetailsActivity.
// utility method used to start sub activity
private void startApplicationDetailsActivity() {
// start new fragment to display extended information
Bundle args = new Bundle();
args.putString(AppOpsDetails.ARG_PACKAGE_NAME, mCurrentPkgName);
SettingsActivity sa = (SettingsActivity) getActivity();
sa.startPreferencePanel(AppOpsDetails.class.getName(), args, org.cyanogenmod.platform.internal.R.string.privacy_guard_manager_title, null, this, RESULT_APP_DETAILS);
}
Aggregations