修改中英文
This commit is contained in:
@@ -9,6 +9,11 @@ import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -17,6 +22,7 @@ import com.yunbao.common.bean.LiveGiftBean;
|
||||
import com.yunbao.common.bean.PrankGiftBean;
|
||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
@@ -26,16 +32,10 @@ import com.yunbao.live.adapter.GiftTopAdapter;
|
||||
import com.yunbao.live.adapter.LiveGiftPagerAdapter;
|
||||
import com.yunbao.live.adapter.LiveGiftPagerAdapter.ActionListener;
|
||||
import com.yunbao.live.bean.GiftTopBean;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
public class GiftPopDialog extends AbsDialogPopupWindow implements ActionListener, View.OnClickListener {
|
||||
|
||||
private Context mContext;
|
||||
@@ -217,7 +217,7 @@ public class GiftPopDialog extends AbsDialogPopupWindow implements ActionListene
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
JSONObject data = list.getJSONObject(i);
|
||||
GiftTopBean giftTopBean = new GiftTopBean();
|
||||
giftTopBean.setName(data.getString("name"));
|
||||
giftTopBean.setName(WordUtil.isNewZh()?data.getString("name"):data.getString("en_name"));
|
||||
name.add(giftTopBean);
|
||||
}
|
||||
|
||||
@@ -265,17 +265,17 @@ public class GiftPopDialog extends AbsDialogPopupWindow implements ActionListene
|
||||
public void onClick(View view) {
|
||||
int id = view.getId();
|
||||
if (id == R.id.btn_send) {
|
||||
DialogUitl.showSimpleInputDialog(mContext, "輸入數量", DialogUitl.INPUT_TYPE_NUMBER, new DialogUitl.SimpleCallback() {
|
||||
DialogUitl.showSimpleInputDialog(mContext, WordUtil.isNewZh() ?"輸入數量":"Input quantity", DialogUitl.INPUT_TYPE_NUMBER, new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
try {
|
||||
prangNum = Integer.parseInt(content);
|
||||
if (prangNum <= 0) {
|
||||
ToastUtil.show("數量不能為0或負數");
|
||||
ToastUtil.show(WordUtil.isNewZh() ?"數量不能為0或負數":"The quantity cannot be zero or negative");
|
||||
return;
|
||||
}
|
||||
if (prangNum > 999) {
|
||||
ToastUtil.show("數量不能大於999");
|
||||
ToastUtil.show(WordUtil.isNewZh() ?"數量不能大於999":"The number cannot be greater than 999");
|
||||
return;
|
||||
}
|
||||
mBtnSend.setText(content);
|
||||
@@ -285,12 +285,12 @@ public class GiftPopDialog extends AbsDialogPopupWindow implements ActionListene
|
||||
dialog.dismiss();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
ToastUtil.show("輸入錯誤");
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "輸入錯誤":"Input error");
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (id == R.id.btn_context) {
|
||||
DialogUitl.showSimpleInputDialog(mContext, "輸入整蠱內容...", new DialogUitl.SimpleCallback() {
|
||||
DialogUitl.showSimpleInputDialog(mContext, WordUtil.isNewZh() ? "輸入整蠱內容..." : "Enter the prank content...", new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
prangContext = content;
|
||||
@@ -307,29 +307,29 @@ public class GiftPopDialog extends AbsDialogPopupWindow implements ActionListene
|
||||
});
|
||||
} else if (id == R.id.gift_btn) {
|
||||
if (bean == null) {
|
||||
ToastUtil.show("整蠱禮物不能為空");
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "整蠱禮物不能為空":"A trick gift can't be empty");
|
||||
return;
|
||||
}
|
||||
if (StringUtil.isEmpty(prangContext) || prangNum == 0) {
|
||||
ToastUtil.show("整蠱內容或數量不能為空");
|
||||
ToastUtil.show(WordUtil.isNewZh() ?"整蠱內容或數量不能為空":"The content or number of pranks cannot be empty");
|
||||
return;
|
||||
}
|
||||
if (prangNum >= 999) {
|
||||
ToastUtil.show("整蠱數量不能過大");
|
||||
ToastUtil.show(WordUtil.isNewZh() ?"整蠱數量不能過大":"The number of pranks should not be too large");
|
||||
return;
|
||||
}
|
||||
if (WordUtil.isSpecialChar(prangContext)) {
|
||||
ToastUtil.show("整蠱內容不能包含特殊字符");
|
||||
ToastUtil.show(WordUtil.isNewZh() ?"整蠱內容不能包含特殊字符":"The prank content must not contain special characters");
|
||||
return;
|
||||
}
|
||||
if (prangContext.length() > 6) {
|
||||
ToastUtil.show("整蠱內容過長");
|
||||
ToastUtil.show(WordUtil.isNewZh() ?"整蠱內容過長":"The prank is too long");
|
||||
return;
|
||||
}
|
||||
if (giftBeans != null) {
|
||||
for (PrankGiftBean giftBean : giftBeans) {
|
||||
if (giftBean.getGiftId().equals(bean.getId() + "")) {
|
||||
ToastUtil.show("整蠱禮物已存在");
|
||||
ToastUtil.show(WordUtil.isNewZh() ?"整蠱禮物已存在":"Prank gifts already exist");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,6 +96,11 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
|
||||
mPrankRecyclerView.setAdapter(recyclerAdapter);
|
||||
mCoinTextView.setOnClickListener(this);
|
||||
mTurntableConfigImageView.setOnClickListener(this);
|
||||
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
mPrankBtn.setText("保存設置");
|
||||
} else {
|
||||
mPrankBtn.setText("Save Settings");
|
||||
}
|
||||
recyclerAdapter.setOnItemClickListener(new OnItemClickListener<String>() {
|
||||
@Override
|
||||
public void onItemClick(String bean, int position) {
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
android:padding="2dp"
|
||||
android:text="@string/lit_icon"
|
||||
android:textColor="#3E68FF"
|
||||
android:textSize="14sp"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="italic|bold" />
|
||||
|
||||
<View
|
||||
@@ -129,7 +129,7 @@
|
||||
android:padding="2dp"
|
||||
android:text="@string/unlit_icon"
|
||||
android:textColor="#3E68FF"
|
||||
android:textSize="14sp"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="italic" />
|
||||
|
||||
<View
|
||||
@@ -154,7 +154,7 @@
|
||||
android:padding="2dp"
|
||||
android:text="@string/all_service_champion"
|
||||
android:textColor="#3E68FF"
|
||||
android:textSize="14sp"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="italic" />
|
||||
|
||||
<View
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
android:layout_marginEnd="16dp"
|
||||
android:background="@drawable/bg_live_prank_turntable_save"
|
||||
android:gravity="center"
|
||||
android:text="保存設置"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:gravity="center"
|
||||
android:text="選擇整蠱禮物"
|
||||
android:text="@string/choose_a_prank_gift"
|
||||
android:textColor="#808080"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -142,7 +142,7 @@
|
||||
android:layout_marginBottom="10dp"
|
||||
android:background="@drawable/bg_prank_gift_item"
|
||||
android:gravity="center"
|
||||
android:text="输入数量"
|
||||
android:text="@string/choose_a_prank_gift_hint2"
|
||||
android:textColor="#8C8C8C"
|
||||
android:textSize="14sp" />
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
android:gravity="start|center"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:text="輸入整蠱內容..."
|
||||
android:text="@string/choose_a_prank_gift_hint"
|
||||
android:textColor="#8C8C8C"
|
||||
android:textSize="14sp" />
|
||||
|
||||
|
||||
@@ -82,6 +82,7 @@
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginBottom="23dp"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp" />
|
||||
|
||||
|
||||
@@ -7,34 +7,44 @@
|
||||
android:layout_marginBottom="10dp"
|
||||
android:background="@drawable/background_151515">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_task_title"
|
||||
android:layout_width="350dp"
|
||||
<LinearLayout
|
||||
android:id="@+id/item_task_title_lay"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="11dp"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_task_complete"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:background="@drawable/background_6cbe53"
|
||||
android:paddingStart="14dp"
|
||||
android:paddingTop="4dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingEnd="14dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/item_task_title" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_task_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_task_complete"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:background="@drawable/background_6cbe53"
|
||||
android:paddingStart="14dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingEnd="4dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/item_task_title" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/item_task_layout"
|
||||
@@ -47,7 +57,7 @@
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/item_task_title">
|
||||
app:layout_constraintTop_toBottomOf="@+id/item_task_title_lay">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/item_task_hot_img"
|
||||
@@ -71,7 +81,7 @@
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintStart_toEndOf="@+id/item_task_layout"
|
||||
app:layout_constraintTop_toBottomOf="@+id/item_task_title">
|
||||
app:layout_constraintTop_toBottomOf="@+id/item_task_title_lay">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/item_task_xp_img"
|
||||
|
||||
@@ -130,7 +130,9 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="100dp"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="@string/random_pk_info_switch"
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/switch1_desc_text"
|
||||
android:layout_width="330dp"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:ellipsize="end"
|
||||
@@ -59,7 +59,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/switch2_title_text"
|
||||
android:layout_width="290dp"
|
||||
android:layout_width="270dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:ellipsize="end"
|
||||
@@ -110,7 +110,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="250dp"
|
||||
android:gravity="center"
|
||||
android:text="您目前還未設置整蠱內容"
|
||||
android:text="@string/prank_content_yet_hint"
|
||||
android:textColor="#BFBFBF"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
|
||||
Reference in New Issue
Block a user