当前位置: 首页>>代码示例>>Java>>正文


Java YandexMetrica类代码示例

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


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


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