From 8d279b67b6e23a438ac01d1972b97e05070928ad Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 25 Jan 2014 22:18:26 +0400 Subject: [PATCH] use line-spacing on headlines; increase default line-height on articles a bit --- res/layout/article_fragment.xml | 16 ++++++------- res/layout/headlines_row.xml | 1 + res/layout/headlines_row_selected.xml | 1 + res/layout/headlines_row_selected_unread.xml | 1 + res/layout/headlines_row_unread.xml | 1 + src/org/fox/ttrss/ArticleFragment.java | 24 ++++++++++++++++++- .../ttrss/offline/OfflineArticleFragment.java | 24 ++++++++++++++++++- 7 files changed, 58 insertions(+), 10 deletions(-) diff --git a/res/layout/article_fragment.xml b/res/layout/article_fragment.xml index 83729a6f..fde7c106 100644 --- a/res/layout/article_fragment.xml +++ b/res/layout/article_fragment.xml @@ -2,11 +2,10 @@ android:id="@+id/article_fragment" android:layout_width="fill_parent" android:layout_height="match_parent" - android:background="?articleBackground" - android:padding="5sp" > + android:background="?articleBackground"> @@ -21,7 +20,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:paddingBottom="2dp" > + android:paddingBottom="6dp" > diff --git a/res/layout/headlines_row_selected.xml b/res/layout/headlines_row_selected.xml index 0364ab3c..9123e44e 100644 --- a/res/layout/headlines_row_selected.xml +++ b/res/layout/headlines_row_selected.xml @@ -77,6 +77,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:paddingTop="3dp" + android:lineSpacingExtra="2sp" android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." android:textColor="?headlineSelectedExcerptTextColor" android:textSize="13sp" /> diff --git a/res/layout/headlines_row_selected_unread.xml b/res/layout/headlines_row_selected_unread.xml index 4edce92a..0b7d7b84 100644 --- a/res/layout/headlines_row_selected_unread.xml +++ b/res/layout/headlines_row_selected_unread.xml @@ -78,6 +78,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:paddingTop="3dp" + android:lineSpacingExtra="2sp" android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." android:textColor="?headlineSelectedExcerptTextColor" android:textSize="13sp" /> diff --git a/res/layout/headlines_row_unread.xml b/res/layout/headlines_row_unread.xml index a6c56c63..0fd5a836 100644 --- a/res/layout/headlines_row_unread.xml +++ b/res/layout/headlines_row_unread.xml @@ -75,6 +75,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:paddingTop="3dp" + android:lineSpacingExtra="2sp" android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." android:textColor="?headlineExcerptTextColor" android:textSize="13sp" /> diff --git a/src/org/fox/ttrss/ArticleFragment.java b/src/org/fox/ttrss/ArticleFragment.java index 3a6af9e9..396253c2 100644 --- a/src/org/fox/ttrss/ArticleFragment.java +++ b/src/org/fox/ttrss/ArticleFragment.java @@ -96,6 +96,28 @@ public class ArticleFragment extends Fragment { if (m_article != null) { + if (!useTitleWebView) { + View scroll = view.findViewById(R.id.article_scrollview); + + if (scroll != null) { + final float scale = getResources().getDisplayMetrics().density; + + if (m_activity.isSmallScreen()) { + scroll.setPadding((int)(8 * scale + 0.5f), + (int)(5 * scale + 0.5f), + (int)(8 * scale + 0.5f), + 0); + } else { + scroll.setPadding((int)(25 * scale + 0.5f), + (int)(10 * scale + 0.5f), + (int)(25 * scale + 0.5f), + 0); + + } + + } + } + int articleFontSize = Integer.parseInt(m_prefs.getString("article_font_size_sp", "16")); int articleSmallFontSize = Math.max(10, Math.min(18, articleFontSize - 2)); @@ -286,7 +308,7 @@ public class ArticleFragment extends Fragment { "" + "" + "" + diff --git a/src/org/fox/ttrss/offline/OfflineArticleFragment.java b/src/org/fox/ttrss/offline/OfflineArticleFragment.java index 59838ea7..9042421b 100644 --- a/src/org/fox/ttrss/offline/OfflineArticleFragment.java +++ b/src/org/fox/ttrss/offline/OfflineArticleFragment.java @@ -133,6 +133,28 @@ public class OfflineArticleFragment extends Fragment { m_cursor.moveToFirst(); if (m_cursor.isFirst()) { + if (!useTitleWebView) { + View scroll = view.findViewById(R.id.article_scrollview); + + if (scroll != null) { + final float scale = getResources().getDisplayMetrics().density; + + if (m_activity.isSmallScreen()) { + scroll.setPadding((int)(8 * scale + 0.5f), + (int)(5 * scale + 0.5f), + (int)(8 * scale + 0.5f), + 0); + } else { + scroll.setPadding((int)(25 * scale + 0.5f), + (int)(10 * scale + 0.5f), + (int)(25 * scale + 0.5f), + 0); + + } + + } + } + int articleFontSize = Integer.parseInt(m_prefs.getString("article_font_size_sp", "16")); int articleSmallFontSize = Math.max(10, Math.min(18, articleFontSize - 2)); @@ -305,7 +327,7 @@ public class OfflineArticleFragment extends Fragment { "" + "" + "" +