add headline image border; make showing them optional
This commit is contained in:
parent
8e8bbf70aa
commit
a38e98c80e
11
res/drawable/flavor_image_border.xml
Normal file
11
res/drawable/flavor_image_border.xml
Normal file
@ -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>
|
@ -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" />
|
||||
|
@ -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" />
|
||||
|
@ -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" />
|
||||
|
@ -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" />
|
||||
|
@ -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>
|
||||
|
@ -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"
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user