bump version

add feedicon to headlines view on tablets
This commit is contained in:
Andrew Dolgov 2013-10-18 00:07:38 +04:00
parent b5d4fac141
commit cc67716030
7 changed files with 79 additions and 9 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fox.ttrss" package="org.fox.ttrss"
android:versionCode="211" android:versionCode="212"
android:versionName="1.16b8" > android:versionName="1.16b9" >
<uses-sdk <uses-sdk
android:minSdkVersion="8" android:minSdkVersion="8"

View File

@ -35,9 +35,19 @@
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_vertical" android:gravity="center_vertical"
android:singleLine="false" 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:textColor="?headlineTextColor"
android:textSize="18sp" /> 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>
<LinearLayout <LinearLayout

View File

@ -36,6 +36,14 @@
android:text="Sample entry title" android:text="Sample entry title"
android:textColor="?attr/headlineSelectedTextColor" android:textColor="?attr/headlineSelectedTextColor"
android:textSize="18sp" /> 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>
<LinearLayout <LinearLayout

View File

@ -37,6 +37,14 @@
android:textColor="?headlineSelectedTextColor" android:textColor="?headlineSelectedTextColor"
android:textSize="18sp" android:textSize="18sp"
android:textStyle="bold" /> 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>
<LinearLayout <LinearLayout

View File

@ -14,8 +14,11 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?headlineUnreadBackground" android:background="?headlineUnreadBackground"
android:orientation="vertical" 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 <LinearLayout
android:id="@+id/linearLayout6" android:id="@+id/linearLayout6"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -34,6 +37,14 @@
android:textColor="?headlineUnreadTextColor" android:textColor="?headlineUnreadTextColor"
android:textSize="18sp" android:textSize="18sp"
android:textStyle="bold" /> 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>
<LinearLayout <LinearLayout
@ -85,7 +96,7 @@
<CheckBox <CheckBox
android:id="@+id/selected" android:id="@+id/selected"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0" android:layout_weight="0"
android:focusable="false" /> android:focusable="false" />
@ -105,18 +116,18 @@
android:id="@+id/marked" android:id="@+id/marked"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="8dp"
android:layout_weight="0" android:layout_weight="0"
android:clickable="true" android:clickable="true"
android:layout_marginRight="8dp"
android:src="@drawable/ic_star_empty" /> android:src="@drawable/ic_star_empty" />
<ImageView <ImageView
android:id="@+id/published" android:id="@+id/published"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="6dp"
android:layout_weight="0" android:layout_weight="0"
android:clickable="true" android:clickable="true"
android:layout_marginRight="6dp"
android:src="@drawable/ic_unpublished" /> android:src="@drawable/ic_unpublished" />
<ImageView <ImageView

View File

@ -67,7 +67,7 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh
private FeedsActivity m_activity; private FeedsActivity m_activity;
private Feed m_selectedFeed; private Feed m_selectedFeed;
private FeedCategory m_activeCategory; 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_enableFeedIcons;
private boolean m_feedIconsChecked = false; private boolean m_feedIconsChecked = false;

View File

@ -1,5 +1,6 @@
package org.fox.ttrss; package org.fox.ttrss;
import java.io.File;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
@ -19,6 +20,8 @@ import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.Resources.Theme; import android.content.res.Resources.Theme;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Paint; import android.graphics.Paint;
import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
@ -71,6 +74,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
private ArticleList m_readArticles = new ArticleList(); private ArticleList m_readArticles = new ArticleList();
private HeadlinesEventListener m_listener; private HeadlinesEventListener m_listener;
private OnlineActivity m_activity; private OnlineActivity m_activity;
public boolean m_enableFeedIcons;
private ImageGetter m_dummyGetter = new ImageGetter() { private ImageGetter m_dummyGetter = new ImageGetter() {
@ -81,6 +85,8 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
} }
}; };
public ArticleList getSelectedArticles() { public ArticleList getSelectedArticles() {
return m_selectedArticles; return m_selectedArticles;
} }
@ -289,6 +295,8 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
list.setLayoutAnimation(controller); list.setLayoutAnimation(controller);
} */ } */
m_enableFeedIcons = m_prefs.getBoolean("download_feed_icons", false);
list.setAdapter(m_adapter); list.setAdapter(m_adapter);
list.setOnItemClickListener(this); list.setOnItemClickListener(this);
list.setOnScrollListener(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); ImageView marked = (ImageView)v.findViewById(R.id.marked);
if (marked != null) { if (marked != null) {