From 75faa60be162c95716e49fe1f4635bd04ab582b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Sun, 2 Feb 2014 16:24:58 +0100 Subject: Hacks to make dialogs on Android 2.3 black on white, and not black on black --- .../sufficientlysecure/keychain/ui/dialog/FileDialogFragment.java | 8 ++++++-- .../keychain/ui/dialog/ShareQrCodeDialogFragment.java | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'OpenPGP-Keychain/src/main/java') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/FileDialogFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/FileDialogFragment.java index 80ba8c725..39ce63b5f 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/FileDialogFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/FileDialogFragment.java @@ -33,10 +33,12 @@ import android.os.Message; import android.os.Messenger; import android.os.RemoteException; import android.support.v4.app.DialogFragment; +import android.text.Html; import android.view.LayoutInflater; import android.view.View; import android.widget.CheckBox; import android.widget.EditText; +import android.widget.TextView; import com.beardedhen.androidbootstrap.BootstrapButton; @@ -57,6 +59,7 @@ public class FileDialogFragment extends DialogFragment { private EditText mFilename; private BootstrapButton mBrowse; private CheckBox mCheckBox; + private TextView mMessageTextView; private static final int REQUEST_CODE = 0x00007004; @@ -96,12 +99,13 @@ public class FileDialogFragment extends DialogFragment { LayoutInflater inflater = (LayoutInflater) activity .getSystemService(Context.LAYOUT_INFLATER_SERVICE); AlertDialog.Builder alert = new AlertDialog.Builder(activity); - alert.setTitle(title); - alert.setMessage(message); View view = inflater.inflate(R.layout.file_dialog, null); + mMessageTextView = (TextView) view.findViewById(R.id.message); + mMessageTextView.setText(message); + mFilename = (EditText) view.findViewById(R.id.input); mFilename.setText(defaultFile); mBrowse = (BootstrapButton) view.findViewById(R.id.btn_browse); diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ShareQrCodeDialogFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ShareQrCodeDialogFragment.java index 653393749..9f3270250 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ShareQrCodeDialogFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ShareQrCodeDialogFragment.java @@ -32,6 +32,7 @@ import android.app.Dialog; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.DialogFragment; +import android.view.ContextThemeWrapper; import android.view.LayoutInflater; import android.view.View; import android.widget.Button; @@ -76,7 +77,7 @@ public class ShareQrCodeDialogFragment extends DialogFragment { Uri dataUri = getArguments().getParcelable(ARG_KEY_URI); mFingerprintOnly = getArguments().getBoolean(ARG_FINGERPRINT_ONLY); - AlertDialog.Builder alert = new AlertDialog.Builder(activity); + AlertDialog.Builder alert = new AlertDialog.Builder(getActivity()); alert.setTitle(R.string.share_qr_code_dialog_title); -- cgit v1.2.3