diff --git a/android/src/com/mapswithme/maps/bookmarks/BookmarkCategoriesAdapter.java b/android/src/com/mapswithme/maps/bookmarks/BookmarkCategoriesAdapter.java index a244515165..2b8711cb5f 100644 --- a/android/src/com/mapswithme/maps/bookmarks/BookmarkCategoriesAdapter.java +++ b/android/src/com/mapswithme/maps/bookmarks/BookmarkCategoriesAdapter.java @@ -26,7 +26,7 @@ public class BookmarkCategoriesAdapter extends BaseBookmarkCategoryAdapter { - if (mOnAddCategoryListener != null) - mOnAddCategoryListener.onAddCategory(); + if (mCategoryListInterface != null) + mCategoryListInterface.onAddCategory(); }); return new Holders.GeneralViewHolder(createListView); } @@ -105,7 +105,9 @@ public class BookmarkCategoriesAdapter extends BaseBookmarkCategoryAdapter { - Toast.makeText(getContext(), "Coming soon", Toast.LENGTH_SHORT).show(); + if (mCategoryListInterface != null) + mCategoryListInterface.onMoreOperationClick(categoryPosition); }); } @@ -141,8 +144,9 @@ public class BookmarkCategoriesAdapter extends BaseBookmarkCategoryAdapter 0 ? count + 2 /* header + add category btn */ : 0; } - interface OnAddCategoryListener + interface CategoryListInterface { void onAddCategory(); + void onMoreOperationClick(int position); } } diff --git a/android/src/com/mapswithme/maps/bookmarks/BookmarkCategoriesFragment.java b/android/src/com/mapswithme/maps/bookmarks/BookmarkCategoriesFragment.java index 3085c501ac..20c178d484 100644 --- a/android/src/com/mapswithme/maps/bookmarks/BookmarkCategoriesFragment.java +++ b/android/src/com/mapswithme/maps/bookmarks/BookmarkCategoriesFragment.java @@ -31,7 +31,7 @@ public class BookmarkCategoriesFragment extends BaseMwmRecyclerFragment RecyclerClickListener, RecyclerLongClickListener, BookmarkManager.BookmarksLoadingListener, - BookmarkCategoriesAdapter.OnAddCategoryListener + BookmarkCategoriesAdapter.CategoryListInterface { private long mSelectedCatId; @Nullable @@ -73,7 +73,7 @@ public class BookmarkCategoriesFragment extends BaseMwmRecyclerFragment { getAdapter().setOnClickListener(this); getAdapter().setOnLongClickListener(this); - getAdapter().setOnAddCategoryListener(this); + getAdapter().setCategoryListInterface(this); getAdapter().registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() { @Override @@ -188,6 +188,11 @@ public class BookmarkCategoriesFragment extends BaseMwmRecyclerFragment @Override public void onLongItemClick(View v, int position) + { + showBottomMenu(position); + } + + private void showBottomMenu(int position) { final BookmarkManager bmManager = BookmarkManager.INSTANCE; mSelectedCatId = bmManager.getCategoryIdByPosition(position); @@ -205,6 +210,12 @@ public class BookmarkCategoriesFragment extends BaseMwmRecyclerFragment bs.tint().show(); } + @Override + public void onMoreOperationClick(int position) + { + showBottomMenu(position); + } + @Override public void onItemClick(View v, int position) {