Permalink
Browse files

Fix text color in AlertDialogs for Android 2.x devices

Always use white text for the dialogs in 2.x, but on >= 3.0 let Android
pick the color on its own.
  • Loading branch information...
1 parent 56f6d52 commit 3121f74a8c303f7e988a88e5b6c4781c1dc6b849 @tuxmobil tuxmobil committed Apr 1, 2012
@@ -15,13 +15,15 @@
android:text="@string/AboutDialog_DevelopersTitle"
android:textSize="20sp"
android:padding="10sp"
+ style="?attr/dialogTextColor"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:autoLink="web"
android:text="@string/AboutDialog_DevelopersText"
android:padding="2sp"
+ style="?attr/dialogTextColor"
/>
<TextView
android:layout_width="fill_parent"
@@ -31,20 +33,23 @@
android:text="@string/AboutDialog_LicenceTitle"
android:textSize="20sp"
android:padding="10sp"
+ style="?attr/dialogTextColor"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:autoLink="web"
android:text="@string/AboutDialog_LicenceText"
android:padding="2sp"
+ style="?attr/dialogTextColor"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/translator_credits"
android:autoLink="web"
android:padding="2sp"
+ style="?attr/dialogTextColor"
/>
</LinearLayout>
@@ -16,6 +16,7 @@
android:layout_height="wrap_content"
android:text="@string/addFriend_Summ"
android:paddingBottom="20dp"
+ style="?attr/dialogTextColor"
/>
<EditText
android:id="@+id/AddContact_EditTextField"
@@ -5,6 +5,7 @@
android:paddingLeft="15dp" android:paddingRight="15dp" android:paddingBottom="15dp" android:paddingTop="10dp" android:layout_gravity="top">
<TextView android:id="@+id/text" android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ style="?attr/dialogTextColor"
android:gravity="top" android:textSize="16sp" android:paddingBottom="20dp"/>
<EditText android:layout_height="wrap_content" android:id="@+id/editText" android:layout_width="match_parent">
<requestFocus></requestFocus>
@@ -19,6 +19,7 @@
android:text="@string/StartupDialog_Summary"
android:drawablePadding="10sp"
android:padding="10sp"
+ style="?attr/dialogTextColor"
android:focusable="true"
/>
<ScrollView android:id="@+id/StartupDialog_ScrollView"
@@ -36,6 +37,7 @@
android:layout_height="wrap_content"
android:text="@string/StartupDialog_Username_title"
android:padding="2sp"
+ style="?attr/dialogTextColor"
/>
<EditText
android:id="@+id/StartupDialog_JID_EditTextField"
@@ -55,6 +57,7 @@
android:layout_height="wrap_content"
android:text="@string/StartupDialog_passwd_title"
android:padding="2sp"
+ style="?attr/dialogTextColor"
/>
<EditText
android:id="@+id/StartupDialog_PASSWD_EditTextField"
@@ -16,6 +16,7 @@
android:text="@string/MoveRosterEntryToGroupDialog_summ"
android:layout_marginBottom="10dp"
android:focusable="true"
+ style="?attr/dialogTextColor"
/>
<org.yaxim.androidclient.dialogs.GroupNameView
android:id="@+id/moverosterentrytogroupview_gv"
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <style name="dialogBackground">
+ <!-- empty -->
+ </style>
+</resources>
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <style name="dialogBackground">
+ <item name="android:textColor">#fff</item>
+ </style>
+</resources>
@@ -4,6 +4,7 @@
<attr name="MainGroup" format="reference" />
<attr name="MainChild" format="reference" />
<attr name="ErrorView" format="reference" />
+ <attr name="dialogTextColor" format="reference" />
<!-- Attributes -->
<attr name="ChatMsgHeaderMeColor" format="reference|color" />
@@ -21,6 +21,7 @@
<item name="ErrorView">@style/StyleErrorView.Light</item>
<item name="ChatNewMessageColor">#ffb0b0b0</item>
<item name="ChatStoredMessageColor">#60b0b0b0</item>
+ <item name="dialogTextColor">@style/dialogBackground</item>
</style>
<style name="IndeterminateProgress" parent="Widget.Sherlock.ProgressBar">
@@ -54,6 +55,7 @@
<item name="ChatNewMessageColor">#ff404040</item>
<item name="ChatStoredMessageColor">#60404040</item>
<item name="ErrorView">@style/StyleErrorView</item>
+ <item name="dialogTextColor">@style/dialogBackground</item>
</style>
</resources>

0 comments on commit 3121f74

Please sign in to comment.