diff --git a/common/src/main/res/values-en-rUS/string.xml b/common/src/main/res/values-en-rUS/string.xml
index b0b12358b..11c39afa5 100644
--- a/common/src/main/res/values-en-rUS/string.xml
+++ b/common/src/main/res/values-en-rUS/string.xml
@@ -1175,6 +1175,6 @@ Limited ride And limited avatar frame
Yes
No
VOTE
- %s \n box disappears after %s seconds
+ %s
box disappears after %s seconds
Please complete the form.
diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml
index 4a2b64265..fb6940897 100644
--- a/common/src/main/res/values-zh-rHK/strings.xml
+++ b/common/src/main/res/values-zh-rHK/strings.xml
@@ -1159,7 +1159,7 @@
是
否
投票中
- %s \n 問答框%s秒后消失
+ %s
問答框%s秒后消失
請完整填寫
填寫“*”的選項可完成
真愛粉\n頭像框(7天)
diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml
index f4b42675d..e67edd9e0 100644
--- a/common/src/main/res/values-zh-rTW/strings.xml
+++ b/common/src/main/res/values-zh-rTW/strings.xml
@@ -1158,7 +1158,7 @@
是
否
投票中
- %s \n 問答框%s秒后消失
+ %s
問答框%s秒后消失
請完整填寫
填寫“*”的選項可完成
真愛粉\n頭像框(7天)
diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml
index 022da19b3..5152c78d3 100644
--- a/common/src/main/res/values-zh/strings.xml
+++ b/common/src/main/res/values-zh/strings.xml
@@ -1160,7 +1160,7 @@
是
否
投票中
- %s \n 問答框%s秒后消失
+ %s
問答框%s秒后消失
請完整填寫
填寫“*”的選項可完成
真愛粉\n頭像框(7天)
diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml
index adf58e673..765c420e3 100644
--- a/common/src/main/res/values/strings.xml
+++ b/common/src/main/res/values/strings.xml
@@ -1165,7 +1165,7 @@ Limited ride And limited avatar frame
Yes
No
VOTE
- %s \n box disappears after %s seconds
+ %s
box disappears after %s seconds
Please complete the form.
Fill And gift
Fill in the \'*\' option to complete
diff --git a/live/src/main/java/com/yunbao/live/utils/LiveRoomVoteManager.java b/live/src/main/java/com/yunbao/live/utils/LiveRoomVoteManager.java
index 3b2dc8080..dbc5dfc72 100644
--- a/live/src/main/java/com/yunbao/live/utils/LiveRoomVoteManager.java
+++ b/live/src/main/java/com/yunbao/live/utils/LiveRoomVoteManager.java
@@ -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 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();
+ }
}
}
diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java
index 0c38f1936..d52287c96 100644
--- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java
+++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java
@@ -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);
diff --git a/live/src/main/res/layout/sim_live_room_vote.xml b/live/src/main/res/layout/sim_live_room_vote.xml
index 8f54fcf6e..1ff258852 100644
--- a/live/src/main/res/layout/sim_live_room_vote.xml
+++ b/live/src/main/res/layout/sim_live_room_vote.xml
@@ -8,7 +8,7 @@
+ />
@@ -70,9 +80,13 @@
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
+ app:autoSizeTextType="uniform"
+ app:autoSizeMinTextSize="5sp"
+ app:autoSizeMaxTextSize="14sp"
+ app:autoSizeStepGranularity="1sp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
- tools:text="不喜欢"
+ tools:text="不喜欢不喜欢不喜"
android:textColor="#FFFFFF"
android:textSize="14sp" />