调整投票展示效果
This commit is contained in:
parent
5af061c26f
commit
3454b6f924
@ -20,6 +20,8 @@ import com.yunbao.common.utils.ToastUtil;
|
|||||||
import com.yunbao.live.R;
|
import com.yunbao.live.R;
|
||||||
import com.yunbao.live.activity.LiveRyAnchorActivity;
|
import com.yunbao.live.activity.LiveRyAnchorActivity;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Timer;
|
import java.util.Timer;
|
||||||
import java.util.TimerTask;
|
import java.util.TimerTask;
|
||||||
|
|
||||||
@ -42,9 +44,11 @@ public class LiveRoomVoteManager {
|
|||||||
|
|
||||||
|
|
||||||
LiveRoomVoteModel createVoteModel;
|
LiveRoomVoteModel createVoteModel;
|
||||||
|
private Map<String,Boolean> foldMap;
|
||||||
|
|
||||||
public LiveRoomVoteManager(Context mContext, View root) {
|
public LiveRoomVoteManager(Context mContext, View root) {
|
||||||
this.mContext = mContext;
|
this.mContext = mContext;
|
||||||
|
foldMap=new HashMap<>();
|
||||||
mAnchorVoteHide = root.findViewById(R.id.vote_hide);
|
mAnchorVoteHide = root.findViewById(R.id.vote_hide);
|
||||||
mVoteShow = root.findViewById(R.id.vote_show);
|
mVoteShow = root.findViewById(R.id.vote_show);
|
||||||
mClose = root.findViewById(R.id.vote_close);
|
mClose = root.findViewById(R.id.vote_close);
|
||||||
@ -160,6 +164,15 @@ public class LiveRoomVoteManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.createVoteModel = createVoteModel;
|
this.createVoteModel = createVoteModel;
|
||||||
|
if(!createVoteModel.isVote()) {
|
||||||
|
if (isFold(createVoteModel.getLiveUid())) {
|
||||||
|
fold();
|
||||||
|
} else {
|
||||||
|
expansion();
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
fold();
|
||||||
|
}
|
||||||
mTitle.setText(createVoteModel.getContent());
|
mTitle.setText(createVoteModel.getContent());
|
||||||
mSubmit.setText(createVoteModel.getAnswer1());
|
mSubmit.setText(createVoteModel.getAnswer1());
|
||||||
mCancel.setText(createVoteModel.getAnswer2());
|
mCancel.setText(createVoteModel.getAnswer2());
|
||||||
@ -209,9 +222,11 @@ public class LiveRoomVoteManager {
|
|||||||
boolean hide = mAnchorVoteHide.getTag() == null || (boolean) mAnchorVoteHide.getTag();
|
boolean hide = mAnchorVoteHide.getTag() == null || (boolean) mAnchorVoteHide.getTag();
|
||||||
Animation animation;
|
Animation animation;
|
||||||
if (hide) {
|
if (hide) {
|
||||||
|
foldMap.put(createVoteModel.getLiveUid(),true);
|
||||||
animation = AnimationUtils.loadAnimation(mContext, R.anim.view_live_anchor_vote_out);
|
animation = AnimationUtils.loadAnimation(mContext, R.anim.view_live_anchor_vote_out);
|
||||||
} else {
|
} else {
|
||||||
animation = AnimationUtils.loadAnimation(mContext, R.anim.view_live_anchor_vote_in);
|
animation = AnimationUtils.loadAnimation(mContext, R.anim.view_live_anchor_vote_in);
|
||||||
|
foldMap.put(createVoteModel.getLiveUid(),false);
|
||||||
}
|
}
|
||||||
animation.setAnimationListener(new Animation.AnimationListener() {
|
animation.setAnimationListener(new Animation.AnimationListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -271,4 +286,8 @@ public class LiveRoomVoteManager {
|
|||||||
hideAnchorVote();
|
hideAnchorVote();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isFold(String mLiveUid) {
|
||||||
|
return foldMap.containsKey(mLiveUid)&& Boolean.TRUE.equals(foldMap.get(mLiveUid));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -3693,11 +3693,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
public void setVoteData(LiveRoomVoteModel voteModel) {
|
public void setVoteData(LiveRoomVoteModel voteModel) {
|
||||||
Log.i("voteModel", voteModel.toString());
|
Log.i("voteModel", voteModel.toString());
|
||||||
voteModel.setLiveUid(mLiveUid);
|
voteModel.setLiveUid(mLiveUid);
|
||||||
if(voteModel.isVote()){
|
|
||||||
voteManager.fold();
|
|
||||||
}else{
|
|
||||||
voteManager.expansion();
|
|
||||||
}
|
|
||||||
voteManager.setCreateVoteModel(voteModel);
|
voteManager.setCreateVoteModel(voteModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user