本文整理汇总了Java中com.mopub.mobileads.MoPubView类的典型用法代码示例。如果您正苦于以下问题:Java MoPubView类的具体用法?Java MoPubView怎么用?Java MoPubView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MoPubView类属于com.mopub.mobileads包,在下文中一共展示了MoPubView类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setupBannerWithWait
import com.mopub.mobileads.MoPubView; //导入依赖的package包/类
private void setupBannerWithWait(final int waitTime) {
FrameLayout adFrame = (FrameLayout) root.findViewById(R.id.adFrame2);
adFrame.removeAllViews();
adView2 = new MoPubView(this.getActivity());
adView2.setAdUnitId(Constants.MOPUB_BANNER_ADUNIT_ID_300x250);
adView2.setBannerAdListener(this);
adView2.setAutorefreshEnabled(true);
adView2.setMinimumWidth(300);
adView2.setMinimumHeight(250);
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
lp.gravity = Gravity.CENTER;
adView2.setLayoutParams(lp);
adFrame.addView(adView2);
//region Prebid API usage
Prebid.attachBidsWhenReady(adView2, Constants.BANNER_300x250, this, waitTime, this.getActivity());
//endregion
}
开发者ID:prebid,项目名称:prebid-mobile-android,代码行数:19,代码来源:MoPubBannerFragment.java
示例2: onBannerFailed
import com.mopub.mobileads.MoPubView; //导入依赖的package包/类
@Override
public void onBannerFailed(MoPubView moPubView,
MoPubErrorCode moPubErrorCode) {
switch (moPubErrorCode) {
case NO_FILL:
mMediationBannerListener.onAdFailedToLoad(MoPubAdapter.this,
AdRequest.ERROR_CODE_NO_FILL);
break;
case NETWORK_TIMEOUT:
mMediationBannerListener.onAdFailedToLoad(MoPubAdapter.this,
AdRequest.ERROR_CODE_NETWORK_ERROR);
break;
case SERVER_ERROR:
mMediationBannerListener.onAdFailedToLoad(MoPubAdapter.this,
AdRequest.ERROR_CODE_INVALID_REQUEST);
break;
default:
mMediationBannerListener.onAdFailedToLoad(MoPubAdapter.this,
AdRequest.ERROR_CODE_INTERNAL_ERROR);
break;
}
}
开发者ID:googleads,项目名称:googleads-mobile-android-mediation,代码行数:23,代码来源:MoPubAdapter.java
示例3: requestAd
import com.mopub.mobileads.MoPubView; //导入依赖的package包/类
@Override
public View requestAd(MediatedBannerAdViewController mBC, Activity activity, String parameter, String uid,
int width, int height, TargetingParameters targetingParameters) {
mpListener = new MoPubListener(mBC, this.getClass().getSimpleName());
adView = new MoPubView(activity);
adView.setAdUnitId(uid);
adView.setBannerAdListener(mpListener);
adView.setAutorefreshEnabled(false);
if (targetingParameters != null) {
if (targetingParameters.getLocation() != null) {
adView.setLocation(targetingParameters.getLocation());
}
String keywords = MoPubListener.keywordsFromTargetingParameters(targetingParameters);
adView.setKeywords(keywords);
}
adView.setMinimumWidth(width);
adView.setMinimumHeight(height);
adView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, Gravity.CENTER));
adView.loadAd();
return adView;
}
开发者ID:appnexus,项目名称:mobile-sdk-android,代码行数:26,代码来源:MoPubBannerAdView.java
示例4: setupBannerWithoutWait
import com.mopub.mobileads.MoPubView; //导入依赖的package包/类
private void setupBannerWithoutWait() {
adView = new MoPubView(this.getActivity());
FrameLayout adFrame = (FrameLayout) root.findViewById(R.id.adFrame);
adFrame.removeAllViews();
adView.setAdUnitId(Constants.MOPUB_BANNER_ADUNIT_ID_320x50);
adView.setBannerAdListener(this);
adView.setAutorefreshEnabled(true);
adView.setMinimumWidth(320);
adView.setMinimumHeight(50);
adView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.TOP | Gravity.CENTER_HORIZONTAL));
adFrame.addView(adView);
Prebid.attachBids(adView, Constants.BANNER_320x50, this.getActivity());
adView.loadAd();
}
开发者ID:prebid,项目名称:prebid-mobile-android,代码行数:15,代码来源:MoPubBannerFragment.java
示例5: onBannerLoaded
import com.mopub.mobileads.MoPubView; //导入依赖的package包/类
@Override
public void onBannerLoaded(MoPubView banner) {
int width = Dips.asIntPixels(banner.getAdWidth(), this.getContext());
int height = Dips.asIntPixels(banner.getAdHeight(), this.getContext());
int left = banner.getLeft();
int top = banner.getTop();
banner.measure(width, height);
banner.layout(left, top, left + width, top + height);
ReactContext reactContext = (ReactContext) getContext();
reactContext.getJSModule(RCTEventEmitter.class).receiveEvent(this.getId(), EVENT_LOADED, null);
}
开发者ID:doomsower,项目名称:react-native-mopub,代码行数:14,代码来源:RNMoPubBanner.java
示例6: onBannerFailed
import com.mopub.mobileads.MoPubView; //导入依赖的package包/类
@Override
public void onBannerFailed(MoPubView banner, MoPubErrorCode errorCode) {
WritableMap event = Arguments.createMap();
event.putString("message", errorCode.toString());
ReactContext reactContext = (ReactContext) getContext();
reactContext.getJSModule(RCTEventEmitter.class).receiveEvent(this.getId(), EVENT_FAILED, event);
}
开发者ID:doomsower,项目名称:react-native-mopub,代码行数:8,代码来源:RNMoPubBanner.java
示例7: requestBannerAd
import com.mopub.mobileads.MoPubView; //导入依赖的package包/类
@Override
public void requestBannerAd(Context context,
MediationBannerListener mediationBannerListener,
Bundle bundle,
AdSize adSize,
MediationAdRequest mediationAdRequest,
Bundle bundle1) {
String adunit = bundle.getString(MOPUB_AD_UNIT_KEY);
mAdSize = adSize;
mMoPubView = new MoPubView(context);
mMoPubView.setBannerAdListener(new MBannerListener(mediationBannerListener));
mMoPubView.setAdUnitId(adunit);
//If test mode is enabled
if (mediationAdRequest.isTesting()) {
mMoPubView.setTesting(true);
}
//If location is available
if (mediationAdRequest.getLocation() != null) {
mMoPubView.setLocation(mediationAdRequest.getLocation());
}
mMoPubView.setKeywords(getKeywords(mediationAdRequest));
mMoPubView.loadAd();
}
开发者ID:googleads,项目名称:googleads-mobile-android-mediation,代码行数:29,代码来源:MoPubAdapter.java
示例8: onBannerLoaded
import com.mopub.mobileads.MoPubView; //导入依赖的package包/类
@Override
public void onBannerLoaded(MoPubView moPubView) {
if (!(mAdSize.getWidth() == moPubView.getAdWidth()
&& mAdSize.getHeight() == moPubView.getAdHeight())) {
Log.w(TAG, "The banner ad size loaded does not match the request size. Update the"
+ " ad size on your MoPub UI to match the request size.");
}
mMediationBannerListener.onAdLoaded(MoPubAdapter.this);
}
开发者ID:googleads,项目名称:googleads-mobile-android-mediation,代码行数:11,代码来源:MoPubAdapter.java
示例9: create
import com.mopub.mobileads.MoPubView; //导入依赖的package包/类
public static CustomEventBannerAdapter create(@NonNull MoPubView moPubView,
@NonNull String className,
@NonNull Map<String, String> serverExtras,
long broadcastIdentifier,
@NonNull AdReport adReport) {
return instance.internalCreate(moPubView, className, serverExtras, broadcastIdentifier, adReport);
}
开发者ID:JSafaiyeh,项目名称:Fabric-Example-App-Android,代码行数:8,代码来源:CustomEventBannerAdapterFactory.java
示例10: internalCreate
import com.mopub.mobileads.MoPubView; //导入依赖的package包/类
protected CustomEventBannerAdapter internalCreate(@NonNull MoPubView moPubView,
@NonNull String className,
@NonNull Map<String, String> serverExtras,
long broadcastIdentifier,
@NonNull AdReport adReport) {
return new CustomEventBannerAdapter(moPubView, className, serverExtras, broadcastIdentifier, adReport);
}
开发者ID:JSafaiyeh,项目名称:Fabric-Example-App-Android,代码行数:8,代码来源:CustomEventBannerAdapterFactory.java
示例11: internalCreate
import com.mopub.mobileads.MoPubView; //导入依赖的package包/类
@Override
protected CustomEventBannerAdapter internalCreate(@NonNull final MoPubView moPubView,
@NonNull final String className,
@NonNull final Map<String, String> serverExtras,
final long broadcastIdentifier,
@NonNull final AdReport adReport) {
this.moPubView = moPubView;
this.className = className;
this.classData = serverExtras;
return mockCustomEventBannerAdapter;
}
开发者ID:JSafaiyeh,项目名称:Fabric-Example-App-Android,代码行数:12,代码来源:TestCustomEventBannerAdapterFactory.java
示例12: onCreate
import com.mopub.mobileads.MoPubView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_banner_ad);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
Toolbar mToolbar = (Toolbar) findViewById(R.id.toolbar);
mToolbar.setTitle("Banner Ad");
setSupportActionBar(mToolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
moPubView = (MoPubView) findViewById(R.id.mopub_sample_ad);
moPubView.setAdUnitId(MOPUB_BANNER_AD_UNIT_ID);
moPubView.loadAd();
}
开发者ID:JSafaiyeh,项目名称:Fabric-Example-App-Android,代码行数:16,代码来源:BannerAdActivity.java
示例13: onBannerFailed
import com.mopub.mobileads.MoPubView; //导入依赖的package包/类
@Override
public void onBannerFailed(MoPubView arg0, MoPubErrorCode arg1) {
homeBrewAd = new ImageView(context);
homeBrewAd.setImageBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.nlv_adbanner));
homeBrewAd.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=com.allgoodpeopleus.NormalLabValues"));
v.getContext().startActivity(intent);
}
});
addView(homeBrewAd);
}
开发者ID:bbhsu2,项目名称:evolution,代码行数:15,代码来源:AdView.java
示例14: onBannerLoaded
import com.mopub.mobileads.MoPubView; //导入依赖的package包/类
@Override
public void onBannerLoaded(MoPubView arg0) {
if (homeBrewAd != null){
homeBrewAd.setVisibility(View.INVISIBLE);
homeBrewAd.setImageBitmap(null);
homeBrewAd.setOnClickListener(null);
}
}
开发者ID:bbhsu2,项目名称:evolution,代码行数:9,代码来源:AdView.java
示例15: onAttachComplete
import com.mopub.mobileads.MoPubView; //导入依赖的package包/类
@Override
public void onAttachComplete(Object adObj) {
if (adObj != null && adObj instanceof MoPubView) {
((MoPubView) adObj).loadAd();
}
}
开发者ID:prebid,项目名称:prebid-mobile-android,代码行数:7,代码来源:MoPubBannerFragment.java
示例16: onBannerLoaded
import com.mopub.mobileads.MoPubView; //导入依赖的package包/类
@Override
public void onBannerLoaded(MoPubView banner) {
}
开发者ID:prebid,项目名称:prebid-mobile-android,代码行数:4,代码来源:MoPubBannerFragment.java
示例17: onBannerFailed
import com.mopub.mobileads.MoPubView; //导入依赖的package包/类
@Override
public void onBannerFailed(MoPubView banner, MoPubErrorCode errorCode) {
}
开发者ID:prebid,项目名称:prebid-mobile-android,代码行数:4,代码来源:MoPubBannerFragment.java
示例18: onBannerClicked
import com.mopub.mobileads.MoPubView; //导入依赖的package包/类
@Override
public void onBannerClicked(MoPubView banner) {
}
开发者ID:prebid,项目名称:prebid-mobile-android,代码行数:4,代码来源:MoPubBannerFragment.java
示例19: onBannerExpanded
import com.mopub.mobileads.MoPubView; //导入依赖的package包/类
@Override
public void onBannerExpanded(MoPubView banner) {
}
开发者ID:prebid,项目名称:prebid-mobile-android,代码行数:4,代码来源:MoPubBannerFragment.java
示例20: onBannerCollapsed
import com.mopub.mobileads.MoPubView; //导入依赖的package包/类
@Override
public void onBannerCollapsed(MoPubView banner) {
}
开发者ID:prebid,项目名称:prebid-mobile-android,代码行数:4,代码来源:MoPubBannerFragment.java
注:本文中的com.mopub.mobileads.MoPubView类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论