diff options
author | cyBerta <cyberta@riseup.net> | 2019-07-12 19:11:42 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2019-07-12 19:11:42 +0200 |
commit | f6200adfb2ea0cf27547263c2045887f3a208d26 (patch) | |
tree | 52bc1fbbdea5ee22c38224a9f1f3572fd63726a8 /app/src/main/java/se/leap/bitmaskclient/fragments | |
parent | db501825dfbe21e74a8839d117f4f194bad73b2f (diff) |
reduce the always on alert dialog customization for now
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/fragments')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/fragments/AlwaysOnDialog.java | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/fragments/AlwaysOnDialog.java b/app/src/main/java/se/leap/bitmaskclient/fragments/AlwaysOnDialog.java index 34ad971e..09817b78 100644 --- a/app/src/main/java/se/leap/bitmaskclient/fragments/AlwaysOnDialog.java +++ b/app/src/main/java/se/leap/bitmaskclient/fragments/AlwaysOnDialog.java @@ -1,31 +1,24 @@ package se.leap.bitmaskclient.fragments; import android.app.Dialog; -import android.content.Context; -import android.content.DialogInterface; import android.content.Intent; import android.os.Build; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; -import android.support.v4.text.TextUtilsCompat; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatDialogFragment; import android.support.v7.widget.AppCompatTextView; -import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; -import android.widget.Button; import android.widget.CheckBox; import butterknife.ButterKnife; import butterknife.InjectView; -import butterknife.OnClick; import se.leap.bitmaskclient.R; import se.leap.bitmaskclient.views.IconTextView; import static se.leap.bitmaskclient.utils.PreferenceHelper.saveShowAlwaysOnDialog; -import static se.leap.bitmaskclient.utils.ViewHelper.convertDimensionToPx; /** @@ -68,23 +61,16 @@ public class AlwaysOnDialog extends AppCompatDialogFragment { blockVpnUserMessage.setVisibility(View.VISIBLE); } - builder.setView(view); + builder.setView(view) + .setPositiveButton(android.R.string.ok, (dialog, id) -> { + if (doNotShowAgainCheckBox.isChecked()) { + saveShowAlwaysOnDialog(getContext(), false); + } + Intent intent = new Intent("android.net.vpn.SETTINGS"); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(intent); + }) + .setNegativeButton(R.string.cancel, (dialog, id) -> dialog.cancel()); return builder.create(); } - - @OnClick(R.id.button_ok) - public void onOkClicked() { - if (doNotShowAgainCheckBox.isChecked()) { - saveShowAlwaysOnDialog(getContext(), false); - } - Intent intent = new Intent("android.net.vpn.SETTINGS"); - intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - startActivity(intent); - dismiss(); - } - - @OnClick(R.id.button_cancel) - public void onCancelClicked() { - dismiss(); - } } |