use of com.android.settings.SettingsActivity in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class AccountSettings method onPreferenceClick.
@Override
public boolean onPreferenceClick(Preference preference) {
// Check the preference
final int count = mProfiles.size();
for (int i = 0; i < count; i++) {
ProfileData profileData = mProfiles.valueAt(i);
if (preference == profileData.addAccountPreference) {
Intent intent = new Intent(ADD_ACCOUNT_ACTION);
intent.putExtra(EXTRA_USER, profileData.userInfo.getUserHandle());
intent.putExtra(EXTRA_AUTHORITIES, mAuthorities);
startActivity(intent);
return true;
}
if (preference == profileData.removeWorkProfilePreference) {
final int userId = profileData.userInfo.id;
UserDialogs.createRemoveDialog(getActivity(), userId, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mUm.removeUser(userId);
}
}).show();
return true;
}
if (preference == profileData.managedProfilePreference) {
Bundle arguments = new Bundle();
arguments.putParcelable(Intent.EXTRA_USER, profileData.userInfo.getUserHandle());
((SettingsActivity) getActivity()).startPreferencePanel(ManagedProfileSettings.class.getName(), arguments, R.string.managed_profile_settings_title, null, null, 0);
return true;
}
}
return false;
}
use of com.android.settings.SettingsActivity in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ToggleFeaturePreferenceFragment method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
SettingsActivity activity = (SettingsActivity) getActivity();
mSwitchBar = activity.getSwitchBar();
mToggleSwitch = mSwitchBar.getSwitch();
onProcessArguments(getArguments());
}
use of com.android.settings.SettingsActivity in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class RunningProcessesView method startServiceDetailsActivity.
// utility method used to start sub activity
private void startServiceDetailsActivity(RunningState.MergedItem mi) {
if (mOwner != null && mi != null) {
// start new fragment to display extended information
Bundle args = new Bundle();
if (mi.mProcess != null) {
args.putInt(RunningServiceDetails.KEY_UID, mi.mProcess.mUid);
args.putString(RunningServiceDetails.KEY_PROCESS, mi.mProcess.mProcessName);
}
args.putInt(RunningServiceDetails.KEY_USER_ID, mi.mUserId);
args.putBoolean(RunningServiceDetails.KEY_BACKGROUND, mAdapter.mShowBackground);
SettingsActivity sa = (SettingsActivity) mOwner.getActivity();
sa.startPreferencePanel(RunningServiceDetails.class.getName(), args, R.string.runningservicedetails_settings_title, null, null, 0);
}
}
use of com.android.settings.SettingsActivity in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class InstalledAppDetails method startAppInfoFragment.
public static void startAppInfoFragment(Class<?> fragment, CharSequence title, SettingsPreferenceFragment caller, AppEntry appEntry) {
// start new fragment to display extended information
Bundle args = new Bundle();
args.putString(ARG_PACKAGE_NAME, appEntry.info.packageName);
args.putInt(ARG_PACKAGE_UID, appEntry.info.uid);
args.putBoolean(AppHeader.EXTRA_HIDE_INFO_BUTTON, true);
SettingsActivity sa = (SettingsActivity) caller.getActivity();
sa.startPreferencePanel(fragment.getName(), args, -1, title, caller, SUB_INFO_FRAGMENT);
}
use of com.android.settings.SettingsActivity in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class TextToSpeechSettings method initSettings.
private void initSettings() {
final ContentResolver resolver = getContentResolver();
// Set up the default rate and pitch.
mDefaultRate = android.provider.Settings.Secure.getInt(resolver, TTS_DEFAULT_RATE, TextToSpeech.Engine.DEFAULT_RATE);
mDefaultPitch = android.provider.Settings.Secure.getInt(resolver, TTS_DEFAULT_PITCH, TextToSpeech.Engine.DEFAULT_PITCH);
mDefaultRatePref.setProgress(getSeekBarProgressFromValue(KEY_DEFAULT_RATE, mDefaultRate));
mDefaultRatePref.setOnPreferenceChangeListener(this);
mDefaultRatePref.setMax(getSeekBarProgressFromValue(KEY_DEFAULT_RATE, MAX_SPEECH_RATE));
mDefaultPitchPref.setProgress(getSeekBarProgressFromValue(KEY_DEFAULT_PITCH, mDefaultPitch));
mDefaultPitchPref.setOnPreferenceChangeListener(this);
mDefaultPitchPref.setMax(getSeekBarProgressFromValue(KEY_DEFAULT_PITCH, MAX_SPEECH_PITCH));
if (mTts != null) {
mCurrentEngine = mTts.getCurrentEngine();
mTts.setSpeechRate(mDefaultRate / 100.0f);
mTts.setPitch(mDefaultPitch / 100.0f);
}
SettingsActivity activity = null;
if (getActivity() instanceof SettingsActivity) {
activity = (SettingsActivity) getActivity();
} else {
throw new IllegalStateException("TextToSpeechSettings used outside a " + "Settings");
}
mEnginePreferenceCategory.removeAll();
List<EngineInfo> engines = mEnginesHelper.getEngines();
for (EngineInfo engine : engines) {
TtsEnginePreference enginePref = new TtsEnginePreference(getPrefContext(), engine, this, activity);
mEnginePreferenceCategory.addPreference(enginePref);
}
checkVoiceData(mCurrentEngine);
}
Aggregations