From 75b10a845c801f57360f0fa4fca188ca86b8b00a Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 23 May 2013 15:59:05 +0400 Subject: [PATCH] headline style updates --- res/layout-sw600dp/feeds_row_selected.xml | 58 -------------- res/layout/feeds_row_selected.xml | 2 +- res/layout/headlines_row.xml | 66 +++++++--------- res/layout/headlines_row_selected.xml | 77 ++++++++----------- res/layout/headlines_row_selected_unread.xml | 73 ++++++++---------- res/layout/headlines_row_unread.xml | 65 +++++++--------- src/org/fox/ttrss/HeadlinesFragment.java | 4 +- .../offline/OfflineHeadlinesFragment.java | 10 ++- 8 files changed, 135 insertions(+), 220 deletions(-) delete mode 100644 res/layout-sw600dp/feeds_row_selected.xml diff --git a/res/layout-sw600dp/feeds_row_selected.xml b/res/layout-sw600dp/feeds_row_selected.xml deleted file mode 100644 index f6217520..00000000 --- a/res/layout-sw600dp/feeds_row_selected.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/res/layout/feeds_row_selected.xml b/res/layout/feeds_row_selected.xml index b1d53549..75d1fc07 100644 --- a/res/layout/feeds_row_selected.xml +++ b/res/layout/feeds_row_selected.xml @@ -3,7 +3,7 @@ android:id="@+id/feeds_row" android:layout_width="match_parent" android:layout_height="?android:attr/listPreferredItemHeight" - android:background="?feedsSelectedBackgroundSolid" + android:background="?feedsSelectedBackground" android:descendantFocusability="blocksDescendants" android:gravity="center_vertical" android:orientation="horizontal" diff --git a/res/layout/headlines_row.xml b/res/layout/headlines_row.xml index d339e281..c8a9a0e7 100644 --- a/res/layout/headlines_row.xml +++ b/res/layout/headlines_row.xml @@ -5,22 +5,17 @@ android:layout_height="wrap_content" android:background="?headlineNormalBackground" android:orientation="vertical" - android:paddingRight="6dp" > + android:paddingLeft="0dp" + android:paddingRight="6dp" + android:paddingTop="6dp" > - - + android:orientation="horizontal" + android:paddingLeft="6dp" > - + android:textSize="16sp" /> + android:orientation="horizontal" > + + + android:textSize="12sp" /> - + android:textSize="12sp" /> + android:textSize="13sp" /> + android:paddingLeft="6dp" > + android:textSize="12sp" /> diff --git a/res/layout/headlines_row_selected.xml b/res/layout/headlines_row_selected.xml index be2239d9..9607bf6c 100644 --- a/res/layout/headlines_row_selected.xml +++ b/res/layout/headlines_row_selected.xml @@ -5,22 +5,17 @@ android:layout_height="wrap_content" android:background="?headlineSelectedBackground" android:orientation="vertical" - android:paddingRight="6dp" > + android:paddingLeft="0dp" + android:paddingRight="6dp" + android:paddingTop="6dp" > - - + android:orientation="horizontal" + android:paddingLeft="6dp" > - + android:text="Sample entry title" + android:textColor="?headlineTextColor" + android:textSize="16sp" + android:textStyle="bold" /> + android:orientation="horizontal" > + + + android:text="Example Feed" + android:textColor="?headlineSecondaryTextColor" + android:textSize="12sp" /> - + android:text="Jan 01, 12:00" + android:textColor="?headlineSecondaryTextColor" + android:textSize="12sp" /> + android:textSize="13sp" /> + android:paddingLeft="6dp" > + android:textSize="12sp" /> - + - \ No newline at end of file diff --git a/res/layout/headlines_row_selected_unread.xml b/res/layout/headlines_row_selected_unread.xml index 93135abb..5b052dab 100644 --- a/res/layout/headlines_row_selected_unread.xml +++ b/res/layout/headlines_row_selected_unread.xml @@ -5,22 +5,17 @@ android:layout_height="wrap_content" android:background="?headlineSelectedBackground" android:orientation="vertical" - android:paddingRight="6dp" > + android:paddingLeft="0dp" + android:paddingRight="6dp" + android:paddingTop="6dp" > - - + android:orientation="horizontal" + android:paddingLeft="6dp" > - + android:orientation="horizontal" > + + + android:text="Example Feed" + android:textColor="?headlineSecondaryTextColor" + android:textSize="12sp" /> - + android:text="Jan 01, 12:00" + android:textColor="?headlineSecondaryTextColor" + android:textSize="12sp" /> + android:textSize="13sp" /> + android:paddingLeft="6dp" > + android:textSize="12sp" /> diff --git a/res/layout/headlines_row_unread.xml b/res/layout/headlines_row_unread.xml index fc1ab67a..89537907 100644 --- a/res/layout/headlines_row_unread.xml +++ b/res/layout/headlines_row_unread.xml @@ -5,22 +5,17 @@ android:layout_height="wrap_content" android:background="?headlineUnreadBackground" android:orientation="vertical" - android:paddingRight="6dp" > + android:paddingLeft="0dp" + android:paddingRight="6dp" + android:paddingTop="6dp" > - - + android:orientation="horizontal" + android:paddingLeft="6dp" > - + android:orientation="horizontal" > + + + android:textSize="12sp" /> - + android:textSize="12sp" /> + android:textSize="13sp" /> + android:paddingLeft="6dp" > + android:textSize="12sp" /> - \ No newline at end of file diff --git a/src/org/fox/ttrss/HeadlinesFragment.java b/src/org/fox/ttrss/HeadlinesFragment.java index b73121a7..2080b043 100644 --- a/src/org/fox/ttrss/HeadlinesFragment.java +++ b/src/org/fox/ttrss/HeadlinesFragment.java @@ -679,8 +679,10 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, TextView author = (TextView)v.findViewById(R.id.author); - if (author != null) { + if (author != null && articleAuthor.length() > 0) { author.setText(getString(R.string.author_formatted, articleAuthor)); + } else { + author.setText(""); } /* ImageView separator = (ImageView)v.findViewById(R.id.headlines_separator); diff --git a/src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java b/src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java index b8ac6023..e89d01f4 100644 --- a/src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java +++ b/src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java @@ -532,8 +532,14 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis if (ta != null) { int authorIndex = article.getColumnIndex("author"); - if (authorIndex >= 0) - ta.setText(article.getString(authorIndex)); + if (authorIndex >= 0) { + String author = article.getString(authorIndex); + + if (author != null && author.length() > 0) + ta.setText(getString(R.string.author_formatted, author)); + else + ta.setText(""); + } } /* ImageView separator = (ImageView)v.findViewById(R.id.headlines_separator);