From c16319a4bff82d5bb6113a2a440be81aafbf7b41 Mon Sep 17 00:00:00 2001 From: GKF Date: Fri, 31 May 2019 08:43:53 +0800 Subject: [PATCH] Theme --- app/src/main/java/io/legado/app/lib/theme/ATH.java | 3 ++- .../main/java/io/legado/app/utils/AlertDialogExtensions.kt | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 app/src/main/java/io/legado/app/utils/AlertDialogExtensions.kt diff --git a/app/src/main/java/io/legado/app/lib/theme/ATH.java b/app/src/main/java/io/legado/app/lib/theme/ATH.java index d7ee194d1..cc135ab5d 100644 --- a/app/src/main/java/io/legado/app/lib/theme/ATH.java +++ b/app/src/main/java/io/legado/app/lib/theme/ATH.java @@ -99,7 +99,7 @@ public final class ATH { TintHelper.setTintAuto(view, color, true); } - public static void setAlertDialogTint(@NonNull AlertDialog dialog) { + public static AlertDialog setAlertDialogTint(@NonNull AlertDialog dialog) { ColorStateList colorStateList = Selector.colorBuild() .setDefaultColor(ThemeStore.accentColor(dialog.getContext())) .setPressedColor(ColorUtil.darkenColor(ThemeStore.accentColor(dialog.getContext()))) @@ -110,6 +110,7 @@ public final class ATH { if (dialog.getButton(androidx.appcompat.app.AlertDialog.BUTTON_POSITIVE) != null) { dialog.getButton(androidx.appcompat.app.AlertDialog.BUTTON_POSITIVE).setTextColor(colorStateList); } + return dialog; } private ATH() { diff --git a/app/src/main/java/io/legado/app/utils/AlertDialogExtensions.kt b/app/src/main/java/io/legado/app/utils/AlertDialogExtensions.kt new file mode 100644 index 000000000..300309ca7 --- /dev/null +++ b/app/src/main/java/io/legado/app/utils/AlertDialogExtensions.kt @@ -0,0 +1,7 @@ +package io.legado.app.utils + +import androidx.appcompat.app.AlertDialog +import io.legado.app.lib.theme.ATH + +val AlertDialog.upTint: AlertDialog + get() = ATH.setAlertDialogTint(this) \ No newline at end of file