From 56d599dd7648c4eafd87f8802f10cc86bcd67a4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Mon, 13 Jul 2015 13:37:04 +0200 Subject: Use support.v7.app.AlertDialog --- .../ui/dialog/CustomAlertDialogBuilder.java | 30 ++-------------------- 1 file changed, 2 insertions(+), 28 deletions(-) (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CustomAlertDialogBuilder.java') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CustomAlertDialogBuilder.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CustomAlertDialogBuilder.java index 794af5b15..8a5cc0656 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CustomAlertDialogBuilder.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CustomAlertDialogBuilder.java @@ -17,18 +17,11 @@ package org.sufficientlysecure.keychain.ui.dialog; -import android.app.AlertDialog; import android.content.Context; -import android.view.View; -import android.widget.TextView; - -import org.sufficientlysecure.keychain.R; +import android.support.v7.app.AlertDialog; /** - * This class extends AlertDiaog.Builder, styling the header using emphasis color. - * Note that this class is a huge hack, because dialog boxes aren't easily stylable. - * Also, the dialog NEEDS to be called with show() directly, not create(), otherwise - * the order of internal operations will lead to a crash! + * Uses support lib's dialog builder. We can apply a theme here later! */ public class CustomAlertDialogBuilder extends AlertDialog.Builder { @@ -36,23 +29,4 @@ public class CustomAlertDialogBuilder extends AlertDialog.Builder { super(context); } - @Override - public AlertDialog show() { - AlertDialog dialog = super.show(); - - int dividerId = dialog.getContext().getResources().getIdentifier("android:id/titleDivider", null, null); - View divider = dialog.findViewById(dividerId); - if (divider != null) { - divider.setBackgroundColor(dialog.getContext().getResources().getColor(R.color.header_text)); - } - - int textViewId = dialog.getContext().getResources().getIdentifier("android:id/alertTitle", null, null); - TextView tv = (TextView) dialog.findViewById(textViewId); - if (tv != null) { - tv.setTextColor(dialog.getContext().getResources().getColor(R.color.header_text)); - } - - return dialog; - } - } -- cgit v1.2.3