diff options
author | Andrew Dolgov <[email protected]> | 2014-01-25 22:18:26 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2014-01-25 22:18:26 +0400 |
commit | 8d279b67b6e23a438ac01d1972b97e05070928ad (patch) | |
tree | 44912e181fe7c1c6c67a04f1e501e1e8c02ad217 | |
parent | d75dc81c0d9e10175322a8ef59e8f25a40ef8276 (diff) |
use line-spacing on headlines; increase default line-height on articles
a bit
-rw-r--r-- | res/layout/article_fragment.xml | 16 | ||||
-rw-r--r-- | res/layout/headlines_row.xml | 1 | ||||
-rw-r--r-- | res/layout/headlines_row_selected.xml | 1 | ||||
-rw-r--r-- | res/layout/headlines_row_selected_unread.xml | 1 | ||||
-rw-r--r-- | res/layout/headlines_row_unread.xml | 1 | ||||
-rw-r--r-- | src/org/fox/ttrss/ArticleFragment.java | 24 | ||||
-rw-r--r-- | src/org/fox/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">
<org.fox.ttrss.util.NoChildFocusScrollView
- android:id="@+id/scrollView1"
+ android:id="@+id/article_scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="false" >
@@ -21,7 +20,7 @@ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
- android:paddingBottom="2dp" >
+ android:paddingBottom="6dp" >
<TextView
android:id="@+id/title"
@@ -55,8 +54,8 @@ android:id="@+id/tags"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_weight="0.5"
- android:ellipsize="end"
+ android:layout_weight="1"
+ android:ellipsize="middle"
android:singleLine="true"
android:fontFamily="sans-serif-light"
android:text="Example Feed"
@@ -67,8 +66,9 @@ android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_weight="0.5"
+ android:layout_weight="0"
android:gravity="right"
+ android:layout_marginLeft="10dp"
android:fontFamily="sans-serif-light"
android:text="Jan 01, 12:00"
android:textAppearance="?android:attr/textAppearanceSmall"
@@ -88,7 +88,7 @@ android:textColor="?articleNoteTextColor"
android:textSize="13sp"
android:padding="2dp"
- android:layout_marginBottom="4dp"
+ android:layout_marginBottom="6dp"
android:text="[Article note]" />
<org.fox.ttrss.util.LessBrokenWebView
diff --git a/res/layout/headlines_row.xml b/res/layout/headlines_row.xml index 7590c292..8d3b4c26 100644 --- a/res/layout/headlines_row.xml +++ b/res/layout/headlines_row.xml @@ -79,6 +79,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/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 { "<meta content=\"text/html; charset=utf-8\" http-equiv=\"content-type\">" + "<meta name=\"viewport\" content=\"width=device-width, user-scalable=no\" />" + "<style type=\"text/css\">" + - "body { padding : 0px; margin : 0px; line-height : 120%; }" + + "body { padding : 0px; margin : 0px; line-height : 130%; }" + "img { max-width : 100%; width : auto; height : auto; }" + cssOverride + "</style>" + 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 { "<meta content=\"text/html; charset=utf-8\" http-equiv=\"content-type\">" + "<meta name=\"viewport\" content=\"width=device-width, user-scalable=no\" />" + "<style type=\"text/css\">" + - "body { padding : 0px; margin : 0px; line-height : 120%; }" + + "body { padding : 0px; margin : 0px; line-height : 130%; }" + cssOverride + "img { max-width : 100%; width : auto; height : auto; }" + "</style>" + |