diff options
-rw-r--r-- | AndroidManifest.xml | 4 | ||||
-rw-r--r-- | res/layout/headlines_row.xml | 12 | ||||
-rw-r--r-- | res/layout/headlines_row_selected.xml | 8 | ||||
-rw-r--r-- | res/layout/headlines_row_selected_unread.xml | 8 | ||||
-rw-r--r-- | res/layout/headlines_row_unread.xml | 21 | ||||
-rw-r--r-- | src/org/fox/ttrss/FeedsFragment.java | 2 | ||||
-rw-r--r-- | src/org/fox/ttrss/HeadlinesFragment.java | 33 |
7 files changed, 79 insertions, 9 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 5a8ee1e9..bf1b2d8c 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="211" - android:versionName="1.16b8" > + android:versionCode="212" + android:versionName="1.16b9" > <uses-sdk android:minSdkVersion="8" diff --git a/res/layout/headlines_row.xml b/res/layout/headlines_row.xml index 6df28379..009048d2 100644 --- a/res/layout/headlines_row.xml +++ b/res/layout/headlines_row.xml @@ -35,9 +35,19 @@ android:layout_weight="1"
android:gravity="center_vertical"
android:singleLine="false"
- android:text="Sample entry title"
+ android:text="Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit."
android:textColor="?headlineTextColor"
android:textSize="18sp" />
+
+ <ImageView
+ android:id="@+id/feed_icon"
+ android:layout_width="16dp"
+ android:layout_height="16dp"
+ android:scaleType="fitXY"
+ android:layout_weight="0"
+
+ android:src="@drawable/ic_published" />
+
</LinearLayout>
<LinearLayout
diff --git a/res/layout/headlines_row_selected.xml b/res/layout/headlines_row_selected.xml index 849e2b6f..a4216ea8 100644 --- a/res/layout/headlines_row_selected.xml +++ b/res/layout/headlines_row_selected.xml @@ -36,6 +36,14 @@ android:text="Sample entry title"
android:textColor="?attr/headlineSelectedTextColor"
android:textSize="18sp" />
+
+ <ImageView
+ android:id="@+id/feed_icon"
+ android:layout_width="16dp"
+ android:layout_height="16dp"
+ android:scaleType="fitXY"
+ android:layout_weight="0"
+ android:src="@drawable/ic_published" />
</LinearLayout>
<LinearLayout
diff --git a/res/layout/headlines_row_selected_unread.xml b/res/layout/headlines_row_selected_unread.xml index 0fa6e213..d6457e62 100644 --- a/res/layout/headlines_row_selected_unread.xml +++ b/res/layout/headlines_row_selected_unread.xml @@ -37,6 +37,14 @@ android:textColor="?headlineSelectedTextColor"
android:textSize="18sp"
android:textStyle="bold" />
+
+ <ImageView
+ android:id="@+id/feed_icon"
+ android:layout_width="16dp"
+ android:layout_height="16dp"
+ android:scaleType="fitXY"
+ android:layout_weight="0"
+ android:src="@drawable/ic_published" />
</LinearLayout>
<LinearLayout
diff --git a/res/layout/headlines_row_unread.xml b/res/layout/headlines_row_unread.xml index 44f1c218..f493dce8 100644 --- a/res/layout/headlines_row_unread.xml +++ b/res/layout/headlines_row_unread.xml @@ -14,8 +14,11 @@ android:layout_height="match_parent"
android:background="?headlineUnreadBackground"
android:orientation="vertical"
- android:paddingTop="6dp" android:paddingLeft="6dp" android:paddingRight="6dp" android:paddingBottom="2dp" > >
-
+ android:paddingBottom="2dp"
+ android:paddingLeft="6dp"
+ android:paddingRight="6dp"
+ android:paddingTop="6dp" >
+
<LinearLayout
android:id="@+id/linearLayout6"
android:layout_width="match_parent"
@@ -34,6 +37,14 @@ android:textColor="?headlineUnreadTextColor"
android:textSize="18sp"
android:textStyle="bold" />
+
+ <ImageView
+ android:id="@+id/feed_icon"
+ android:layout_width="16dp"
+ android:layout_height="16dp"
+ android:scaleType="fitXY"
+ android:layout_weight="0"
+ android:src="@drawable/ic_published" />
</LinearLayout>
<LinearLayout
@@ -85,7 +96,7 @@ <CheckBox
android:id="@+id/selected"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:layout_height="wrap_content"
android:layout_weight="0"
android:focusable="false" />
@@ -105,18 +116,18 @@ android:id="@+id/marked"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_marginRight="8dp"
android:layout_weight="0"
android:clickable="true"
- android:layout_marginRight="8dp"
android:src="@drawable/ic_star_empty" />
<ImageView
android:id="@+id/published"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_marginRight="6dp"
android:layout_weight="0"
android:clickable="true"
- android:layout_marginRight="6dp"
android:src="@drawable/ic_unpublished" />
<ImageView
diff --git a/src/org/fox/ttrss/FeedsFragment.java b/src/org/fox/ttrss/FeedsFragment.java index fe6ba048..d9daddaf 100644 --- a/src/org/fox/ttrss/FeedsFragment.java +++ b/src/org/fox/ttrss/FeedsFragment.java @@ -67,7 +67,7 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh private FeedsActivity m_activity; private Feed m_selectedFeed; private FeedCategory m_activeCategory; - private static final String ICON_PATH = "/icons/"; + protected static final String ICON_PATH = "/icons/"; private boolean m_enableFeedIcons; private boolean m_feedIconsChecked = false; diff --git a/src/org/fox/ttrss/HeadlinesFragment.java b/src/org/fox/ttrss/HeadlinesFragment.java index c23889aa..0e7e9fa1 100644 --- a/src/org/fox/ttrss/HeadlinesFragment.java +++ b/src/org/fox/ttrss/HeadlinesFragment.java @@ -1,5 +1,6 @@ package org.fox.ttrss; +import java.io.File; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -19,6 +20,8 @@ import android.app.Activity; import android.content.Context; import android.content.SharedPreferences; import android.content.res.Resources.Theme; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; import android.graphics.Paint; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; @@ -71,6 +74,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, private ArticleList m_readArticles = new ArticleList(); private HeadlinesEventListener m_listener; private OnlineActivity m_activity; + public boolean m_enableFeedIcons; private ImageGetter m_dummyGetter = new ImageGetter() { @@ -81,6 +85,8 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, } }; + + public ArticleList getSelectedArticles() { return m_selectedArticles; } @@ -289,6 +295,8 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, list.setLayoutAnimation(controller); } */ + m_enableFeedIcons = m_prefs.getBoolean("download_feed_icons", false); + list.setAdapter(m_adapter); list.setOnItemClickListener(this); list.setOnScrollListener(this); @@ -685,6 +693,31 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, } + ImageView feedIcon = (ImageView)v.findViewById(R.id.feed_icon); + + if (feedIcon != null) { + if (!m_activity.isSmallScreen() && m_enableFeedIcons && article.feed_title != null && (m_feed.is_cat || m_feed.id < 0)) { + + try { + File storage = m_activity.getExternalCacheDir(); + + File iconFile = new File(storage.getAbsolutePath() + FeedsFragment.ICON_PATH + article.feed_id + ".ico"); + if (iconFile.exists()) { + Bitmap bmpOrig = BitmapFactory.decodeFile(iconFile.getAbsolutePath()); + if (bmpOrig != null) { + feedIcon.setImageBitmap(bmpOrig); + } + } + } catch (NullPointerException e) { + + } + + } else { + feedIcon.setVisibility(View.GONE); + } + + } + ImageView marked = (ImageView)v.findViewById(R.id.marked); if (marked != null) { |