Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Nullable
- @Override
- public View getNativeAdView(@NonNull final Context context, @Nullable final ViewGroup viewGroup,
- @NonNull NativeAdViewType type, @NonNull String key) {
- final NativeAd adNative = getNativeAdAtIndex(key);
- if (adNative != null) {
- final LayoutInflater inflater = LayoutInflater.from(context);
- NativeAdView view;
- switch (type) {
- case GRID:
- view = (NativeAdView) inflater.inflate(R.layout.ad_grid, viewGroup);
- break;
- case LIST:
- view = (NativeAdView) inflater.inflate(R.layout.ad_list, viewGroup);
- break;
- case PLAYER_PORTRAIT:
- view = (NativeAdView) inflater.inflate(R.layout.ad_player_square, viewGroup);
- break;
- case PLAYER_LANDSCAPE:
- view = (NativeAdView) inflater.inflate(R.layout.ad_player_landscape, viewGroup);
- break;
- default:
- LogHelper.w(TAG_LOG, "Не обработанный тип представления:", type.name());
- view = (NativeAdView) inflater.inflate(R.layout.ad_list, viewGroup);
- }
- return bindView(context, view, adNative);
- }
- return null;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement