package com.sheep.gamegroup.util.share;

import com.sheep.gamegroup.util.LogUtil;
import com.sheep.jiuyan.samllsheep.utils.G;
import com.umeng.socialize.UMShareListener;
import com.umeng.socialize.bean.SHARE_MEDIA;

/**
 * Created by realicing on 2018/12/6.
 * realicing@sina.com
 */
public class CommonUMShareListener implements UMShareListener {

    @Override
    public void onStart(SHARE_MEDIA share_media) {
        LogUtil.println("UMShareListener", "start", share_media.getName());
    }

    @Override
    public void onResult(SHARE_MEDIA share_media) {
        LogUtil.println("UMShareListener", "result", share_media.getName());
    }

    @Override
    public void onError(SHARE_MEDIA share_media, Throwable throwable) {
        String msg = throwable.getMessage();
        G.showToast(msg != null && msg.contains("没有安装应用") ? "没有安装应用" : msg);
        LogUtil.println("UMShareListener", "error", share_media.getName() +
                ",msg:" + throwable.getMessage());
    }

    @Override
    public void onCancel(SHARE_MEDIA share_media) {
        LogUtil.println("UMShareListener", "delete", share_media.getName());
    }
}
