Search in sources :

Example 11 with SystemUIDialog

use of com.android.systemui.statusbar.phone.SystemUIDialog in project android_frameworks_base by AOSPA.

the class DataSaverTile method handleClick.

@Override
protected void handleClick() {
    if (mState.value || Prefs.getBoolean(mContext, Prefs.Key.QS_DATA_SAVER_DIALOG_SHOWN, false)) {
        // Do it right away.
        toggleDataSaver();
        return;
    }
    // Shows dialog first
    SystemUIDialog dialog = new SystemUIDialog(mContext);
    dialog.setTitle(com.android.internal.R.string.data_saver_enable_title);
    dialog.setMessage(com.android.internal.R.string.data_saver_description);
    dialog.setPositiveButton(com.android.internal.R.string.data_saver_enable_button, new DialogInterface.OnClickListener() {

        @Override
        public void onClick(DialogInterface dialog, int which) {
            toggleDataSaver();
        }
    });
    dialog.setNegativeButton(com.android.internal.R.string.cancel, null);
    dialog.setShowForAllUsers(true);
    dialog.show();
    Prefs.putBoolean(mContext, Prefs.Key.QS_DATA_SAVER_DIALOG_SHOWN, true);
}
Also used : SystemUIDialog(com.android.systemui.statusbar.phone.SystemUIDialog) DialogInterface(android.content.DialogInterface)

Example 12 with SystemUIDialog

use of com.android.systemui.statusbar.phone.SystemUIDialog in project android_frameworks_base by AOSPA.

the class TunerService method showResetRequest.

public static final void showResetRequest(final Context context, final Runnable onDisabled) {
    SystemUIDialog dialog = new SystemUIDialog(context);
    dialog.setShowForAllUsers(true);
    dialog.setMessage(R.string.remove_from_settings_prompt);
    dialog.setButton(DialogInterface.BUTTON_NEGATIVE, context.getString(R.string.cancel), (OnClickListener) null);
    dialog.setButton(DialogInterface.BUTTON_POSITIVE, context.getString(R.string.guest_exit_guest_dialog_remove), new OnClickListener() {

        @Override
        public void onClick(DialogInterface dialog, int which) {
            // Tell the tuner (in main SysUI process) to clear all its settings.
            context.sendBroadcast(new Intent(TunerService.ACTION_CLEAR));
            // Disable access to tuner.
            TunerService.setTunerEnabled(context, false);
            // Make them sit through the warning dialog again.
            Settings.Secure.putInt(context.getContentResolver(), TunerFragment.SETTING_SEEN_TUNER_WARNING, 0);
            if (onDisabled != null) {
                onDisabled.run();
            }
        }
    });
    dialog.show();
}
Also used : SystemUIDialog(com.android.systemui.statusbar.phone.SystemUIDialog) DialogInterface(android.content.DialogInterface) OnClickListener(android.content.DialogInterface.OnClickListener) Intent(android.content.Intent)

Example 13 with SystemUIDialog

use of com.android.systemui.statusbar.phone.SystemUIDialog in project platform_frameworks_base by android.

the class VolumeUI method showServiceActivationDialog.

private void showServiceActivationDialog(final ComponentName component) {
    final SystemUIDialog d = new SystemUIDialog(mContext);
    d.setMessage(mContext.getString(R.string.volumeui_prompt_message, getAppLabel(component)));
    d.setPositiveButton(R.string.volumeui_prompt_allow, new OnClickListener() {

        @Override
        public void onClick(DialogInterface dialog, int which) {
            mVolumeControllerService.setComponent(component);
        }
    });
    d.setNegativeButton(R.string.volumeui_prompt_deny, null);
    d.show();
}
Also used : SystemUIDialog(com.android.systemui.statusbar.phone.SystemUIDialog) DialogInterface(android.content.DialogInterface) OnClickListener(android.content.DialogInterface.OnClickListener)

Example 14 with SystemUIDialog

use of com.android.systemui.statusbar.phone.SystemUIDialog in project platform_frameworks_base by android.

the class TunerService method showResetRequest.

public static final void showResetRequest(final Context context, final Runnable onDisabled) {
    SystemUIDialog dialog = new SystemUIDialog(context);
    dialog.setShowForAllUsers(true);
    dialog.setMessage(R.string.remove_from_settings_prompt);
    dialog.setButton(DialogInterface.BUTTON_NEGATIVE, context.getString(R.string.cancel), (OnClickListener) null);
    dialog.setButton(DialogInterface.BUTTON_POSITIVE, context.getString(R.string.guest_exit_guest_dialog_remove), new OnClickListener() {

        @Override
        public void onClick(DialogInterface dialog, int which) {
            // Tell the tuner (in main SysUI process) to clear all its settings.
            context.sendBroadcast(new Intent(TunerService.ACTION_CLEAR));
            // Disable access to tuner.
            TunerService.setTunerEnabled(context, false);
            // Make them sit through the warning dialog again.
            Settings.Secure.putInt(context.getContentResolver(), TunerFragment.SETTING_SEEN_TUNER_WARNING, 0);
            if (onDisabled != null) {
                onDisabled.run();
            }
        }
    });
    dialog.show();
}
Also used : SystemUIDialog(com.android.systemui.statusbar.phone.SystemUIDialog) DialogInterface(android.content.DialogInterface) OnClickListener(android.content.DialogInterface.OnClickListener) Intent(android.content.Intent)

Example 15 with SystemUIDialog

use of com.android.systemui.statusbar.phone.SystemUIDialog in project platform_frameworks_base by android.

the class PowerNotificationWarnings method showStartSaverConfirmation.

private void showStartSaverConfirmation() {
    if (mSaverConfirmation != null)
        return;
    final SystemUIDialog d = new SystemUIDialog(mContext);
    d.setTitle(R.string.battery_saver_confirmation_title);
    d.setMessage(com.android.internal.R.string.battery_saver_description);
    d.setNegativeButton(android.R.string.cancel, null);
    d.setPositiveButton(R.string.battery_saver_confirmation_ok, mStartSaverMode);
    d.setShowForAllUsers(true);
    d.setOnDismissListener(new OnDismissListener() {

        @Override
        public void onDismiss(DialogInterface dialog) {
            mSaverConfirmation = null;
        }
    });
    d.show();
    mSaverConfirmation = d;
}
Also used : SystemUIDialog(com.android.systemui.statusbar.phone.SystemUIDialog) DialogInterface(android.content.DialogInterface) OnDismissListener(android.content.DialogInterface.OnDismissListener)

Aggregations

SystemUIDialog (com.android.systemui.statusbar.phone.SystemUIDialog)28 DialogInterface (android.content.DialogInterface)19 OnClickListener (android.content.DialogInterface.OnClickListener)9 OnDismissListener (android.content.DialogInterface.OnDismissListener)5 View (android.view.View)5 ImageView (android.widget.ImageView)5 TextView (android.widget.TextView)5 Intent (android.content.Intent)4 SpannableStringBuilder (android.text.SpannableStringBuilder)4 LinkMovementMethod (android.text.method.LinkMovementMethod)4 ActivityManager (android.app.ActivityManager)1 ApplicationInfo (android.content.pm.ApplicationInfo)1 PackageManager (android.content.pm.PackageManager)1 NameNotFoundException (android.content.pm.PackageManager.NameNotFoundException)1 Drawable (android.graphics.drawable.Drawable)1 StatusBarNotification (android.service.notification.StatusBarNotification)1 ViewGroup (android.view.ViewGroup)1 OnDismissAction (com.android.keyguard.KeyguardHostView.OnDismissAction)1 GestureAnywhereView (com.android.systemui.chaos.lab.gestureanywhere.GestureAnywhereView)1 NavigationBarView (com.android.systemui.statusbar.phone.NavigationBarView)1