diff --git a/android/src/com/mapswithme/maps/bookmarks/BookmarkCollectionAdapter.java b/android/src/com/mapswithme/maps/bookmarks/BookmarkCollectionAdapter.java index 3738a93ee5..5c34d40627 100644 --- a/android/src/com/mapswithme/maps/bookmarks/BookmarkCollectionAdapter.java +++ b/android/src/com/mapswithme/maps/bookmarks/BookmarkCollectionAdapter.java @@ -38,44 +38,12 @@ public class BookmarkCollectionAdapter extends RecyclerView.Adapter mClickListener; - static class SectionPosition - { - static final int INVALID_POSITION = -1; - - private final int mSectionIndex; - private final int mItemIndex; - - SectionPosition(int sectionInd, int itemInd) - { - mSectionIndex = sectionInd; - mItemIndex = itemInd; - } - - int getSectionIndex() - { - return mSectionIndex; - } - - int getItemIndex() - { - return mItemIndex; - } - - boolean isTitlePosition() - { - return mSectionIndex != INVALID_POSITION && mItemIndex == INVALID_POSITION; - } - - boolean isItemPosition() - { - return mSectionIndex != INVALID_POSITION && mItemIndex != INVALID_POSITION; - } - } - BookmarkCollectionAdapter(@NonNull List itemsCategories, @NonNull List itemsCollection) { + //noinspection AssignmentOrReturnOfFieldWithMutableType mItemsCategory = itemsCategories; + //noinspection AssignmentOrReturnOfFieldWithMutableType mItemsCollection = itemsCollection; mSectionCount = 0; @@ -126,8 +94,8 @@ public class BookmarkCollectionAdapter extends RecyclerView.Adapter categories = getItemsListByType(type); - int itemIndex = sp.mItemIndex; - if (sp.mItemIndex > categories.size() - 1) + int itemIndex = sp.getItemIndex(); + if (sp.getItemIndex() > categories.size() - 1) throw new ArrayIndexOutOfBoundsException(itemIndex); return categories.get(itemIndex); } @@ -185,7 +153,7 @@ public class BookmarkCollectionAdapter extends RecyclerView.Adapter