forked from organicmaps/organicmaps-tmp
[android] Fixes aster review.
This commit is contained in:
parent
c597053db1
commit
a9f31ecd1e
4 changed files with 22 additions and 19 deletions
|
@ -64,9 +64,9 @@ public class BookmarkCollectionAdapter extends RecyclerView.Adapter<RecyclerView
|
|||
category.invertVisibility();
|
||||
notifyItemChanged(mHolder.getAdapterPosition());
|
||||
notifyItemChanged(SectionPosition.INVALID_POSITION);
|
||||
|
||||
String compilationTypeString = BookmarkManager.INSTANCE.getCompilationType(category.getId()) ==
|
||||
BookmarkManager.CATEGORY ?
|
||||
|
||||
int type = BookmarkManager.INSTANCE.getCompilationType(category.getId());
|
||||
String compilationTypeString = type == BookmarkManager.CATEGORY ?
|
||||
Statistics.ParamValue.CATEGORY :
|
||||
Statistics.ParamValue.COLLECTION;
|
||||
Statistics.INSTANCE.trackGuideVisibilityChange(
|
||||
|
|
|
@ -622,18 +622,7 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment<BookmarkListA
|
|||
new Factory.ShowBookmarkTask(bookmark.getCategoryId(), bookmark.getBookmarkId()));
|
||||
|
||||
Statistics.INSTANCE.trackGuideBookmarkSelect(mCategoryDataSource.getData().getServerId(),
|
||||
getParamValueByType(bookmark.getCategoryId()));
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private String getParamValueByType(long catId)
|
||||
{
|
||||
if (BookmarkManager.INSTANCE.isCompilation(catId))
|
||||
return Statistics.ParamValue.MAIN;
|
||||
else if (BookmarkManager.INSTANCE.getCompilationType(catId) == BookmarkManager.CATEGORY)
|
||||
return Statistics.ParamValue.CATEGORY;
|
||||
else
|
||||
return Statistics.ParamValue.COLLECTION;
|
||||
bookmark.getCategoryId());
|
||||
}
|
||||
|
||||
public void onItemMore(int position)
|
||||
|
|
|
@ -93,7 +93,7 @@ public class Holders
|
|||
|
||||
void setAction(@NonNull HeaderActionChildCategories action,
|
||||
final boolean showAll,
|
||||
@BookmarkManager.CompilationType final int compilationType,
|
||||
@BookmarkManager.CompilationType int compilationType,
|
||||
@NonNull String serverId)
|
||||
{
|
||||
mButton.setText(showAll
|
||||
|
@ -123,7 +123,9 @@ public class Holders
|
|||
private final boolean mShowAll;
|
||||
@BookmarkManager.CompilationType
|
||||
private final int mCompilationType;
|
||||
@NonNull
|
||||
private final String mServerId;
|
||||
@NonNull
|
||||
private final String mCompilationTypeString;
|
||||
|
||||
ToggleShowAllChildCategoryClickListener(@NonNull HeaderActionChildCategories action,
|
||||
|
|
|
@ -1950,10 +1950,22 @@ public enum Statistics
|
|||
trackEvent(GUIDES_OPEN, params().add(SERVER_ID, serverId), STATISTICS_CHANNEL_REALTIME);
|
||||
}
|
||||
|
||||
public void trackGuideBookmarkSelect(@NonNull String serverId, @NonNull String from)
|
||||
public void trackGuideBookmarkSelect(@NonNull String serverId, long catId)
|
||||
{
|
||||
trackEvent(GUIDES_BOOKMARK_SELECT, params().add(SERVER_ID, serverId).add(FROM, from),
|
||||
STATISTICS_CHANNEL_REALTIME);
|
||||
trackEvent(GUIDES_BOOKMARK_SELECT, params()
|
||||
.add(SERVER_ID, serverId)
|
||||
.add(FROM, getCompilationTypeById(catId)), STATISTICS_CHANNEL_REALTIME);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private String getCompilationTypeById(long catId)
|
||||
{
|
||||
if (!BookmarkManager.INSTANCE.isCompilation(catId))
|
||||
return Statistics.ParamValue.MAIN;
|
||||
else if (BookmarkManager.INSTANCE.getCompilationType(catId) == BookmarkManager.CATEGORY)
|
||||
return Statistics.ParamValue.CATEGORY;
|
||||
else
|
||||
return Statistics.ParamValue.COLLECTION;
|
||||
}
|
||||
|
||||
public void trackCollectionOrCategorySelect(@NonNull String serverId, @NonNull String categoryName,
|
||||
|
|
Loading…
Add table
Reference in a new issue