summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2014-10-16 12:19:52 +0400
committerAndrew Dolgov <[email protected]>2014-10-16 12:19:52 +0400
commita38e98c80e80e955818ad83f72601734c7c42197 (patch)
tree23ba0a2897900992946a3ad34e71ccbad9c6db52
parent8e8bbf70aad0b6a4cc9a94bc2a4d7a14936862ee (diff)
add headline image border; make showing them optional
-rw-r--r--res/drawable/flavor_image_border.xml11
-rw-r--r--res/layout/headlines_row.xml6
-rw-r--r--res/layout/headlines_row_selected.xml8
-rw-r--r--res/layout/headlines_row_selected_unread.xml6
-rw-r--r--res/layout/headlines_row_unread.xml11
-rw-r--r--res/values/strings.xml1
-rw-r--r--res/xml/preferences.xml5
-rw-r--r--src/org/fox/ttrss/HeadlinesFragment.java2
8 files changed, 41 insertions, 9 deletions
diff --git a/res/drawable/flavor_image_border.xml b/res/drawable/flavor_image_border.xml
new file mode 100644
index 00000000..3dea012b
--- /dev/null
+++ b/res/drawable/flavor_image_border.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="rectangle" >
+
+ <corners android:radius="0dp" />
+
+ <stroke
+ android:width="1dp"
+ android:color="#cccccc" />
+
+</shape> \ No newline at end of file
diff --git a/res/layout/headlines_row.xml b/res/layout/headlines_row.xml
index 1d40e1bf..8902a6bc 100644
--- a/res/layout/headlines_row.xml
+++ b/res/layout/headlines_row.xml
@@ -85,8 +85,12 @@
android:id="@+id/flavor_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_gravity="center"
android:adjustViewBounds="true"
- android:maxHeight="128dp"
+ android:background="@drawable/flavor_image_border"
+ android:cropToPadding="true"
+ android:maxHeight="256dp"
+ android:padding="1dp"
android:scaleType="centerInside"
android:src="@null"
android:visibility="gone" />
diff --git a/res/layout/headlines_row_selected.xml b/res/layout/headlines_row_selected.xml
index 332b239a..0e600daa 100644
--- a/res/layout/headlines_row_selected.xml
+++ b/res/layout/headlines_row_selected.xml
@@ -79,12 +79,16 @@
android:layout_gravity="center"
android:layout_height="wrap_content" >
- <ImageView
+ <ImageView
android:id="@+id/flavor_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_gravity="center"
android:adjustViewBounds="true"
- android:maxHeight="128dp"
+ android:background="@drawable/flavor_image_border"
+ android:cropToPadding="true"
+ android:maxHeight="256dp"
+ android:padding="1dp"
android:scaleType="centerInside"
android:src="@null"
android:visibility="gone" />
diff --git a/res/layout/headlines_row_selected_unread.xml b/res/layout/headlines_row_selected_unread.xml
index 553bb9f8..5e4f7eeb 100644
--- a/res/layout/headlines_row_selected_unread.xml
+++ b/res/layout/headlines_row_selected_unread.xml
@@ -84,8 +84,12 @@
android:id="@+id/flavor_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_gravity="center"
android:adjustViewBounds="true"
- android:maxHeight="128dp"
+ android:background="@drawable/flavor_image_border"
+ android:cropToPadding="true"
+ android:maxHeight="256dp"
+ android:padding="1dp"
android:scaleType="centerInside"
android:src="@null"
android:visibility="gone" />
diff --git a/res/layout/headlines_row_unread.xml b/res/layout/headlines_row_unread.xml
index 70fc7a9e..96a65134 100644
--- a/res/layout/headlines_row_unread.xml
+++ b/res/layout/headlines_row_unread.xml
@@ -74,18 +74,21 @@
</LinearLayout>
<FrameLayout
- android:paddingTop="3dp"
android:id="@+id/flavorImageHolder"
android:layout_width="match_parent"
- android:layout_gravity="center"
- android:layout_height="wrap_content" >
+ android:layout_height="wrap_content"
+ android:paddingTop="3dp" >
<ImageView
android:id="@+id/flavor_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_gravity="center"
android:adjustViewBounds="true"
- android:maxHeight="128dp"
+ android:background="@drawable/flavor_image_border"
+ android:cropToPadding="true"
+ android:maxHeight="256dp"
+ android:padding="1dp"
android:scaleType="centerInside"
android:src="@null"
android:visibility="gone" />
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 69ffbd8c..d5653d49 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -221,5 +221,6 @@
<string name="pref_headlines_use_condensed_fonts_long">Use condensed fonts for headline titles and a few other UI elements.</string>
<string name="pref_headlines_full_content_long">Show full article content in headlines. Resource intensive, can cause UI lag on some devices.</string>
<string name="pref_headlines_full_content">Show full content</string>
+ <string name="prefs_headlines_show_flavor_image">Show article image</string>
</resources>
diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml
index bd45d553..3a2166b9 100644
--- a/res/xml/preferences.xml
+++ b/res/xml/preferences.xml
@@ -92,6 +92,11 @@
android:key="headlines_show_content"
android:summary="@string/pref_headlines_show_content_long"
android:title="@string/pref_headlines_show_content" />
+
+ <CheckBoxPreference
+ android:defaultValue="true"
+ android:key="headlines_show_flavor_image"
+ android:title="@string/prefs_headlines_show_flavor_image" />
<!-- <CheckBoxPreference
android:defaultValue="false"
diff --git a/src/org/fox/ttrss/HeadlinesFragment.java b/src/org/fox/ttrss/HeadlinesFragment.java
index a5198406..baa94bf9 100644
--- a/src/org/fox/ttrss/HeadlinesFragment.java
+++ b/src/org/fox/ttrss/HeadlinesFragment.java
@@ -819,7 +819,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
final ImageView flavorImage = (ImageView) v.findViewById(R.id.flavor_image);
- if (flavorImage != null && m_prefs.getBoolean("headlines_show_content", true)) {
+ if (flavorImage != null && m_prefs.getBoolean("headlines_show_flavor_image", true)) {
flavorImage.setVisibility(View.GONE);
Document doc = Jsoup.parse(articleContent);