use of com.android.settings.SettingsActivity in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class UserDictionaryAddWordFragment method onItemSelected.
@Override
public void onItemSelected(final AdapterView<?> parent, final View view, final int pos, final long id) {
final LocaleRenderer locale = (LocaleRenderer) parent.getItemAtPosition(pos);
if (locale.isMoreLanguages()) {
SettingsActivity sa = (SettingsActivity) getActivity();
sa.startPreferenceFragment(new UserDictionaryLocalePicker(this), true);
} else {
mContents.updateLocale(locale.getLocaleString());
}
}
use of com.android.settings.SettingsActivity in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class WifiSettings method setOffMessage.
private void setOffMessage() {
if (isUiRestricted()) {
if (!isUiRestrictedByOnlyAdmin()) {
addMessagePreference(R.string.wifi_empty_list_user_restricted);
}
getPreferenceScreen().removeAll();
return;
}
TextView emptyTextView = getEmptyTextView();
if (emptyTextView == null) {
return;
}
final CharSequence briefText = getText(R.string.wifi_empty_list_wifi_off);
// Don't use WifiManager.isScanAlwaysAvailable() to check the Wi-Fi scanning mode. Instead,
// read the system settings directly. Because when the device is in Airplane mode, even if
// Wi-Fi scanning mode is on, WifiManager.isScanAlwaysAvailable() still returns "off".
final ContentResolver resolver = getActivity().getContentResolver();
final boolean wifiScanningMode = Settings.Global.getInt(resolver, Settings.Global.WIFI_SCAN_ALWAYS_AVAILABLE, 0) == 1;
if (!wifiScanningMode) {
// Show only the brief text if the user is not allowed to configure scanning settings,
// or the scanning mode has been turned off.
emptyTextView.setText(briefText, BufferType.SPANNABLE);
} else {
// Append the description of scanning settings with link.
final StringBuilder contentBuilder = new StringBuilder();
contentBuilder.append(briefText);
contentBuilder.append("\n\n");
contentBuilder.append(getText(R.string.wifi_scan_notify_text));
LinkifyUtils.linkify(emptyTextView, contentBuilder, new LinkifyUtils.OnClickListener() {
@Override
public void onClick() {
final SettingsActivity activity = (SettingsActivity) WifiSettings.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 PowerUsageDetail 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(InstalledAppDetails.ARG_PACKAGE_NAME, mPackages[0]);
SettingsActivity sa = (SettingsActivity) getActivity();
sa.startPreferencePanel(InstalledAppDetails.class.getName(), args, R.string.application_info_label, null, null, 0);
}
use of com.android.settings.SettingsActivity in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ColorPickerPreference method showFragment.
private void showFragment(Bundle state) {
SettingsActivity sa = null;
if (getContext() instanceof ContextThemeWrapper) {
if (((ContextThemeWrapper) getContext()).getBaseContext() instanceof SettingsActivity) {
sa = (SettingsActivity) ((ContextThemeWrapper) getContext()).getBaseContext();
}
}
if (sa == null) {
return;
}
Bundle arguments;
if (state != null) {
arguments = new Bundle(state);
} else {
SharedPreferences prefs = sa.getSharedPreferences("color_picker_fragment", Activity.MODE_PRIVATE);
boolean showHelpScreen = prefs.getBoolean("show_help_screen", true);
arguments = new Bundle();
arguments.putInt("new_color", mValue);
arguments.putInt("old_color", mValue);
arguments.putBoolean("help_screen_visible", showHelpScreen);
}
arguments.putInt("initial_color", mValue);
arguments.putInt("reset_color_1", mResetColor1);
arguments.putInt("reset_color_2", mResetColor2);
arguments.putCharSequence("reset_color_1_title", mResetColor1Title);
arguments.putCharSequence("reset_color_2_title", mResetColor2Title);
arguments.putBoolean("alpha_slider_visible", mAlphaSliderVisible);
mPickerFragment = new ColorPickerFragment();
mPickerFragment.setArguments(arguments);
mPickerFragment.setOnColorChangedListener(this);
FragmentTransaction transaction = sa.getFragmentManager().beginTransaction();
transaction.replace(R.id.main_content, mPickerFragment);
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
transaction.addToBackStack(":settings:prefs");
transaction.setBreadCrumbTitle(R.string.color_picker_fragment_title);
transaction.commitAllowingStateLoss();
}
use of com.android.settings.SettingsActivity in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ConvertToFbe method convert.
private void convert() {
SettingsActivity sa = (SettingsActivity) getActivity();
sa.startPreferencePanel(ConfirmConvertToFbe.class.getName(), null, R.string.convert_to_file_encryption, null, null, 0);
}
Aggregations