mirror of https://github.com/M66B/FairEmail.git
parent
f3b404e9c8
commit
c5662d05d2
@ -0,0 +1,42 @@
|
|||||||
|
package eu.faircode.email;
|
||||||
|
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.appcompat.app.AlertDialog;
|
||||||
|
import androidx.preference.PreferenceManager;
|
||||||
|
|
||||||
|
public class FragmentDialogNotifications extends FragmentDialogBase {
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
||||||
|
final Context context = getContext();
|
||||||
|
|
||||||
|
return new AlertDialog.Builder(context)
|
||||||
|
.setIcon(R.drawable.twotone_notifications_off_24)
|
||||||
|
.setTitle(R.string.title_hint_notifications)
|
||||||
|
.setMessage(R.string.title_hint_notifications_remark)
|
||||||
|
.setPositiveButton(R.string.title_fix, new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
Intent intent = new Intent(context, ActivitySetup.class)
|
||||||
|
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||||
|
context.startActivity(intent);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setNegativeButton(R.string.title_dismiss, new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
|
prefs.edit().putBoolean("notifications_reminder", false).apply();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.create();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue