投票修复测试回报问题
This commit is contained in:
@@ -4,6 +4,7 @@ import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.text.Html;
|
||||
import android.view.View;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationUtils;
|
||||
@@ -44,11 +45,9 @@ public class LiveRoomVoteManager {
|
||||
|
||||
|
||||
LiveRoomVoteModel createVoteModel;
|
||||
private Map<String,Boolean> foldMap;
|
||||
|
||||
public LiveRoomVoteManager(Context mContext, View root) {
|
||||
this.mContext = mContext;
|
||||
foldMap=new HashMap<>();
|
||||
mAnchorVoteHide = root.findViewById(R.id.vote_hide);
|
||||
mVoteShow = root.findViewById(R.id.vote_show);
|
||||
mClose = root.findViewById(R.id.vote_close);
|
||||
@@ -151,7 +150,7 @@ public class LiveRoomVoteManager {
|
||||
cancel();
|
||||
return;
|
||||
}
|
||||
mTitle.setText(String.format(mContext.getString(R.string.live_room_vote_over_tip), msg, time + ""));
|
||||
mTitle.setText(Html.fromHtml(String.format(mContext.getString(R.string.live_room_vote_over_tip), msg, time + "")));
|
||||
});
|
||||
}
|
||||
}, 0, 1000);
|
||||
@@ -164,14 +163,10 @@ public class LiveRoomVoteManager {
|
||||
return;
|
||||
}
|
||||
this.createVoteModel = createVoteModel;
|
||||
if(!createVoteModel.isVote()) {
|
||||
if (isFold(createVoteModel.getLiveUid())) {
|
||||
fold();
|
||||
} else {
|
||||
expansion();
|
||||
}
|
||||
}else {
|
||||
if (createVoteModel.isVote()) {
|
||||
fold();
|
||||
}else{
|
||||
expansion();
|
||||
}
|
||||
mTitle.setText(createVoteModel.getContent());
|
||||
mSubmit.setText(createVoteModel.getAnswer1());
|
||||
@@ -203,8 +198,12 @@ public class LiveRoomVoteManager {
|
||||
mProgress.setMax(createVoteModel.getAnswer1Num() + createVoteModel.getAnswer2Num());
|
||||
setLength(createVoteModel.getAnswer1Num());
|
||||
}
|
||||
if(isAnchor){
|
||||
if (isAnchor) {
|
||||
mClose.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
if (mSubmit.getTag() != null && mSubmit.getTag().equals(createVoteModel.getLiveUid())) {
|
||||
new Handler(Looper.getMainLooper()).postDelayed(this::fold,300);
|
||||
}
|
||||
}
|
||||
show();
|
||||
} catch (Exception e) {
|
||||
@@ -222,11 +221,9 @@ public class LiveRoomVoteManager {
|
||||
boolean hide = mAnchorVoteHide.getTag() == null || (boolean) mAnchorVoteHide.getTag();
|
||||
Animation animation;
|
||||
if (hide) {
|
||||
foldMap.put(createVoteModel.getLiveUid(),true);
|
||||
animation = AnimationUtils.loadAnimation(mContext, R.anim.view_live_anchor_vote_out);
|
||||
} else {
|
||||
animation = AnimationUtils.loadAnimation(mContext, R.anim.view_live_anchor_vote_in);
|
||||
foldMap.put(createVoteModel.getLiveUid(),false);
|
||||
}
|
||||
animation.setAnimationListener(new Animation.AnimationListener() {
|
||||
@Override
|
||||
@@ -276,18 +273,16 @@ public class LiveRoomVoteManager {
|
||||
voteLayout.setVisibility(View.GONE);
|
||||
mSubmit.setTag(null);
|
||||
}
|
||||
public void fold(){
|
||||
if(mVoteShow.getVisibility()!=View.VISIBLE){
|
||||
hideAnchorVote();
|
||||
}
|
||||
}
|
||||
public void expansion(){
|
||||
if(mVoteShow.getVisibility()==View.VISIBLE){
|
||||
|
||||
public void fold() {
|
||||
if (mVoteShow.getVisibility() != View.VISIBLE) {
|
||||
hideAnchorVote();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isFold(String mLiveUid) {
|
||||
return foldMap.containsKey(mLiveUid)&& Boolean.TRUE.equals(foldMap.get(mLiveUid));
|
||||
public void expansion() {
|
||||
if (mVoteShow.getVisibility() == View.VISIBLE) {
|
||||
hideAnchorVote();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3683,7 +3683,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
|
||||
public void dismissVote(String msg, String data) {
|
||||
voteManager.endTimerTask(msg);
|
||||
voteManager.endTimerTask(data);
|
||||
LiveChatBean bean = new LiveChatBean();
|
||||
bean.setType(LiveChatBean.SYSTEM3_COLOR);
|
||||
bean.setContent(data);
|
||||
|
||||
Reference in New Issue
Block a user