本文整理汇总了Java中com.yandex.metrica.YandexMetrica.reportEvent方法的典型用法代码示例。如果您正苦于以下问题:Java YandexMetrica.reportEvent方法的具体用法?Java YandexMetrica.reportEvent怎么用?Java YandexMetrica.reportEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.yandex.metrica.YandexMetrica
的用法示例。
在下文中一共展示了YandexMetrica.reportEvent方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPlayClickListener
import com.yandex.metrica.YandexMetrica; //导入方法依赖的package包/类
private View.OnClickListener getPlayClickListener(final int position) {
return new View.OnClickListener() {
@Override
public void onClick(View view) {
DownloadMaster.getInstance().cleanProgressInterfaces();
YandexMetrica.reportEvent(Analytics.MIDDLE_SCREEN_PLAY_EPISODE);
Track track = tracks.get(position);
if (iPlayableMediaItem instanceof Podcast) {
((Podcast) iPlayableMediaItem).selectTrack(track);
}
ProfileManager.getInstance().removeNewTrack(iPlayableMediaItem, track);
notifyItemChanged(position);
UniversalPlayer.getInstance().setMediaItem(iPlayableMediaItem, true);
ActivityPlayer.openWithIntent((Activity) mContext);
}
};
}
示例2: onMenuItemClick
import com.yandex.metrica.YandexMetrica; //导入方法依赖的package包/类
@Override
public boolean onMenuItemClick(MenuItem item) {
MediaItem mediaItem = UniversalPlayer.getInstance().getPlayingMediaItem();
if (item.getItemId() == R.id.action_favorites_player) {
if (mediaItem.isSubscribed) {
itemFavorites.setIcon(getResources().getDrawable(R.drawable.ic_heart_white_24dp));
ProfileManager.getInstance().removeSubscribedMediaItem(mediaItem);
Toast.makeText(this, getString(R.string.removed_from_favorites), Toast.LENGTH_SHORT).show();
YandexMetrica.reportEvent(Analytics.PLAYER_UNSUBSCRIBE);
} else {
itemFavorites.setIcon(getResources().getDrawable(R.drawable.ic_heart_black_24dp));
ProfileManager.getInstance().addSubscribedMediaItem(mediaItem);
Toast.makeText(this, getString(R.string.added_to_favorites), Toast.LENGTH_SHORT).show();
YandexMetrica.reportEvent(Analytics.PLAYER_SUBSCRIBE);
}
} else if (item.getItemId() == R.id.action_player_settings) {
openContextMenu(findViewById(R.id.action_player_settings), ContextMenuType.PLAYER_SETTINGS, null, null);
}
return false;
}
示例3: onContextItemSelected
import com.yandex.metrica.YandexMetrica; //导入方法依赖的package包/类
@Override
public boolean onContextItemSelected(MenuItem item) {
if (item.getTitle().equals(getString(R.string.select_stream_quality))) {
YandexMetrica.reportEvent(Analytics.PLAYER_STREAM_QUALITY);
ContextMenuHelper.selectRadioStreamQuality(this, fragmentPlayer, (RadioItem) currentMediaItem);
} else if (item.getTitle().equals("Show notes")) {
DialogFragmentTrackInfo dialogFragmentTrackInfo = new DialogFragmentTrackInfo();
dialogFragmentTrackInfo.setTrack(((Podcast) UniversalPlayer.getInstance().getPlayingMediaItem()).getSelectedTrack());
dialogFragmentTrackInfo.enableStream = false;
showDialogFragment(dialogFragmentTrackInfo);
} else if (item.getTitle().equals(getString(R.string.stream_info))) {
ContextMenuHelper.showStreamInfoDialog(this);
YandexMetrica.reportEvent(Analytics.PLAYER_STREAM_INFO);
}
return super.onContextItemSelected(item);
}
示例4: getDownloadCancellListener
import com.yandex.metrica.YandexMetrica; //导入方法依赖的package包/类
private View.OnClickListener getDownloadCancellListener(final RecyclerView.ViewHolder holder, final Track currentTrack) {
return new View.OnClickListener() {
@Override
public void onClick(View view) {
DownloadMaster.DownloadTask task = DownloadMaster.getInstance().getTaskByName(currentTrack.getTitle());
if (task != null) {
YandexMetrica.reportEvent(Analytics.MIDDLE_SCREEN_CANCELL_DOWNLOAD_EPISODE);
DownloadMaster.getInstance().cancelDownload(currentTrack.getTitle());
((ViewHolderTrack) holder).btnDownload.setVisibility(View.VISIBLE);
((ViewHolderTrack) holder).cvDownloadProgress.setVisibility(View.INVISIBLE);
}
}
};
}
示例5: getPlaylistOpenClickListener
import com.yandex.metrica.YandexMetrica; //导入方法依赖的package包/类
public View.OnClickListener getPlaylistOpenClickListener() {
isOpen = false;
return new View.OnClickListener() {
@Override
public void onClick(View v) {
YandexMetrica.reportEvent(Analytics.PLAYLIST_TOGGLE);
if (isOpen) {
runCloseAnimation();
} else {
runOpenPlaylistAnimation();
}
isOpen = !isOpen;
}
};
}
示例6: setMediaItem
import com.yandex.metrica.YandexMetrica; //导入方法依赖的package包/类
/**
* Checks if given type of media item is supported, if yes copies it and save instance in player.
*
* @param mediaItem
*/
public void setMediaItem(MediaItem mediaItem) {
if (isCurrentMediaItem(mediaItem)) {
return;
}
YandexMetrica.reportEvent(Analytics.PLAY_PREFIX + mediaItem.getName());
if (mediaItem instanceof RadioItem) {
this.mediaItem = new RadioItem((RadioItem) mediaItem);
} else if (mediaItem instanceof Podcast) {
this.mediaItem = new Podcast((Podcast) mediaItem);
} else {
throw new RuntimeException("Unsupported type of MediaItem");
}
}
示例7: onContextItemSelected
import com.yandex.metrica.YandexMetrica; //导入方法依赖的package包/类
@Override
public boolean onContextItemSelected(MenuItem item) {
int id = item.getItemId();
if (currentContextMenuData != null && currentContextMenuData instanceof Podcast
&& item.getTitle().equals(getString(R.string.about_podcast))) {
YandexMetrica.reportEvent(Analytics.MIDDLE_SCREEN_ABOUT_PODCAST);
ContextMenuHelper.showAboutPodcastDialog((Podcast) currentContextMenuData, this);
} else if (currentContextMenuData != null && currentContextMenuData instanceof Podcast
&& item.getTitle().equals(getString(R.string.open_on_disk))) {
YandexMetrica.reportEvent(Analytics.MIDDLE_SCREEN_OPEN_ON_DISK);
ContextMenuHelper.showPodcastInFolder((MediaItem) currentContextMenuData, this);
} else if (currentContextMenuData != null && currentContextMenuData instanceof Podcast
&& item.getTitle().equals(getString(R.string.remove_all_episods))) {
YandexMetrica.reportEvent(Analytics.MIDDLE_REMOVE_ALL_EPISODES);
ContextMenuHelper.removeAllDonwloadedEpisods(this, (Podcast) currentContextMenuData, onContextItemSelected);
} else if (currentContextMenuData != null && currentContextMenuData instanceof MediaItem.MediaItemBucket
&& item.getTitle().equals(getString(R.string.delete))) {
YandexMetrica.reportEvent(Analytics.MIDDLE_REMOVE_EPISODE);
MediaItem mediaItem = ((MediaItem.MediaItemBucket) currentContextMenuData).mediaItem;
Track track = ((MediaItem.MediaItemBucket) currentContextMenuData).track;
ContextMenuHelper.removeDonwloadedTrack(this, track, mediaItem, onContextItemSelected);
} else if (id == R.id.itemLogout) {
LoginMaster.getInstance().logout();
getSlidingMenu().updateHeader(true);
if (onContextItemSelected != null) {
onContextItemSelected.operationFinished();
}
}
return super.onContextItemSelected(item);
}
示例8: reportSearchEvent
import com.yandex.metrica.YandexMetrica; //导入方法依赖的package包/类
public static void reportSearchEvent(String query) {
if (query == null || query.isEmpty()) {
Log.w(TAG, "Empty search query");
return;
}
// event attributes
Map<String, Object> attr = new HashMap<String, Object>();
attr.put(YM_ATTR_SEARCH_QUERY, query);
YandexMetrica.reportEvent(YM_EVENT_SEARCH, attr);
Log.d(TAG, String.format("reportSearchEvent: %s / %s", YM_EVENT_SEARCH, attr.toString()));
}
示例9: reportRegionEvent
import com.yandex.metrica.YandexMetrica; //导入方法依赖的package包/类
public static void reportRegionEvent(String regionName) {
if (regionName == null || regionName.isEmpty()) {
Log.w(TAG, "Empty region name");
return;
}
// event attributes
Map<String, Object> attr = new HashMap<String, Object>();
attr.put(YM_ATTR_REGION_NAME, regionName);
YandexMetrica.reportEvent(YM_EVENT_REGION, attr);
Log.d(TAG, String.format("reportRegionEvent: %s / %s", YM_EVENT_REGION, attr.toString()));
}
示例10: reportYPShareEvent
import com.yandex.metrica.YandexMetrica; //导入方法依赖的package包/类
public static void reportYPShareEvent(String type) {
if (type == null || type.isEmpty()) {
Log.w(TAG, "Empty share type");
return;
}
// event attributes
Map<String, Object> attr = new HashMap<String, Object>();
attr.put(YM_ATTR_SHARE, type);
YandexMetrica.reportEvent(YM_EVENT_FEATURE, attr);
}
示例11: event
import com.yandex.metrica.YandexMetrica; //导入方法依赖的package包/类
public static void event(String name) {
YandexMetrica.reportEvent(name);
}
示例12: purchase
import com.yandex.metrica.YandexMetrica; //导入方法依赖的package包/类
public static void purchase(String id) {
HashMap<String, Object> map = new HashMap<>();
map.put(PRODUCT, id);
YandexMetrica.reportEvent(PURCHASE, map);
}
示例13: onItemClick
import com.yandex.metrica.YandexMetrica; //导入方法依赖的package包/类
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
YandexMetrica.reportEvent(Analytics.PLAYLIST_ITEM_CLICK);
changeTrack(position);
}
示例14: sendEvent
import com.yandex.metrica.YandexMetrica; //导入方法依赖的package包/类
@Override
public void sendEvent(@NonNull String eventName) {
YandexMetrica.reportEvent(eventName);
}