add[整蛊翻译]

This commit is contained in:
Martin 2024-06-11 16:55:07 +08:00
parent c5de062171
commit 0425b56106
13 changed files with 281 additions and 148 deletions

View File

@ -1353,11 +1353,11 @@ Limited ride And limited avatar frame</string>
<string name="interactive_game_search_room_broadcast_room">Whether to enter the live broadcast room</string> <string name="interactive_game_search_room_broadcast_room">Whether to enter the live broadcast room</string>
<string name="interactive_game_search_room_bhe_game">Noonly enter the game</string> <string name="interactive_game_search_room_bhe_game">Noonly enter the game</string>
<string name="interactive_game_rooms_oin">There are currently no rooms to join</string> <string name="interactive_game_rooms_oin">There are currently no rooms to join</string>
<string name="prank_switch">Turntable prank switch</string> <string name="prank_switch">Turntable Trick Switch</string>
<string name="see_the_contents_of">After closing, all users will not be able to see the contents of the turntable</string> <string name="see_the_contents_of">After turning it on, all users will not be able to see the content of the carousel.</string>
<string name="diamonds_every_time">The turntable consumes diamonds every time</string> <string name="diamonds_every_time">Each turn of the wheel consumes diamonds</string>
<string name="diamonds_every_time_requirement_of">Minimum requirement of 1000 diamonds</string> <string name="diamonds_every_time_requirement_of">Starting with at least 1000 diamonds</string>
<string name="diamonds_every_time_requirement_of_hint">Fill in the content of the prankFill in a minimum of 2 words and a maximum of 10 words</string> <string name="diamonds_every_time_requirement_of_hint">Choose a gift</string>
<string name="prank_content_yet_hint">You have not set up the prank content yet</string> <string name="prank_content_yet_hint">You have not set up the prank content yet</string>
<string name="choose_a_prank_gift">Choose a prank gift</string> <string name="choose_a_prank_gift">Choose a prank gift</string>
<string name="choose_a_prank_gift_hint">Enter the prank content...</string> <string name="choose_a_prank_gift_hint">Enter the prank content...</string>

View File

@ -1356,11 +1356,11 @@ Limited ride And limited avatar frame</string>
<string name="interactive_game_search_room_broadcast_room">Whether to enter the live broadcast room</string> <string name="interactive_game_search_room_broadcast_room">Whether to enter the live broadcast room</string>
<string name="interactive_game_search_room_bhe_game">Noonly enter the game</string> <string name="interactive_game_search_room_bhe_game">Noonly enter the game</string>
<string name="interactive_game_rooms_oin">There are currently no rooms to join</string> <string name="interactive_game_rooms_oin">There are currently no rooms to join</string>
<string name="prank_switch">Turntable prank switch</string> <string name="prank_switch">Turntable Trick Switch</string>
<string name="see_the_contents_of">After closing, all users will not be able to see the contents of the turntable</string> <string name="see_the_contents_of">After turning it on, all users will not be able to see the content of the carousel.</string>
<string name="diamonds_every_time">The turntable consumes diamonds every time</string> <string name="diamonds_every_time">Each turn of the wheel consumes diamonds</string>
<string name="diamonds_every_time_requirement_of">Minimum requirement of 1000 diamonds</string> <string name="diamonds_every_time_requirement_of">Starting with at least 1000 diamonds</string>
<string name="diamonds_every_time_requirement_of_hint">Fill in the content of the prankFill in a minimum of 2 words and a maximum of 10 words</string> <string name="diamonds_every_time_requirement_of_hint">Choose a gift</string>
<string name="prank_content_yet_hint">You have not set up the prank content yet</string> <string name="prank_content_yet_hint">You have not set up the prank content yet</string>
<string name="choose_a_prank_gift">Choose a prank gift</string> <string name="choose_a_prank_gift">Choose a prank gift</string>
<string name="choose_a_prank_gift_hint">Enter the prank content...</string> <string name="choose_a_prank_gift_hint">Enter the prank content...</string>

View File

@ -131,4 +131,10 @@
<item name="android:activityCloseEnterAnimation">@anim/out_to_right_abit</item> <item name="android:activityCloseEnterAnimation">@anim/out_to_right_abit</item>
<item name="android:activityCloseExitAnimation">@anim/out_to_right</item> <item name="android:activityCloseExitAnimation">@anim/out_to_right</item>
</style> </style>
<style name="PrankTabLayoutTextStyle" parent="TextAppearance.Design.Tab">
<item name="textAllCaps">false</item>
<item name="android:textAllCaps">false</item>
</style>
</resources> </resources>

View File

@ -235,19 +235,36 @@ public class LivePrankRecyclerAdapter extends RecyclerView.Adapter<LivePrankRecy
} }
private String getChineseNum(int id) { private String getChineseNum(int id) {
switch (id) { if(WordUtil.isNewZh()){
case 1: switch (id) {
return ""; case 1:
case 2: return "";
return ""; case 2:
case 3: return "";
return ""; case 3:
case 4: return "";
return ""; case 4:
case 5: return "";
return ""; case 5:
case 6: return "";
return ""; case 6:
return "";
}
}else{
switch (id) {
case 1:
return " No. 1";
case 2:
return " No. 2";
case 3:
return " No. 3";
case 4:
return " No. 4";
case 5:
return " No. 5";
case 6:
return " No. 6";
}
} }
return ""; return "";
} }
@ -271,17 +288,17 @@ public class LivePrankRecyclerAdapter extends RecyclerView.Adapter<LivePrankRecy
} else { } else {
switch (id) { switch (id) {
case 1: case 1:
return "Extraction probability40%"; return "Chance of extraction: 40%";
case 2: case 2:
return "Extraction probability30%"; return "Chance of extraction: 30%";
case 3: case 3:
return "Extraction probability15%"; return "Chance of extraction: 15%";
case 4: case 4:
return "Extraction probability10%"; return "Chance of extraction: 10%";
case 5: case 5:
return "Extraction probability4%"; return "Chance of extraction: 4%";
default: default:
return "Extraction probability1%"; return "Chance of extraction: 1%";
} }
} }

View File

@ -3,6 +3,7 @@ package com.yunbao.live.dialog;
import android.content.Context; import android.content.Context;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
@ -27,6 +28,8 @@ public class LivePrankAddGiftDialog extends AbsDialogPopupWindow {
private TextView giftText; private TextView giftText;
private TextView numberText; private TextView numberText;
private EditText contentText; private EditText contentText;
private LinearLayout giftNumberLayout;
private boolean isShowGiftNumber = true;
private OnItemClickListener<PrankGiftBean> onItemClickListener; private OnItemClickListener<PrankGiftBean> onItemClickListener;
@ -42,7 +45,8 @@ public class LivePrankAddGiftDialog extends AbsDialogPopupWindow {
} }
public LivePrankAddGiftDialog setGiftBeans(List<PrankGiftBean> giftBeans) { public LivePrankAddGiftDialog setGiftBeans(List<PrankGiftBean> giftBeans,boolean isShow) {
this.isShowGiftNumber = isShow;
this.giftBeans = giftBeans; this.giftBeans = giftBeans;
return this; return this;
} }
@ -68,6 +72,10 @@ public class LivePrankAddGiftDialog extends AbsDialogPopupWindow {
giftText = findViewById(R.id.gift_text); giftText = findViewById(R.id.gift_text);
numberText = findViewById(R.id.number_text); numberText = findViewById(R.id.number_text);
contentText = findViewById(R.id.content_text); contentText = findViewById(R.id.content_text);
giftNumberLayout= findViewById(R.id.giftNumberLayout);
if(isShowGiftNumber){
giftNumberLayout.setVisibility(VISIBLE);
}
ViewClicksAntiShake.clicksAntiShake(backBtn, new ViewClicksAntiShake.ViewClicksCallBack() { ViewClicksAntiShake.clicksAntiShake(backBtn, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override @Override
@ -131,11 +139,18 @@ public class LivePrankAddGiftDialog extends AbsDialogPopupWindow {
ToastUtil.show(WordUtil.isNewZh() ? "整蠱禮物不能為空" : "A trick gift can't be empty"); ToastUtil.show(WordUtil.isNewZh() ? "整蠱禮物不能為空" : "A trick gift can't be empty");
return; return;
} }
if (numberText.getTag()==null||StringUtil.isEmpty(prankContent)){ if(isShowGiftNumber){
ToastUtil.show(WordUtil.isNewZh() ? "整蠱內容或數量不能為空" : "The content or number of pranks cannot be empty"); if (numberText.getTag()==null||StringUtil.isEmpty(prankContent)){
return; ToastUtil.show(WordUtil.isNewZh() ? "整蠱內容或數量不能為空" : "The content or number of pranks cannot be empty");
return;
}
bean.setNum(Integer.parseInt(numberText.getText().toString()));
}else{
if (StringUtil.isEmpty(prankContent)){
ToastUtil.show(WordUtil.isNewZh() ? "整蠱內容或數量不能為空" : "The content or number of pranks cannot be empty");
return;
}
} }
bean.setNum(Integer.parseInt(numberText.getText().toString()));
bean.setTitle(prankContent); bean.setTitle(prankContent);
onItemClickListener.onItemClick(bean,0); onItemClickListener.onItemClick(bean,0);
dismiss(); dismiss();

View File

@ -69,6 +69,7 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
private TextView giftTypeTodoText; private TextView giftTypeTodoText;
private TextView giftTypeNowSwitchText; private TextView giftTypeNowSwitchText;
private Button mBtnAddGift; private Button mBtnAddGift;
private ImageView help;
public void setmLiveUid(String mLiveUid) { public void setmLiveUid(String mLiveUid) {
this.mLiveUid = mLiveUid; this.mLiveUid = mLiveUid;
@ -109,6 +110,7 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
} }
private void initView() { private void initView() {
help = (ImageView) findViewById(R.id.help);
mTabLayout = (TabLayout) findViewById(R.id.prank_tabLayout); mTabLayout = (TabLayout) findViewById(R.id.prank_tabLayout);
mTurntableConfigLayout = findViewById(R.id.turntable_layout); mTurntableConfigLayout = findViewById(R.id.turntable_layout);
mGiftConfigLayout = findViewById(R.id.gift_layout); mGiftConfigLayout = findViewById(R.id.gift_layout);
@ -122,6 +124,7 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
mPrankRecyclerView.setAdapter(recyclerAdapter); mPrankRecyclerView.setAdapter(recyclerAdapter);
mCoinTextView.setOnClickListener(this); mCoinTextView.setOnClickListener(this);
mTurntableConfigImageView.setOnClickListener(this); mTurntableConfigImageView.setOnClickListener(this);
help.setOnClickListener(this);
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
mPrankBtn.setText("發送圖標"); mPrankBtn.setText("發送圖標");
} else { } else {
@ -159,6 +162,15 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
giftBeans.remove(position); giftBeans.remove(position);
recyclerAdapter.setList(giftBeans); recyclerAdapter.setList(giftBeans);
recyclerAdapter.notifyDataSetChanged(); recyclerAdapter.notifyDataSetChanged();
if (giftBeans.size() < 6) {
mBtnAddGift.setVisibility(View.VISIBLE);
mGiftNotDate.setVisibility(View.VISIBLE);
mPrankBtn.setVisibility(View.VISIBLE);
} else {
mBtnAddGift.setVisibility(View.GONE);
mGiftNotDate.setVisibility(View.GONE);
mPrankBtn.setVisibility(View.GONE);
}
} }
} }
}); });
@ -202,7 +214,7 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
if (mPrankBtn.getTag() != null && Integer.parseInt(mPrankBtn.getTag().toString()) == 0) { if (mPrankBtn.getTag() != null && Integer.parseInt(mPrankBtn.getTag().toString()) == 0) {
SocketRyChatUtil.sendPrankIcon(); SocketRyChatUtil.sendPrankIcon();
} else { } else {
showGiftDialog();
} }
} }
}); });
@ -223,9 +235,14 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
if ((int) mPrankBtn.getTag() == 0) { if ((int) mPrankBtn.getTag() == 0) {
clearPrankConfig(); clearPrankConfig();
} else { } else {
giftSwitch1Btn.setTag("false");
giftSwitch1Btn.setImageResource(R.mipmap.special_icon_off);
giftBeans = new ArrayList<>(); giftBeans = new ArrayList<>();
recyclerAdapter.setList(giftBeans); recyclerAdapter.setList(giftBeans);
recyclerAdapter.notifyDataSetChanged(); recyclerAdapter.notifyDataSetChanged();
mPrankBtn.setVisibility(View.VISIBLE);
mBtnAddGift.setVisibility(View.VISIBLE);
mGiftNotDate.setVisibility(View.VISIBLE);
} }
} }
}); });
@ -239,10 +256,9 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
turntable.setText("轉盤整蠱"); turntable.setText("轉盤整蠱");
gift.setText("禮物整蠱"); gift.setText("禮物整蠱");
} else { } else {
turntable.setText("Turntable prank"); turntable.setText("Turntable");
gift.setText("Gift prank"); gift.setText("Gift");
} }
turntable.setTag(0); turntable.setTag(0);
gift.setTag(1); gift.setTag(1);
mTabLayout.addTab(turntable); mTabLayout.addTab(turntable);
@ -261,6 +277,7 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
mBtnAddGift.setVisibility(View.GONE); mBtnAddGift.setVisibility(View.GONE);
mGiftNotDate.setVisibility(View.GONE); mGiftNotDate.setVisibility(View.GONE);
recyclerAdapter.setViewType(LivePrankRecyclerAdapter.TYPE_TURNTABLE); recyclerAdapter.setViewType(LivePrankRecyclerAdapter.TYPE_TURNTABLE);
mPrankBtn.setVisibility(View.VISIBLE);
mPrankBtn.setBackgroundResource(R.drawable.bg_live_prank_turntable_save); mPrankBtn.setBackgroundResource(R.drawable.bg_live_prank_turntable_save);
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
mPrankBtn.setText("發送圖標"); mPrankBtn.setText("發送圖標");
@ -303,7 +320,7 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
} }
private void showGiftDialog() { private void showGiftDialog() {
LivePrankAddGiftDialog livePrankAddGiftDialog = new LivePrankAddGiftDialog(mContext).setGiftBeans(giftBeans); LivePrankAddGiftDialog livePrankAddGiftDialog = new LivePrankAddGiftDialog(mContext).setGiftBeans(giftBeans, giftTypeNowText.getTag().equals("1"));
livePrankAddGiftDialog.setOnItemClickListener(new OnItemClickListener<PrankGiftBean>() { livePrankAddGiftDialog.setOnItemClickListener(new OnItemClickListener<PrankGiftBean>() {
@SuppressLint("NotifyDataSetChanged") @SuppressLint("NotifyDataSetChanged")
@Override @Override
@ -314,9 +331,11 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
if (giftBeans.size() < 6) { if (giftBeans.size() < 6) {
mBtnAddGift.setVisibility(View.VISIBLE); mBtnAddGift.setVisibility(View.VISIBLE);
mGiftNotDate.setVisibility(View.VISIBLE); mGiftNotDate.setVisibility(View.VISIBLE);
mPrankBtn.setVisibility(View.VISIBLE);
} else { } else {
mBtnAddGift.setVisibility(View.GONE); mBtnAddGift.setVisibility(View.GONE);
mGiftNotDate.setVisibility(View.VISIBLE); mGiftNotDate.setVisibility(View.GONE);
mPrankBtn.setVisibility(View.GONE);
} }
} }
}); });
@ -330,8 +349,10 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
giftTypeNowText = (TextView) findViewById(R.id.gift_type_now_text); giftTypeNowText = (TextView) findViewById(R.id.gift_type_now_text);
giftTypeTodoText = (TextView) findViewById(R.id.gift_type_todo); giftTypeTodoText = (TextView) findViewById(R.id.gift_type_todo);
giftTypeNowSwitchText = (TextView) findViewById(R.id.gift_type_now_switch); giftTypeNowSwitchText = (TextView) findViewById(R.id.gift_type_now_switch);
giftTypeNowText.setTag("2");
mBtnAddGift = (Button) findViewById(R.id.gift_add_btn); mBtnAddGift = (Button) findViewById(R.id.gift_add_btn);
mBtnAddGift.setVisibility(View.GONE); mBtnAddGift.setVisibility(View.GONE);
mGiftNotDate.setVisibility(View.GONE);
ViewClicksAntiShake.clicksAntiShake(giftSwitch1Btn, new ViewClicksAntiShake.ViewClicksCallBack() { ViewClicksAntiShake.clicksAntiShake(giftSwitch1Btn, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override @Override
@ -351,6 +372,12 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
CharSequence tmp = giftTypeNowText.getText(); CharSequence tmp = giftTypeNowText.getText();
giftTypeNowText.setText(giftTypeNowSwitchText.getText()); giftTypeNowText.setText(giftTypeNowSwitchText.getText());
giftTypeNowSwitchText.setText(tmp); giftTypeNowSwitchText.setText(tmp);
if (giftTypeNowText.getTag().equals("1")) {
giftTypeNowText.setTag("2");
} else {
giftTypeNowText.setTag("1");
}
initGiftData();
} }
}); });
ViewClicksAntiShake.clicksAntiShake(mBtnAddGift, new ViewClicksAntiShake.ViewClicksCallBack() { ViewClicksAntiShake.clicksAntiShake(mBtnAddGift, new ViewClicksAntiShake.ViewClicksCallBack() {
@ -378,7 +405,7 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
private void setGiftBean(List<PrankGiftBean> prankGiftBeans) { private void setGiftBean(List<PrankGiftBean> prankGiftBeans) {
JSONArray prankJson = getJsonObjects(prankGiftBeans); JSONArray prankJson = getJsonObjects(prankGiftBeans);
LiveNetManager.get(mContext).setPrankGift(mLiveUid, giftSwitch1Btn.getTag().equals("true")?"1":"0", new Gson().toJson(prankJson), "1", new HttpCallback<PrankHttpTurntableBean>() { LiveNetManager.get(mContext).setPrankGift(mLiveUid, giftSwitch1Btn.getTag().equals("true") ? "1" : "0", new Gson().toJson(prankJson), giftTypeNowText.getTag().toString(), new HttpCallback<PrankHttpTurntableBean>() {
@Override @Override
public void onSuccess(PrankHttpTurntableBean data) { public void onSuccess(PrankHttpTurntableBean data) {
initGiftData(); initGiftData();
@ -410,23 +437,31 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
} }
private void initGiftData() { private void initGiftData() {
LiveNetManager.get(mContext).getPrankGiftList(mLiveUid, mPrankBtn.getTag().equals("0")?"2":"1",new HttpCallback<PrankGiftResultBean>() { LiveNetManager.get(mContext).getPrankGiftList(mLiveUid, giftTypeNowText.getTag().toString(), new HttpCallback<PrankGiftResultBean>() {
@Override @Override
public void onSuccess(PrankGiftResultBean data) { public void onSuccess(PrankGiftResultBean data) {
if(mPrankBtn.getTag().toString().equals("1")){ if (mPrankBtn.getTag().toString().equals("1")) {
if(data.getPrank_list()!=null){ if (data.getPrank_list() != null) {
if (data.getPrank_list().size() < 6) { if (data.getPrank_list().size() < 6) {
mBtnAddGift.setVisibility(View.VISIBLE); mBtnAddGift.setVisibility(View.VISIBLE);
mGiftNotDate.setVisibility(View.VISIBLE); mGiftNotDate.setVisibility(View.VISIBLE);
} else { } else {
mBtnAddGift.setVisibility(View.GONE); mBtnAddGift.setVisibility(View.GONE);
mGiftNotDate.setVisibility(View.VISIBLE); mGiftNotDate.setVisibility(View.GONE);
mPrankBtn.setVisibility(View.GONE);
} }
mPrankRecyclerView.setVisibility(View.VISIBLE); mPrankRecyclerView.setVisibility(View.VISIBLE);
recyclerAdapter.setViewType(LivePrankRecyclerAdapter.TYPE_GIFT); recyclerAdapter.setViewType(LivePrankRecyclerAdapter.TYPE_GIFT);
giftBeans = data.getPrank_list(); giftBeans = data.getPrank_list();
recyclerAdapter.setList(giftBeans); recyclerAdapter.setList(giftBeans);
recyclerAdapter.notifyDataSetChanged(); recyclerAdapter.notifyDataSetChanged();
if (data.getStatus().equals("1")) {
giftSwitch1Btn.setTag("true");
giftSwitch1Btn.setImageResource(R.mipmap.special_icon_on);
} else {
giftSwitch1Btn.setTag("false");
giftSwitch1Btn.setImageResource(R.mipmap.special_icon_off);
}
} }
} }
@ -491,37 +526,26 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
} }
return; return;
} }
LiveNetManager.get(mContext).setAnchorPrankTurntable( LiveNetManager.get(mContext).setAnchorPrankTurntable(mLiveUid, bean.getCoin() + "", bean.getTurntable1(), bean.getTurntable2(), bean.getTurntable3(), bean.getTurntable4(), bean.getTurntable5(), bean.getTurntable6(), bean.getStatus() + "", new HttpCallback<Object>() {
mLiveUid, @Override
bean.getCoin() + "", public void onSuccess(Object data) {
bean.getTurntable1(),
bean.getTurntable2(),
bean.getTurntable3(),
bean.getTurntable4(),
bean.getTurntable5(),
bean.getTurntable6(),
bean.getStatus() + "",
new HttpCallback<Object>() {
@Override
public void onSuccess(Object data) {
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
ToastUtil.show("保存成功"); ToastUtil.show("保存成功");
} else { } else {
ToastUtil.show("Save success"); ToastUtil.show("Save success");
}
}
@Override
public void onError(String error) {
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
ToastUtil.show("保存失败:" + error);
} else {
ToastUtil.show("Save failed" + error);
}
}
} }
); }
@Override
public void onError(String error) {
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
ToastUtil.show("保存失败:" + error);
} else {
ToastUtil.show("Save failed" + error);
}
}
});
} }
@Override @Override
@ -572,7 +596,9 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
} }
}); });
} }
} else if (id == R.id.help) {
LivePrankExplainDialog livePrankExplainDialog = new LivePrankExplainDialog(mContext);
livePrankExplainDialog.showDialog();
} }
} }
} }

View File

@ -2,35 +2,18 @@ package com.yunbao.live.dialog;
import android.content.Context; import android.content.Context;
import android.text.Html; import android.text.Html;
import android.view.View;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import com.lxj.xpopup.XPopup; import com.lxj.xpopup.XPopup;
import com.yunbao.common.dialog.AbsDialogPopupWindow; import com.yunbao.common.dialog.AbsDialogPopupWindow;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
public class LivePrankExplainDialog extends AbsDialogPopupWindow { public class LivePrankExplainDialog extends AbsDialogPopupWindow {
TextView content; TextView content;
String contentText = "<font color=\"#FFFFFF\">" +
"1、當前整蠱分類有哪些</font> <font color=\"#FFFFFF\"> 當前分爲轉盤整蠱和禮物整蠱。可根據實際情況決定,例如都設置或只設置一種。" +
"</font> <font color=\"\">" +
"2、轉盤整蠱如何填寫</font> <font color=\"#F9B003\">\n" +
"打開開關→設置價格→填寫6個整蠱→保存設置。\n" +
"\n" +
"</font> <font color=\"#FFFFFF\">注意:若有人發起整蠱,將提示你完成該整蠱,期間若有人花費鑽石拯救你,則不用完成整蠱。\n</font><font color=\"#FFFFFF\">" +
"3、禮物整蠱如何填寫</font> <font color=\"#F9B003\">\n" +
"當前分爲禮物數達成整蠱和連擊數最高整蠱。\n" +
"\n" +
"禮物數達成整蠱:打開開關→選擇禮物→填寫數量→填寫整蠱→保存設置。\n" +
"\n" +
"連擊數最高整蠱:打開開關→切換→選擇禮物→填寫整蠱→保存設置。\n</font><font color=\"\">" +
"4、整蠱如何填寫</font> <font color=\"\">\n" +
"根據你的實際情況決定。例如:唱歌、跳舞、情書、下蹲、吃辣或其他任意才藝。\n</font><font color=\"\">" +
"5、我怎麽知道該做哪些整蠱</font> <font color=\"\">\n" +
"系統將發送消息至彈幕;\n" +
"你需要做的整蠱會自動挂起。</font>";
public LivePrankExplainDialog(@NonNull Context context) { public LivePrankExplainDialog(@NonNull Context context) {
super(context); super(context);
} }
@ -42,7 +25,7 @@ public class LivePrankExplainDialog extends AbsDialogPopupWindow {
@Override @Override
public int bindLayoutId() { public int bindLayoutId() {
return R.layout.dialog_live_prank_add_gift_number; return R.layout.dialog_live_prank_explain;
} }
@Override @Override
@ -58,6 +41,70 @@ public class LivePrankExplainDialog extends AbsDialogPopupWindow {
void initView() { void initView() {
content = findViewById(R.id.content); content = findViewById(R.id.content);
content.setText(Html.fromHtml(contentText)); findViewById(R.id.back).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
dialog.dismiss();
}
});
StringBuffer stringBuffer = new StringBuffer();
if(WordUtil.isNewZh()){
stringBuffer.append(getHtmlContent(true,"1、當前整蠱分類有哪些","\"#FFFFFF\"",false));
stringBuffer.append(getHtmlContent(false,"當前分爲轉盤整蠱和禮物整蠱。可根據實際情況決定,例如都設置或只設置一種。","\"#FFFFFF\"",true));
stringBuffer.append(getHtmlContent(true,"2、轉盤整蠱如何填寫","\"#F9B003\"",false));
stringBuffer.append(getHtmlContent(false,"打開開關→設置價格→填寫6個整蠱→保存設置。","\"#F9B003\"",true));
stringBuffer.append(getHtmlContent(false,"注意:若有人發起整蠱,將提示你完成該整蠱,期間若有人花費鑽石拯救你,則不用完成整蠱。","\"#FFFFFF\"",true));
stringBuffer.append(getHtmlContent(true,"3、禮物整蠱如何填寫","\"#FFFFFF\"",false));
stringBuffer.append(getHtmlContent(false,"當前分爲禮物數達成整蠱和連擊數最高整蠱。","\"#FFFFFF\"",true));
stringBuffer.append(getHtmlContent(false,"禮物數達成整蠱:打開開關→選擇禮物→填寫數量→填寫整蠱→保存設置。","\"#F9B003\"",true));
stringBuffer.append(getHtmlContent(false,"連擊數最高整蠱:打開開關→切換→選擇禮物→填寫整蠱→保存設置。","\"#F9B003\"",true));
stringBuffer.append(getHtmlContent(true,"4、整蠱如何填寫","\"#FFFFFF\"",false));
stringBuffer.append(getHtmlContent(false,"根據你的實際情況決定。例如:唱歌、跳舞、情書、下蹲、吃辣或其他任意才藝。","\"#FFFFFF\"",true));
stringBuffer.append(getHtmlContent(true,"5、我怎麽知道該做哪些整蠱","\"#FFFFFF\"",false));
stringBuffer.append(getHtmlContent(false,"系統將發送消息至彈幕;","\"#FFFFFF\"",false));
stringBuffer.append(getHtmlContent(false,"你需要做的整蠱會自動挂起。","\"#FFFFFF\"",false));
}else{
stringBuffer.append(getHtmlContent(true,"1. What are the current categories of pranks?","\"#FFFFFF\"",false));
stringBuffer.append(getHtmlContent(false,"Currently it is divided into turntable tricking and gift tricking. It can be decided according to the actual situation, for example, setting both or only one type.","\"#FFFFFF\"",true));
stringBuffer.append(getHtmlContent(true,"2. How to fill in the turntable trick?","\"#F9B003\"",false));
stringBuffer.append(getHtmlContent(false,"Turn on the switch → set the price → fill in 6 tricks → save the settings.","\"#F9B003\"",true));
stringBuffer.append(getHtmlContent(false,"Note: If someone initiates a trick, you will be prompted to complete the trick. If someone spends diamonds to save you during this period, you do not need to complete the trick.","\"#FFFFFF\"",true));
stringBuffer.append(getHtmlContent(true,"3. How to fill in the gift form?","\"#FFFFFF\"",false));
stringBuffer.append(getHtmlContent(false,"Currently, it is divided into the number of gifts to reach Tricky and the number of combos to reach Tricky.","\"#FFFFFF\"",true));
stringBuffer.append(getHtmlContent(false,"The number of gifts reaches Trick: turn on the switch → select the gift → fill in the quantity → fill in the trick → save the settings.","\"#F9B003\"",true));
stringBuffer.append(getHtmlContent(false,"The trick with the highest number of combos: turn on the switch → switch → select the gift → fill in the trick → save the settings.","\"#F9B003\"",true));
stringBuffer.append(getHtmlContent(true,"4. How to fill in Tricky?","\"#FFFFFF\"",false));
stringBuffer.append(getHtmlContent(false,"Decide based on your actual situation. For example: singing, dancing, love letters, squatting, eating spicy food or any other talent.","\"#FFFFFF\"",true));
stringBuffer.append(getHtmlContent(true,"5. How do I know which tricks to do?","\"#FFFFFF\"",false));
stringBuffer.append(getHtmlContent(false,"The system will send a message to the barrage;","\"#FFFFFF\"",false));
stringBuffer.append(getHtmlContent(false,"The tricks you need to do will automatically hang.","\"#FFFFFF\"",false));
}
content.setText(Html.fromHtml(stringBuffer.toString()));
} }
public String getHtmlContent(boolean isTitle, String content, String color, boolean linebreak) {
StringBuffer result = new StringBuffer();
if (isTitle) {
result.append("<br><b><font color=" + color + ">");
result.append(content);
result.append("</br></b></font>");
} else {
result.append("<br><font color=" + color + ">");
result.append(content);
result.append("</br></font>");
}
if (linebreak) {
result.append("<br></br>");
}
return result.toString();
}
} }

View File

@ -16,6 +16,7 @@
app:tabIndicator="@drawable/random_pk_shape_tab_indicator" app:tabIndicator="@drawable/random_pk_shape_tab_indicator"
app:tabIndicatorColor="#F6F7FB" app:tabIndicatorColor="#F6F7FB"
app:tabIndicatorFullWidth="false" app:tabIndicatorFullWidth="false"
app:tabTextAppearance="@style/PrankTabLayoutTextStyle"
app:tabMaxWidth="100dp" app:tabMaxWidth="100dp"
app:tabMode="scrollable" app:tabMode="scrollable"
app:tabSelectedTextColor="#F6F7FB" app:tabSelectedTextColor="#F6F7FB"

View File

@ -65,12 +65,12 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="65dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:gravity="center" android:gravity="center|left"
android:text="@string/live_prank_gift_add_gift" android:text= "@string/live_prank_gift_add_gift"
android:textColor="#FFFFFF" android:textColor="#FFFFFF"
android:textSize="14sp" /> android:textSize="14sp" />
@ -97,17 +97,19 @@
<LinearLayout <LinearLayout
android:id="@+id/giftNumberLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="65dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:gravity="center" android:gravity="center|left"
android:text="@string/live_prank_gift_add_gift_number" android:text="@string/live_prank_gift_add_gift_number"
android:textColor="#FFFFFF" android:textColor="#FFFFFF"
android:textSize="14sp" /> android:textSize="14sp" />
@ -140,11 +142,11 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="65dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:gravity="center" android:gravity="center|left"
android:text="@string/live_prank_gift_add_gift_content" android:text="@string/live_prank_gift_add_gift_content"
android:textColor="#FFFFFF" android:textColor="#FFFFFF"
android:textSize="14sp" /> android:textSize="14sp" />

View File

@ -1,46 +1,53 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="330dp" android:layout_height="400dp"
android:orientation="vertical"
android:paddingBottom="20dp"
android:background="#000002"> android:background="#000002">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView <ImageView
android:id="@+id/title" android:id="@+id/back"
android:layout_width="wrap_content" android:layout_width="18dp"
android:layout_height="wrap_content" android:layout_height="18dp"
android:layout_marginTop="16dp" android:layout_marginStart="16dp"
android:text="@string/alive_prank_gift_dialog_explain" android:layout_marginTop="18dp"
android:textColor="#FFFFFF" app:srcCompat="@mipmap/icon_back" />
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView <TextView
android:id="@+id/back" android:id="@+id/title"
android:layout_width="18dp" android:layout_width="match_parent"
android:layout_height="18dp" android:layout_height="wrap_content"
android:layout_marginStart="16dp" android:layout_marginTop="16dp"
android:layout_marginTop="18dp" android:layout_marginRight="18dp"
app:layout_constraintStart_toStartOf="parent" android:gravity="center_horizontal"
app:layout_constraintTop_toTopOf="parent" android:text="@string/alive_prank_gift_dialog_explain"
app:srcCompat="@mipmap/icon_back" /> android:textColor="#FFFFFF"
android:textSize="16sp" />
<TextView </LinearLayout>
android:id="@+id/content"
<ScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="16dp" android:layout_marginTop="10dp">
android:layout_marginTop="50dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title">
</TextView> <TextView
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:orientation="vertical">
</androidx.constraintlayout.widget.ConstraintLayout> </TextView>
</ScrollView>
</LinearLayout>

View File

@ -22,7 +22,7 @@
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:orientation="vertical" android:orientation="vertical"
android:visibility="visible" android:visibility="visible"
tools:visibility="gone"> tools:visibility="visible">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/turntable_config_layout" android:id="@+id/turntable_config_layout"
@ -41,14 +41,16 @@
<TextView <TextView
android:id="@+id/switch1_desc_text" android:id="@+id/switch1_desc_text"
android:layout_width="300dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:ellipsize="end" android:ellipsize="end"
android:singleLine="true" android:layout_marginEnd="10dp"
android:maxLines="2"
android:text="@string/see_the_contents_of" android:text="@string/see_the_contents_of"
android:textColor="#B3B3B3" android:textColor="#B3B3B3"
android:textSize="10sp" android:textSize="10sp"
app:layout_constraintEnd_toStartOf="@+id/switch1_btn"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/switch1_title_text" /> app:layout_constraintTop_toBottomOf="@+id/switch1_title_text" />
@ -70,13 +72,15 @@
<TextView <TextView
android:id="@+id/switch2_title_text" android:id="@+id/switch2_title_text"
android:layout_width="270dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:ellipsize="end" android:ellipsize="end"
android:singleLine="true" android:layout_marginEnd="10dp"
android:maxLines="2"
android:text="@string/diamonds_every_time" android:text="@string/diamonds_every_time"
android:textColor="#FFFFFF" android:textColor="#FFFFFF"
app:layout_constraintEnd_toStartOf="@+id/switch2_btn"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@ -116,7 +120,7 @@
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:orientation="vertical" android:orientation="vertical"
android:visibility="gone" android:visibility="gone"
tools:visibility="visible"> tools:visibility="gone">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/gift_config_layout" android:id="@+id/gift_config_layout"
@ -143,6 +147,7 @@
android:text="@string/live_prank_switch_info" android:text="@string/live_prank_switch_info"
android:textColor="#B3B3B3" android:textColor="#B3B3B3"
android:textSize="10sp" android:textSize="10sp"
app:layout_constraintRight_toLeftOf="@+id/gift_switch1_btn"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/gift_switch1_title_text" /> app:layout_constraintTop_toBottomOf="@+id/gift_switch1_title_text" />
@ -188,7 +193,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="right" android:layout_gravity="right"
android:layout_marginStart="10dp" android:layout_marginStart="5dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:drawableEnd="@mipmap/ic_prank_gift_switch" android:drawableEnd="@mipmap/ic_prank_gift_switch"
android:text="@string/live_prank_dialog_gift_type_number" android:text="@string/live_prank_dialog_gift_type_number"

View File

@ -2417,6 +2417,7 @@
android:layout_gravity="end" android:layout_gravity="end"
android:visibility="gone" android:visibility="gone"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
tools:visibility="visible"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:layout_width="44dp" android:layout_width="44dp"
android:layout_height="46dp"/> android:layout_height="46dp"/>

View File

@ -123,17 +123,23 @@
<string name="details">Details></string> <string name="details">Details></string>
<string name="combo_vote">Combo</string> <string name="combo_vote">Combo</string>
<string name="combo_vote_more">Most first</string> <string name="combo_vote_more">Most first</string>
<string name="live_prank_dialog_save">Clear</string> <string name="live_prank_dialog_save">Save</string>
<string name="live_prank_dialog_clear">Save</string> <string name="live_prank_dialog_clear">Clear</string>
<string name="live_prank_dialog_gift_type_todo">Switch to</string> <string name="live_prank_dialog_gift_type_todo">Switch to</string>
<string name="live_prank_dialog_gift_type_number">Highest combo</string> <string name="live_prank_dialog_gift_type_number">highest combo</string>
<string name="live_prank_dialog_gift_type_achieved">Quantity achieved</string> <string name="live_prank_dialog_gift_type_achieved">Quantity achieved</string>
<string name="live_prank_switch">gift trick switch</string> <string name="live_prank_switch">gift trick switch</string>
<string name="live_prank_switch_info">After closing, the user cannot see the gift trick</string> <string name="live_prank_switch_info">After closing, the user cannot see the gift trick</string>
<string name="live_prank_add_gift">+ Add gift trick</string> <string name="live_prank_add_gift">+ Add gift trick</string>
<string name="live_prank_gift_tips">You can add up to 6, and it is recommended to add 4.</string> <string name="live_prank_gift_tips">You can add up to 6, and it is recommended to add 4.</string>
<string name="live_prank_gift_add_title">Add gift</string>
<string name="live_prank_gift_add_gift">Gift</string>
<string name="live_prank_gift_add_gift_number">Quantity</string>
<string name="live_prank_gift_add_gift_number_select">Fill in the number</string>
<string name="live_prank_gift_add_gift_content">Content</string>
<string name="live_prank_gift_add_gift_contnet_select">Please enter prank content, such as a dance.</string>
<string name="alive_prank_gift_add_gift_content_sub">Confirm</string> <string name="alive_prank_gift_add_gift_content_sub">confirm</string>
<string name="alive_prank_gift_dialog_number_title">Quantity</string> <string name="alive_prank_gift_dialog_number_title">Quantity</string>
<string name="live_prank_gift_dialog_number_btn">+ Set other quantity (up to 9999)</string> <string name="live_prank_gift_dialog_number_btn">+ Set other quantity (up to 9999)</string>
<string name="alive_prank_gift_dialog_explain">Trick instructions</string> <string name="alive_prank_gift_dialog_explain">Trick instructions</string>