|
|
@@ -11,6 +11,9 @@ import android.text.TextUtils;
|
|
|
import android.util.Log;
|
|
|
import android.view.Menu;
|
|
|
|
|
|
+import android.view.View;
|
|
|
+import android.widget.Button;
|
|
|
+import butterknife.BindView;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.kfzs.duanduan.utils.StatusBarUtils;
|
|
|
import com.sheep.gamegroup.absBase.BaseUMActivity;
|
|
|
@@ -44,6 +47,9 @@ import com.sheep.jiuyan.samllsheep.utils.G;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.SpUtils;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
|
|
|
import com.sheep.jiuyan.samllsheep.wxutil.WXAPIUtil;
|
|
|
+import com.tencent.klevin.KleinManager;
|
|
|
+import com.tencent.klevin.base.callback.KleinResponseCallback;
|
|
|
+import com.tencent.klevin.util.AdUtils;
|
|
|
import com.umeng.socialize.UMAuthListener;
|
|
|
import com.umeng.socialize.UMShareAPI;
|
|
|
import com.umeng.socialize.bean.SHARE_MEDIA;
|
|
|
@@ -64,11 +70,60 @@ public class LoginAct extends BaseUMActivity implements LoginController {
|
|
|
|
|
|
private Stack<String> titleStack = new Stack<>();
|
|
|
|
|
|
+ @BindView(R.id.btn_courage_video)
|
|
|
+ Button btn_courage_video;
|
|
|
+
|
|
|
@Override
|
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
|
StatusBarUtils.setTranslucent(this);
|
|
|
super.onCreate(savedInstanceState);
|
|
|
EventBus.getDefault().register(this);
|
|
|
+ btn_courage_video.setOnClickListener(v -> preAndPlayAd());
|
|
|
+ }
|
|
|
+
|
|
|
+ //预加载激励视频
|
|
|
+ private void preAndPlayAd( ) {
|
|
|
+ showProgress();
|
|
|
+ int posId = 30113;
|
|
|
+ int duration = 0;
|
|
|
+ //String data = "{\"placements\":[{\"pos_id\":" + posId + ",\"ad_count\":" + releaseTask.getTask().getVideo_num() + "}],\"ad_reward_trigger\":1, \"ad_reward_duration\":" + duration + ", \"ad_reward_automute\":1}";
|
|
|
+ String data = "{\"placements\":[{\"pos_id\":" + posId + ",\"ad_count\":1}],\"ad_reward_trigger\":1, \"ad_reward_duration\":" + duration + ", \"ad_reward_automute\":1}";
|
|
|
+
|
|
|
+ KleinManager.getInstance().loadEncourageAD(SheepApp.getInstance().getApplicationContext(), data, new KleinResponseCallback() {
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int i) {
|
|
|
+ hideProgress();
|
|
|
+ //播放激励视频
|
|
|
+ KleinManager.getInstance().showAD(LoginAct.this, AdUtils.TYPE_AD_REWARD,
|
|
|
+ new KleinResponseCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int i) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFail(int i) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onEvent(int i) {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFail(int i) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onEvent(int i) {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
@Override
|