From 54b4aa15a742fc2d44ddc58786fb4f9081017365 Mon Sep 17 00:00:00 2001 From: Shinokuni Date: Sat, 9 Mar 2019 18:35:09 +0100 Subject: [PATCH] Modify edit feed dialog opening way and add feed website link opening on long click --- app/src/main/AndroidManifest.xml | 3 ++- .../app/activities/ManageFeedsActivity.java | 12 ++++++++++ .../readrops/app/database/dao/FeedDao.java | 2 +- .../com/readrops/app/views/FeedsAdapter.java | 14 +++++++---- app/src/main/res/drawable/ic_folder_grey.xml | 5 ++++ app/src/main/res/layout/feed_layout.xml | 24 +++++++++---------- 6 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 app/src/main/res/drawable/ic_folder_grey.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 0e52631b..b5ae7d19 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -5,6 +5,7 @@ + + android:parentActivityName=".activities.MainActivity"> > getAllFeedsWithFolder(); } diff --git a/app/src/main/java/com/readrops/app/views/FeedsAdapter.java b/app/src/main/java/com/readrops/app/views/FeedsAdapter.java index ce044853..b0411fa8 100644 --- a/app/src/main/java/com/readrops/app/views/FeedsAdapter.java +++ b/app/src/main/java/com/readrops/app/views/FeedsAdapter.java @@ -31,7 +31,6 @@ public class FeedsAdapter extends ListAdapter DIFF_CALLBACK = new DiffUtil.ItemCallback() { @Override public boolean areItemsTheSame(@NonNull FeedWithFolder feedWithFolder, @NonNull FeedWithFolder t1) { - Log.d("", "areItemsTheSame: "); return feedWithFolder.getFeed().getId() == t1.getFeed().getId(); } @@ -67,6 +66,8 @@ public class FeedsAdapter extends ListAdapter listener.onEdit(getItem(i))); + viewHolder.itemView.setOnClickListener(v -> listener.onEdit(getItem(i))); + viewHolder.itemView.setOnLongClickListener(v -> { + listener.onOpenLink(getItem(i)); + return true; + }); viewHolder.deleteFeed.setOnClickListener(v -> listener.onDelete(getItem(i))); } @@ -122,20 +127,20 @@ public class FeedsAdapter extends ListAdapter + + diff --git a/app/src/main/res/layout/feed_layout.xml b/app/src/main/res/layout/feed_layout.xml index 57ac8254..4befb3a3 100644 --- a/app/src/main/res/layout/feed_layout.xml +++ b/app/src/main/res/layout/feed_layout.xml @@ -14,8 +14,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?android:attr/selectableItemBackground" - android:clickable="true" - android:focusable="true" android:padding="6dp"> + + - - -