Commit 17a85653 by 代凡

添加配置功能

parent 010b9dd8
......@@ -4,7 +4,6 @@ import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.text.TextUtils;
import android.util.Log;
import android.widget.EditText;
import com.blankj.utilcode.util.ToastUtils;
import com.easefun.polyv.businesssdk.PolyvChatDomainManager;
......@@ -15,7 +14,6 @@ import com.easefun.polyv.businesssdk.vodplayer.PolyvVodSDKClient;
import com.easefun.polyv.cloudclass.config.PolyvLiveSDKClient;
import com.easefun.polyv.cloudclass.model.PolyvLiveStatusVO;
import com.easefun.polyv.cloudclass.net.PolyvApiManager;
import com.easefun.polyv.cloudclassdemo.login.PolyvCloudClassLoginActivity;
import com.easefun.polyv.cloudclassdemo.watch.PolyvCloudClassHomeActivity;
import com.easefun.polyv.foundationsdk.log.PolyvCommonLog;
import com.easefun.polyv.foundationsdk.net.PolyvResponseBean;
......@@ -36,6 +34,8 @@ import java.io.IOException;
import io.reactivex.disposables.Disposable;
import retrofit2.adapter.rxjava2.HttpException;
import static com.easefun.polyvsdk.cloudclass.rn.PolyvErrorCode.channleLoadFailed;
/**
* @author df
* @create 2019/9/6
......@@ -91,16 +91,20 @@ public class PolyvCloudClassRNModule extends ReactContextBaseJavaModule {
if (code == PolyvErrorCode.success) {
PolyvInitManager.init(vodKey, decodeKey, decodeIv, getReactApplicationContext());
WritableMap map = Arguments.createMap();
map.putInt("code", PolyvErrorCode.success);
promise.resolve(map);
sendSuccessMessage(promise);
} else {
getErrorMessage(promise, code);
sendErrorMessage(promise, code);
}
}
private void getErrorMessage(Promise promise, int code) {
private void sendSuccessMessage(Promise promise) {
WritableMap map = Arguments.createMap();
map.putInt("code", PolyvErrorCode.success);
promise.resolve(map);
}
private void sendErrorMessage(Promise promise, int code) {
String errorCode = "" + code;
String errorDesc = PolyvErrorCode.getDesc(code);
Throwable throwable = new Throwable(errorDesc);
......@@ -109,7 +113,8 @@ public class PolyvCloudClassRNModule extends ReactContextBaseJavaModule {
}
@ReactMethod
public void playbackLogin(int handler, String userId, String channelId, String vid, String appId, String appScrect, Promise promise) {
public void playbackLogin(int handler, String userId, String channelId,
String vid, String appId, String appScrect, Promise promise) {
int code = PolyvErrorCode.success;
if (TextUtils.isEmpty(userId)) {
......@@ -126,9 +131,9 @@ public class PolyvCloudClassRNModule extends ReactContextBaseJavaModule {
if(code == PolyvErrorCode.success){
progress.show();
checkToken(userId,null,channelId,vid,appId,false);
checkToken(userId,null,channelId,vid,appId,false,promise);
}else {
getErrorMessage(promise, code);
sendErrorMessage(promise, code);
}
}
......@@ -148,13 +153,14 @@ public class PolyvCloudClassRNModule extends ReactContextBaseJavaModule {
if(code == PolyvErrorCode.success){
progress.show();
checkToken(userId,appScrect,channelId,null,appId,true);
checkToken(userId,appScrect,channelId,null,appId,true, promise);
}else {
getErrorMessage(promise, code);
sendErrorMessage(promise, code);
}
}
private void checkToken(String userId, String appSecret, String channel, String vid, String appId, boolean live) {
private void checkToken(String userId, String appSecret, String channel, String vid, String appId, boolean live, Promise promise) {
//请求token接口
getTokenDisposable = PolyvLoginManager.checkLoginToken(userId, appSecret, appId,
channel, vid,
......@@ -166,10 +172,10 @@ public class PolyvCloudClassRNModule extends ReactContextBaseJavaModule {
PolyvVodSDKClient.getInstance().initConfig(appId, appSecret);
if (!live) {
requestPlayBackStatus(userId,channel, vid);
requestPlayBackStatus(userId,channel, vid,promise);
return;
}
requestLiveStatus(userId, channel);
requestLiveStatus(userId, channel,promise);
PolyvChatDomainManager.getInstance().setChatDomain(responseBean);
}
......@@ -183,19 +189,19 @@ public class PolyvCloudClassRNModule extends ReactContextBaseJavaModule {
@Override
public void onError(Throwable e) {
super.onError(e);
errorStatus(e);
errorStatus(e,promise);
}
});
}
private void requestPlayBackStatus(String userId,String channelId, String vid) {
private void requestPlayBackStatus(String userId, String channelId, String vid, Promise promise) {
if (TextUtils.isEmpty(vid)) {
return;
}
verifyDispose = PolyvLoginManager.getPlayBackType(vid, new PolyvrResponseCallback<PolyvPlayBackVO>() {
@Override
public void onSuccess(PolyvPlayBackVO playBack) {
sendSuccessMessage(promise);
boolean isLivePlayBack = playBack.getLiveType() == 0;
startActivityForPlayback(vid,channelId,userId, isLivePlayBack);
}
......@@ -209,7 +215,7 @@ public class PolyvCloudClassRNModule extends ReactContextBaseJavaModule {
@Override
public void onError(Throwable e) {
super.onError(e);
errorStatus(e);
errorStatus(e, promise);
}
});
}
......@@ -218,11 +224,12 @@ public class PolyvCloudClassRNModule extends ReactContextBaseJavaModule {
ToastUtils.showLong(message);
}
public void errorStatus(Throwable e) {
public void errorStatus(Throwable e, Promise promise) {
PolyvCommonLog.exception(e);
progress.dismiss();
if (e instanceof HttpException) {
try {
sendErrorMessage(promise,channleLoadFailed);
ToastUtils.showLong(((HttpException) e).response().errorBody().string());
} catch (IOException e1) {
e1.printStackTrace();
......@@ -232,7 +239,7 @@ public class PolyvCloudClassRNModule extends ReactContextBaseJavaModule {
}
}
private void requestLiveStatus(String userId, String channelId) {
private void requestLiveStatus(String userId, String channelId, Promise promise) {
verifyDispose = PolyvResponseExcutor.excuteUndefinData(PolyvApiManager.getPolyvLiveStatusApi().geLiveStatusJson(channelId)
, new PolyvrResponseCallback<PolyvLiveStatusVO>() {
@Override
......@@ -241,7 +248,7 @@ public class PolyvCloudClassRNModule extends ReactContextBaseJavaModule {
String[] dataArr = data.split(",");
boolean isAlone = "alone".equals(dataArr[1]);//是否有ppt
sendSuccessMessage(promise);
startActivityForLive(userId, channelId, isAlone);
progress.dismiss();
}
......@@ -255,7 +262,7 @@ public class PolyvCloudClassRNModule extends ReactContextBaseJavaModule {
@Override
public void onError(Throwable e) {
super.onError(e);
errorStatus(e);
errorStatus(e, promise);
}
});
}
......
......@@ -14,6 +14,10 @@ android {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
qatest {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
......@@ -30,6 +34,9 @@ dependencies {
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
api 'com.android.support:design:27.1.1'
api 'com.easefun.polyv:polyvSDKCloudClass:0.8.1'
api 'com.easefun.polyv:polyvSDKCloudClass:0.8.2.02'
//glide
api 'jp.wasabeef:glide-transformations:3.3.0'
api "com.github.bumptech.glide:okhttp3-integration:4.7.1"
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
}
......@@ -65,6 +65,8 @@ public abstract class PolyvCommonMediacontroller<T extends PolyvCommonVideoView>
private static final String landTag = "land";
private static final String portraitTag = "portrait";
protected boolean joinLinkMic;
private Runnable hideTask = new Runnable() {
@Override
public void run() {
......@@ -165,7 +167,6 @@ public abstract class PolyvCommonMediacontroller<T extends PolyvCommonVideoView>
public void initialConfig(ViewGroup view) {
parentView = view;
changeToPortrait();
}
private void setPortraitController() {
......@@ -201,7 +202,6 @@ public abstract class PolyvCommonMediacontroller<T extends PolyvCommonVideoView>
@Override
public void show() {
show(SHOW_TIME);
}
@Override
......
......@@ -23,6 +23,8 @@ import com.easefun.polyv.commonui.player.ppt.PolyvPPTView;
import com.easefun.polyv.commonui.widget.PolyvTouchContainerView;
import com.easefun.polyv.foundationsdk.config.PolyvPlayOption;
import com.easefun.polyv.foundationsdk.log.PolyvCommonLog;
import com.easefun.polyv.foundationsdk.permission.PolyvPermissionManager;
import com.easefun.polyv.foundationsdk.utils.PolyvControlUtils;
import com.easefun.polyv.foundationsdk.utils.PolyvScreenUtils;
/**
......@@ -50,6 +52,7 @@ public abstract class PolyvCommonVideoHelper<T extends IPolyvVideoItem<P, Q>, P
protected static int videoViewVolume;
protected static final Handler S_HANDLER;
protected PolyvPermissionManager permissionManager;
private boolean firstSwitchLocation = true;//第一次切换主副屏 不用动画
......@@ -85,6 +88,7 @@ public abstract class PolyvCommonVideoHelper<T extends IPolyvVideoItem<P, Q>, P
polyvPPTItem.addMediaController(controller);
videoItem.bindPPTView(polyvPPTItem);
addCloudClassWebProcessor();
}
}
......@@ -108,6 +112,11 @@ public abstract class PolyvCommonVideoHelper<T extends IPolyvVideoItem<P, Q>, P
public abstract void resetView(boolean isNoramlLivePlayBack);
/**
* 增加云客堂web端得处理器
*/
protected abstract void addCloudClassWebProcessor();
public void addPPT(PolyvTouchContainerView container) {
pptParent = container;
if(pptContianer == null){
......@@ -220,9 +229,9 @@ public abstract class PolyvCommonVideoHelper<T extends IPolyvVideoItem<P, Q>, P
firstSwitchLocation = false;
}
public void showCamerView() {
if(pptParent != null){
pptParent.setVisibility(View.VISIBLE);
public void showCameraView() {
if(pptContianer != null){
pptContianer.setVisibility(View.VISIBLE);
}
PolyvPPTItem pptItem = videoItem.getPPTItem();
if (pptItem != null) {
......@@ -297,8 +306,18 @@ public abstract class PolyvCommonVideoHelper<T extends IPolyvVideoItem<P, Q>, P
// }
}
public boolean requestPermission() {
permissionManager.request();
return true;
}
public void destory() {
PolyvCommonLog.d(TAG, "destroy helper video");
if(videoViewVolume >0){
PolyvControlUtils.setVolume(context, videoViewVolume);
}
videoView.destroy();
controller.destroy();
videoItem.destroy();
......
......@@ -118,6 +118,7 @@ public class PolyvBaseActivity extends AppCompatActivity implements PolyvPermiss
protected void onCreate(@Nullable Bundle savedInstanceState) {
if (savedInstanceState != null) {
savedInstanceState.putParcelable("android:support:fragments", null);
savedInstanceState.putParcelable("android:fragments", null);
}
super.onCreate(savedInstanceState);
isCreateSuccess = false;
......@@ -173,7 +174,7 @@ public class PolyvBaseActivity extends AppCompatActivity implements PolyvPermiss
//新增的findViewById()方法,用于兼容support 25
@SuppressWarnings("unchecked")
public <T extends View> T findView(@IdRes int id) {
return (T)super.findViewById(id);
return (T) super.findViewById(id);
}
// </editor-fold>
......
package com.easefun.polyv.commonui.player;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Toast;
import com.easefun.polyv.businesssdk.api.common.ppt.PolyvPPTVodProcessor;
import com.easefun.polyv.businesssdk.model.video.PolyvBaseVideoParams;
import com.easefun.polyv.businesssdk.vodplayer.PolyvVodVideoView;
import com.easefun.polyv.businesssdk.web.IPolyvWebMessageProcessor;
import com.easefun.polyv.commonui.PolyvCommonVideoHelper;
import com.easefun.polyv.commonui.player.ppt.PolyvPPTItem;
import com.easefun.polyv.commonui.player.widget.PolyvVodMediaController;
import com.easefun.polyv.commonui.player.widget.PolyvVodVideoItem;
import com.easefun.polyv.foundationsdk.log.PolyvCommonLog;
import com.github.lzyzsd.jsbridge.CallBackFunction;
import tv.danmaku.ijk.media.player.IjkMediaPlayer;
......@@ -38,6 +42,32 @@ public class PolyvVodVideoHelper extends PolyvCommonVideoHelper<PolyvVodVideoIte
}
@Override
protected void addCloudClassWebProcessor() {
if(pptView != null){
IPolyvWebMessageProcessor<PolyvPPTVodProcessor.PolyvVideoPPTCallback> processor = new
PolyvPPTVodProcessor(null);
pptView.addWebProcessor(processor);
processor.registerJSHandler(new PolyvPPTVodProcessor.PolyvVideoPPTCallback() {
@Override
public void callVideoDuration(CallBackFunction function) {
PolyvCommonLog.d(TAG,"callVideoDuration:");
if (videoView == null) {
return;
}
String time = "{\"time\":" + videoView.getCurrentPosition() + "}";
PolyvCommonLog.d(TAG,"time:"+time);
function.onCallBack(time);
}
@Override
public void pptPrepare() {
pptView.setLoadingViewVisible(View.INVISIBLE);
}
});
}
}
public void pause() {
videoView.pause();
}
......
......@@ -4,6 +4,8 @@ import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
......@@ -29,6 +31,7 @@ public class PolyvPPTItem<T extends PolyvCommonMediacontroller> extends
private T mediaController;
private boolean hasClosed;
private GestureDetector gestureDetector;
public PolyvPPTItem(@NonNull Context context) {
this(context, null);
......@@ -49,7 +52,33 @@ public class PolyvPPTItem<T extends PolyvCommonMediacontroller> extends
polyvPptView = findViewById(R.id.polyv_ppt_view);
pptContiner = findViewById(R.id.polyv_ppt_container);
videoSubviewClose = findViewById(R.id.video_subview_close);
// pptContiner.setOnClickListener(this);
videoSubviewClose.setOnClickListener(this);
listenerSingleTap();
}
/**
* 监听单击手势事件,消费事件后 同时将事件继续上抛给父类 进行手势处理
*/
private void listenerSingleTap() {
pptContiner.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
gestureDetector.onTouchEvent(event);
((ViewGroup)pptContiner.getParent()).onTouchEvent(event);
return true;
}
});
gestureDetector = new GestureDetector(getContext(), new GestureDetector.SimpleOnGestureListener() {
@Override
public boolean onSingleTapUp(MotionEvent e) {
PolyvCommonLog.e(TAG,"onSingleTapUp");
mediaController.changePPTVideoLocation();
return true;
}
});
}
public void show(int show) {
......@@ -73,9 +102,18 @@ public class PolyvPPTItem<T extends PolyvCommonMediacontroller> extends
if (id == R.id.video_subview_close) {
hasClosed = true;
hideSubView();
}else if(id == R.id.polyv_ppt_container){
// mediaController.changePPTVideoLocation();
}
}
@Override
public boolean onTouchEvent(MotionEvent event) {
PolyvCommonLog.e(TAG,"onTouchEvent:"+event.getAction());
gestureDetector.onTouchEvent(event);
return super.onTouchEvent(event);
}
public void hideSubView() {
((ViewGroup) pptContiner.getParent()).setVisibility(INVISIBLE);
mediaController.updateControllerWithCloseSubView();
......
......@@ -2,22 +2,29 @@ package com.easefun.polyv.commonui.player.ppt;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import com.easefun.polyv.businesssdk.api.common.ppt.IPolyvPPTView;
import com.easefun.polyv.businesssdk.api.common.ppt.PolyvPPTVodProcessor;
import com.easefun.polyv.businesssdk.api.common.ppt.PolyvPPTWebView;
import com.easefun.polyv.businesssdk.model.ppt.PolyvPPTAuthentic;
import com.easefun.polyv.businesssdk.web.IPolyvWebMessageProcessor;
import com.easefun.polyv.cloudclass.model.PolyvSocketMessageVO;
import com.easefun.polyv.commonui.R;
import com.easefun.polyv.foundationsdk.log.PolyvCommonLog;
import com.easefun.polyv.foundationsdk.rx.PolyvRxBus;
import com.easefun.polyv.foundationsdk.rx.PolyvRxTimer;
import com.easefun.polyv.foundationsdk.utils.PolyvGsonUtil;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import static com.easefun.polyv.businesssdk.api.common.ppt.PolyvCloudClassPPTProcessor.AUTHORIZATION_PPT_PAINT;
import static com.easefun.polyv.businesssdk.api.common.ppt.PolyvCloudClassPPTProcessor.PPT_PAINT_STATUS;
import static com.easefun.polyv.cloudclass.PolyvSocketEvent.ONSLICECONTROL;
import static com.easefun.polyv.cloudclass.PolyvSocketEvent.ONSLICEDRAW;
import static com.easefun.polyv.cloudclass.PolyvSocketEvent.ONSLICEID;
......@@ -58,7 +65,12 @@ public class PolyvPPTView extends FrameLayout implements IPolyvPPTView {
polyvPPTWebView = findViewById(R.id.polyv_ppt_web);
pptLoadingView = findViewById(R.id.polyv_ppt_default_icon);
loadWeb();
}
@Override
public void addWebProcessor(IPolyvWebMessageProcessor processor) {
processor.bindWebView(polyvPPTWebView);
polyvPPTWebView.registerProcessor(processor);
}
private void loadWeb() {
......@@ -135,6 +147,7 @@ public class PolyvPPTView extends FrameLayout implements IPolyvPPTView {
PolyvCommonLog.d(TAG, "destroy ppt view");
if (polyvPPTWebView != null) {
polyvPPTWebView.removeAllViews();
polyvPPTWebView.destroy();
removeView(polyvPPTWebView);
}
polyvPPTWebView = null;
......@@ -167,17 +180,23 @@ public class PolyvPPTView extends FrameLayout implements IPolyvPPTView {
}
}
@Override
public void sendWebMessage(String event, String message) {
polyvPPTWebView.callMessage(event,message);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
PolyvCommonLog.e(TAG,"onTouchEvent");
return super.onTouchEvent(event);
}
public void setLoadingViewVisible(int visible) {
if (pptLoadingView != null) {
pptLoadingView.setVisibility(visible);
}
}
@Override
public void addPPTCallback(PolyvPPTWebView.PolyvVideoPPTCallback polyvVideoPPTCallback) {
polyvPPTWebView.setPolyvVideoPPTCallback(polyvVideoPPTCallback);
}
public void updateDelayTime(int delay_time){
this.delayTime = delay_time;
}
......@@ -185,4 +204,9 @@ public class PolyvPPTView extends FrameLayout implements IPolyvPPTView {
public void resetDelayTime(){
this.delayTime = DELAY_TIME;
}
public void updateBrushPermission(String message) {
PolyvPPTAuthentic polyvPPTAuthentic = PolyvGsonUtil.fromJson(PolyvPPTAuthentic.class,message);
polyvPPTWebView.setNeedGestureAction("1".equals(polyvPPTAuthentic.getStatus()));
}
}
......@@ -216,7 +216,6 @@ public class PolyvVodMediaController extends PolyvCommonMediacontroller<PolyvVod
int totalTime = polyvVideoView.getDuration();
tvTotaltime.setText(" / " + PolyvTimeUtils.generateTime(totalTime));
tvTotaltimeLand.setText(" / " + PolyvTimeUtils.generateTime(totalTime));
videoControllerPort.setVisibility(VISIBLE);
}
@Override
......@@ -385,7 +384,7 @@ public class PolyvVodMediaController extends PolyvCommonMediacontroller<PolyvVod
pbSubviewShow.setVisibility(GONE);
pbSubviewShowLand.setVisibility(GONE);
if (polyvVodVideoHelper != null) {
polyvVodVideoHelper.showCamerView();
polyvVodVideoHelper.showCameraView();
}
}
......
......@@ -69,7 +69,7 @@ public class PolyvAnswerView extends FrameLayout {
private static final String TAG = "PolyvAnswerView";
//为true加载web url资源,为false加载本地url资源
private static final boolean LOAD_WEB_URL =true;
private static final boolean LOAD_WEB_URL = true;
private PolyvAnswerWebView answerWebView;
private ViewGroup answerContainer;
......@@ -133,9 +133,9 @@ public class PolyvAnswerView extends FrameLayout {
}
});
if (LOAD_WEB_URL){
if (LOAD_WEB_URL) {
answerWebView.loadWeb();
}else {
} else {
answerWebView.loadUrl("file:///android_asset/index.html");
}
......@@ -175,7 +175,7 @@ public class PolyvAnswerView extends FrameLayout {
@Override
public void accept(BUS_EVENT event) throws Exception {
if (event.type == BUS_EVENT.TYPE_SHOW_BULLETIN) {
showAnswerContainer();
showAnswerContainer(PolyvSocketEvent.BULLETIN_SHOW);
answerWebView.callBulletinShow(bulletinVO);
}
}
......@@ -191,7 +191,7 @@ public class PolyvAnswerView extends FrameLayout {
});
}
public void processSocketMessage(PolyvSocketMessageVO polyvSocketMessage, String event) {
public void processSocketMessage(PolyvSocketMessageVO polyvSocketMessage, final String event) {
final String msg = polyvSocketMessage.getMessage();
if (msg == null || event == null) {
return;
......@@ -210,7 +210,7 @@ public class PolyvAnswerView extends FrameLayout {
curQuestionId = notNull(polyvQuestionSResult).getQuestionId();
isQuestionAnswer = false;
lockToPortrait();//讲师发题
showAnswerContainer();
showAnswerContainer(event);
answerWebView.callUpdateNewQuestion(msg);
}
});
......@@ -229,7 +229,7 @@ public class PolyvAnswerView extends FrameLayout {
return;
}
lockToPortrait();//答题结果
showAnswerContainer();
showAnswerContainer(event);
answerWebView.callHasChooseAnswer(socketVO.getQuestionId(), msg);
}
});
......@@ -249,7 +249,7 @@ public class PolyvAnswerView extends FrameLayout {
}
if (!isQuestionAnswer && questionId.equals(curQuestionId)) {
lockToPortrait();//截止答题
showAnswerContainer();
showAnswerContainer(event);
answerWebView.callStopQuestion();
}
}
......@@ -257,7 +257,7 @@ public class PolyvAnswerView extends FrameLayout {
break;
//开始问卷调查
case PolyvSocketEvent.START_QUESTIONNAIRE:
showAnswerContainer();
showAnswerContainer(event);
answerWebView.callStartQuestionnaire(msg);
lockToPortrait();//问卷调查
break;
......@@ -267,17 +267,17 @@ public class PolyvAnswerView extends FrameLayout {
break;
//开始抽奖
case PolyvSocketEvent.LOTTERY_START:
showAnswerContainer();
showAnswerContainer(event);
answerWebView.callStartLottery();
break;
//当前频道正在抽奖
case PolyvSocketEvent.ON_LOTTERY:
showAnswerContainer();
showAnswerContainer(event);
answerWebView.callStartLottery();
break;
//停止抽奖
case PolyvSocketEvent.LOTTERY_END:
showAnswerContainer();
showAnswerContainer(event);
boolean win = false;
String winnerCode = "";
PolyvLotteryEndVO vo = PolyvGsonUtil.fromJson(PolyvLotteryEndVO.class, msg);
......@@ -293,11 +293,11 @@ public class PolyvAnswerView extends FrameLayout {
PolyvLottery2JsVO winnerVo = new PolyvLottery2JsVO(win, vo.getPrize(), winnerCode);
String winnerJson1 = winnerVo.toJson();
LogUtils.d(winnerJson1);
final boolean winTemp=win;
final boolean winTemp = win;
answerWebView.callLotteryEnd(winnerJson1, vo.getSessionId(), vo.getLotteryId(), new Runnable() {
@Override
public void run() {
if (winTemp){
if (winTemp) {
onWinLotteryShow();
}
}
......@@ -306,7 +306,7 @@ public class PolyvAnswerView extends FrameLayout {
//未领奖的中奖人信息
case PolyvSocketEvent.LOTTERY_WINNER:
PolyvLotteryWinnerVO winnerVO = PolyvGsonUtil.fromJson(PolyvLotteryWinnerVO.class, msg);
showAnswerContainer();
showAnswerContainer(event);
final PolyvLottery2JsVO winnerJsonVO = new PolyvLottery2JsVO(true, notNull(winnerVO).getPrize(), winnerVO.getWinnerCode());
String winnerJson2 = winnerJsonVO.toJson();
if (winnerJsonVO.isWin()) {
......@@ -316,7 +316,7 @@ public class PolyvAnswerView extends FrameLayout {
answerWebView.callLotteryWinner(winnerJson2, winnerVO.getSessionId(), winnerVO.getLotteryId(), new Runnable() {
@Override
public void run() {
if (winnerJsonVO.isWin()){
if (winnerJsonVO.isWin()) {
onWinLotteryShow();
}
}
......@@ -324,7 +324,7 @@ public class PolyvAnswerView extends FrameLayout {
break;
//开始签到
case PolyvSocketEvent.START_SIGN_IN:
showAnswerContainer();
showAnswerContainer(event);
PolyvSignInVO signInVO = PolyvGsonUtil.fromJson(PolyvSignInVO.class, msg);
PolyvSignIn2JsVO signIn2JsVO = new PolyvSignIn2JsVO(notNull(signInVO).getData().getLimitTime(), signInVO.getData().getMessage());
String signJson;
......@@ -339,7 +339,7 @@ public class PolyvAnswerView extends FrameLayout {
break;
//显示公告
case PolyvSocketEvent.BULLETIN_SHOW:
showAnswerContainer();
showAnswerContainer(event);