Search in sources :

Example 76 with Activity

use of android.app.Activity in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class SupportDisclaimerDialogFragment method onClick.

@Override
public void onClick(DialogInterface dialog, int which) {
    if (which == Dialog.BUTTON_NEGATIVE) {
        MetricsLogger.action(getContext(), MetricsProto.MetricsEvent.ACTION_SUPPORT_DISCLAIMER_CANCEL);
        return;
    }
    final Activity activity = getActivity();
    final CheckBox doNotShow = (CheckBox) getDialog().findViewById(R.id.support_disclaimer_do_not_show_again);
    final SupportFeatureProvider supportFeatureProvider = FeatureFactory.getFactory(activity).getSupportFeatureProvider(activity);
    supportFeatureProvider.setShouldShowDisclaimerDialog(getContext(), !doNotShow.isChecked());
    final Bundle bundle = getArguments();
    MetricsLogger.action(activity, MetricsProto.MetricsEvent.ACTION_SUPPORT_DISCLAIMER_OK);
    supportFeatureProvider.startSupport(getActivity(), (Account) bundle.getParcelable(EXTRA_ACCOUNT), bundle.getInt(EXTRA_TYPE));
}
Also used : CheckBox(android.widget.CheckBox) Bundle(android.os.Bundle) Activity(android.app.Activity) SupportFeatureProvider(com.android.settings.overlay.SupportFeatureProvider)

Example 77 with Activity

use of android.app.Activity in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class SupportDisclaimerDialogFragment method onCreateDialog.

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()).setTitle(R.string.support_disclaimer_title).setPositiveButton(android.R.string.ok, this).setNegativeButton(android.R.string.cancel, this);
    final View content = LayoutInflater.from(builder.getContext()).inflate(R.layout.support_disclaimer_content, null);
    final TextView disclaimer = (TextView) content.findViewById(R.id.support_disclaimer_text);
    final Activity activity = getActivity();
    final SupportFeatureProvider supportFeatureProvider = FeatureFactory.getFactory(activity).getSupportFeatureProvider(activity);
    disclaimer.setText(supportFeatureProvider.getDisclaimerStringResId());
    stripUnderlines((Spannable) disclaimer.getText());
    return builder.setView(content).create();
}
Also used : AlertDialog(android.app.AlertDialog) Activity(android.app.Activity) TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View) SupportFeatureProvider(com.android.settings.overlay.SupportFeatureProvider)

Example 78 with Activity

use of android.app.Activity in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class LegalSettings method onCreate.

public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    addPreferencesFromResource(R.xml.about_legal);
    final Activity act = getActivity();
    // These are contained in the "container" preference group
    PreferenceGroup parentPreference = getPreferenceScreen();
    Utils.updatePreferenceToSpecificActivityOrRemove(act, parentPreference, KEY_TERMS, Utils.UPDATE_PREFERENCE_FLAG_SET_TITLE_TO_MATCHING_ACTIVITY);
    Utils.updatePreferenceToSpecificActivityOrRemove(act, parentPreference, KEY_LICENSE, Utils.UPDATE_PREFERENCE_FLAG_SET_TITLE_TO_MATCHING_ACTIVITY);
    Utils.updatePreferenceToSpecificActivityOrRemove(act, parentPreference, KEY_COPYRIGHT, Utils.UPDATE_PREFERENCE_FLAG_SET_TITLE_TO_MATCHING_ACTIVITY);
    Utils.updatePreferenceToSpecificActivityOrRemove(act, parentPreference, KEY_WEBVIEW_LICENSE, Utils.UPDATE_PREFERENCE_FLAG_SET_TITLE_TO_MATCHING_ACTIVITY);
}
Also used : Activity(android.app.Activity) PreferenceGroup(android.support.v7.preference.PreferenceGroup)

Example 79 with Activity

use of android.app.Activity in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ManageApplications method createHeader.

private void createHeader() {
    Activity activity = getActivity();
    FrameLayout pinnedHeader = (FrameLayout) mRootView.findViewById(R.id.pinned_header);
    mSpinnerHeader = (ViewGroup) activity.getLayoutInflater().inflate(R.layout.apps_filter_spinner, pinnedHeader, false);
    mFilterSpinner = (Spinner) mSpinnerHeader.findViewById(R.id.filter_spinner);
    mFilterAdapter = new FilterSpinnerAdapter(this);
    mFilterSpinner.setAdapter(mFilterAdapter);
    mFilterSpinner.setOnItemSelectedListener(this);
    pinnedHeader.addView(mSpinnerHeader, 0);
    mFilterAdapter.enableFilter(getDefaultFilter());
    if (mListType == LIST_TYPE_MAIN) {
        if (UserManager.get(getActivity()).getUserProfiles().size() > 1) {
            mFilterAdapter.enableFilter(FILTER_APPS_PERSONAL);
            mFilterAdapter.enableFilter(FILTER_APPS_WORK);
        }
    }
    if (mListType == LIST_TYPE_NOTIFICATION) {
        mFilterAdapter.enableFilter(FILTER_APPS_BLOCKED);
        mFilterAdapter.enableFilter(FILTER_APPS_SILENT);
        mFilterAdapter.enableFilter(FILTER_APPS_SENSITIVE);
        mFilterAdapter.enableFilter(FILTER_APPS_HIDE_NOTIFICATIONS);
        mFilterAdapter.enableFilter(FILTER_APPS_PRIORITY);
    }
    if (mListType == LIST_TYPE_HIGH_POWER) {
        mFilterAdapter.enableFilter(FILTER_APPS_POWER_WHITELIST_ALL);
    }
    if (mListType == LIST_TYPE_STORAGE) {
        mApplications.setOverrideFilter(new VolumeFilter(mVolumeUuid));
    }
}
Also used : FrameLayout(android.widget.FrameLayout) PreferenceFrameLayout(android.preference.PreferenceFrameLayout) UsageAccessSettingsActivity(com.android.settings.Settings.UsageAccessSettingsActivity) WriteSettingsActivity(com.android.settings.Settings.WriteSettingsActivity) AllApplicationsActivity(com.android.settings.Settings.AllApplicationsActivity) HighPowerApplicationsActivity(com.android.settings.Settings.HighPowerApplicationsActivity) SettingsActivity(com.android.settings.SettingsActivity) StorageUseActivity(com.android.settings.Settings.StorageUseActivity) OverlaySettingsActivity(com.android.settings.Settings.OverlaySettingsActivity) NotificationAppListActivity(com.android.settings.Settings.NotificationAppListActivity) Activity(android.app.Activity) VolumeFilter(com.android.settingslib.applications.ApplicationsState.VolumeFilter)

Example 80 with Activity

use of android.app.Activity in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class AmbientSettings method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    final Activity activity = getActivity();
    ContentResolver resolver = getActivity().getContentResolver();
    addPreferencesFromResource(R.xml.ambient_settings);
    mDozePreference = (SwitchPreference) findPreference(KEY_DOZE);
    mDozePreference.setOnPreferenceChangeListener(this);
    mDozePulseIn = (ListPreference) findPreference(KEY_DOZE_PULSE_IN);
    mDozePulseIn.setOnPreferenceChangeListener(this);
    mDozePulseVisible = (ListPreference) findPreference(KEY_DOZE_PULSE_VISIBLE);
    mDozePulseVisible.setOnPreferenceChangeListener(this);
    mDozePulseOut = (ListPreference) findPreference(KEY_DOZE_PULSE_OUT);
    mDozePulseOut.setOnPreferenceChangeListener(this);
    mDozeTriggerPickup = (SwitchPreference) findPreference(KEY_DOZE_PULSE_PICKUP);
    mDozeTriggerPickup.setOnPreferenceChangeListener(this);
    mDozePulseOnNotification = (SwitchPreference) findPreference(KEY_DOZE_PULSE_ON_NOTIFICATION);
    mDozePulseOnNotification.setOnPreferenceChangeListener(this);
    updateDozeOptions();
    mDozeBrightness = (Preference) findPreference(KEY_DOZE_BRIGHTNESS_LEVEL);
}
Also used : Activity(android.app.Activity) ContentResolver(android.content.ContentResolver)

Aggregations

Activity (android.app.Activity)3220 Intent (android.content.Intent)612 View (android.view.View)535 Test (org.junit.Test)456 TextView (android.widget.TextView)263 Context (android.content.Context)220 ArrayList (java.util.ArrayList)201 Bundle (android.os.Bundle)197 DialogInterface (android.content.DialogInterface)167 SettingsActivity (com.android.settings.SettingsActivity)167 ViewGroup (android.view.ViewGroup)133 ImageView (android.widget.ImageView)116 AlertDialog (android.app.AlertDialog)109 LayoutInflater (android.view.LayoutInflater)109 Preference (android.support.v7.preference.Preference)83 PackageManager (android.content.pm.PackageManager)76 Uri (android.net.Uri)76 EditText (android.widget.EditText)72 ComponentName (android.content.ComponentName)71 Handler (android.os.Handler)71