From d0e2278df743a39e64720485859405aa2c7f013e Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Tue, 18 Apr 2023 13:45:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E8=AF=AD=E8=A8=80=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/src/main/res/values-en-rUS/string.xml | 13 +- common/src/main/res/values-zh-rHK/strings.xml | 13 ++ common/src/main/res/values-zh-rTW/strings.xml | 13 ++ common/src/main/res/values-zh/strings.xml | 13 ++ common/src/main/res/values/strings.xml | 13 +- .../yunbao/main/activity/MsgSettActivity.java | 155 +++++++++--------- .../src/main/res/layout/activity_msg_sett.xml | 24 +-- 7 files changed, 154 insertions(+), 90 deletions(-) diff --git a/common/src/main/res/values-en-rUS/string.xml b/common/src/main/res/values-en-rUS/string.xml index 2af8b7a70..7c70e1247 100644 --- a/common/src/main/res/values-en-rUS/string.xml +++ b/common/src/main/res/values-en-rUS/string.xml @@ -1125,5 +1125,16 @@ Limited ride And limited avatar frame Where is the host doing badly~\nBrother, are you sure you want to unfollow? follow Heat Add - + Private chat prompt + A private buoy on the side of the broadcast room + Dynamic message + The anchor posts a new dynamic notification + Interactive notification + Like, comment, and encourage gifts + Chat notification + User chat message + System notification + New activity, system message + Broadcast notice + Get live notification after opening diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index 956b12d6c..6cd79c545 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1119,4 +1119,17 @@ 添加禮物、貴族、守護心願 热度加成 最多只能设置10条 + + 私聊提示 + 直播間內的側邊私聊浮標 + 動態消息 + 主播發佈新動態通知 + 互動通知 + 點讚、評論、鼓勵送禮 + 聊天通知 + 用戶聊天訊息 + 系統通知 + 新活動、系統消息 + 開播通知 + 開啟後獲得直播通知 diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index 956b12d6c..6cd79c545 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1119,4 +1119,17 @@ 添加禮物、貴族、守護心願 热度加成 最多只能设置10条 + + 私聊提示 + 直播間內的側邊私聊浮標 + 動態消息 + 主播發佈新動態通知 + 互動通知 + 點讚、評論、鼓勵送禮 + 聊天通知 + 用戶聊天訊息 + 系統通知 + 新活動、系統消息 + 開播通知 + 開啟後獲得直播通知 diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index 956b12d6c..6cd79c545 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1119,4 +1119,17 @@ 添加禮物、貴族、守護心願 热度加成 最多只能设置10条 + + 私聊提示 + 直播間內的側邊私聊浮標 + 動態消息 + 主播發佈新動態通知 + 互動通知 + 點讚、評論、鼓勵送禮 + 聊天通知 + 用戶聊天訊息 + 系統通知 + 新活動、系統消息 + 開播通知 + 開啟後獲得直播通知 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 2af8b7a70..7c70e1247 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1125,5 +1125,16 @@ Limited ride And limited avatar frame Where is the host doing badly~\nBrother, are you sure you want to unfollow? follow Heat Add - + Private chat prompt + A private buoy on the side of the broadcast room + Dynamic message + The anchor posts a new dynamic notification + Interactive notification + Like, comment, and encourage gifts + Chat notification + User chat message + System notification + New activity, system message + Broadcast notice + Get live notification after opening diff --git a/main/src/main/java/com/yunbao/main/activity/MsgSettActivity.java b/main/src/main/java/com/yunbao/main/activity/MsgSettActivity.java index 3eb1ce462..805905987 100644 --- a/main/src/main/java/com/yunbao/main/activity/MsgSettActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MsgSettActivity.java @@ -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"; + 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,27 +32,29 @@ 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); + hdd_switch = (ImageView) findViewById(R.id.hdd_switch); lt_switch = (ImageView) findViewById(R.id.lt_switch); - xt_switch= (ImageView) findViewById(R.id.xt_switch); - kb_switch= (ImageView) findViewById(R.id.kb_switch); - privateChatMessageSwitch=findViewById(R.id.private_chat_switch); + xt_switch = (ImageView) findViewById(R.id.xt_switch); + kb_switch = (ImageView) findViewById(R.id.kb_switch); + privateChatMessageSwitch = findViewById(R.id.private_chat_switch); getData(); dt_switch.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //打开的 - if (dt_switch.getDrawable().getCurrent().getConstantState().equals(getResources().getDrawable(R.mipmap.special_icon_on).getConstantState())){ - if(setMsgMasterSwitch("2","1")){ + 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")){ + } + ; + } else { + if (setMsgMasterSwitch("1", "1")) { dt_switch.setImageResource(R.mipmap.special_icon_on); - }; + } + ; } } }); @@ -68,14 +63,16 @@ public class MsgSettActivity extends AbsActivity { @Override public void onClick(View v) { //打开的 - if (hdd_switch.getDrawable().getCurrent().getConstantState().equals(getResources().getDrawable(R.mipmap.special_icon_on).getConstantState())){ - if(setMsgMasterSwitch("2","2")){ + 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")){ + } + ; + } else { + if (setMsgMasterSwitch("1", "2")) { hdd_switch.setImageResource(R.mipmap.special_icon_on); - }; + } + ; } } }); @@ -84,14 +81,16 @@ public class MsgSettActivity extends AbsActivity { @Override public void onClick(View v) { //打开的 - if (lt_switch.getDrawable().getCurrent().getConstantState().equals(getResources().getDrawable(R.mipmap.special_icon_on).getConstantState())){ - if(setMsgMasterSwitch("2","3")){ + 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")){ + } + ; + } else { + if (setMsgMasterSwitch("1", "3")) { lt_switch.setImageResource(R.mipmap.special_icon_on); - }; + } + ; } } }); @@ -100,14 +99,16 @@ public class MsgSettActivity extends AbsActivity { @Override public void onClick(View v) { //打开的 - if (xt_switch.getDrawable().getCurrent().getConstantState().equals(getResources().getDrawable(R.mipmap.special_icon_on).getConstantState())){ - if(setMsgMasterSwitch("2","4")){ + 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")){ + } + ; + } else { + if (setMsgMasterSwitch("1", "4")) { xt_switch.setImageResource(R.mipmap.special_icon_on); - }; + } + ; } } }); @@ -116,24 +117,24 @@ public class MsgSettActivity extends AbsActivity { kb_switch.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - int is =1; + int is = 1; //打开的 - if (kb_switch.getDrawable().getCurrent().getConstantState().equals(getResources().getDrawable(R.mipmap.special_icon_on).getConstantState())){ + if (kb_switch.getDrawable().getCurrent().getConstantState().equals(getResources().getDrawable(R.mipmap.special_icon_on).getConstantState())) { is = 2; - }else{ + } else { is = 1; } - MainNetManager.get(mContext).setBeginShowMsgSwitch(is+"", "1","", new HttpCallback() { + MainNetManager.get(mContext).setBeginShowMsgSwitch(is + "", "1", "", new HttpCallback() { @Override public void onSuccess(ResponseData data) { - Log.e("ds",data.getCode()+""); - if(data.getCode() == 200 ){ - Log.e("ds",kb_switch.getDrawable().getCurrent().getConstantState()+""); - if (kb_switch.getDrawable().getCurrent().getConstantState().equals(getResources().getDrawable(R.mipmap.special_icon_on).getConstantState())){ + Log.e("ds", data.getCode() + ""); + if (data.getCode() == 200) { + Log.e("ds", kb_switch.getDrawable().getCurrent().getConstantState() + ""); + if (kb_switch.getDrawable().getCurrent().getConstantState().equals(getResources().getDrawable(R.mipmap.special_icon_on).getConstantState())) { kb_switch.setImageResource(R.mipmap.special_icon_off); follow_list.setVisibility(View.GONE); - }else{ + } else { getData(); } } @@ -142,7 +143,7 @@ public class MsgSettActivity extends AbsActivity { @Override public void onError(String error) { - Log.e("ds",kb_switch.getDrawable().getCurrent().getConstantState()+"11"+error); + Log.e("ds", kb_switch.getDrawable().getCurrent().getConstantState() + "11" + error); } }); @@ -160,12 +161,12 @@ public class MsgSettActivity extends AbsActivity { } });*/ privateChatMessageSwitch.setOnClickListener(view -> { - if (privateChatMessageSwitch.getDrawable().getCurrent().getConstantState().equals(getResources().getDrawable(R.mipmap.special_icon_on).getConstantState())){ + if (privateChatMessageSwitch.getDrawable().getCurrent().getConstantState().equals(getResources().getDrawable(R.mipmap.special_icon_on).getConstantState())) { privateChatMessageSwitch.setImageResource(R.mipmap.special_icon_off); - SpUtil.getInstance().setBooleanValue(SWITCH_PRIVATE_CHAT_MSG,false); - }else{ + SpUtil.getInstance().setBooleanValue(SWITCH_PRIVATE_CHAT_MSG, false); + } else { privateChatMessageSwitch.setImageResource(R.mipmap.special_icon_on); - SpUtil.getInstance().setBooleanValue(SWITCH_PRIVATE_CHAT_MSG,true); + SpUtil.getInstance().setBooleanValue(SWITCH_PRIVATE_CHAT_MSG, true); } }); @@ -175,59 +176,59 @@ public class MsgSettActivity extends AbsActivity { } - public void getData(){ + public void getData() { MainNetManager.get(mContext) .getMsgSwitchDetail(new HttpCallback() { @Override public void onSuccess(MsgSwitchDetailModel data) { - if(data.getDynamic_msg_switch().equals("2")){ + if (data.getDynamic_msg_switch().equals("2")) { dt_switch.setImageResource(R.mipmap.special_icon_off); - }else{ + } else { dt_switch.setImageResource(R.mipmap.special_icon_on); } - if(data.getInteraction_show_msg_switch().equals("2")){ + if (data.getInteraction_show_msg_switch().equals("2")) { hdd_switch.setImageResource(R.mipmap.special_icon_off); - }else{ + } else { hdd_switch.setImageResource(R.mipmap.special_icon_on); } - if(data.getChat_msg_switch().equals("2")){ + if (data.getChat_msg_switch().equals("2")) { lt_switch.setImageResource(R.mipmap.special_icon_off); - }else{ + } else { lt_switch.setImageResource(R.mipmap.special_icon_on); } - if(data.getChat_msg_switch().equals("2")){ + if (data.getChat_msg_switch().equals("2")) { lt_switch.setImageResource(R.mipmap.special_icon_off); - }else{ + } else { lt_switch.setImageResource(R.mipmap.special_icon_on); } - if(data.getSystem_msg_switch().equals("2")){ + if (data.getSystem_msg_switch().equals("2")) { xt_switch.setImageResource(R.mipmap.special_icon_off); - }else{ + } else { xt_switch.setImageResource(R.mipmap.special_icon_on); } - if(data.getSystem_msg_switch().equals("2")){ + if (data.getSystem_msg_switch().equals("2")) { xt_switch.setImageResource(R.mipmap.special_icon_off); - }else{ + } else { xt_switch.setImageResource(R.mipmap.special_icon_on); } - for(int i = 0; i < data.getFollowList().size();i++) { - if(!data.getFollowList().get(i).getStatus().equals("2")){ + for (int i = 0; i < data.getFollowList().size(); i++) { + if (!data.getFollowList().get(i).getStatus().equals("2")) { kb_switch.setImageResource(R.mipmap.special_icon_on); follow_list.setVisibility(View.VISIBLE); break; } } - if(SpUtil.getInstance().getBooleanValue(SWITCH_PRIVATE_CHAT_MSG)){ + if (SpUtil.getInstance().getBooleanValue(SWITCH_PRIVATE_CHAT_MSG)) { privateChatMessageSwitch.setImageResource(R.mipmap.special_icon_on); - }else{ + } else { privateChatMessageSwitch.setImageResource(R.mipmap.special_icon_off); } @@ -243,14 +244,16 @@ public class MsgSettActivity extends AbsActivity { } }); } + boolean ret = false; - public boolean setMsgMasterSwitch(String status,String type){ - ret =false; + + public boolean setMsgMasterSwitch(String status, String type) { + ret = false; MainNetManager.get(mContext).setMsgMasterSwitch(status, type, new HttpCallback() { @Override public void onSuccess(ResponseData data) { - if(data.getCode() == 200 ){ + if (data.getCode() == 200) { ret = true; } diff --git a/main/src/main/res/layout/activity_msg_sett.xml b/main/src/main/res/layout/activity_msg_sett.xml index 19fed35e7..32fb6c269 100644 --- a/main/src/main/res/layout/activity_msg_sett.xml +++ b/main/src/main/res/layout/activity_msg_sett.xml @@ -33,7 +33,7 @@ @@ -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" /> @@ -73,7 +73,7 @@ @@ -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" /> @@ -113,7 +113,7 @@ @@ -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" /> @@ -152,7 +152,7 @@ @@ -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" /> @@ -192,7 +192,7 @@ @@ -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" /> @@ -234,7 +234,7 @@ @@ -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" />