Search in sources :

Example 1 with SupportFeatureProvider

use of com.android.settings.overlay.SupportFeatureProvider 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 2 with SupportFeatureProvider

use of com.android.settings.overlay.SupportFeatureProvider 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)

Aggregations

Activity (android.app.Activity)2 SupportFeatureProvider (com.android.settings.overlay.SupportFeatureProvider)2 AlertDialog (android.app.AlertDialog)1 Bundle (android.os.Bundle)1 View (android.view.View)1 CheckBox (android.widget.CheckBox)1 TextView (android.widget.TextView)1