add various per-feed icons for the conns/feeds sidebar

This commit is contained in:
Andrew Dolgov 2015-06-04 23:44:26 +03:00
parent 8c6d767190
commit c30f85616e
30 changed files with 67 additions and 2 deletions

View File

@ -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="337"
android:versionName="1.111" >
android:versionCode="338"
android:versionName="1.112" >
<uses-sdk
android:minSdkVersion="15"

View File

@ -13,6 +13,7 @@ import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.widget.SwipeRefreshLayout;
import android.util.Log;
import android.util.TypedValue;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.LayoutInflater;
@ -25,6 +26,7 @@ import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
@ -466,6 +468,16 @@ public class FeedCategoriesFragment extends BaseFeedlistFragment implements OnIt
}
ImageView icon = (ImageView) v.findViewById(R.id.icon);
if (icon != null) {
TypedValue tv = new TypedValue();
m_activity.getTheme().resolveAttribute(R.attr.ic_folder_outline, tv, true);
icon.setImageResource(tv.resourceId);
}
TextView tt = (TextView) v.findViewById(R.id.title);
if (tt != null) {

View File

@ -14,6 +14,7 @@ import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.widget.SwipeRefreshLayout;
import android.util.Log;
import android.util.TypedValue;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.LayoutInflater;
@ -26,6 +27,7 @@ import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
@ -645,6 +647,36 @@ public class FeedsFragment extends BaseFeedlistFragment implements OnItemClickLi
}
ImageView icon = (ImageView) v.findViewById(R.id.icon);
if (icon != null) {
TypedValue tv = new TypedValue();
if (feed.id == 0 && !feed.is_cat) {
m_activity.getTheme().resolveAttribute(R.attr.ic_archive, tv, true);
icon.setImageResource(tv.resourceId);
} else if (feed.id == -1 && !feed.is_cat) {
m_activity.getTheme().resolveAttribute(R.attr.ic_star, tv, true);
icon.setImageResource(tv.resourceId);
} else if (feed.id == -2 && !feed.is_cat) {
m_activity.getTheme().resolveAttribute(R.attr.ic_checkbox_marked, tv, true);
icon.setImageResource(tv.resourceId);
} else if (feed.id == -3 && !feed.is_cat) {
m_activity.getTheme().resolveAttribute(R.attr.ic_coffee, tv, true);
icon.setImageResource(tv.resourceId);
} else if (feed.id == -4 && !feed.is_cat) {
m_activity.getTheme().resolveAttribute(R.attr.ic_folder_outline, tv, true);
icon.setImageResource(tv.resourceId);
} else if (feed.is_cat) {
m_activity.getTheme().resolveAttribute(R.attr.ic_folder_outline, tv, true);
icon.setImageResource(tv.resourceId);
} else {
m_activity.getTheme().resolveAttribute(R.attr.ic_rss_box, tv, true);
icon.setImageResource(tv.resourceId);
}
}
TextView tt = (TextView) v.findViewById(R.id.title);
if (tt != null) {

View File

@ -12,6 +12,7 @@ import android.provider.BaseColumns;
import android.support.v4.widget.SimpleCursorAdapter;
import android.support.v4.widget.SwipeRefreshLayout;
import android.util.Log;
import android.util.TypedValue;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.LayoutInflater;
@ -23,6 +24,7 @@ import android.widget.AdapterView;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
@ -282,6 +284,16 @@ public class OfflineFeedCategoriesFragment extends BaseFeedlistFragment implemen
}
ImageView icon = (ImageView) v.findViewById(R.id.icon);
if (icon != null) {
TypedValue tv = new TypedValue();
m_activity.getTheme().resolveAttribute(R.attr.ic_folder_outline, tv, true);
icon.setImageResource(tv.resourceId);
}
TextView tt = (TextView) v.findViewById(R.id.title);
if (tt != null) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 727 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 509 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 928 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 741 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 608 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 928 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -40,6 +40,9 @@
<attr name="ic_filter_variant" format="reference" />
<attr name="ic_cloud_download" format="reference" />
<attr name="ic_cloud_upload" format="reference" />
<attr name="ic_archive" format="reference" />
<attr name="ic_coffee" format="reference" />
<attr name="ic_folder_outline" format="reference" />
<declare-styleable name="ScrimInsetsView">
<attr format="reference|color" name="insetForeground">
</attr></declare-styleable>

View File

@ -53,6 +53,9 @@
<item name="ic_filter_variant">@drawable/ic_filter_variant_dark</item>
<item name="ic_cloud_download">@drawable/ic_cloud_download_dark</item>
<item name="ic_cloud_upload">@drawable/ic_cloud_upload_dark</item>
<item name="ic_archive">@drawable/ic_archive_dark</item>
<item name="ic_coffee">@drawable/ic_coffee_dark</item>
<item name="ic_folder_outline">@drawable/ic_folder_outline_dark</item>
</style>
<style name="DarkTheme.Base" parent="Theme.AppCompat.NoActionBar">
@ -107,6 +110,9 @@
<item name="ic_filter_variant">@drawable/ic_filter_variant</item>
<item name="ic_cloud_download">@drawable/ic_cloud_download</item>
<item name="ic_cloud_upload">@drawable/ic_cloud_upload</item>
<item name="ic_archive">@drawable/ic_archive</item>
<item name="ic_coffee">@drawable/ic_coffee</item>
<item name="ic_folder_outline">@drawable/ic_folder_outline</item>
</style>
<style name="DarkDialogTheme" parent="android:Theme"></style>