Search in sources :

Example 21 with SettingsActivity

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;
}
Also used : DialogInterface(android.content.DialogInterface) Bundle(android.os.Bundle) Intent(android.content.Intent) SettingsActivity(com.android.settings.SettingsActivity)

Example 22 with SettingsActivity

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());
}
Also used : SettingsActivity(com.android.settings.SettingsActivity)

Example 23 with SettingsActivity

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);
    }
}
Also used : Bundle(android.os.Bundle) SettingsActivity(com.android.settings.SettingsActivity)

Example 24 with SettingsActivity

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);
}
Also used : Bundle(android.os.Bundle) SettingsActivity(com.android.settings.SettingsActivity)

Example 25 with SettingsActivity

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);
}
Also used : EngineInfo(android.speech.tts.TextToSpeech.EngineInfo) SettingsActivity(com.android.settings.SettingsActivity) ContentResolver(android.content.ContentResolver)

Aggregations

SettingsActivity (com.android.settings.SettingsActivity)28 Bundle (android.os.Bundle)10 Intent (android.content.Intent)4 TextView (android.widget.TextView)4 ContentResolver (android.content.ContentResolver)3 View (android.view.View)3 AdapterView (android.widget.AdapterView)2 ImageView (android.widget.ImageView)2 ListView (android.widget.ListView)2 SearchView (android.widget.SearchView)2 LinkifyUtils (com.android.settings.LinkifyUtils)2 FragmentTransaction (android.app.FragmentTransaction)1 ComponentName (android.content.ComponentName)1 Context (android.content.Context)1 DialogInterface (android.content.DialogInterface)1 SendIntentException (android.content.IntentSender.SendIntentException)1 SharedPreferences (android.content.SharedPreferences)1 UserInfo (android.content.pm.UserInfo)1 Resources (android.content.res.Resources)1 Cursor (android.database.Cursor)1