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


Java IAdContants类代码示例

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


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

示例1: run

import com.youdo.ad.interfaces.IAdContants; //导入依赖的package包/类
@Override
public void run(IXYDEvent arg0) {
	String type = arg0.getType();
	if (type.equals(AdApplicationContext.AD_PREPARED)) {
		if (isInteractiveAdShow) {
			DisposableStatsUtils.disposeSHU(getAdvInfo());
		}
	} else if (type.equals(AdApplicationContext.AD_STOPED)) {
		isInteractiveAdShow = false;
		isInteractiveAdHide = false;
		mAdApplicationContext.removeAllListeners();
		mActivity.runOnUiThread(new Runnable() {

			@Override
			public void run() {
				mInteractiveAdContainer.removeAllViews();
				mInteractiveAdContainer.setVisibility(View.GONE);
				mInteractiveAdGoFull.setVisibility(View.GONE);
				if (mAdPageHolder != null) {
					mAdPageHolder.setVisibility(View.VISIBLE);
				}
			}
		});

		if ((mediaPlayerDelegate.videoInfo != null && !StaticsUtil.PLAY_TYPE_LOCAL
				.equals(mediaPlayerDelegate.videoInfo.getPlayType()))) {
			mActivity.setOrientionEnable();
		}
		if (mMediaPlayerDelegate != null
				&& mMediaPlayerDelegate.mediaPlayer != null
				&& mediaPlayerDelegate.videoInfo.getCurrentAdvInfo() != null
				&& mInteractiveAdVideoRs
						.equalsIgnoreCase(mediaPlayerDelegate.videoInfo
								.getCurrentAdvInfo().RS)) {
			mediaPlayerDelegate.videoInfo.removePlayedAdv();
			mMediaPlayerDelegate.mediaPlayer.skipCurPreAd();
		}

	} else if (type.equals(AdApplicationContext.AD_ERROR)) {
		Logger.e("PlayFlow", "PlugiADPlay: interactive ad error");
		closeInteractiveAd();
	} else if (type.equals(AdApplicationContext.AD_VIEW_MODE_CHANGE)) {
		String oldViewMode = (String) arg0.getData().get("oldViewMode");
		String newViewMode = (String) arg0.getData().get("newViewMode");

		if (IAdContants.ViewMode.EXPAND.getValue().equals(oldViewMode)
				&& IAdContants.ViewMode.THUMBNAIL.getValue().equals(
						newViewMode)) {
			isInteractiveAdHide = true;
			mAdApplicationContext.hide();
			mActivity.runOnUiThread(new Runnable() {

				@Override
				public void run() {
					mInteractiveAdContainer.setVisibility(View.GONE);
					if (mAdPageHolder != null) {
						mAdPageHolder.setVisibility(View.VISIBLE);
					}
					mInteractiveAdGoFull.setVisibility(View.VISIBLE);
				}
			});
			if ((mediaPlayerDelegate.videoInfo != null && !StaticsUtil.PLAY_TYPE_LOCAL
					.equals(mediaPlayerDelegate.videoInfo.getPlayType()))) {
				mActivity.setOrientionEnable();
			}
		}
		if (IAdContants.ViewMode.EXPAND.getValue().equals(newViewMode)) {
			isInteractiveAdHide = false;
		}

	} else if (type.equals(IAdApplicationContext.VIDEO_PAUSE)) {
		if (mMediaPlayerDelegate != null) {
			mMediaPlayerDelegate.pauseByInteractiveAd();
		}
	} else if (type.equals(IAdApplicationContext.VIDEO_RESUME)) {
		if (mMediaPlayerDelegate != null) {
			mMediaPlayerDelegate.startByInteractiveAd();
		}
	}
}
 
开发者ID:Dreamer206602,项目名称:SimplifyReader2,代码行数:81,代码来源:PluginADPlay.java


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