Improved notification permissions dialog

pull/214/head
M66B 11 months ago
parent e31ca0a1c6
commit 77ab2c0450

@ -25,6 +25,8 @@ import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.text.SpannableStringBuilder;
import android.text.style.RelativeSizeSpan;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
@ -37,10 +39,17 @@ public class FragmentDialogNotifications extends FragmentDialogBase {
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) { public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
final Context context = getContext(); final Context context = getContext();
SpannableStringBuilder ssb = new SpannableStringBuilderEx();
ssb.append(context.getString(R.string.title_hint_notifications_remark));
ssb.append("\n\n");
int start = ssb.length();
ssb.append(context.getString(R.string.title_hint_dismiss));
ssb.setSpan(new RelativeSizeSpan(HtmlHelper.FONT_SMALL), start, ssb.length(), 0);
return new AlertDialog.Builder(context) return new AlertDialog.Builder(context)
.setIcon(R.drawable.twotone_notifications_off_24) .setIcon(R.drawable.twotone_notifications_off_24)
.setTitle(R.string.title_hint_notifications) .setTitle(R.string.title_hint_notifications)
.setMessage(R.string.title_hint_notifications_remark) .setMessage(ssb)
.setPositiveButton(R.string.title_fix, new DialogInterface.OnClickListener() { .setPositiveButton(R.string.title_fix, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {

Loading…
Cancel
Save