• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java YandexMetrica类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.yandex.metrica.YandexMetrica的典型用法代码示例。如果您正苦于以下问题:Java YandexMetrica类的具体用法?Java YandexMetrica怎么用?Java YandexMetrica使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



YandexMetrica类属于com.yandex.metrica包,在下文中一共展示了YandexMetrica类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: initNotTrackable

import com.yandex.metrica.YandexMetrica; //导入依赖的package包/类
/**
 * Init playable without tracks (i.e radio station)
 */
private void initNotTrackable() {
    rvTracks.setVisibility(View.GONE);
    btnMediaMore.setVisibility(View.GONE);
    svDetails.setVisibility(View.VISIBLE);
    svDetails.setEnabled(false);
    svDetails.setIMovable(this);
    tvDetailedDescription.setText(playableItem.getDescription().isEmpty() ? getString(R.string.empty_description) : playableItem.getDescription());
    fbDetailsPlay.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            if (GlobalUtils.isInternetConnected()) {
                UniversalPlayer.getInstance().setMediaItem(playableItem, true);
                getActivity().runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        ActivityPlayer.openWithIntent(getActivity());
                    }
                });
            } else {
                Toast.makeText(getActivity(), getString(R.string.no_internet_access), Toast.LENGTH_SHORT).show();
            }
            YandexMetrica.reportEvent(Analytics.MIDDLE_SCREEN_PLAY_RADIO);
        }
    });
}
 
开发者ID:KKorvin,项目名称:uPods-android,代码行数:29,代码来源:FragmentMediaItemDetails.java


示例2: initSubscribeBtn

import com.yandex.metrica.YandexMetrica; //导入依赖的package包/类
private void initSubscribeBtn() {
    btnSubscribe.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            if (playableItem.isSubscribed) {
                ProfileManager.getInstance().removeSubscribedMediaItem(playableItem);
                btnSubscribe.setText(getString(R.string.subscribe));
                YandexMetrica.reportEvent(Analytics.MIDDLE_SCREEN_UNSUBSCRIBE);
            } else {
                ProfileManager.getInstance().addSubscribedMediaItem(playableItem);
                btnSubscribe.setText(getString(R.string.unsubscribe));
                YandexMetrica.reportEvent(Analytics.MIDDLE_SCREEN_SUBSCRIBE);
            }
        }
    });
}
 
开发者ID:KKorvin,项目名称:uPods-android,代码行数:17,代码来源:FragmentMediaItemDetails.java


示例3: 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);
        }
    };
}
 
开发者ID:KKorvin,项目名称:uPods-android,代码行数:18,代码来源:TracksAdapter.java


示例4: onCreate

import com.yandex.metrica.YandexMetrica; //导入依赖的package包/类
@Override
public void onCreate() {
    isLoaded = false;
    applicationContext = getApplicationContext();
    YandexMetrica.activate(getApplicationContext(), Config.YANDEX_METRICS_API_KEY);
    YandexMetrica.enableActivityAutoTracking(this);
    FacebookSdk.sdkInitialize(applicationContext);
    LoginMaster.getInstance().init();
    new Prefs.Builder()
            .setContext(this)
            .setMode(ContextWrapper.MODE_PRIVATE)
            .setPrefsName(getPackageName())
            .setUseDefaultSharedPreference(true).build();

    super.onCreate();
}
 
开发者ID:KKorvin,项目名称:uPods-android,代码行数:17,代码来源:UpodsApplication.java


示例5: 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;
}
 
开发者ID:KKorvin,项目名称:uPods-android,代码行数:21,代码来源:ActivityPlayer.java


示例6: 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);
}
 
开发者ID:KKorvin,项目名称:uPods-android,代码行数:17,代码来源:ActivityPlayer.java


示例7: bindTitleViewHolder

import com.yandex.metrica.YandexMetrica; //导入依赖的package包/类
private void bindTitleViewHolder(RecyclerView.ViewHolder holder, int position) {
    MediaItemTitle currentItem = (MediaItemTitle) items.get(position);
    ViewHolderMediaItemTitle holderMediaItemTitle = ((ViewHolderMediaItemTitle) holder);

    holderMediaItemTitle.tvMediaCardTitle.setText(currentItem.getTitle());
    if (currentItem.getSubTitle().isEmpty()) {
        holderMediaItemTitle.tvMediaCardSubTitle.setVisibility(View.GONE);
        RelativeLayout.LayoutParams llp = (RelativeLayout.LayoutParams) holderMediaItemTitle.tvMediaCardTitle.getLayoutParams();
        // Left // Top // Right // Bottom
        llp.setMargins(UIHelper.dpToPixels(15), UIHelper.dpToPixels(10), UIHelper.dpToPixels(15), UIHelper.dpToPixels(3));
        holderMediaItemTitle.tvMediaCardTitle.setLayoutParams(llp);
    } else {
        holderMediaItemTitle.tvMediaCardSubTitle.setVisibility(View.VISIBLE);
        holderMediaItemTitle.tvMediaCardSubTitle.setText(currentItem.getSubTitle());
    }

    if (!currentItem.showButton) {
        holderMediaItemTitle.btnMediaTitleMore.setVisibility(View.GONE);
    } else {
        holderMediaItemTitle.btnMediaTitleMore.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                YandexMetrica.reportEvent(Analytics.FEATURED_BUTTON_MORE);
                Toast.makeText(mContext, R.string.coming_soon, Toast.LENGTH_SHORT).show();
            }
        });
    }
    holder.itemView.setTag(currentItem);
}
 
开发者ID:KKorvin,项目名称:uPods-android,代码行数:30,代码来源:MediaItemsAdapter.java


示例8: 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);
            }
        }
    };
}
 
开发者ID:KKorvin,项目名称:uPods-android,代码行数:15,代码来源:TracksAdapter.java


示例9: 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;
        }
    };
}
 
开发者ID:KKorvin,项目名称:uPods-android,代码行数:16,代码来源:Playlist.java


示例10: 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");
    }
}
 
开发者ID:KKorvin,项目名称:uPods-android,代码行数:19,代码来源:UniversalPlayer.java


示例11: 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);
}
 
开发者ID:KKorvin,项目名称:uPods-android,代码行数:31,代码来源:ActivityMain.java


示例12: onCreate

import com.yandex.metrica.YandexMetrica; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();

    if (!BuildConfig.DEBUG) {
        // AppMetrica SDK
        YandexMetrica.activate(getApplicationContext(), AM_KEY);
        YandexMetrica.enableActivityAutoTracking(this);

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
            YandexMetrica.enableActivityAutoTracking(this);
        }
    }
}
 
开发者ID:x1unix,项目名称:Avi,代码行数:15,代码来源:Application.java


示例13: onCreate

import com.yandex.metrica.YandexMetrica; //导入依赖的package包/类
@Override public void onCreate() {
  super.onCreate();
  instance = this;

  Timber.plant(new AndroidUtils.AndroidDebugTree());

  // Initializing the AppMetrica SDK
  YandexMetrica.activate(getApplicationContext(), "");
  // Tracking user activity
  YandexMetrica.enableActivityAutoTracking(this);
}
 
开发者ID:ozodrukh,项目名称:IUT-E-class,代码行数:12,代码来源:EclassApplication.java


示例14: onResume

import com.yandex.metrica.YandexMetrica; //导入依赖的package包/类
@Override
protected void onResume() {
    super.onResume();

    // resume metric
    YandexMetrica.onResumeActivity(this);
}
 
开发者ID:LizaAlert-HotLine,项目名称:AndroidMobileWorkplace,代码行数:8,代码来源:SearchActivity.java


示例15: onPause

import com.yandex.metrica.YandexMetrica; //导入依赖的package包/类
@Override
protected void onPause() {
    super.onPause();

    // pause metric
    YandexMetrica.onPauseActivity(this);
}
 
开发者ID:LizaAlert-HotLine,项目名称:AndroidMobileWorkplace,代码行数:8,代码来源:SearchActivity.java


示例16: 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()));
}
 
开发者ID:LizaAlert-HotLine,项目名称:AndroidMobileWorkplace,代码行数:14,代码来源:YM.java


示例17: 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()));
}
 
开发者ID:LizaAlert-HotLine,项目名称:AndroidMobileWorkplace,代码行数:14,代码来源:YM.java


示例18: 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);
}
 
开发者ID:LizaAlert-HotLine,项目名称:AndroidMobileWorkplace,代码行数:12,代码来源:YM.java


示例19: setup

import com.yandex.metrica.YandexMetrica; //导入依赖的package包/类
public static void setup(Context context) {
    YandexMetrica.activate(context.getApplicationContext(), YANDEX_METRICA_KEY);
}
 
开发者ID:mecid,项目名称:robird-reborn,代码行数:4,代码来源:Analytics.java


示例20: event

import com.yandex.metrica.YandexMetrica; //导入依赖的package包/类
public static void event(String name) {
    YandexMetrica.reportEvent(name);
}
 
开发者ID:mecid,项目名称:robird-reborn,代码行数:4,代码来源:Analytics.java



注:本文中的com.yandex.metrica.YandexMetrica类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RateType类代码示例发布时间:2022-05-22
下一篇:
Java MediaWikiParserFactory类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap