diff options
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CustomAlertDialogBuilder.java')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CustomAlertDialogBuilder.java | 30 |
1 files changed, 2 insertions, 28 deletions
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; - } - } |