多语言切换

This commit is contained in:
18401019693 2023-04-18 13:45:21 +08:00
parent 098ef7aa36
commit d0e2278df7
7 changed files with 154 additions and 90 deletions

View File

@ -1125,5 +1125,16 @@ Limited ride And limited avatar frame</string>
<string name="unfollow"> Where is the host doing badly~\nBrother, are you sure you want to unfollow?</string>
<string name="unfollow_confrim">follow</string>
<string name="heat_add">Heat Add</string>
<string name="chat_prompt">Private chat prompt</string>
<string name="broadcast_oom">A private buoy on the side of the broadcast room</string>
<string name="chat_prompt2">Dynamic message</string>
<string name="chat_prompt3">The anchor posts a new dynamic notification</string>
<string name="chat_prompt4">Interactive notification</string>
<string name="chat_prompt5">Like, comment, and encourage gifts</string>
<string name="chat_prompt6">Chat notification</string>
<string name="chat_prompt7">User chat message</string>
<string name="chat_prompt8">System notification</string>
<string name="chat_prompt9">New activity, system message</string>
<string name="chat_prompt10">Broadcast notice</string>
<string name="chat_prompt11">Get live notification after opening</string>
</resources>

View File

@ -1119,4 +1119,17 @@
<string name="add_gift2">添加禮物、貴族、守護心願</string>
<string name="heat_add">热度加成</string>
<string name="must_hint">最多只能设置10条</string>
<string name="chat_prompt">私聊提示</string>
<string name="broadcast_oom">直播間內的側邊私聊浮標</string>
<string name="chat_prompt2">動態消息</string>
<string name="chat_prompt3">主播發佈新動態通知</string>
<string name="chat_prompt4">互動通知</string>
<string name="chat_prompt5">點讚、評論、鼓勵送禮</string>
<string name="chat_prompt6">聊天通知</string>
<string name="chat_prompt7">用戶聊天訊息</string>
<string name="chat_prompt8">系統通知</string>
<string name="chat_prompt9">新活動、系統消息</string>
<string name="chat_prompt10">開播通知</string>
<string name="chat_prompt11">開啟後獲得直播通知</string>
</resources>

View File

@ -1119,4 +1119,17 @@
<string name="add_gift2">添加禮物、貴族、守護心願</string>
<string name="heat_add">热度加成</string>
<string name="must_hint">最多只能设置10条</string>
<string name="chat_prompt">私聊提示</string>
<string name="broadcast_oom">直播間內的側邊私聊浮標</string>
<string name="chat_prompt2">動態消息</string>
<string name="chat_prompt3">主播發佈新動態通知</string>
<string name="chat_prompt4">互動通知</string>
<string name="chat_prompt5">點讚、評論、鼓勵送禮</string>
<string name="chat_prompt6">聊天通知</string>
<string name="chat_prompt7">用戶聊天訊息</string>
<string name="chat_prompt8">系統通知</string>
<string name="chat_prompt9">新活動、系統消息</string>
<string name="chat_prompt10">開播通知</string>
<string name="chat_prompt11">開啟後獲得直播通知</string>
</resources>

View File

@ -1119,4 +1119,17 @@
<string name="add_gift2">添加禮物、貴族、守護心願</string>
<string name="heat_add">热度加成</string>
<string name="must_hint">最多只能设置10条</string>
<string name="chat_prompt">私聊提示</string>
<string name="broadcast_oom">直播間內的側邊私聊浮標</string>
<string name="chat_prompt2">動態消息</string>
<string name="chat_prompt3">主播發佈新動態通知</string>
<string name="chat_prompt4">互動通知</string>
<string name="chat_prompt5">點讚、評論、鼓勵送禮</string>
<string name="chat_prompt6">聊天通知</string>
<string name="chat_prompt7">用戶聊天訊息</string>
<string name="chat_prompt8">系統通知</string>
<string name="chat_prompt9">新活動、系統消息</string>
<string name="chat_prompt10">開播通知</string>
<string name="chat_prompt11">開啟後獲得直播通知</string>
</resources>

View File

@ -1125,5 +1125,16 @@ Limited ride And limited avatar frame</string>
<string name="unfollow"> Where is the host doing badly~\nBrother, are you sure you want to unfollow?</string>
<string name="unfollow_confrim">follow</string>
<string name="heat_add">Heat Add</string>
<string name="chat_prompt">Private chat prompt</string>
<string name="broadcast_oom">A private buoy on the side of the broadcast room</string>
<string name="chat_prompt2">Dynamic message</string>
<string name="chat_prompt3">The anchor posts a new dynamic notification</string>
<string name="chat_prompt4">Interactive notification</string>
<string name="chat_prompt5">Like, comment, and encourage gifts</string>
<string name="chat_prompt6">Chat notification</string>
<string name="chat_prompt7">User chat message</string>
<string name="chat_prompt8">System notification</string>
<string name="chat_prompt9">New activity, system message</string>
<string name="chat_prompt10">Broadcast notice</string>
<string name="chat_prompt11">Get live notification after opening</string>
</resources>

View File

@ -1,36 +1,29 @@
package com.yunbao.main.activity;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.bean.MsgSwitchDetailModel;
import com.yunbao.common.bean.SlideInfoModel;
import com.yunbao.common.http.ResponseData;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.main.MainNetManager;
import com.yunbao.common.utils.SpUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.live.views.LoadingView;
import com.yunbao.main.R;
import com.yunbao.main.adapter.MainHomeLivesClassAdapter;
import com.yunbao.main.adapter.MsgFollowAdapter;
import java.util.List;
public class MsgSettActivity extends AbsActivity {
ImageView dt_switch, hdd_switch, lt_switch, xt_switch, kb_switch, privateChatMessageSwitch;
public static final String SWITCH_PRIVATE_CHAT_MSG = "private_chat_message_switch";
RecyclerView follow_list;
@Override
protected int getLayoutId() {
return R.layout.activity_msg_sett;
@ -39,7 +32,7 @@ public class MsgSettActivity extends AbsActivity {
@Override
protected void main() {
super.main();
setTitle("消息通知");
setTitle(getString(R.string.alerts));
follow_list = (RecyclerView) findViewById(R.id.follow_list);
dt_switch = (ImageView) findViewById(R.id.dt_switch);
hdd_switch = (ImageView) findViewById(R.id.hdd_switch);
@ -55,11 +48,13 @@ public class MsgSettActivity extends AbsActivity {
if (dt_switch.getDrawable().getCurrent().getConstantState().equals(getResources().getDrawable(R.mipmap.special_icon_on).getConstantState())) {
if (setMsgMasterSwitch("2", "1")) {
dt_switch.setImageResource(R.mipmap.special_icon_off);
};
}
;
} else {
if (setMsgMasterSwitch("1", "1")) {
dt_switch.setImageResource(R.mipmap.special_icon_on);
};
}
;
}
}
});
@ -71,11 +66,13 @@ public class MsgSettActivity extends AbsActivity {
if (hdd_switch.getDrawable().getCurrent().getConstantState().equals(getResources().getDrawable(R.mipmap.special_icon_on).getConstantState())) {
if (setMsgMasterSwitch("2", "2")) {
hdd_switch.setImageResource(R.mipmap.special_icon_off);
};
}
;
} else {
if (setMsgMasterSwitch("1", "2")) {
hdd_switch.setImageResource(R.mipmap.special_icon_on);
};
}
;
}
}
});
@ -87,11 +84,13 @@ public class MsgSettActivity extends AbsActivity {
if (lt_switch.getDrawable().getCurrent().getConstantState().equals(getResources().getDrawable(R.mipmap.special_icon_on).getConstantState())) {
if (setMsgMasterSwitch("2", "3")) {
lt_switch.setImageResource(R.mipmap.special_icon_off);
};
}
;
} else {
if (setMsgMasterSwitch("1", "3")) {
lt_switch.setImageResource(R.mipmap.special_icon_on);
};
}
;
}
}
});
@ -103,11 +102,13 @@ public class MsgSettActivity extends AbsActivity {
if (xt_switch.getDrawable().getCurrent().getConstantState().equals(getResources().getDrawable(R.mipmap.special_icon_on).getConstantState())) {
if (setMsgMasterSwitch("2", "4")) {
xt_switch.setImageResource(R.mipmap.special_icon_off);
};
}
;
} else {
if (setMsgMasterSwitch("1", "4")) {
xt_switch.setImageResource(R.mipmap.special_icon_on);
};
}
;
}
}
});
@ -243,7 +244,9 @@ public class MsgSettActivity extends AbsActivity {
}
});
}
boolean ret = false;
public boolean setMsgMasterSwitch(String status, String type) {
ret = false;
MainNetManager.get(mContext).setMsgMasterSwitch(status, type, new HttpCallback<ResponseData>() {

View File

@ -33,7 +33,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="私聊提示"
android:text="@string/chat_prompt"
android:textColor="#ff1e1f20"
android:textSize="16sp" />
@ -41,7 +41,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="直播間內的側邊私聊浮標"
android:text="@string/broadcast_oom"
android:textColor="#ffc7c8c9"
android:textSize="12sp" />
</LinearLayout>
@ -73,7 +73,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="動態消息"
android:text="@string/chat_prompt2"
android:textColor="#ff1e1f20"
android:textSize="16sp" />
@ -81,7 +81,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="主播發佈新動態通知"
android:text="@string/chat_prompt3"
android:textColor="#ffc7c8c9"
android:textSize="12sp" />
</LinearLayout>
@ -113,7 +113,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="互動通知"
android:text="@string/chat_prompt4"
android:textColor="#ff1e1f20"
android:textSize="16sp" />
@ -121,7 +121,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="點讚、評論、鼓勵送禮"
android:text="@string/chat_prompt5"
android:textColor="#ffc7c8c9"
android:textSize="12sp" />
</LinearLayout>
@ -152,7 +152,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="聊天通知"
android:text="@string/chat_prompt6"
android:textColor="#ff1e1f20"
android:textSize="16sp" />
@ -160,7 +160,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="用戶聊天訊息"
android:text="@string/chat_prompt7"
android:textColor="#ffc7c8c9"
android:textSize="12sp" />
</LinearLayout>
@ -192,7 +192,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="系統通知"
android:text="@string/chat_prompt8"
android:textColor="#ff1e1f20"
android:textSize="16sp" />
@ -200,7 +200,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="新活動、系統消息"
android:text="@string/chat_prompt9"
android:textColor="#ffc7c8c9"
android:textSize="12sp" />
</LinearLayout>
@ -234,7 +234,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="開播通知"
android:text="@string/chat_prompt10"
android:textColor="#ff1e1f20"
android:textSize="16sp" />
@ -242,7 +242,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="開啟後獲得直播通知"
android:text="@string/chat_prompt11"
android:textColor="#ffc7c8c9"
android:textSize="12sp" />
</LinearLayout>