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));
}
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();
}
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);
}
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));
}
}
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);
}
Aggregations