From ab3f65b98501ff8a2ce96f02cae206d6aa6c4140 Mon Sep 17 00:00:00 2001 From: velichkomarija Date: Fri, 2 Oct 2020 17:20:09 +0300 Subject: [PATCH] [android] Fixes after review. --- android/res/values/dimens.xml | 3 -- .../bookmarks/BookmarkCollectionAdapter.java | 32 +++++------------ .../maps/bookmarks/BookmarksListFragment.java | 34 +++++++++++-------- .../mapswithme/maps/bookmarks/Holders.java | 2 +- 4 files changed, 29 insertions(+), 42 deletions(-) diff --git a/android/res/values/dimens.xml b/android/res/values/dimens.xml index 28a3bbd9ad..4b24b64148 100644 --- a/android/res/values/dimens.xml +++ b/android/res/values/dimens.xml @@ -270,12 +270,9 @@ 98dp 44dp 180dp - 108dp 60dp 68dp - 32dp 56dp - 60dp 508dp diff --git a/android/src/com/mapswithme/maps/bookmarks/BookmarkCollectionAdapter.java b/android/src/com/mapswithme/maps/bookmarks/BookmarkCollectionAdapter.java index 474e221f91..73909e4f72 100644 --- a/android/src/com/mapswithme/maps/bookmarks/BookmarkCollectionAdapter.java +++ b/android/src/com/mapswithme/maps/bookmarks/BookmarkCollectionAdapter.java @@ -1,6 +1,5 @@ package com.mapswithme.maps.bookmarks; -import android.content.Context; import android.content.res.Resources; import android.view.LayoutInflater; import android.view.ViewGroup; @@ -20,9 +19,6 @@ public class BookmarkCollectionAdapter extends RecyclerView.Adapter mItemsCollection; @NonNull @@ -30,9 +26,9 @@ public class BookmarkCollectionAdapter extends RecyclerView.Adapter mClickListener; @@ -70,10 +66,11 @@ public class BookmarkCollectionAdapter extends RecyclerView.Adapter itemsCategories, + @NonNull List itemsCollection) { - mCollectionSectionIndex = SectionPosition.INVALID_POSITION; - mCategorySectionIndex = SectionPosition.INVALID_POSITION; + mItemsCategory = itemsCategories; + mItemsCollection = itemsCollection; mSectionCount = 0; if (mItemsCollection.size() > 0) @@ -118,7 +115,7 @@ public class BookmarkCollectionAdapter extends RecyclerView.Adapter categories = getItemsListByType(type); @@ -128,16 +125,6 @@ public class BookmarkCollectionAdapter extends RecyclerView.Adapter itemsCategories, - @NonNull List itemsCollection) - { - mContext = context; - mItemsCategory = itemsCategories; - mItemsCollection = itemsCollection; - calculateSections(); - } - public void setOnClickListener(@Nullable OnItemClickListener listener) { mClickListener = listener; @@ -207,9 +194,9 @@ public class BookmarkCollectionAdapter extends RecyclerView.Adapter mCategoryItems = BookmarkManager.INSTANCE.getChildrenCategories(categoryId); List mCollectionItems = BookmarkManager.INSTANCE.getChildrenCollections(categoryId); - mBookmarkCollectionAdapter = new BookmarkCollectionAdapter(requireContext(), mCategoryItems, mCollectionItems); + mBookmarkCollectionAdapter = new BookmarkCollectionAdapter(mCategoryItems, mCollectionItems); } @Override @@ -224,30 +225,31 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment