@Test public void renderAdView_shouldReturnPopulatedView() { subject.renderAdView(relativeLayout, nativeResponse); assertThat(((TextView)relativeLayout.findViewById(titleView.getId())).getText()).isEqualTo("test title"); assertThat(((TextView)relativeLayout.findViewById(textView.getId())).getText()).isEqualTo( "test text"); assertThat(((TextView)relativeLayout.findViewById(callToActionView.getId())).getText()).isEqualTo("test call to action"); }
@Override public void renderAdView(@NonNull final View view, @NonNull final NativeResponse nativeResponse) { NativeViewHolder nativeViewHolder = mViewHolderMap.get(view); if (nativeViewHolder == null) { nativeViewHolder = NativeViewHolder.fromViewBinder(view, mViewBinder); mViewHolderMap.put(view, nativeViewHolder); } nativeViewHolder.update(nativeResponse); nativeViewHolder.updateExtras(view, nativeResponse, mViewBinder); view.setVisibility(VISIBLE); }
MoPubNativeAdRenderer implements MoPubAdRenderer<NativeResponse> { @Override public void renderAdView(@NonNull final View view, @NonNull final NativeResponse nativeResponse) { NativeViewHolder nativeViewHolder = mViewHolderMap.get(view); if (nativeViewHolder == null) { nativeViewHolder = NativeViewHolder.fromViewBinder(view, mViewBinder); mViewHolderMap.put(view, nativeViewHolder); } nativeViewHolder.update(nativeResponse); nativeViewHolder.updateExtras(view, nativeResponse, mViewBinder); view.setVisibility(VISIBLE); } }
MoPubNativeAdRenderer implements MoPubAdRenderer<NativeResponse> { @Override public void renderAdView(@NonNull final View view, @NonNull final NativeResponse nativeResponse) { NativeViewHolder nativeViewHolder = mViewHolderMap.get(view); if (nativeViewHolder == null) { nativeViewHolder = NativeViewHolder.fromViewBinder(view, mViewBinder); mViewHolderMap.put(view, nativeViewHolder); } nativeViewHolder.update(nativeResponse); nativeViewHolder.updateExtras(view, nativeResponse, mViewBinder); view.setVisibility(VISIBLE); } MoPubNativeAdRenderer(@NonNull final ViewBinder viewBinder); }
MoPubNativeAdRenderer implements MoPubAdRenderer<NativeResponse> { @Override public void renderAdView(@NonNull final View view, @NonNull final NativeResponse nativeResponse) { NativeViewHolder nativeViewHolder = mViewHolderMap.get(view); if (nativeViewHolder == null) { nativeViewHolder = NativeViewHolder.fromViewBinder(view, mViewBinder); mViewHolderMap.put(view, nativeViewHolder); } nativeViewHolder.update(nativeResponse); nativeViewHolder.updateExtras(view, nativeResponse, mViewBinder); view.setVisibility(VISIBLE); } MoPubNativeAdRenderer(@NonNull final ViewBinder viewBinder); @Override @NonNull View createAdView(@NonNull final Context context, @Nullable final ViewGroup parent); @Override void renderAdView(@NonNull final View view,
            @NonNull final NativeResponse nativeResponse); }
MoPubNativeAdRenderer implements MoPubAdRenderer<NativeResponse> { @Override public void renderAdView(@NonNull final View view, @NonNull final NativeResponse nativeResponse) { NativeViewHolder nativeViewHolder = mViewHolderMap.get(view); if (nativeViewHolder == null) { nativeViewHolder = NativeViewHolder.fromViewBinder(view, mViewBinder); mViewHolderMap.put(view, nativeViewHolder); } nativeViewHolder.update(nativeResponse); nativeViewHolder.updateExtras(view, nativeResponse, mViewBinder); view.setVisibility(VISIBLE); } MoPubNativeAdRenderer(@NonNull final ViewBinder viewBinder); @Override @NonNull View createAdView(@NonNull final Context context, @Nullable final ViewGroup parent); @Override void renderAdView(@NonNull final View view,
            @NonNull final NativeResponse nativeResponse);  }