[android] Fixes after review.

This commit is contained in:
velichkomarija 2020-10-09 09:56:45 +03:00 committed by Aleksandr Zatsepin
parent ff7c0da926
commit 97145d97e2
3 changed files with 4 additions and 6 deletions

View file

@ -146,9 +146,9 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment<BookmarkListA
mBookmarkCollectionAdapter = new BookmarkCollectionAdapter(mCategoryItems, mCollectionItems);
mBookmarkCollectionAdapter.setOnClickListener((v, item) -> {
Intent intent = new Intent(getActivity(), BookmarkListActivity.class)
Intent intent = new Intent(getActivity(), BookmarkListActivity.class)
.putExtra(BookmarksListFragment.EXTRA_CATEGORY, item);
startActivityForResult(intent, 101);
startActivity(intent);
});
}

View file

@ -143,8 +143,8 @@ public class Holders
void setOnClickListener(@Nullable OnItemClickListener<BookmarkCategory> listener)
{
mView.setOnClickListener(v -> {
if (listener != null)
listener.onItemClick(v,mEntity);
if (listener != null && mEntity != null)
listener.onItemClick(v, mEntity);
});
}

View file

@ -31,8 +31,6 @@ public class CategoryDataSource extends RecyclerView.AdapterDataObserver impleme
BookmarkManager.INSTANCE.getCategoriesSnapshot(mCategory.getType().getFilterStrategy());
int index = snapshot.indexOfOrInvalidIndex(mCategory);
if (index >= 0)
{
mCategory = snapshot.getItems().get(index);
}
}
}