aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2014-02-02 16:24:58 +0100
committerDominik Schürmann <dominik@dominikschuermann.de>2014-02-02 16:24:58 +0100
commit75faa60be162c95716e49fe1f4635bd04ab582b8 (patch)
tree3f98476ec9efdce9da2061e931bc27f1142f41f2 /OpenPGP-Keychain
parent172b57bb97afb7f1917f11e760495bb7fe4b8b8c (diff)
downloadopen-keychain-75faa60be162c95716e49fe1f4635bd04ab582b8.tar.gz
open-keychain-75faa60be162c95716e49fe1f4635bd04ab582b8.tar.bz2
open-keychain-75faa60be162c95716e49fe1f4635bd04ab582b8.zip
Hacks to make dialogs on Android 2.3 black on white, and not black on black
Diffstat (limited to 'OpenPGP-Keychain')
-rw-r--r--OpenPGP-Keychain/src/main/AndroidManifest.xml2
-rw-r--r--OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/FileDialogFragment.java8
-rw-r--r--OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ShareQrCodeDialogFragment.java3
-rw-r--r--OpenPGP-Keychain/src/main/res/drawable-hdpi/popup_center_bright.9.pngbin0 -> 1110 bytes
-rw-r--r--OpenPGP-Keychain/src/main/res/drawable-hdpi/popup_full_bright.9.pngbin0 -> 2039 bytes
-rw-r--r--OpenPGP-Keychain/src/main/res/layout/file_dialog.xml27
-rw-r--r--OpenPGP-Keychain/src/main/res/values-v14/styles.xml18
-rw-r--r--OpenPGP-Keychain/src/main/res/values/styles.xml22
8 files changed, 57 insertions, 23 deletions
diff --git a/OpenPGP-Keychain/src/main/AndroidManifest.xml b/OpenPGP-Keychain/src/main/AndroidManifest.xml
index 49442f163..414361a47 100644
--- a/OpenPGP-Keychain/src/main/AndroidManifest.xml
+++ b/OpenPGP-Keychain/src/main/AndroidManifest.xml
@@ -56,7 +56,7 @@
android:allowBackup="false"
android:hardwareAccelerated="true"
android:icon="@drawable/icon"
- android:theme="@style/Theme.AppCompat.Light"
+ android:theme="@style/KeychainTheme"
android:label="@string/app_name">
<activity
android:name=".ui.KeyListPublicActivity"
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);
diff --git a/OpenPGP-Keychain/src/main/res/drawable-hdpi/popup_center_bright.9.png b/OpenPGP-Keychain/src/main/res/drawable-hdpi/popup_center_bright.9.png
new file mode 100644
index 000000000..c2a739c42
--- /dev/null
+++ b/OpenPGP-Keychain/src/main/res/drawable-hdpi/popup_center_bright.9.png
Binary files differ
diff --git a/OpenPGP-Keychain/src/main/res/drawable-hdpi/popup_full_bright.9.png b/OpenPGP-Keychain/src/main/res/drawable-hdpi/popup_full_bright.9.png
new file mode 100644
index 000000000..6b8aa9d52
--- /dev/null
+++ b/OpenPGP-Keychain/src/main/res/drawable-hdpi/popup_full_bright.9.png
Binary files differ
diff --git a/OpenPGP-Keychain/src/main/res/layout/file_dialog.xml b/OpenPGP-Keychain/src/main/res/layout/file_dialog.xml
index 87816067f..a2939f571 100644
--- a/OpenPGP-Keychain/src/main/res/layout/file_dialog.xml
+++ b/OpenPGP-Keychain/src/main/res/layout/file_dialog.xml
@@ -1,32 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2010 Thialfihar <thi@thialfihar.org>
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:bootstrapbutton="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="5dip"
- android:paddingRight="5dip" >
+ android:paddingRight="5dip">
+
+ <TextView
+ android:id="@+id/message"
+ android:layout_marginBottom="8dp"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:orientation="horizontal" >
+ android:orientation="horizontal">
<EditText
android:id="@+id/input"
diff --git a/OpenPGP-Keychain/src/main/res/values-v14/styles.xml b/OpenPGP-Keychain/src/main/res/values-v14/styles.xml
new file mode 100644
index 000000000..4f8c45117
--- /dev/null
+++ b/OpenPGP-Keychain/src/main/res/values-v14/styles.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Used in Android >= 4 -->
+
+ <style name="KeychainTheme" parent="@style/Theme.AppCompat.Light">
+ </style>
+
+ <style name="SectionHeader">
+ <item name="android:drawableBottom">@drawable/section_header</item>
+ <item name="android:drawablePadding">4dp</item>
+ <item name="android:layout_marginTop">8dp</item>
+ <item name="android:paddingLeft">4dp</item>
+ <item name="android:textAllCaps">true</item>
+ <item name="android:textColor">@color/emphasis</item>
+ <item name="android:textSize">14sp</item>
+ </style>
+
+</resources> \ No newline at end of file
diff --git a/OpenPGP-Keychain/src/main/res/values/styles.xml b/OpenPGP-Keychain/src/main/res/values/styles.xml
index 9e61bbef4..f03d72605 100644
--- a/OpenPGP-Keychain/src/main/res/values/styles.xml
+++ b/OpenPGP-Keychain/src/main/res/values/styles.xml
@@ -1,14 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
+ <!-- Used in Android < 4 -->
+
+
+ <style name="KeychainTheme" parent="@style/Theme.AppCompat.Light">
+ <item name="android:alertDialogStyle">@style/CustomDialogTheme</item>
+ </style>
+
+ <!-- Ugly fix to make content background of Dialogs on Android < 4 white not black! -->
+ <style name="CustomDialogTheme" parent="@android:style/Theme.Dialog">
+ <item name="android:fullDark">@drawable/popup_full_bright</item>
+ <!--<item name="android:topDark">@android:drawable/popup_full_dark</item>-->
+ <item name="android:centerDark">@drawable/popup_center_bright</item>
+ <!--<item name="android:bottomDark">@android:drawable/popup_bottom_dark</item>-->
+ <!--<item name="fullBright">@android:drawable/popup_full_bright</item>-->
+ <!--<item name="topBright">@android:drawable/popup_top_bright</item>-->
+ <!--<item name="centerBright">@android:drawable/popup_center_bright</item>-->
+ <!--<item name="bottomBright">@android:drawable/popup_bottom_bright</item>-->
+ <!--<item name="bottomMedium">@android:drawable/popup_bottom_medium</item>-->
+ <!--<item name="centerMedium">@android:drawable/popup_center_medium</item>-->
+ </style>
<style name="SectionHeader">
<item name="android:drawableBottom">@drawable/section_header</item>
<item name="android:drawablePadding">4dp</item>
<item name="android:layout_marginTop">8dp</item>
<item name="android:paddingLeft">4dp</item>
- <!-- <item name="android:textAllCaps">true</item> -->
<item name="android:textColor">@color/emphasis</item>
<item name="android:textSize">14sp</item>
</style>
+
</resources> \ No newline at end of file