diff --git a/android/src/com/mapswithme/maps/bookmarks/BookmarkCollectionAdapter.java b/android/src/com/mapswithme/maps/bookmarks/BookmarkCollectionAdapter.java index 7e98d71aaa..08deef115e 100644 --- a/android/src/com/mapswithme/maps/bookmarks/BookmarkCollectionAdapter.java +++ b/android/src/com/mapswithme/maps/bookmarks/BookmarkCollectionAdapter.java @@ -13,6 +13,7 @@ import com.mapswithme.maps.R; import com.mapswithme.maps.adapter.OnItemClickListener; import com.mapswithme.maps.bookmarks.data.BookmarkCategory; import com.mapswithme.maps.bookmarks.data.BookmarkManager; +import com.mapswithme.util.statistics.Statistics; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -29,6 +30,8 @@ public class BookmarkCollectionAdapter extends RecyclerView.Adapter mItemsCollection; @@ -62,13 +65,23 @@ public class BookmarkCollectionAdapter extends RecyclerView.Adapter itemsCategories, @NonNull List itemsCollection) { + mParentServerId = parentServerId; mParentCategoryId = parentCategoryId; //noinspection AssignmentOrReturnOfFieldWithMutableType mItemsCategory = itemsCategories; @@ -220,7 +233,8 @@ public class BookmarkCollectionAdapter extends RecyclerView.Adapter mCategoryItems = BookmarkManager.INSTANCE.getChildrenCategories(categoryId); List mCollectionItems = BookmarkManager.INSTANCE.getChildrenCollections(categoryId); - mBookmarkCollectionAdapter = new BookmarkCollectionAdapter(categoryId ,mCategoryItems, mCollectionItems); + mBookmarkCollectionAdapter = new BookmarkCollectionAdapter( + getCategoryOrThrow().getServerId(), categoryId, mCategoryItems, mCollectionItems); mBookmarkCollectionAdapter.setOnClickListener((v, item) -> { Intent intent = new Intent(getActivity(), BookmarkListActivity.class) .putExtra(BookmarksListFragment.EXTRA_CATEGORY, item); - // TODO(@velichkomarija): Statistics.INSTANCE.trackCollectionOrCategorySelect() + + final boolean isCategory = BookmarkManager.INSTANCE.getCompilationType(item.getId()) == + BookmarkManager.CATEGORY; + Statistics.INSTANCE.trackCollectionOrCategorySelect(item.getServerId(), item.getName(), + isCategory); startActivity(intent); }); } @Override - public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) + public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, + @Nullable Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_bookmark_list, container, false); } @@ -615,9 +621,19 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment