投票修复测试回报问题

This commit is contained in:
zlzw 2023-05-18 15:02:11 +08:00
parent bd8cf94171
commit 070312ff53
8 changed files with 47 additions and 38 deletions

View File

@ -1175,6 +1175,6 @@ Limited ride And limited avatar frame</string>
<string name="live_vote_close_yes">Yes</string> <string name="live_vote_close_yes">Yes</string>
<string name="live_vote_close_no">No</string> <string name="live_vote_close_no">No</string>
<string name="live_vote_hide_text">VOTE</string> <string name="live_vote_hide_text">VOTE</string>
<string name="live_room_vote_over_tip">%s \n box disappears after %s seconds</string> <string name="live_room_vote_over_tip">%s <br/> box disappears after %s seconds</string>
<string name="live_anchor_vote_tip">Please complete the form.</string> <string name="live_anchor_vote_tip">Please complete the form.</string>
</resources> </resources>

View File

@ -1159,7 +1159,7 @@
<string name="live_vote_close_yes"></string> <string name="live_vote_close_yes"></string>
<string name="live_vote_close_no"></string> <string name="live_vote_close_no"></string>
<string name="live_vote_hide_text">投票中</string> <string name="live_vote_hide_text">投票中</string>
<string name="live_room_vote_over_tip">%s \n 問答框%s秒后消失</string> <string name="live_room_vote_over_tip">%s <br/> 問答框%s秒后消失</string>
<string name="live_anchor_vote_tip">請完整填寫</string> <string name="live_anchor_vote_tip">請完整填寫</string>
<string name="complete_information_consumable">填寫“*”的選項可完成</string> <string name="complete_information_consumable">填寫“*”的選項可完成</string>
<string name="love_powder">真愛粉\n頭像框(7天)</string> <string name="love_powder">真愛粉\n頭像框(7天)</string>

View File

@ -1158,7 +1158,7 @@
<string name="live_vote_close_yes"></string> <string name="live_vote_close_yes"></string>
<string name="live_vote_close_no"></string> <string name="live_vote_close_no"></string>
<string name="live_vote_hide_text">投票中</string> <string name="live_vote_hide_text">投票中</string>
<string name="live_room_vote_over_tip">%s \n 問答框%s秒后消失</string> <string name="live_room_vote_over_tip">%s <br/> 問答框%s秒后消失</string>
<string name="live_anchor_vote_tip">請完整填寫</string> <string name="live_anchor_vote_tip">請完整填寫</string>
<string name="complete_information_consumable">填寫“*”的選項可完成</string> <string name="complete_information_consumable">填寫“*”的選項可完成</string>
<string name="love_powder">真愛粉\n頭像框(7天)</string> <string name="love_powder">真愛粉\n頭像框(7天)</string>

View File

@ -1160,7 +1160,7 @@
<string name="live_vote_close_yes"></string> <string name="live_vote_close_yes"></string>
<string name="live_vote_close_no"></string> <string name="live_vote_close_no"></string>
<string name="live_vote_hide_text">投票中</string> <string name="live_vote_hide_text">投票中</string>
<string name="live_room_vote_over_tip">%s \n 問答框%s秒后消失</string> <string name="live_room_vote_over_tip">%s <br/> 問答框%s秒后消失</string>
<string name="live_anchor_vote_tip">請完整填寫</string> <string name="live_anchor_vote_tip">請完整填寫</string>
<string name="complete_information_consumable">填寫“*”的選項可完成</string> <string name="complete_information_consumable">填寫“*”的選項可完成</string>
<string name="love_powder">真愛粉\n頭像框(7天)</string> <string name="love_powder">真愛粉\n頭像框(7天)</string>

View File

@ -1165,7 +1165,7 @@ Limited ride And limited avatar frame</string>
<string name="live_vote_close_yes">Yes</string> <string name="live_vote_close_yes">Yes</string>
<string name="live_vote_close_no">No</string> <string name="live_vote_close_no">No</string>
<string name="live_vote_hide_text">VOTE</string> <string name="live_vote_hide_text">VOTE</string>
<string name="live_room_vote_over_tip">%s \n box disappears after %s seconds</string> <string name="live_room_vote_over_tip">%s <br/> box disappears after %s seconds</string>
<string name="live_anchor_vote_tip">Please complete the form.</string> <string name="live_anchor_vote_tip">Please complete the form.</string>
<string name="complete_information">Fill And gift</string> <string name="complete_information">Fill And gift</string>
<string name="complete_information_consumable">Fill in the \'*\' option to complete</string> <string name="complete_information_consumable">Fill in the \'*\' option to complete</string>

View File

@ -4,6 +4,7 @@ import android.content.Context;
import android.graphics.Color; import android.graphics.Color;
import android.os.Handler; import android.os.Handler;
import android.os.Looper; import android.os.Looper;
import android.text.Html;
import android.view.View; import android.view.View;
import android.view.animation.Animation; import android.view.animation.Animation;
import android.view.animation.AnimationUtils; import android.view.animation.AnimationUtils;
@ -44,11 +45,9 @@ 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);
@ -151,7 +150,7 @@ public class LiveRoomVoteManager {
cancel(); cancel();
return; 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); }, 0, 1000);
@ -164,15 +163,11 @@ public class LiveRoomVoteManager {
return; return;
} }
this.createVoteModel = createVoteModel; this.createVoteModel = createVoteModel;
if(!createVoteModel.isVote()) { if (createVoteModel.isVote()) {
if (isFold(createVoteModel.getLiveUid())) {
fold(); fold();
}else{ }else{
expansion(); 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());
@ -205,6 +200,10 @@ public class LiveRoomVoteManager {
} }
if (isAnchor) { if (isAnchor) {
mClose.setVisibility(View.VISIBLE); mClose.setVisibility(View.VISIBLE);
} else {
if (mSubmit.getTag() != null && mSubmit.getTag().equals(createVoteModel.getLiveUid())) {
new Handler(Looper.getMainLooper()).postDelayed(this::fold,300);
}
} }
show(); show();
} catch (Exception e) { } catch (Exception e) {
@ -222,11 +221,9 @@ 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
@ -276,18 +273,16 @@ public class LiveRoomVoteManager {
voteLayout.setVisibility(View.GONE); voteLayout.setVisibility(View.GONE);
mSubmit.setTag(null); mSubmit.setTag(null);
} }
public void fold() { public void fold() {
if (mVoteShow.getVisibility() != View.VISIBLE) { if (mVoteShow.getVisibility() != View.VISIBLE) {
hideAnchorVote(); hideAnchorVote();
} }
} }
public void expansion() { public void expansion() {
if (mVoteShow.getVisibility() == View.VISIBLE) { if (mVoteShow.getVisibility() == View.VISIBLE) {
hideAnchorVote(); hideAnchorVote();
} }
} }
public boolean isFold(String mLiveUid) {
return foldMap.containsKey(mLiveUid)&& Boolean.TRUE.equals(foldMap.get(mLiveUid));
}
} }

View File

@ -3683,7 +3683,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
} }
public void dismissVote(String msg, String data) { public void dismissVote(String msg, String data) {
voteManager.endTimerTask(msg); voteManager.endTimerTask(data);
LiveChatBean bean = new LiveChatBean(); LiveChatBean bean = new LiveChatBean();
bean.setType(LiveChatBean.SYSTEM3_COLOR); bean.setType(LiveChatBean.SYSTEM3_COLOR);
bean.setContent(data); bean.setContent(data);

View File

@ -8,7 +8,7 @@
<LinearLayout <LinearLayout
android:id="@+id/live_room_vote" android:id="@+id/live_room_vote"
android:layout_width="130dp" android:layout_width="130dp"
android:layout_height="wrap_content" android:layout_height="88dp"
android:layout_marginTop="-8dp" android:layout_marginTop="-8dp"
android:layout_marginEnd="12dp" android:layout_marginEnd="12dp"
android:background="@drawable/background_cc000" android:background="@drawable/background_cc000"
@ -20,28 +20,35 @@
<TextView <TextView
android:id="@+id/title" android:id="@+id/title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="0dp"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_weight="8"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginEnd="10dp" android:layout_marginEnd="10dp"
tools:text="主播的這個舞蹈你 喜歡嗎" app:autoSizeTextType="uniform"
app:autoSizeMinTextSize="9sp"
app:autoSizeMaxTextSize="16sp"
app:autoSizeStepGranularity="1sp"
tools:text="各位粉絲團的親親親想聽什麽歌曲聽什麽都可以只要你想聽哈哈哈哈哈?"
android:textColor="#FFFFFF" android:textColor="#FFFFFF"
android:textSize="14sp" /> />
<ProgressBar <ProgressBar
android:layout_weight="1"
android:id="@+id/vote_progress" android:id="@+id/vote_progress"
style="?android:attr/progressBarStyleHorizontal" style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="8dp" android:layout_height="0dp"
android:layout_marginTop="9dp"
android:max="20" android:max="20"
android:progress="10" android:progress="10"
android:progressDrawable="@drawable/live_room_qa_progress" android:progressDrawable="@drawable/live_room_qa_progress"
android:rotationY="180" /> android:rotationY="180" />
<LinearLayout <LinearLayout
android:layout_weight="5"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="0dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
@ -50,15 +57,18 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="1" android:layout_weight="1"
app:autoSizeTextType="uniform"
app:autoSizeMinTextSize="5sp"
app:autoSizeMaxTextSize="14sp"
app:autoSizeStepGranularity="1sp"
android:gravity="center" android:gravity="center"
android:paddingTop="5dp" android:paddingTop="5dp"
android:paddingBottom="5dp" android:paddingBottom="5dp"
tools:text="喜欢" tools:text="喜欢喜欢喜欢喜欢"
android:textColor="#FFFFFF" android:textColor="#FFFFFF"
android:textSize="14sp" /> android:textSize="14sp" />
<View <View
android:layout_width="1dp" android:layout_width="1dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#FFF" /> android:background="#FFF" />
@ -70,9 +80,13 @@
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center" android:gravity="center"
app:autoSizeTextType="uniform"
app:autoSizeMinTextSize="5sp"
app:autoSizeMaxTextSize="14sp"
app:autoSizeStepGranularity="1sp"
android:paddingTop="5dp" android:paddingTop="5dp"
android:paddingBottom="5dp" android:paddingBottom="5dp"
tools:text="不喜欢" tools:text="不喜欢不喜欢不喜"
android:textColor="#FFFFFF" android:textColor="#FFFFFF"
android:textSize="14sp" /> android:textSize="14sp" />
</LinearLayout> </LinearLayout>