Commit 8f367830 authored by mengcuiguang's avatar mengcuiguang

添加日志

parent 33ac2ce8
package com.mints.goodmoney.ad.express
import com.mints.goodmoney.BuildConfig
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.manager.YlhAdManager
import com.mints.goodmoney.utils.LogUtil
import com.qq.e.ads.nativ.ADSize
import com.qq.e.ads.nativ.NativeExpressAD
import com.qq.e.ads.nativ.NativeExpressADView
......@@ -31,6 +33,10 @@ object YlhPreLoadExpressManager {
nativeExpressAD = NativeExpressAD(MintsApplication.getContext(), ADSize(ADSize.FULL_WIDTH, ADSize.AUTO_HEIGHT), YlhAdManager.YLH_AD_NATIVEEXPRESS_AWARD, object : NativeExpressAD.NativeExpressADListener {
override fun onNoAD(p0: AdError?) {
if (BuildConfig.DEBUG) {
LogUtil.d("通用奖励 ylh:TTNativeExpressManager", "onError ${p0?.errorCode} ${p0?.errorMsg}")
}
}
override fun onADClicked(p0: NativeExpressADView?) {
......
......@@ -85,7 +85,7 @@ public class TTNativeExpressManager {
@Override
public void onError(int code, String message) {
LogUtil.d("通用TTNativeExpressManager", "onError " + code + message);
LogUtil.d("通用奖励 csj:TTNativeExpressManager", "onError " + code + message);
if (view != null) {
......
package com.mints.goodmoney.utils;
import android.annotation.SuppressLint;
import android.content.Context;
import android.util.Log;
import android.widget.Toast;
/**
* Create by hanweiwei on 11/07/2018
*/
public final class TToast {
private static Toast sToast;
public static void show(Context context, String msg) {
show(context, msg, Toast.LENGTH_SHORT);
}
public static void show(Context context, String msg, int duration) {
Toast toast = getToast(context);
if (toast != null) {
toast.setDuration(duration);
toast.setText(String.valueOf(msg));
toast.show();
} else {
Log.i("TToast", "toast msg: " + String.valueOf(msg));
}
}
@SuppressLint("ShowToast")
private static Toast getToast(Context context) {
if (context == null) {
return sToast;
}
// if (sToast == null) {
// synchronized (TToast.class) {
// if (sToast == null) {
sToast = Toast.makeText(context.getApplicationContext(), "", Toast.LENGTH_SHORT);
// }
// }
// }
return sToast;
}
public static void reset() {
sToast = null;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment