diff options
author | Andrew Dolgov <[email protected]> | 2014-01-24 13:41:37 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2014-01-24 13:41:37 +0400 |
commit | 8a97531a5a1d2e013db08b7fbef0eb2cd10baaf9 (patch) | |
tree | 97dc743ac00a46be77d00d3bdebad4795a533ce7 | |
parent | e840ebbc96d080b0d0ef278ba74461dbd3b0a5c2 (diff) |
tweak typography and layouts a bit
-rw-r--r-- | AndroidManifest.xml | 4 | ||||
-rw-r--r-- | res/layout/article_fragment.xml | 35 | ||||
-rw-r--r-- | res/layout/article_fragment_compat.xml | 25 | ||||
-rw-r--r-- | res/layout/headlines_row.xml | 5 | ||||
-rw-r--r-- | res/layout/headlines_row_selected.xml | 5 | ||||
-rw-r--r-- | res/layout/headlines_row_selected_unread.xml | 5 | ||||
-rw-r--r-- | res/layout/headlines_row_unread.xml | 9 | ||||
-rw-r--r-- | src/org/fox/ttrss/ArticleFragment.java | 30 | ||||
-rw-r--r-- | src/org/fox/ttrss/offline/OfflineArticleFragment.java | 35 |
9 files changed, 82 insertions, 71 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index b140ace3..af410bb2 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.fox.ttrss" - android:versionCode="230" - android:versionName="1.34" > + android:versionCode="231" + android:versionName="1.35" > <uses-sdk android:minSdkVersion="8" diff --git a/res/layout/article_fragment.xml b/res/layout/article_fragment.xml index 70016361..65ff34f9 100644 --- a/res/layout/article_fragment.xml +++ b/res/layout/article_fragment.xml @@ -1,7 +1,7 @@ <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/article_fragment"
android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_height="match_parent"
android:background="?articleBackground"
android:padding="5sp" >
@@ -28,46 +28,28 @@ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
+ android:paddingTop="4dp"
+ android:fontFamily="sans-serif-condensed"
android:paddingBottom="4dp"
- android:text="My simple headline"
+ android:text="My simple headline"
android:textColor="?linkColor"
android:textSize="18sp" />
<TextView
- android:id="@+id/author"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:ellipsize="end"
- android:gravity="right"
- android:singleLine="true"
- android:text="by Author"
- android:textColor="?headlineSecondaryTextColor"
- android:textSize="12sp" />
-
- <TextView
android:id="@+id/comments"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
- android:gravity="right"
+ android:fontFamily="sans-serif-light"
android:text="24 comments"
android:textColor="?linkColor"
android:textSize="12sp" />
- <ImageView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="4dp"
- android:layout_marginTop="4dp"
- android:layout_weight="0"
- android:background="?ttrssHorizontalDivider"
- android:paddingTop="2dip" />
-
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_weight="1"
+ android:layout_weight="1"
+ android:paddingTop="4dp"
android:paddingBottom="4dp" >
<TextView
@@ -77,6 +59,7 @@ android:layout_weight="0.5"
android:ellipsize="end"
android:singleLine="true"
+ android:fontFamily="sans-serif-light"
android:text="Example Feed"
android:textColor="?headlineSecondaryTextColor"
android:textSize="12sp" />
@@ -87,10 +70,12 @@ android:layout_height="wrap_content"
android:layout_weight="0.5"
android:gravity="right"
+ android:fontFamily="sans-serif-light"
android:text="Jan 01, 12:00"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?headlineSecondaryTextColor"
android:textSize="12sp" />
+
</LinearLayout>
</LinearLayout>
diff --git a/res/layout/article_fragment_compat.xml b/res/layout/article_fragment_compat.xml index 8c37eb72..dfe49ae7 100644 --- a/res/layout/article_fragment_compat.xml +++ b/res/layout/article_fragment_compat.xml @@ -26,41 +26,22 @@ android:layout_height="wrap_content" android:layout_weight="1" android:paddingBottom="4dp" + android:fontFamily="sans-serif-condensed" android:text="My simple headline" android:textColor="?linkColor" android:textSize="18sp" /> <TextView - android:id="@+id/author" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_weight="1" - android:ellipsize="end" - android:gravity="right" - android:singleLine="true" - android:text="by Author" - android:textColor="?headlineSecondaryTextColor" - android:textSize="12sp" /> - - <TextView android:id="@+id/comments" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="right" android:text="24 comments" + android:fontFamily="sans-serif-light" android:textColor="?linkColor" android:textSize="12sp" /> - <ImageView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="4dp" - android:layout_marginTop="4dp" - android:layout_weight="0" - android:background="?ttrssHorizontalDivider" - android:paddingTop="2dip" /> - <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" @@ -75,6 +56,7 @@ android:ellipsize="end" android:singleLine="true" android:text="Example Feed" + android:fontFamily="sans-serif-light" android:textColor="?headlineSecondaryTextColor" android:textSize="12sp" /> @@ -85,6 +67,7 @@ android:layout_weight="0.5" android:gravity="right" android:text="Jan 01, 12:00" + android:fontFamily="sans-serif-light" android:textAppearance="?android:attr/textAppearanceSmall" android:textColor="?headlineSecondaryTextColor" android:textSize="12sp" /> diff --git a/res/layout/headlines_row.xml b/res/layout/headlines_row.xml index 6df28379..92998b3e 100644 --- a/res/layout/headlines_row.xml +++ b/res/layout/headlines_row.xml @@ -36,6 +36,7 @@ android:gravity="center_vertical"
android:singleLine="false"
android:text="Sample entry title"
+ android:fontFamily="sans-serif-condensed"
android:textColor="?headlineTextColor"
android:textSize="18sp" />
</LinearLayout>
@@ -58,6 +59,7 @@ android:gravity="center_vertical"
android:singleLine="true"
android:text="Example Feed"
+ android:fontFamily="sans-serif-light"
android:textColor="?headlineSecondaryTextColor"
android:textSize="12sp" />
@@ -68,6 +70,7 @@ android:layout_weight="1"
android:gravity="right|center_vertical"
android:text="Jan 01, 12:00"
+ android:fontFamily="sans-serif-light"
android:textColor="?headlineSecondaryTextColor"
android:textSize="12sp" />
</LinearLayout>
@@ -102,6 +105,8 @@ android:gravity="center_vertical"
android:singleLine="true"
android:text="by Author"
+ android:fontFamily="sans-serif-light"
+ android:textStyle="italic"
android:textColor="?headlineSecondaryTextColor"
android:textSize="12sp" />
diff --git a/res/layout/headlines_row_selected.xml b/res/layout/headlines_row_selected.xml index 849e2b6f..2f6e9cba 100644 --- a/res/layout/headlines_row_selected.xml +++ b/res/layout/headlines_row_selected.xml @@ -31,6 +31,7 @@ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
+ android:fontFamily="sans-serif-condensed"
android:gravity="center_vertical"
android:singleLine="false"
android:text="Sample entry title"
@@ -55,6 +56,7 @@ android:ellipsize="end"
android:gravity="center_vertical"
android:singleLine="true"
+ android:fontFamily="sans-serif-light"
android:text="Example Feed"
android:textColor="?headlineSelectedSecondaryTextColor"
android:textSize="12sp" />
@@ -66,6 +68,7 @@ android:layout_weight="1"
android:gravity="right|center_vertical"
android:text="Jan 01, 12:00"
+ android:fontFamily="sans-serif-light"
android:textColor="?headlineSelectedSecondaryTextColor"
android:textSize="12sp" />
</LinearLayout>
@@ -100,6 +103,8 @@ android:gravity="center_vertical"
android:singleLine="true"
android:text="by Author"
+ android:fontFamily="sans-serif-light"
+ android:textStyle="italic"
android:textColor="?headlineSelectedSecondaryTextColor"
android:textSize="12sp" />
diff --git a/res/layout/headlines_row_selected_unread.xml b/res/layout/headlines_row_selected_unread.xml index 0fa6e213..d8ab9ce5 100644 --- a/res/layout/headlines_row_selected_unread.xml +++ b/res/layout/headlines_row_selected_unread.xml @@ -34,6 +34,7 @@ android:gravity="center_vertical"
android:singleLine="false"
android:text="Sample entry title"
+ android:fontFamily="sans-serif-condensed"
android:textColor="?headlineSelectedTextColor"
android:textSize="18sp"
android:textStyle="bold" />
@@ -57,6 +58,7 @@ android:gravity="center_vertical"
android:singleLine="true"
android:text="Example Feed"
+ android:fontFamily="sans-serif-light"
android:textColor="?headlineSelectedSecondaryTextColor"
android:textSize="12sp" />
@@ -66,6 +68,7 @@ android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right|center_vertical"
+ android:fontFamily="sans-serif-light"
android:text="Jan 01, 12:00"
android:textColor="?headlineSelectedSecondaryTextColor"
android:textSize="12sp" />
@@ -101,6 +104,8 @@ android:gravity="center_vertical"
android:singleLine="true"
android:text="by Author"
+ android:fontFamily="sans-serif-light"
+ android:textStyle="italic"
android:textColor="?headlineSelectedSecondaryTextColor"
android:textSize="12sp" />
diff --git a/res/layout/headlines_row_unread.xml b/res/layout/headlines_row_unread.xml index 44f1c218..94df05f3 100644 --- a/res/layout/headlines_row_unread.xml +++ b/res/layout/headlines_row_unread.xml @@ -28,6 +28,7 @@ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
+ android:fontFamily="sans-serif-condensed"
android:gravity="center_vertical"
android:singleLine="false"
android:text="Sample entry title"
@@ -53,15 +54,17 @@ android:ellipsize="end"
android:gravity="center_vertical"
android:singleLine="true"
- android:text="Example Feed"
+ android:fontFamily="sans-serif-light"
+ android:text="Example Feed"
android:textColor="?headlineSecondaryTextColor"
android:textSize="12sp" />
<TextView
android:id="@+id/date"
- android:layout_width="wrap_content"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
+ android:fontFamily="sans-serif-light"
android:gravity="right|center_vertical"
android:text="Jan 01, 12:00"
android:textColor="?headlineSecondaryTextColor"
@@ -98,6 +101,8 @@ android:gravity="center_vertical"
android:singleLine="true"
android:text="by Author"
+ android:fontFamily="sans-serif-light"
+ android:textStyle="italic"
android:textColor="?headlineSecondaryTextColor"
android:textSize="12sp" />
diff --git a/src/org/fox/ttrss/ArticleFragment.java b/src/org/fox/ttrss/ArticleFragment.java index d7791d83..96c119d9 100644 --- a/src/org/fox/ttrss/ArticleFragment.java +++ b/src/org/fox/ttrss/ArticleFragment.java @@ -333,12 +333,31 @@ public class ArticleFragment extends Fragment { DateFormat df = new SimpleDateFormat("MMM dd, HH:mm"); dv.setText(df.format(d)); } + + TextView author = (TextView)view.findViewById(R.id.author); + + boolean hasAuthor = false; + if (author != null) { + if (m_article.author != null && m_article.author.length() > 0) { + author.setText(getString(R.string.author_formatted, m_article.author)); + } else { + author.setVisibility(View.GONE); + } + hasAuthor = true; + } + TextView tagv = (TextView)view.findViewById(R.id.tags); if (tagv != null) { if (m_article.feed_title != null) { - tagv.setText(m_article.feed_title); + String fTitle = m_article.feed_title; + + if (!hasAuthor && m_article.author != null && m_article.author.length() > 0) { + fTitle += " (" + getString(R.string.author_formatted, m_article.author) + ")"; + } + + tagv.setText(fTitle); } else if (m_article.tags != null) { String tagsStr = ""; @@ -353,15 +372,6 @@ public class ArticleFragment extends Fragment { } } - TextView author = (TextView)view.findViewById(R.id.author); - - if (author != null) { - if (m_article.author != null && m_article.author.length() > 0) { - author.setText(getString(R.string.author_formatted, m_article.author)); - } else { - author.setVisibility(View.GONE); - } - } } return view; diff --git a/src/org/fox/ttrss/offline/OfflineArticleFragment.java b/src/org/fox/ttrss/offline/OfflineArticleFragment.java index a1033aec..de697006 100644 --- a/src/org/fox/ttrss/offline/OfflineArticleFragment.java +++ b/src/org/fox/ttrss/offline/OfflineArticleFragment.java @@ -327,29 +327,42 @@ public class OfflineArticleFragment extends Fragment { DateFormat df = new SimpleDateFormat("MMM dd, HH:mm"); dv.setText(df.format(d)); } + + TextView author = (TextView)view.findViewById(R.id.author); + + boolean hasAuthor = false; + if (author != null) { + int authorIndex = m_cursor.getColumnIndex("author"); + if (authorIndex >= 0) + author.setText(m_cursor.getString(authorIndex)); + else + author.setVisibility(View.GONE); + + hasAuthor = true; + } + TextView tagv = (TextView)view.findViewById(R.id.tags); if (tagv != null) { int feedTitleIndex = m_cursor.getColumnIndex("feed_title"); - if (feedTitleIndex != -1 && m_isCat) { - tagv.setText(m_cursor.getString(feedTitleIndex)); + if (feedTitleIndex != -1 /* && m_isCat */) { + String fTitle = m_cursor.getString(feedTitleIndex); + + int authorIndex = m_cursor.getColumnIndex("author"); + + if (!hasAuthor && authorIndex >= 0) { + fTitle += " (" + getString(R.string.author_formatted, m_cursor.getString(authorIndex)) + ")"; + } + + tagv.setText(fTitle); } else { String tagsStr = m_cursor.getString(m_cursor.getColumnIndex("tags")); tagv.setText(tagsStr); } } - TextView author = (TextView)view.findViewById(R.id.author); - - if (author != null) { - int authorIndex = m_cursor.getColumnIndex("author"); - if (authorIndex >= 0) - author.setText(m_cursor.getString(authorIndex)); - else - author.setVisibility(View.GONE); - } } return view; |