@Test public void renderAdView_withNoViewHolder_shouldCreateNativeViewHolder() { subject.renderAdView(relativeLayout, nativeResponse); NativeViewHolder expectedViewHolder = NativeViewHolder.fromViewBinder(relativeLayout, viewBinder); NativeViewHolder viewHolder = subject.mViewHolderMap.get(relativeLayout); compareNativeViewHolders(expectedViewHolder, viewHolder); }
@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);  }