package net.youmi.ads.nativead.demo.ad.callback;

import android.content.Context;
import android.widget.Toast;

import net.youmi.ads.nativead.adrequest.YoumiNativeAdModel;
import net.youmi.ads.nativead.effrequest.OnYoumiNativeAdEffRequestListener;

import java.util.Locale;

/**
 * @author zhitao
 * @since 2017-07-06 17:11
 */
public class MyOnYoumiNativeAdEffRequestListener implements OnYoumiNativeAdEffRequestListener {
	
	private Context mContext;
	
	private String mEffDesc;
	
	public MyOnYoumiNativeAdEffRequestListener(Context context, String effDesc) {
		mContext = context.getApplicationContext();
		mEffDesc = effDesc;
	}
	
	/**
	 * 效果记录发送完毕时回调
	 *
	 * @param isSuccess 是否所有对应的效果记录都发送成功
	 * @param adModel   效果记录对应的广告信息对象
	 */
	@Override
	public void onEffRequestFinish(boolean isSuccess, YoumiNativeAdModel adModel) {
		Toast.makeText(
				mContext,
				String.format(Locale.getDefault(), "发送广告位 %s 的 %s %s", adModel.getSlotId(), mEffDesc, isSuccess ? "成功" : "失败"),
				Toast.LENGTH_SHORT
		).show();
	}
}

@@ -648,16 +648,31 @@
 %E5%BD%95%E5%8F%91%E9%80%81%E5%AE%8C%E6%AF%95%E6%97%B6%E5%9B%9E%E8%B0%83
+(%E6%9C%AC%E5%9B%9E%E8%B0%83%E6%96%B9%E6%B3%95%E6%89%A7%E8%A1%8C%E5%9C%A8UI%E7%BA%BF%E7%A8%8B%E4%B8%AD)
 %0A%09 *%0A%09 *

update demo