diff --git a/res/layout-sw600dp/feeds_row_selected.xml b/res/layout-sw600dp/feeds_row_selected.xml index 12336d71..f6217520 100644 --- a/res/layout-sw600dp/feeds_row_selected.xml +++ b/res/layout-sw600dp/feeds_row_selected.xml @@ -4,6 +4,7 @@ android:layout_width="match_parent" android:layout_height="?android:attr/listPreferredItemHeight" android:background="?feedsSelectedBackground" + android:descendantFocusability="blocksDescendants" android:gravity="center_vertical" android:orientation="horizontal" android:paddingBottom="10dip" @@ -43,4 +44,15 @@ android:textSize="13sp" android:textStyle="bold" /> + + \ No newline at end of file diff --git a/res/layout/feeds_row.xml b/res/layout/feeds_row.xml index bd033b25..ffea8cf6 100644 --- a/res/layout/feeds_row.xml +++ b/res/layout/feeds_row.xml @@ -3,6 +3,7 @@ android:id="@+id/feeds_row" android:layout_width="match_parent" android:layout_height="?android:attr/listPreferredItemHeight" + android:descendantFocusability="blocksDescendants" android:gravity="center_vertical" android:orientation="horizontal" android:paddingBottom="10dip" @@ -42,4 +43,15 @@ android:textSize="13sp" android:textStyle="bold" /> + + \ No newline at end of file diff --git a/res/layout/feeds_row_selected.xml b/res/layout/feeds_row_selected.xml index cb95a819..b1d53549 100644 --- a/res/layout/feeds_row_selected.xml +++ b/res/layout/feeds_row_selected.xml @@ -4,6 +4,7 @@ android:layout_width="match_parent" android:layout_height="?android:attr/listPreferredItemHeight" android:background="?feedsSelectedBackgroundSolid" + android:descendantFocusability="blocksDescendants" android:gravity="center_vertical" android:orientation="horizontal" android:paddingBottom="10dip" @@ -43,4 +44,15 @@ android:textSize="13sp" android:textStyle="bold" /> + + \ No newline at end of file diff --git a/src/org/fox/ttrss/FeedCategoriesFragment.java b/src/org/fox/ttrss/FeedCategoriesFragment.java index 90889255..fdd44f9e 100644 --- a/src/org/fox/ttrss/FeedCategoriesFragment.java +++ b/src/org/fox/ttrss/FeedCategoriesFragment.java @@ -21,6 +21,7 @@ import android.support.v4.app.Fragment; import android.util.Log; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; +import android.view.View.OnClickListener; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; @@ -29,6 +30,7 @@ import android.widget.AdapterView; 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; @@ -406,6 +408,21 @@ public class FeedCategoriesFragment extends Fragment implements OnItemClickListe icon.setImageResource(cat.unread > 0 ? R.drawable.ic_rss : R.drawable.ic_rss_bw); } + ImageButton ib = (ImageButton) v.findViewById(R.id.feed_menu_button); + + if (ib != null) { + if (m_activity.isDarkTheme()) + ib.setImageResource(R.drawable.ic_mailbox_collapsed_holo_dark); + + ib.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + getActivity().openContextMenu(v); + } + }); + } + + return v; } } @@ -422,6 +439,8 @@ public class FeedCategoriesFragment extends Fragment implements OnItemClickListe public void onItemClick(AdapterView av, View view, int position, long id) { ListView list = (ListView)av; + Log.d(TAG, "onItemClick=" + position); + if (list != null) { FeedCategory cat = (FeedCategory)list.getItemAtPosition(position); diff --git a/src/org/fox/ttrss/FeedsFragment.java b/src/org/fox/ttrss/FeedsFragment.java index da428823..181d4418 100644 --- a/src/org/fox/ttrss/FeedsFragment.java +++ b/src/org/fox/ttrss/FeedsFragment.java @@ -34,6 +34,7 @@ import android.util.Base64; import android.util.Log; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; +import android.view.View.OnClickListener; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; @@ -42,6 +43,7 @@ import android.widget.AdapterView; 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; @@ -529,6 +531,20 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh } } + + ImageButton ib = (ImageButton) v.findViewById(R.id.feed_menu_button); + + if (ib != null) { + if (m_activity.isDarkTheme()) + ib.setImageResource(R.drawable.ic_mailbox_collapsed_holo_dark); + + ib.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + getActivity().openContextMenu(v); + } + }); + } return v; } diff --git a/src/org/fox/ttrss/offline/OfflineFeedCategoriesFragment.java b/src/org/fox/ttrss/offline/OfflineFeedCategoriesFragment.java index 85f49d6b..31cfcb03 100644 --- a/src/org/fox/ttrss/offline/OfflineFeedCategoriesFragment.java +++ b/src/org/fox/ttrss/offline/OfflineFeedCategoriesFragment.java @@ -15,6 +15,7 @@ import android.support.v4.widget.SimpleCursorAdapter; import android.util.Log; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; +import android.view.View.OnClickListener; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; @@ -22,6 +23,7 @@ import android.view.ViewGroup; 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,21 @@ public class OfflineFeedCategoriesFragment extends Fragment implements OnItemCli if (icon != null) { icon.setImageResource(cursor.getInt(cursor.getColumnIndex("unread")) > 0 ? R.drawable.ic_rss : R.drawable.ic_rss_bw); } + + ImageButton ib = (ImageButton) v.findViewById(R.id.feed_menu_button); + + if (ib != null) { + if (m_activity.isDarkTheme()) + ib.setImageResource(R.drawable.ic_mailbox_collapsed_holo_dark); + + ib.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + getActivity().openContextMenu(v); + } + }); + } + return v; } diff --git a/src/org/fox/ttrss/offline/OfflineFeedsFragment.java b/src/org/fox/ttrss/offline/OfflineFeedsFragment.java index 50e13afb..a2231485 100644 --- a/src/org/fox/ttrss/offline/OfflineFeedsFragment.java +++ b/src/org/fox/ttrss/offline/OfflineFeedsFragment.java @@ -20,6 +20,7 @@ import android.support.v4.widget.SimpleCursorAdapter; import android.util.Log; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; +import android.view.View.OnClickListener; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; @@ -27,6 +28,7 @@ import android.view.ViewGroup; 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; @@ -307,6 +309,20 @@ public class OfflineFeedsFragment extends Fragment implements OnItemClickListene } + ImageButton ib = (ImageButton) v.findViewById(R.id.feed_menu_button); + + if (ib != null) { + if (m_activity.isDarkTheme()) + ib.setImageResource(R.drawable.ic_mailbox_collapsed_holo_dark); + + ib.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + getActivity().openContextMenu(v); + } + }); + } + return v; } }