From a55c83693c3cfc3de3f89160cc38f95d7a6d75c4 Mon Sep 17 00:00:00 2001 From: Mark Anderson Date: Mon, 9 Jun 2014 21:29:32 +0100 Subject: [PATCH] Dark theme for profile activity --- .../NewsBlur/res/layout/activity_profile.xml | 2 +- .../res/layout/fragment_profileactivity.xml | 7 ++-- .../res/layout/fragment_profiledetails.xml | 2 +- .../res/layout/profile_user_statistics.xml | 18 ++++------- .../NewsBlur/res/layout/row_activity.xml | 7 ++-- clients/android/NewsBlur/res/values/attrs.xml | 3 ++ .../android/NewsBlur/res/values/colors.xml | 1 + .../android/NewsBlur/res/values/styles.xml | 32 ++++++++++++++++++- clients/android/NewsBlur/res/values/theme.xml | 6 ++++ .../com/newsblur/view/ActivitiesAdapter.java | 12 +++++-- 10 files changed, 64 insertions(+), 26 deletions(-) diff --git a/clients/android/NewsBlur/res/layout/activity_profile.xml b/clients/android/NewsBlur/res/layout/activity_profile.xml index 934f258d9..e3e4f0c42 100644 --- a/clients/android/NewsBlur/res/layout/activity_profile.xml +++ b/clients/android/NewsBlur/res/layout/activity_profile.xml @@ -2,7 +2,7 @@ + style="?itemBackground" > \ No newline at end of file diff --git a/clients/android/NewsBlur/res/layout/fragment_profiledetails.xml b/clients/android/NewsBlur/res/layout/fragment_profiledetails.xml index 301175945..762036224 100644 --- a/clients/android/NewsBlur/res/layout/fragment_profiledetails.xml +++ b/clients/android/NewsBlur/res/layout/fragment_profiledetails.xml @@ -2,7 +2,7 @@ @@ -28,10 +27,9 @@ android:layout_height="fill_parent" android:layout_marginRight="1dp" android:layout_weight="1" - android:background="@color/item_background" + style="?profileCount" android:gravity="center_horizontal" android:paddingTop="12dp" - android:textColor="@color/darkgray" android:textSize="30dp" android:textStyle="bold" /> @@ -41,10 +39,9 @@ android:layout_height="fill_parent" android:layout_marginRight="1dp" android:layout_weight="1" - android:background="@color/item_background" + style="?profileCount" android:gravity="center_horizontal" android:paddingTop="12dp" - android:textColor="@color/darkgray" android:textSize="30dp" android:textStyle="bold" /> @@ -59,12 +56,11 @@ android:layout_height="fill_parent" android:layout_marginRight="1dp" android:layout_weight="1" - android:background="@color/item_background" + style="?profileCount" android:gravity="center_horizontal" android:paddingBottom="15dp" android:paddingTop="3dp" android:text="@string/profile_shared" - android:textColor="@color/darkgray" android:textSize="11dp" /> diff --git a/clients/android/NewsBlur/res/layout/row_activity.xml b/clients/android/NewsBlur/res/layout/row_activity.xml index 26003bdbf..60b465ee9 100644 --- a/clients/android/NewsBlur/res/layout/row_activity.xml +++ b/clients/android/NewsBlur/res/layout/row_activity.xml @@ -2,7 +2,7 @@ @@ -23,19 +23,18 @@ android:layout_alignParentRight="true" android:layout_alignParentTop="true" android:layout_marginRight="10dp" - android:textColor="@color/darkgray" + style="?profileActivityRow" android:textSize="10dp" /> \ No newline at end of file diff --git a/clients/android/NewsBlur/res/values/attrs.xml b/clients/android/NewsBlur/res/values/attrs.xml index 8b2a2e22f..2dc790498 100644 --- a/clients/android/NewsBlur/res/values/attrs.xml +++ b/clients/android/NewsBlur/res/values/attrs.xml @@ -24,6 +24,9 @@ + + + diff --git a/clients/android/NewsBlur/res/values/colors.xml b/clients/android/NewsBlur/res/values/colors.xml index 672a9598a..b935db457 100644 --- a/clients/android/NewsBlur/res/values/colors.xml +++ b/clients/android/NewsBlur/res/values/colors.xml @@ -83,6 +83,7 @@ #0E366f #405BA8 + #319DC5 #CC2A2E diff --git a/clients/android/NewsBlur/res/values/styles.xml b/clients/android/NewsBlur/res/values/styles.xml index 4b8388b75..c317a29a9 100644 --- a/clients/android/NewsBlur/res/values/styles.xml +++ b/clients/android/NewsBlur/res/values/styles.xml @@ -71,7 +71,7 @@ + + + + + + + + + + + + diff --git a/clients/android/NewsBlur/res/values/theme.xml b/clients/android/NewsBlur/res/values/theme.xml index 0ffd91201..76bc7c50f 100644 --- a/clients/android/NewsBlur/res/values/theme.xml +++ b/clients/android/NewsBlur/res/values/theme.xml @@ -25,6 +25,9 @@ @style/folderBorderTop @style/folderBorderBottom @style/divider + @style/profileCount + @style/profileActivityList + @style/profileActivityRow diff --git a/clients/android/NewsBlur/src/com/newsblur/view/ActivitiesAdapter.java b/clients/android/NewsBlur/src/com/newsblur/view/ActivitiesAdapter.java index ac9274845..d05e6dee1 100644 --- a/clients/android/NewsBlur/src/com/newsblur/view/ActivitiesAdapter.java +++ b/clients/android/NewsBlur/src/com/newsblur/view/ActivitiesAdapter.java @@ -22,6 +22,7 @@ import com.newsblur.activity.Profile; import com.newsblur.domain.UserDetails; import com.newsblur.network.domain.ActivitiesResponse; import com.newsblur.util.ImageLoader; +import com.newsblur.util.PrefsUtils; public class ActivitiesAdapter extends ArrayAdapter { @@ -52,9 +53,14 @@ public class ActivitiesAdapter extends ArrayAdapter { sharedStory = resources.getString(R.string.profile_shared_story); withComment = resources.getString(R.string.profile_with_comment); ago = resources.getString(R.string.profile_ago); - - highlight = new ForegroundColorSpan(resources.getColor(R.color.linkblue)); - darkgray = new ForegroundColorSpan(resources.getColor(R.color.darkgray)); + + if (PrefsUtils.isLightThemeSelected(context)) { + highlight = new ForegroundColorSpan(resources.getColor(R.color.linkblue)); + darkgray = new ForegroundColorSpan(resources.getColor(R.color.darkgray)); + } else { + highlight = new ForegroundColorSpan(resources.getColor(R.color.dark_linkblue)); + darkgray = new ForegroundColorSpan(resources.getColor(R.color.white)); + } } @Override