From bfbbe54308e4952710da238ea421051bebc971fc Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Mon, 17 Apr 2023 16:30:12 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=A4=9A=E8=AF=AD=E8=A8=80=E5=88=87?= =?UTF-8?q?=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/shayu/phonelive/AppContext.java | 1 + .../yunbao/common/activity/AbsActivity.java | 2 + .../com/yunbao/common/bean/LiveClassBean.java | 20 + .../yunbao/common/http/CommonHttpUtil.java | 7 +- .../yunbao/common/manager/IMLoginManager.java | 17 +- .../common/manager/LiveClassManager.java | 42 + common/src/main/res/values-en-rUS/string.xml | 1129 +++++++++++++++++ config.gradle | 4 +- .../activity/LanguageSettingActivity.java | 34 +- .../adapter/MainHomeLivesClassAdapter.java | 26 +- .../com/yunbao/main/utils/LanguageUtil.java | 7 +- .../main/views/MainHomeLiveViewHolder.java | 63 +- .../yunbao/main/views/MainHomeViewHolder.java | 6 +- .../res/layout/activity_language_sett.xml | 1 + main/src/main/res/layout/activity_setting.xml | 2 +- 15 files changed, 1302 insertions(+), 59 deletions(-) create mode 100644 common/src/main/java/com/yunbao/common/manager/LiveClassManager.java create mode 100644 common/src/main/res/values-en-rUS/string.xml diff --git a/app/src/main/java/com/shayu/phonelive/AppContext.java b/app/src/main/java/com/shayu/phonelive/AppContext.java index 3783dfb0d..9ad90e49c 100644 --- a/app/src/main/java/com/shayu/phonelive/AppContext.java +++ b/app/src/main/java/com/shayu/phonelive/AppContext.java @@ -80,6 +80,7 @@ public class AppContext extends CommonAppContext { public LiveImDeletUtil liveImDeletUtil; private final static List> activities = new ArrayList<>(); + private static final class AdjustLifecycleCallbacks implements ActivityLifecycleCallbacks { @Override public void onActivityResumed(Activity activity) { diff --git a/common/src/main/java/com/yunbao/common/activity/AbsActivity.java b/common/src/main/java/com/yunbao/common/activity/AbsActivity.java index e75bf5ae6..fe5f5c33e 100644 --- a/common/src/main/java/com/yunbao/common/activity/AbsActivity.java +++ b/common/src/main/java/com/yunbao/common/activity/AbsActivity.java @@ -27,6 +27,7 @@ import androidx.appcompat.app.AppCompatActivity; import com.yunbao.common.R; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.interfaces.LifeCycleListener; +import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.ClickUtil; import java.util.ArrayList; @@ -48,6 +49,7 @@ public abstract class AbsActivity extends AppCompatActivity { Resources res = super.getResources(); Configuration config = new Configuration(); config.setToDefaults(); + config.locale = IMLoginManager.get(this).getLocaleLanguage(); res.updateConfiguration(config, res.getDisplayMetrics()); return res; } diff --git a/common/src/main/java/com/yunbao/common/bean/LiveClassBean.java b/common/src/main/java/com/yunbao/common/bean/LiveClassBean.java index 2f7a593d3..cc05b3bff 100644 --- a/common/src/main/java/com/yunbao/common/bean/LiveClassBean.java +++ b/common/src/main/java/com/yunbao/common/bean/LiveClassBean.java @@ -14,6 +14,26 @@ public class LiveClassBean { private boolean isAll; private String des; private boolean checked; + private String chinese; + private String english; + + public String getChinese() { + return chinese; + } + + public LiveClassBean setChinese(String chinese) { + this.chinese = chinese; + return this; + } + + public String getEnglish() { + return english; + } + + public LiveClassBean setEnglish(String english) { + this.english = english; + return this; + } public int getId() { return id; diff --git a/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java b/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java index 82d94a308..57a4b75f0 100644 --- a/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java +++ b/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java @@ -19,6 +19,7 @@ import com.yunbao.common.event.FollowEvent; import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.manager.APKManager; import com.yunbao.common.manager.IMLoginManager; +import com.yunbao.common.manager.LiveClassManager; import com.yunbao.common.manager.NewLevelManager; import com.yunbao.common.utils.L; import com.yunbao.common.utils.MD5Util; @@ -156,7 +157,7 @@ public class CommonHttpUtil { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { locale = context.getResources().getConfiguration().getLocales().get(0); } else { - locale = context.getResources().getConfiguration().locale; + locale = IMLoginManager.get(context).getLocaleLanguage(); } if (locale.getLanguage().equals("zh")) { lang = "chinese"; @@ -202,6 +203,10 @@ public class CommonHttpUtil { JSONArray levelArray = obj.getJSONArray("levelanchor_new"); new NewLevelManager(context).UpAnchorDataLevel(levelArray.toJSONString()); } + if (obj.containsKey("liveclass")) {//缓存直播间分类 + JSONArray levelArray = obj.getJSONArray("liveclass"); + new LiveClassManager(context).UpDataLiveClass(levelArray.toJSONString()); + } if (obj.containsKey("apk_ver")) { APKManager.get().setApkVer(obj.getString("apk_ver")); } diff --git a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java index 305b8108f..6fcdf9af1 100644 --- a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java +++ b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java @@ -23,6 +23,8 @@ import com.yunbao.common.views.floatingview.APPEasyFloat; import org.greenrobot.eventbus.EventBus; +import java.util.Locale; + /** * 登录者信息管理 */ @@ -46,6 +48,20 @@ public class IMLoginManager extends BaseCacheManager { private final String STATUS_ANCHOR_SAY = "anchorSay"; private final String STATUS_ANCHOR_CALL = "anchorCallMe"; + private final String KEY_LANGUAGE = "language"; + + public void setLanguage(boolean isEnglish) { + put(KEY_LANGUAGE, isEnglish); + } + + public Locale getLocaleLanguage() { + if (!getBoolean(KEY_LANGUAGE, false)) { + return Locale.SIMPLIFIED_CHINESE; + } else { + return new Locale("en", "rUS"); + } + } + public void setDefaultBubbleUrl(String defaultBubbleUrl) { put(keyDefaultBubbleUrl, defaultBubbleUrl); } @@ -55,7 +71,6 @@ public class IMLoginManager extends BaseCacheManager { } - public void setXiaJBG(boolean xjbg) { put(xiaJBG, xjbg); } diff --git a/common/src/main/java/com/yunbao/common/manager/LiveClassManager.java b/common/src/main/java/com/yunbao/common/manager/LiveClassManager.java new file mode 100644 index 000000000..9a875ba53 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/manager/LiveClassManager.java @@ -0,0 +1,42 @@ +package com.yunbao.common.manager; + +import android.content.Context; + +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import com.yunbao.common.bean.LiveClassBean; +import com.yunbao.common.bean.NewLevelModel; +import com.yunbao.common.manager.base.BaseCacheManager; + +import java.util.ArrayList; +import java.util.List; + +public class LiveClassManager extends BaseCacheManager { + private final String KEY_LIVE_CLASS = "keyLiveClass"; + private List liveClass = new ArrayList<>(); + + public LiveClassManager(Context context) { + super(context); + } + + /** + * 缓存等级图标 + * + * @param json + */ + public void UpDataLiveClass(String json) { + liveClass = new Gson().fromJson(json, new TypeToken>() { + }.getType()); + put(KEY_LIVE_CLASS, liveClass); + } + + /** + * 获取等级数据 + * + * @return + */ + public List getLiveClass() { + return getList(KEY_LIVE_CLASS, new TypeToken>() { + }.getType()); + } +} diff --git a/common/src/main/res/values-en-rUS/string.xml b/common/src/main/res/values-en-rUS/string.xml new file mode 100644 index 000000000..2af8b7a70 --- /dev/null +++ b/common/src/main/res/values-en-rUS/string.xml @@ -0,0 +1,1129 @@ + + + Drop down to refresh + Refreshing + Loading + Release refresh now + Refresh finish + refresh failed + M-d HH:mm + Pull up to load more + Release load now + Loading + Refreshing + Load complete + Failed to load + Are you sure to use the data? + Edit Profile + Are you sure to use the data? + Confirm + The nickname is duplicated, please re-enter it. + This invitation code does not exist, please re-enter it. + Nickname is illegal + + + No more data + Pull black + Relieving blackout + Remarks + Sign in immediately + Continuously signed in + day + Beauty initialization exception, unable to use + Withdrawals account + You have not set up a withdrawal account yet + Add withdrawal account + Account type + Please enter the cardholder\'s name + Please enter the bank card account number + Please enter bank name + Please enter wechat account + Please enter Alipay account number. + Please enter the name of Alipay account. + Alipay + WeChat + Bank card + Do you want to delete this account? + Withdrawals record + Give + Account balance + Alipay + WeChat payment + Recharge success + Failure of recharge + Alipay is not installed. + Wechat is not installed + No QQ installed + Replication link + Replication success + Editing materials + Head portrait + Nickname + ModifyName + Modify remarks + Please enter comments~ + Signature modification + autograph + Binding phone + TASK1 + TASK2 + TASK3 + Give a\nfree gift + Incomplete + Complete + Follow\nanchor + light UP\nRoom + completing mission + + + ApplyMic + Cancel Mic + Close Mic + Quit Mic + Birthday + Gender + Location + My anchor impression + Set the picture successfully + Leave something~ + Please enter a nickname~ + Up to 20 words can be input + Up to 8 words can be input + Please enter a nickname + Please enter signature + Please select the correct date + Warm tip: you can change your nickname once for free, and then 1800 diamonds will be needed + Follow + VIP + Rosy + Skin + Smooth + BigEyes + SlimFace + ThinFace + Chin + Nose + Lips + copy + Today\'s Live WishList + Make a wish, the audience to help you achieve + Generate + Add gifts and quantities + Wishes set on the same day will expire at 24:00 on the same day + BrightEye + Teeth + Light + Cute + Goddess + Glamour + Magnificent + White + White + JP + B&W + Soft + Warmth + Retro + Flower + Easy + Vitality + Warm + Bright + Deep + Sunset + Cure + Filter + Preset + Beauty + + The anchor sends a flying kiss to you + It\'s a great opportunity, reply now! + A bunch of rose + Roses Bouquet + Lollipop + Free for a limited time + Follow and reply + + Following + My concern + My Black List + TA\'s attention + You haven\'t paid attention to anyone yet + Pay attention to the people you are interested in + TA hasn\'t paid attention to anyone yet + Fans + Opps… The anchor did not open the voice link + Fans + Free + My fans + TA fans + You don\'t have fans yet + Improving personal information will make more people pay attention to you~ + TA doesn\'t have any fans yet + Forget password + Retrieve immediately + Choose guard duration + Option privilege + Immediate opening + Open guard + Renewal Guardian + My + Become the guardian of %s + Open a guard for your favorite anchor + The guardian date expires at: %s + GET + Only one can be given away~ + Guard + Contribution this week + anchor are waiting at your guard! + Let\'s open up a guard for our favorite anchor + You are the current anchor\'s monthly guard \ n the guard date expires + You are the current anchor\'s annual guardian \ n the guardian date expires + Special gift for annual guard + You haven\'t guarded + 您為當前主播的月守護\n無法開通周守護 + You are the monthly guard of the current anchor. Opening the annual guard will cover your monthly guard time. Do you want to open it? + You will spend%1$s%2$s to open%3$s for the anchor + + Week Guardian + Month Guardian + Year Guardian + Pack + Guardian list + Guard the anchor + homepage + "%1$s" is also in%2$s, ~ Click to view TA\'s story + TA has%1$s fans. Come and watch! + Hi ~ I\'m the anchor. Come and talk to me. + [picture] + [voice] + [position] + news + Message + Ignore unread + Unread message ignored + Message sending failed + Frequent operation + The other party temporarily refuses to receive your message + You haven\'t heard anything yet + Send message + picture + shot + Speech input + position + Select pictures + No pictures found + Please select a picture + Search location + Location information not obtained + Map not loaded + Address not obtained + Failed to get location + Click follow to see the other party\'s news in time + Hold to talk + Release end + Please speak. + Recording time is too short + System message + No system message yet + Private chat + Anchor impression + Add impression + Add up to three impressions + Please select impression + Unmodified impression + Please choose your impression of the host + The impression you received from the anchor + You haven\'t received the impression of the anchor yet + Cancel photo + Deselected + Cancel clipping + Sign in for consent + Service and privacy terms + Other login methods + More exciting experience after registering! + Please enter your mobile number + Please input a password + Login immediately + Logon + Immediate registration + Forget password + Please enter the correct mobile number + Authorizing login + Login successfully + privilege grant failed + Authorization cancelled + Live broadcast + Login + shopmall + Recomm + CSD + anchor + Live broadcast + Room type + Share to + Live cover + Change cover + Live broadcast title + Write a title for the live broadcast + channel + Select live channel + During the live broadcast, if the operator finds that the selected channel does not match the live content, he / she will adjust your live channel. + Please set room password + Please set the charge amount (the revenue is subject to the end of live broadcast) + Please set room password + Please set the charge amount + Charge amount + Selective charging + Do you want to end the live broadcast? + The anchor has approved your application, do you want to join now? + Exiting the live broadcast room will disconnect the microphone connection. Do you want to exit? + Beauty + Beans + DO + Coins + A maximum of 10 entries can be set + Personalized Dress Up + Flip + Mirroring + Trickster + MultiplayerPK + Voice Link + Start + LeaveTemporarily + ResumeLive + Flash lamp + accompaniment + share + Game + Red envelopes + Lian Mai + SinglePK + WishList + Only the rear camera can turn on the flash + Flash on failed + You\'ve been banned + Live broadcast ended + Back to home page + Duration of live broadcast + Harvest + Number of visitors + Guan Zhong + Let\'s have a chat~ + Open the barrage, + strip + Please enter the room password + Password error + Broadcast failure + Video format not supported + Video address contains Chinese, unable to play + Guard + I light up. + Into the studio + Sending gifts + sent + UnlockVIP + + + I sent one. + Give + Continuous delivery + x + Sending x + Pretty + Send out + income + City not set + Gift contribution list + Kick people + Permanent ban + This field ban + Set as management + Cancel management + managers + Close live broadcast + Forbidden live broadcast + Disable account + Current administrator + Kicked out of the room + Forbidden forever + Forbidden by this scene + Set as Administrator + Cancelled administrator + You\'ve been kicked out of the room + Live content suspected of violation + Rank + data + The anchorman will leave for a while. The highlights will not be interrupted. Don\'t go away + The anchor is back! + Thrust failure + Camera open failed + Microphone on failed + View + Online List + DayRank + WeekRank + Viewers + There is no anchor for the time being + Let\'s start your live broadcast~ + The host you\'re focusing on doesn\'t start + Let\'s go and see the live broadcast of other hosts~ + Go to other channels quickly~ + You haven\'t had a live broadcast recently + Let\'s go to the opening live experience + TA hasn\'t had a live broadcast recently + Please select a channel + Focus on the anchor + Are you sure to report? + Interaction + End Lian Mai + Allowed even wheat + Ban Lian Mai + Initiate a link request + Initiate PK request + Quit even wheat + The current anchor is temporarily unable to connect + No response from the other party + The anchor is busy + The other anchor is busy + The host rejected your request for wheat + The host refused your request + The opposite host rejected your PK request + Opposite host exits Lianmai + The host accepts your request to connect wheat and begins to connect wheat + You have applied, please wait + The host accepts your request to connect wheat + The host accepts your request to connect wheat and begins to connect wheat + The anchor accepted your PK request and started PK + Failed to push the stream of Lianmai, has exited Lianmai + Link request sent~ + PK request sent~ + PK initiated by the other party + You can\'t play background music when you\'re on Wheat + You need to turn off the background music when connecting the wheat + Live recording + No title + People watched the live broadcast + You can\'t connect the wheat in the game state~ + You can\'t play with Mai~ + Please try again later + Connecting wheat is currently in progress~ + You are already in PK + We + Other party + The balance is insufficient. Do you want to recharge it? + Current online anchor + The other anchor is in the game + Invite Lian Mai + Already invited + Please enter the host nickname or ID you want to search + No anchor at present + PK time + Penalty time + No video + Let\'s release our own video + home page + nearby + Ranking + My + Ordinary room + Paying room + Time room + Password room + Income statement + Contribution list + Daily + Week + Honor + Car + No mount yet + Medal + No medal yet + OwningGuild + Monthly list + General list + Maintenance notice + Guard + Temporary lack of time and space + Live broadcast immediately + Release dynamics + Please fill in the invitation code + Press again to exit + Old password + Please enter the old password + New password + Please fill in the new password + Confirm password + Confirm new password + Confirm revision + reset password + QQ + QQ Zone + WeChat + Wechat Moments + Facebook + Twitter + Search songs + No songs to download + Invalid song download address + Lyrics not found + Song not found + Music + volume + No music at all + You haven\'t collected any music yet + No such music + Let\'s take a look at other types of music + You have denied the permission to read and write files. Please modify it in the settings + You have denied the permission to use the camera. Please modify it in the settings + You have denied permission to use microphone. Please modify it in settings + You have denied the permission to use the location. Please modify it in the settings + You have denied the right to read mobile phone information. Please modify it in settings + My income + Receivable amount + Please select a withdrawal account + Enter the number of%1$s to withdraw + Total%1$s number + Number of%1$s withdrawable + Enter the number of%1$s to extract + Immediate withdrawals + register + Please enter your mobile number + Please enter the verification code + Please fill in the password + Please confirm the password + Fill in the invitation code (optional) + Register and log in + Get verification code + Regain + Passwords are inconsistent + In registration + Live room red envelope + Send red envelopes to the audience in the current live studio + Red envelopes + Average red envelope + Congratulations on making a fortune + Hand out red envelopes + Please enter the amount + Please enter quantity + %1$s red packets in total + rob + An instant red envelope was distributed + A delayed red packet was distributed + rob + View claim details + Congratulations! + Grab the%1$s red packet sent by%1$s + %1$s red packets + My%1$s has been saved + Received%1$s of%2$s%3$s + Not snatch + After the countdown + Red envelopes in the studio! Grab it + Single amount + Total sum + skip + Click to enter + Recommended for you + male + female + Personality settings + Logout + Scavenging + Cache cleared + search + Please enter the nickname or ID you want to search + No content found + QQ + QQ Zone + WeChat + Wechat Moments + facebook + twitter + Share success + Sharing failure + Share cancel + Version update + Immediate use + Not updated + It\'s the latest version + Invalid download address + Say something~ + Video download successful + Video download failed + No more videos + comment + I can\'t give myself a compliment + No comment for the moment. Grab the sofa + Reply + Expand more replies + Retract + Flip + Flash lamp + Camera open failed + Microphone on failed + Record failure + Don\'t worry, the picture hasn\'t come out yet + And the recording is not over + The incoming video path is empty + Outdated Version + Tencent cloud authentication failed + Extremely slow + slow + normal + fast + Extremely fast + WishList + Video preprocessing + Video preprocessing failed + Video preprocessing cancel + In processing + Abnormal status, Stop editing + Choose music + Search song name + Popular songs + My collection + Filter + Tailoring + Special effects + Capture the required audio clip + Original voice + Drag the sliders on both sides to select the clipping area + Add video description~ + Confirm release + Video Publishing + Video generation in progress + Video generated successfully + Failed to generate video + Do you want to give up publishing this video + Local video not found + Local video + Video duration does not meet the requirements + Failed to generate video cover image + Please add a video description + In release + Released successfully + Publishing succeeded, please wait for approval + Save only + Release only + Save and publish + Re shooting + Sign out + Long press to add special effects + Publishing failure + You don\'t have a video yet + Go to shoot and upload + TA has no video works yet + My video + Choose a reason to report + For more details, please describe in the description box (optional) + Submission + Please select the reason for reporting + Report success + It\'s at the top + Are you sure you want to delete the previous video? + Exit video editing + Add to + accept + whole + Album + cancel + camera + Picture selection/Preview + Preview + Pictures and videos + Determine + Please enter content + Choice + Select file + Can not pay attention to yourself + Tips + download + delete + End + Popular + Network request failed + Please check the network connection and try again~ + Loading + position + No more data + No data + nearby + ten thousand + One moment please + News + Report + retry + refuse + Preservation + Register + No one is currently in the voice link + Welcome to PDLIVE + Newcomer Bonus + EXP + Complete newcomer tasks for more rewards + ReceiveAwards + One free gift privilege! + + Send out + I am sorry + video + myname.pdlive.shayu.fileprovider + people + individual + + Number + Next step + upload + My studio + My room + Administrators + Black users + Banned users + List of forbidden users + Live room of + Lifting of the ban + Blacklist of users + No banned users + No blacklisted users + You are not an administrator yet + Relieving blackout + Happy mid + Invitation code + Congratulations%1$s get%2$SX%3$s times + Lucky gift description + Current prize pool level + Current bonus pool amount + Lv.%1$s + Send barrage, need to reach level%1$s + Speak, need to reach level%1$s + Open positioning + Resolutely shut down + Close the location, the live broadcast will not be seen by nearby people, and the number of people in the live studio may be reduced. Are you sure to close it? + Mars + Shopping Mall + Detailed + wallet + Personalized signature + Personal information + Please select payment method + expenditure + income + User recharge agreement + Read and agree + Please select the recharge amount + Payment method not selected + My%1$s + Recharge + Receive + News Center + Version + Confirm payment + Confirm payment (¥%1$s) + Payment method + Immediate payment + User level + Anchor level + The connection has been disconnected, please restart the broadcast + Absolutely empty + Chat + Live + Break + + Please, can you pay attention to me? + Follow and exit + Exit + User + + If you don\'t take the initiative,how can we have a story?Tell the anchor say hi~ + + + follow + Enter activity + + in + gave + \'s live studio has been opened + \'s live studio has been renewed + opened the + renewed + + Enter the live broadcast room + Beans + + Encourage the author of this dynamic article + + Confirm encouragement + Dynamic encouragement + Encouraging records + + The author hasn\'t given encouragement yet T_T + + Click to see more + + Customer service + Set up + Every Day 13:00PM-24:00AM + + Withdraw + + Open VIP and enjoy exclusive privileges! + Meet someone you like by chance~ + There is no news yet~~ + + Current VIP : + Expiration time: + + Successfully joined the blacklist + Failed to join blacklist + + Blacklist removed successfully + Failed to remove blacklist + + Reply + Reply to comments + + Click here to enter the reply + + For the time being, it is only open to the anchor + + 2011402032399020 + 959584e054a33614996361f0044e5253 + + ui10vIggex2F043HnztYNuA3g + J8jvBBeJoZbVojbkWUrvsj0K0UUkuV69CqQ7CEobhJn6tvAKpQ + ZWRrZnRUNlBlcHVxMXpsMzVmb2k6MTpjaQ + aq0eV4R1pqMK_AAeKRWnjPr7ErGMGgTPGgZJdm73WeRY-Kluws + + 1527128092082286592-NfYVOcHXy630vYUj4nMlDPh8PsVBHE + U5avdnRMb7yON6sYp4SAb1I99mFD8ch9KHIuFbEbd0IDN + + Complete the new person\'s pre task + Unlock custom features + Unlock the live room speech function + + Predecessors + Sign in with Facebook + Sign in with Twitter + Sign in with Google + + Request timed out, please try again later. + + Receive 1000 free beans + Now mobile number + Confirm to bind mobile number + Modify mobile number + After the mobile phone number is successfully bound, it will be automatically obtained + x1000 + After binding the mobile account, you can log in with the mobile account, + It can also be used to retrieve passwords. + + Bind account + + Trickster initiator + Trickery content + Exempt from this trickery + + Consume + Thanks for saving + + You can only speak after completing the previous task + + Heat addition + Hot & Time + + 熱度可以給主播的房間增加曝光度,熱度越高的直播間,在首頁的排名也越靠前,從而帶來更多的進房用戶,幫助主播在一段時間內迅速提高房間熱度,送出之後立即生效。 + 熱度卡如何獲得? + 1、周星榜主播冠軍的第一名用戶每週可自動獲得; + 2、通過參與官方活動,具體活動可留意官方消息。 + 熱度卡如何使用? + 前往「個人中心」-「我的包裹」中,即可使用熱度卡。 + 熱度卡生效多久? + 對指定主播使用熱度卡後,將會立即生效,效果時長為24小時,不管主播是否在線,熱度時長都將會持續減少 + Rewards coming! + Receive free +Limited ride And limited avatar frame + Looking for you like? + Go contact your personal guide to + get your prize redemption code! + Contact a mentor now! + Withdrawal succeeded + normal barrage + Float barrage + Total speaker + quote + Available times: %s Note: Update times at 4:00 am on the 1st of each month + Content cannot be empty + Noble exclusive site-wide news + Display messages on the whole station and jump to the current live room + Open noble king, emperor, super emperor to get free + back + to the nobles + Use successfully + Go to the live room + search history + you may also like + anchor + More + Live + More + Fun Games + Value-added benefits + Fan Club + Activity + Basic tools + Effect settings + Shield gift effect + Shield car effect + You are in the current live room + has recommended an anchor to you! + has sent you a reward, come and get it! + Pay attention to the channel that suits you. + What do you say to everyone + Settings + No access to the mystery man\'s personal home page。 + The Mystery Man + Notice + Online Service + Hot Ticket + Register and log in + Sign up for PD LIVE + Tell the world! + Tell the world! %s recommends anchor %s to everyone! + Tell the world! %s recommends the anchor %s to everyone, and the splendid glance is amazing! + Failed to load data, please try again later + open + Not enough speakers + order inquiries + No exception to the order + Login failed, please log in again + + onlookers + The live broadcast studio was opened + Baron + Viscount + Marquis + Duke + King + Emperor + Super king + Please wait... + The slide set + Slide up and down to switch the broadcast room + \ @user nickname \t\t hello ~ + oline_list + Search for people who want @ + The online audience + The audience + can not \@ myself + Total star + The number of power + %sStar challenge + Congratulations %s, completed %s %s star challenge, go to meet the host face! + star + Join your favorite host fan club + Small window play Settings + Small window to play + Minimize Play + Continue to guard + Join Fan club + Daemon list + You are the weekly guardian of the current anchor + You are the monthly guardian of the current anchor + You are the annual guardian of the current anchor + Show when exiting the live room + ALL Minimize Play + Anchor is waiting for you to become the guardian of TA, \n escort for TA! + Open a guard for your favorite anchor + Show on other apps and pages \n Need to open the display + Go to open + Don\'t like the small window play?\n You can turn it off in [Personal Center] - [Settings] + Go to Settings + Got it + Open noble, enjoy a lot of privileges! + Personal Settings + Rewards + Change password + Blacklist + Message Settings + Blocking gift effects + Blocking seat effects + If you want to Minimize Play,\nYou can go to set the license. + + + In a batch + Chat + Congratulations %s have won %s in the Lucky Angel! The next lucky angel will be you! + Congratulations on %s winning %s in Luck 100 %%! Go pass on the good luck! + Guardian group %s people + receive + To complete + Already collected + Image quality selection + More Settings + view more + The gift is on the way... + The gift is on the way + Remaining count :%s + Whether to confirm multiple PK (deduct 1 point after confirmation) remaining times on the day: %s + Invite \n anchor + End \nPK + Time %s + + accept + refuse + Persist in refusing + Random PK hint + + Automatic speech robot setup + Robot switch + Robot name setting + The word limit is 2 to 8 word + Automatic greeting setting + Number of configured items + Set automatic message sending + Go to set + Thank you for sending gifts, PK start, PK end automatic robot message, \n does not support customization. + Add content + At regular intervals, the robot automatically says the following sentence at random。 + Fill in the content recommendation, such as: send wish list, add fan group, etc + Automatic speech interval (minutes) + At least once every 5 minutes + When a user enters the studio, the robot will @the user and automatically + The following sentence is random. Set a minimum of 1 to a maximum of 20. + Robot setup + High definition + fluency + Ultra hd + After determining the definition of the broadcast, you need to restart the broadcast to change + Confirmation of broadcast Settings + clarity + Live channel + broadcast + robot + set + Not set + no + yes + Ultra HD hint + In the case of unstable network speed, the selection of ultra HD may lead to the delay of the picture in the broadcast room. Do you confirm the selection? + Stick to choice + Network prompt + The system detects that your network is unstable and insufficient device memory will affect the fluency of your live broadcast. Therefore, it is recommended that you choose fluency and clarity. + check version + Update + Latest Version + updating + There is no choice, the anchor is not turned on FHD live. + There is no choice, the anchor is not turned on HD live. + Sorry, this feature is on hold. + phone + Broadcast + Click To View + Anchor Task + I have read and agreed to the + Please read and agree to the PDLIVE Host Agreement + PDLIVE Host Agreement + The statute of limitations for new anchors expires + coin + gold + Number of gifts + Number of entry + New attention + Follow the conversion rate + New fan group + Fan group conversion rate + loading… + Gift and seat effects have been turned off and can be turned on manually in "Settings". + i \'m sorry! An error occurred. + Congratulations on getting it! + You have accumulated sign-ups this month %s Heaven + Sign in for 1 more day to get extra bonus. + Sign in to the center」 + Go to the「Sign-in Center」to get extra rewards! + Sign-in Center + Back to top + Go to the sign-in center + Confirm pick up + Unable to login? Click here to contact customer service + By logging in, you agree to the Terms of + Service + and + Privacy + Terms and policies + For details, please read the following message to install the application: + Welcome to PD LIVE. For your personal information and privacy, we will adopt the highest standards of treatment and protection. + In order to provide you with one-click sharing service, our product integrates Mob+U-Share SDK, The Mob+SDK needs to collect your device Mac address, unique device identifier (1MEIandroid IDIDFAOPENUDIDGUID, SIM card IMSI information), and public social account information that you need to share in order to complete the one-click sharing service. And through the geographical location calibration report data accuracy, provide basic anti-cheating services. For the sake of your information security, we have made data security and confidentiality agreements with third-party SDK service providers, and these companies will strictly abide by our data privacy and security requirements. We will not share your personally identifiable information with them unless we have your consent. To facilitate you better understand/Mob + data types and USES, and how to protect your personal information, you can log on to https:www.mob.com aboutpolicy understand [Mob +] privacy policy). + Clicking Agree means you have read and agree to all of the above.。 + agreement + Welcome to PD LIVE. + gift + User service agreement + 一 Fan privilege 一 + Gift name + True love ranking + and + Speech memo + Privacy policy + Daily gift pack + To one\'s liking + Opened a pair of + guard + I bought a ride + Purchased a beautiful number + VIP + Random PK + VIP seating + True love ranking + Please enter the number + You are the current anchor whose weekly guardian \n guardian date is up + My %1$s: + Top-up instructions + Registration means consent + One-time gift ≥2000 diamonds), can obtain fan privilege yo + Top up + User level + aristocracy + Fan club + Voice connection is not enabled + Wall of honor + Get a fan badge for giving gifts + Whether to clear unread messages + The application collects location data to support login and registration functions. + Goddess says + Say something... + %s here comes + Daily Wishes + Weekly Wishes + Month Wishes + Seasonal Wishes + Wish%s + aristocrat + sure + Reset Your: Day + Reset Wish: Week + Reset Wish: Month + Reset Wish: Month + Is reset confirmed + Resetting will empty the wish list, \nregardless of whether the wish is completed or not + Confirm Reset + Back to list + Current wish list not saved + Do you keep a current wishlist? + Not saved + + You have a %s, do you want to use it? Use it to open a diamond %s and get %s gold beans back + Not used + Use + wish + Play setting + language setting + Traditional Chinese + Add gifts, nobles, and guardian wishes + GoddessSaid + Contact information + unfollow + Where is the host doing badly~\nBrother, are you sure you want to unfollow? + follow + Heat Add + + diff --git a/config.gradle b/config.gradle index 95a3f25a3..367862767 100644 --- a/config.gradle +++ b/config.gradle @@ -9,9 +9,9 @@ ext { ] manifestPlaceholders = [ //正式、 - serverHost : "https://napi.yaoulive.com", +// serverHost : "https://napi.yaoulive.com", //测试 -// serverHost : "https ://ceshi.yaoulive.com", + serverHost : "https://ceshi.yaoulive.com", //腾讯地图 txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB", diff --git a/main/src/main/java/com/yunbao/main/activity/LanguageSettingActivity.java b/main/src/main/java/com/yunbao/main/activity/LanguageSettingActivity.java index 39275e236..02431ad32 100644 --- a/main/src/main/java/com/yunbao/main/activity/LanguageSettingActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/LanguageSettingActivity.java @@ -1,10 +1,13 @@ package com.yunbao.main.activity; import android.app.Activity; +import android.content.Intent; +import android.view.View; import android.widget.ImageView; import android.widget.LinearLayout; import com.yunbao.common.activity.AbsActivity; +import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.AppManager; import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.main.R; @@ -16,6 +19,7 @@ import java.util.Stack; public class LanguageSettingActivity extends AbsActivity { private LinearLayout traditionalChinese, english; private ImageView imgTraditionalChinese, imgEnglish; + private Locale locale; @Override protected int getLayoutId() { @@ -25,6 +29,14 @@ public class LanguageSettingActivity extends AbsActivity { @Override protected void main() { super.main(); + locale = IMLoginManager.get(mContext).getLocaleLanguage(); + if (locale == Locale.SIMPLIFIED_CHINESE) { + findViewById(R.id.img_english).setVisibility(View.GONE); + findViewById(R.id.img_traditional_chinese).setVisibility(View.VISIBLE); + } else { + findViewById(R.id.img_english).setVisibility(View.VISIBLE); + findViewById(R.id.img_traditional_chinese).setVisibility(View.GONE); + } traditionalChinese = findViewById(R.id.traditional_chinese); english = findViewById(R.id.english); imgEnglish = findViewById(R.id.img_english); @@ -33,13 +45,23 @@ public class LanguageSettingActivity extends AbsActivity { ViewClicksAntiShake.clicksAntiShake(traditionalChinese, new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { - changeAllActivitysLanguage(Locale.SIMPLIFIED_CHINESE); + locale = Locale.SIMPLIFIED_CHINESE; + findViewById(R.id.img_english).setVisibility(View.GONE); + findViewById(R.id.img_traditional_chinese).setVisibility(View.VISIBLE); } }); ViewClicksAntiShake.clicksAntiShake(english, new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { - changeAllActivitysLanguage(Locale.US); + locale = new Locale("en", "rUS"); + findViewById(R.id.img_english).setVisibility(View.VISIBLE); + findViewById(R.id.img_traditional_chinese).setVisibility(View.GONE); + } + }); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.complete), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + changeAllActivitysLanguage(locale); } }); } @@ -47,8 +69,12 @@ public class LanguageSettingActivity extends AbsActivity { private void changeAllActivitysLanguage(Locale locale) { Stack allActivityStacks = AppManager.getInstance().getAllActivityStacks(); for (int i = 0; i < allActivityStacks.size(); i++) { - LanguageUtil.shiftLanguage(locale, allActivityStacks.get(i),mContext); + if (!(allActivityStacks.get(i) instanceof LanguageSettingActivity)) { + LanguageUtil.shiftLanguage(locale, allActivityStacks.get(i), mContext); + } } - + IMLoginManager.get(mContext).setLanguage(locale != Locale.SIMPLIFIED_CHINESE); + startActivity(new Intent(mContext, MainActivity.class)); + finish(); } } diff --git a/main/src/main/java/com/yunbao/main/adapter/MainHomeLivesClassAdapter.java b/main/src/main/java/com/yunbao/main/adapter/MainHomeLivesClassAdapter.java index 38cc49fae..582bf1b5c 100644 --- a/main/src/main/java/com/yunbao/main/adapter/MainHomeLivesClassAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/MainHomeLivesClassAdapter.java @@ -3,19 +3,21 @@ package com.yunbao.main.adapter; import android.annotation.SuppressLint; import android.content.Context; import android.graphics.Color; - -import androidx.annotation.NonNull; -import androidx.recyclerview.widget.RecyclerView; +import android.os.Build; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + import com.yunbao.common.bean.LiveClassBean; import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.main.R; import java.util.List; +import java.util.Locale; public class MainHomeLivesClassAdapter extends RecyclerView.Adapter { @@ -71,6 +73,7 @@ public class MainHomeLivesClassAdapter extends RecyclerView.Adapter= Build.VERSION_CODES.N) { + locale = mContext.getResources().getConfiguration().getLocales().get(0); + } else { + locale = mContext.getResources().getConfiguration().locale; + } + if (locale.getLanguage().equals("zh")) { + mName.setText(bean.getChinese()); + } else { + mName.setText(bean.getEnglish()); + } + + if (position == choice) { mName.setBackgroundResource(R.drawable.button_ffc621); mName.setTextColor(Color.parseColor("#FFC621")); - }else{ + } else { mName.setBackgroundResource(R.drawable.button_cbd5e0); mName.setTextColor(Color.parseColor("#484D68")); } diff --git a/main/src/main/java/com/yunbao/main/utils/LanguageUtil.java b/main/src/main/java/com/yunbao/main/utils/LanguageUtil.java index c18836014..99048a50d 100644 --- a/main/src/main/java/com/yunbao/main/utils/LanguageUtil.java +++ b/main/src/main/java/com/yunbao/main/utils/LanguageUtil.java @@ -7,8 +7,6 @@ import android.content.res.Configuration; import android.content.res.Resources; import android.util.DisplayMetrics; -import com.yunbao.main.activity.MainActivity; - import java.lang.reflect.Method; import java.util.Locale; @@ -42,9 +40,8 @@ public class LanguageUtil { DisplayMetrics dm = resources.getDisplayMetrics(); config.locale = locale; resources.updateConfiguration(config, dm); - if (!(activity instanceof MainActivity)) { - activity.recreate(); - } + activity.finish(); + } diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java index da5733aac..8f9a7e52d 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java @@ -3,10 +3,7 @@ package com.yunbao.main.views; import android.animation.ObjectAnimator; import android.app.Dialog; import android.content.Context; -import android.content.Intent; import android.graphics.Outline; -import android.net.Uri; -import android.os.Environment; import android.text.TextUtils; import android.util.Log; import android.view.View; @@ -14,7 +11,6 @@ import android.view.ViewGroup; import android.view.ViewOutlineProvider; import android.widget.ImageView; -import androidx.core.content.FileProvider; import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -29,7 +25,6 @@ import com.yunbao.common.activity.WebViewActivity; import com.yunbao.common.adapter.RefreshAdapter; import com.yunbao.common.bean.AnchorRecommendModel; import com.yunbao.common.bean.BannerBean; -import com.yunbao.common.bean.ConfigBean; import com.yunbao.common.bean.LiveBean; import com.yunbao.common.bean.LiveClassBean; import com.yunbao.common.bean.WeekListBean; @@ -37,10 +32,10 @@ import com.yunbao.common.custom.CommonRefreshView; import com.yunbao.common.custom.ItemDecoration; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.interfaces.OnItemClickListener; +import com.yunbao.common.manager.LiveClassManager; import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.MicStatusManager; import com.yunbao.common.utils.RouteUtil; -import com.yunbao.common.utils.ShareUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.views.CustomViewHolder; import com.yunbao.live.event.LiveRoomChangeEvent; @@ -59,7 +54,6 @@ import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; -import java.io.File; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -272,37 +266,34 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement mClassRecyclerViewTop = (RecyclerView) findViewById(R.id.classRecyclerView_top); mClassRecyclerViewTop.setHasFixedSize(true); mClassRecyclerViewTop.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false)); - ConfigBean configBean = CommonAppConfig.getInstance().getConfig(); - if (configBean != null) { - List list = configBean.getLiveClass(); - if (list != null && list.size() > 0) { - List targetList = new ArrayList<>(); - if (list.size() <= 6) { - targetList.addAll(list); - } else { - targetList.addAll(list); - } - final MainHomeLivesClassAdapter topAdapter = new MainHomeLivesClassAdapter(mContext, targetList, false); - topAdapter.setOnItemClickListener(new OnItemClickListener() { - @Override - public void onItemClick(LiveClassBean bean, int position) { - if (!canClick()) { - return; - } - if (position != 0) { - select = bean.getId(); - } else { - select = 0; - } - mRefreshView.initData(); - topAdapter.choice = position; - topAdapter.notifyDataSetChanged(); - + List list = new LiveClassManager(mContext).getLiveClass(); + if (list != null && list.size() > 0) { + List targetList = new ArrayList<>(); + if (list.size() <= 6) { + targetList.addAll(list); + } else { + targetList.addAll(list); + } + final MainHomeLivesClassAdapter topAdapter = new MainHomeLivesClassAdapter(mContext, targetList, false); + topAdapter.setOnItemClickListener(new OnItemClickListener() { + @Override + public void onItemClick(LiveClassBean bean, int position) { + if (!canClick()) { + return; } - }); - if (mClassRecyclerViewTop != null) { - mClassRecyclerViewTop.setAdapter(topAdapter); + if (position != 0) { + select = bean.getId(); + } else { + select = 0; + } + mRefreshView.initData(); + topAdapter.choice = position; + topAdapter.notifyDataSetChanged(); + } + }); + if (mClassRecyclerViewTop != null) { + mClassRecyclerViewTop.setAdapter(topAdapter); } } View headView = mAdapter.getHeadView(); diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java index 7025820a8..7ab3282ec 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java @@ -93,9 +93,9 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder { @Override protected String[] getTitles() { return new String[]{ - WordUtil.getString(R.string.follow), - WordUtil.getString(R.string.hot), - WordUtil.getString(R.string.recomment), + mContext.getString(R.string.follow), + mContext.getString(R.string.hot), + mContext.getString(R.string.recomment), }; } diff --git a/main/src/main/res/layout/activity_language_sett.xml b/main/src/main/res/layout/activity_language_sett.xml index 725f459a7..c8f128d89 100644 --- a/main/src/main/res/layout/activity_language_sett.xml +++ b/main/src/main/res/layout/activity_language_sett.xml @@ -32,6 +32,7 @@ android:textStyle="bold" /> From 098ef7aa36c8492d35ad5d8f9ba7da87cca9453b Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Tue, 18 Apr 2023 10:30:55 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=A4=9A=E8=AF=AD=E8=A8=80=E5=88=87?= =?UTF-8?q?=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/share/ui/InvitePopDialog.java | 4 +- .../com/yunbao/share/ui/SharePopDialog.java | 6 +- .../phonelive/activity/LauncherActivity.java | 2 +- .../yunbao/beauty/adapter/TieZhiAdapter.java | 4 +- .../com/yunbao/common/CommonAppConfig.java | 2 +- .../yunbao/common/activity/ErrorActivity.java | 2 +- .../common/activity/WebViewActivity.java | 2 +- .../common/adapter/ChatChargeCoinAdapter.java | 2 +- .../com/yunbao/common/bean/LiveTaskModel.java | 2 +- .../java/com/yunbao/common/bean/UserBean.java | 2 +- .../dialog/LiveChargeDialogFragment.java | 4 +- .../dialog/MessageLongClickPopuwindow.java | 5 +- .../com/yunbao/common/utils/DialogUitl.java | 2 +- .../com/yunbao/common/utils/VersionUtil.java | 24 ++++---- .../activity/EditNameRemarksActivity.java | 2 +- .../yunbao/live/activity/LiveActivity.java | 6 +- .../live/activity/LiveAnchorActivity.java | 16 ++--- .../live/activity/LiveAudienceActivity.java | 2 +- .../live/activity/LiveBlackActivity.java | 2 +- .../activity/LiveChooseClassActivity.java | 2 +- .../live/activity/LiveGuardListActivity.java | 2 +- .../live/activity/LiveRecordActivity.java | 2 +- .../live/activity/LiveReportActivity.java | 2 +- .../live/activity/LiveRyAnchorActivity.java | 20 +++---- .../live/activity/LiveShutUpActivity.java | 2 +- .../live/activity/LiveTRTCAnchorActivity.java | 2 +- .../MedalQuestionWebViewActivity.java | 2 +- .../live/activity/RoomManageActivity.java | 2 +- .../activity/RoomManageDetailActivity.java | 2 +- .../live/activity/WebViewActivityMedal.java | 2 +- .../live/activity/ZhuangBanActivity.java | 2 +- .../adapter/AnchorUserMicInfoAdapter.java | 8 +-- .../com/yunbao/live/adapter/GuardAdapter.java | 2 +- .../live/adapter/LiveAdminRoomAdapter.java | 2 +- .../adapter/LiveAnchorEditCallMeAdapter.java | 8 +-- .../yunbao/live/adapter/LiveGiftAdapter.java | 2 +- .../adapter/LiveNewGuardBuyItemsAdapter.java | 2 +- .../yunbao/live/adapter/LivePkAdapter.java | 2 +- .../live/adapter/LiveTaskRecyclerAdapter.java | 4 +- .../adapter/LiveUserAnchorMailBoxAdapter.java | 12 ++-- .../yunbao/live/adapter/RedPackAdapter.java | 4 +- .../com/yunbao/live/bean/GuardBuyBean.java | 10 ++-- .../live/dialog/GiftPrizePoolFragment.java | 2 +- .../live/dialog/LiveBeautyDialogFragment.java | 60 +++++++++---------- .../live/dialog/LiveDataInfoDialog.java | 32 +++++----- .../dialog/LiveFansMedalDialogFragment.java | 8 +-- .../dialog/LiveGuardBuyDialogFragment.java | 10 ++-- .../live/dialog/LiveGuardDialogFragment.java | 10 ++-- .../live/dialog/LiveInputDialogFragment.java | 6 +- .../dialog/LiveNewGuardBuyDialogFragment.java | 21 +++---- .../LiveNewGuardListDialogFragment.java | 8 +-- .../dialog/LiveNewRoomTypeDialogFragment.java | 2 +- .../dialog/LiveOldUserDialogFragment.java | 8 +-- .../dialog/LiveRedPackListDialogFragment.java | 2 +- .../LiveRedPackResultDialogFragment.java | 6 +- .../dialog/LiveRedPackRobDialogFragment.java | 2 +- .../dialog/LiveRedPackSendDialogFragment.java | 2 +- .../yunbao/live/dialog/LiveTaskDialog.java | 8 +-- ...LiveUserAnchorMailBoxWebInfoPopDialog.java | 2 +- .../live/dialog/LiveUserDialogFragment.java | 12 ++-- .../live/dialog/RandomPkDialogFragment.java | 8 +-- .../live/presenter/LiveGiftAnimPresenter.java | 6 +- .../presenter/LiveLinkMicAnchorPresenter.java | 6 +- .../presenter/LiveLinkMicPkPresenter.java | 2 +- .../live/presenter/LiveLinkMicPresenter.java | 8 +-- .../presenter/LiveRoomCheckLivePresenter.java | 12 ++-- .../presenter/LiveRyLinkMicPkPresenter.java | 4 +- .../presenter/UserHomeSharePresenter.java | 4 +- .../yunbao/live/socket/SocketChatUtil.java | 10 ++-- .../com/yunbao/live/socket/SocketClient.java | 10 ++-- .../yunbao/live/socket/SocketRyChatUtil.java | 10 ++-- .../yunbao/live/socket/SocketRyClient.java | 14 ++--- .../com/yunbao/live/utils/LiveTextRender.java | 12 ++-- .../live/views/LiveAdminListViewHolder.java | 2 +- .../live/views/LiveGiftLuckTopViewHolder.java | 2 +- .../live/views/LiveLinkMicPkViewHolder.java | 4 +- .../views/LiveLinkMicPlayTxViewHolder.java | 2 +- .../live/views/LiveNewReadyRyViewHolder.java | 12 ++-- .../live/views/LivePlayRyViewHolder.java | 2 +- .../live/views/LivePlayTxViewHolder.java | 2 +- .../views/LivePlayTxViewHolder_backup.java | 2 +- .../views/LivePushTxViewHolder360Beauty.java | 2 +- .../live/views/LiveReadyRyViewHolder.java | 12 ++-- .../live/views/LiveReadyViewHolder.java | 12 ++-- .../yunbao/live/views/LiveRoomViewHolder.java | 14 ++--- .../live/views/LuckLiveGiftViewHolder.java | 2 +- .../live/views/PortraitLiveManager.java | 4 +- .../main/activity/BindUserActivity.java | 22 +++---- .../yunbao/main/activity/CashActivity.java | 2 +- .../main/activity/ChatRoomActivity.java | 2 +- .../main/activity/EditNameActivity.java | 2 +- .../main/activity/EditProfileActivity.java | 2 +- .../yunbao/main/activity/EditSexActivity.java | 2 +- .../main/activity/EditSignActivity.java | 2 +- .../yunbao/main/activity/EntryActivity.java | 2 +- .../yunbao/main/activity/FansActivity.java | 4 +- .../yunbao/main/activity/FindPwdActivity.java | 22 +++---- .../yunbao/main/activity/FollowActivity.java | 6 +- .../yunbao/main/activity/LoginActivity.java | 4 +- .../yunbao/main/activity/MainActivity.java | 6 +- .../main/activity/MainListActivity.java | 4 +- .../main/activity/ModifyPwdActivity.java | 10 ++-- .../yunbao/main/activity/MyCoinActivity.java | 6 +- .../main/activity/MyImpressActivity.java | 4 +- .../main/activity/MyProfitActivity.java | 8 +-- .../yunbao/main/activity/MyVideoActivity.java | 2 +- .../main/activity/MyWalletActivity.java | 4 +- .../main/activity/MyWebViewActivity.java | 2 +- .../main/activity/MyWebViewActivity2.java | 2 +- .../main/activity/RegisterActivity.java | 16 ++--- .../yunbao/main/activity/RewardActivity.java | 2 +- .../yunbao/main/activity/SettingActivity.java | 8 +-- .../main/activity/ThreeDistributActivity.java | 2 +- .../main/activity/WeekWebViewActivity.java | 2 +- .../main/activity/ZhuangBanActivity.java | 2 +- .../com/yunbao/main/adapter/CoinAdapter.java | 2 +- .../yunbao/main/adapter/MainListAdapter.java | 4 +- .../yunbao/main/adapter/SearchAdapter.java | 4 +- .../yunbao/main/dialog/OneLoginDialog.java | 6 +- .../views/AbsMainListChildViewHolder.java | 2 +- .../yunbao/main/views/BonusViewHolder.java | 2 +- .../views/MainHomeCommunityViewHolder.java | 7 +-- .../main/views/MainHomeCsdViewHolder.java | 3 +- .../main/views/MainHomeShopViewHolder.java | 3 +- .../yunbao/main/views/MainListViewHolder.java | 4 +- .../yunbao/main/views/MainNearViewHolder.java | 2 +- .../main/views/UserHomeDetailViewHolder.java | 6 +- .../yunbao/main/views/UserHomeViewHolder.java | 12 ++-- .../main/views/UserHomeViewHolder2.java | 18 +++--- .../video/activity/AbsVideoPlayActivity.java | 2 +- .../video/activity/VideoChooseActivity.java | 2 +- .../video/activity/VideoEditActivity.java | 10 ++-- .../video/activity/VideoPublishActivity.java | 8 +-- .../video/activity/VideoReportActivity.java | 2 +- .../yunbao/video/bean/VideoCommentBean.java | 2 +- .../dialog/VideoInputDialogFragment.java | 2 +- .../video/views/VideoCommentViewHolder.java | 2 +- 137 files changed, 413 insertions(+), 414 deletions(-) diff --git a/Share/src/main/java/com/yunbao/share/ui/InvitePopDialog.java b/Share/src/main/java/com/yunbao/share/ui/InvitePopDialog.java index c413749f2..12930aaec 100644 --- a/Share/src/main/java/com/yunbao/share/ui/InvitePopDialog.java +++ b/Share/src/main/java/com/yunbao/share/ui/InvitePopDialog.java @@ -135,7 +135,7 @@ public class InvitePopDialog extends AbsDialogPopupWindow { private ShareBuilder builder(int type) { ShareBuilder builder = ShareBuilder.builder(type); - builder.setText(WordUtil.getString(R.string.dialog_invite_info)); + builder.setText(getContext().getString(R.string.dialog_invite_info)); builder.setLink(url); builder.setUid(uid); builder.setAnchorId(anchorId); @@ -148,7 +148,7 @@ public class InvitePopDialog extends AbsDialogPopupWindow { ClipboardManager cm = (ClipboardManager) getContext().getSystemService(CLIPBOARD_SERVICE); ClipData clipData = ClipData.newPlainText("text", info.getText() + "\n" + url); cm.setPrimaryClip(clipData); - ToastUtil.show(WordUtil.getString(com.yunbao.common.R.string.copy_success)); + ToastUtil.show(getContext().getString(com.yunbao.common.R.string.copy_success)); } public InvitePopDialog setUrl(String data) { diff --git a/Share/src/main/java/com/yunbao/share/ui/SharePopDialog.java b/Share/src/main/java/com/yunbao/share/ui/SharePopDialog.java index 8485f70bf..329fe807b 100644 --- a/Share/src/main/java/com/yunbao/share/ui/SharePopDialog.java +++ b/Share/src/main/java/com/yunbao/share/ui/SharePopDialog.java @@ -114,13 +114,13 @@ public class SharePopDialog extends AbsDialogPopupWindow { } } link.setText(url); - info.setText(String.format(WordUtil.getString(R.string.dialog_share_info), StringUtil.isEmpty(anchorName) ? "" : anchorName)); + info.setText(String.format(getContext().getString(R.string.dialog_share_info), StringUtil.isEmpty(anchorName) ? "" : anchorName)); ImgLoader.display(getContext(), anchorAvatar, avatar); } private ShareBuilder builder(int type) { ShareBuilder builder = ShareBuilder.builder(type); - builder.setText(String.format(WordUtil.getString(R.string.dialog_share_info), StringUtil.isEmpty(anchorName) ? "" : anchorName)); + builder.setText(String.format(getContext().getString(R.string.dialog_share_info), StringUtil.isEmpty(anchorName) ? "" : anchorName)); builder.setUid(uid); builder.setAnchorId(anchorId); builder.setAnchorName(anchorName); @@ -141,6 +141,6 @@ public class SharePopDialog extends AbsDialogPopupWindow { ClipboardManager cm = (ClipboardManager) getContext().getSystemService(CLIPBOARD_SERVICE); ClipData clipData = ClipData.newPlainText("text",info.getText().toString()+"\n"+url); cm.setPrimaryClip(clipData); - ToastUtil.show(WordUtil.getString(com.yunbao.common.R.string.copy_success)); + ToastUtil.show(getContext().getString(com.yunbao.common.R.string.copy_success)); } } diff --git a/app/src/main/java/com/shayu/phonelive/activity/LauncherActivity.java b/app/src/main/java/com/shayu/phonelive/activity/LauncherActivity.java index 371732ef7..bbcf63b50 100644 --- a/app/src/main/java/com/shayu/phonelive/activity/LauncherActivity.java +++ b/app/src/main/java/com/shayu/phonelive/activity/LauncherActivity.java @@ -511,7 +511,7 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL } } else if (e == TXLiveConstants.PLAY_ERR_NET_DISCONNECT || e == TXLiveConstants.PLAY_ERR_FILE_NOT_FOUND) { - ToastUtil.show(WordUtil.getString(R.string.live_play_error)); + ToastUtil.show(mContext.getString(R.string.live_play_error)); checkUidAndToken(); } else if (e == TXLiveConstants.PLAY_EVT_PLAY_PROGRESS) { int progress = bundle.getInt("EVT_PLAY_PROGRESS_MS"); diff --git a/beauty/src/main/java/com/yunbao/beauty/adapter/TieZhiAdapter.java b/beauty/src/main/java/com/yunbao/beauty/adapter/TieZhiAdapter.java index e9420fe72..573b5aa43 100644 --- a/beauty/src/main/java/com/yunbao/beauty/adapter/TieZhiAdapter.java +++ b/beauty/src/main/java/com/yunbao/beauty/adapter/TieZhiAdapter.java @@ -86,7 +86,7 @@ public class TieZhiAdapter extends RecyclerView.Adapter { TiUtils.unzip(file, targetDir); bean.setDownloadSuccess(mContext); } catch (Exception e) { - ToastUtil.show(WordUtil.getString(R.string.tiezhi_download_failed)); + ToastUtil.show(mContext.getString(R.string.tiezhi_download_failed)); bean.setDownloading(false); } finally { file.delete(); @@ -103,7 +103,7 @@ public class TieZhiAdapter extends RecyclerView.Adapter { @Override public void onError(Throwable e) { - ToastUtil.show(WordUtil.getString(R.string.tiezhi_download_failed)); + ToastUtil.show(mContext.getString(R.string.tiezhi_download_failed)); bean.setDownloading(false); notifyItemChanged(position, Constants.PAYLOAD); mLoadingTaskMap.remove(position); diff --git a/common/src/main/java/com/yunbao/common/CommonAppConfig.java b/common/src/main/java/com/yunbao/common/CommonAppConfig.java index f514fc808..8633489c6 100644 --- a/common/src/main/java/com/yunbao/common/CommonAppConfig.java +++ b/common/src/main/java/com/yunbao/common/CommonAppConfig.java @@ -383,7 +383,7 @@ public class CommonAppConfig { public String getAppName() { if (TextUtils.isEmpty(mAppName)) { int res = CommonAppContext.sInstance.getResources().getIdentifier("app_name", "string", "myname.pdlive.shayu"); - mAppName = WordUtil.getString(res); + mAppName =WordUtil.getString(res); } return mAppName; } diff --git a/common/src/main/java/com/yunbao/common/activity/ErrorActivity.java b/common/src/main/java/com/yunbao/common/activity/ErrorActivity.java index 6cc2a39e8..80c834c67 100644 --- a/common/src/main/java/com/yunbao/common/activity/ErrorActivity.java +++ b/common/src/main/java/com/yunbao/common/activity/ErrorActivity.java @@ -60,6 +60,6 @@ public class ErrorActivity extends AbsActivity { ClipboardManager clipboardManager = (ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE); ClipData clipData = ClipData.newPlainText("text", mErrorInfo); clipboardManager.setPrimaryClip(clipData); - ToastUtil.show(WordUtil.getString(R.string.copy_success)); + ToastUtil.show(mContext.getString(R.string.copy_success)); } } diff --git a/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java b/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java index 36bd403cc..17c8a6c13 100644 --- a/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java +++ b/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java @@ -186,7 +186,7 @@ public class WebViewActivity extends AbsActivity { intent.setData(MediaStore.Images.Media.EXTERNAL_CONTENT_URI); } intent.setType("image/*"); - startActivityForResult(Intent.createChooser(intent, WordUtil.getString(R.string.choose_flie)), CHOOSE); + startActivityForResult(Intent.createChooser(intent, mContext.getString(R.string.choose_flie)), CHOOSE); } @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) diff --git a/common/src/main/java/com/yunbao/common/adapter/ChatChargeCoinAdapter.java b/common/src/main/java/com/yunbao/common/adapter/ChatChargeCoinAdapter.java index 0534be3d8..e981d0bba 100644 --- a/common/src/main/java/com/yunbao/common/adapter/ChatChargeCoinAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/ChatChargeCoinAdapter.java @@ -41,7 +41,7 @@ public class ChatChargeCoinAdapter extends RecyclerView.Adapter() { @Override public void onSuccess(RecallNotificationMessage recallNotificationMessage) { - ToastUtil.show(getString(R.string.withdraw_success)); + ToastUtil.show(mContext.getString(R.string.withdraw_success)); //删除草稿信息 IMCenter.getInstance().clearTextMessageDraft(message.getConversationType(), message.getTargetId(), null); } diff --git a/common/src/main/java/com/yunbao/common/utils/DialogUitl.java b/common/src/main/java/com/yunbao/common/utils/DialogUitl.java index 1ad1b3e7e..0e40c91ba 100644 --- a/common/src/main/java/com/yunbao/common/utils/DialogUitl.java +++ b/common/src/main/java/com/yunbao/common/utils/DialogUitl.java @@ -309,7 +309,7 @@ public class DialogUitl { if (v.getId() == R.id.btn_confirm) { if (callback != null) { if (c.getTime().getTime() > new Date().getTime()) { - ToastUtil.show(WordUtil.getString(R.string.edit_profile_right_date)); + ToastUtil.show(context.getString(R.string.edit_profile_right_date)); } else { String result = DateFormat.format("yyyy-MM-dd", c).toString(); callback.onConfirmClick(result); diff --git a/common/src/main/java/com/yunbao/common/utils/VersionUtil.java b/common/src/main/java/com/yunbao/common/utils/VersionUtil.java index 27c6ab2df..6527c7fc4 100644 --- a/common/src/main/java/com/yunbao/common/utils/VersionUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/VersionUtil.java @@ -48,10 +48,10 @@ public class VersionUtil { //不强更 if (configBean.getForceUpdate() != 1) { DialogUitl.Builder builder = new DialogUitl.Builder(context); - builder.setTitle(WordUtil.getString(R.string.version_update)) + builder.setTitle(context.getString(R.string.version_update)) .setContent(configBean.getUpdateDes()) - .setConfrimString(WordUtil.getString(R.string.version_immediate_use)) - .setCancelString(WordUtil.getString(R.string.version_not_update)) + .setConfrimString(context.getString(R.string.version_immediate_use)) + .setCancelString(context.getString(R.string.version_not_update)) .setCancelable(false) .setClickCallback(new DialogUitl.SimpleCallback2() { public void onCancelClick() { @@ -79,10 +79,10 @@ public class VersionUtil { .show(); } else { DialogUitl.Builder builder = new DialogUitl.Builder(context); - builder.setTitle(WordUtil.getString(R.string.version_update)) + builder.setTitle(context.getString(R.string.version_update)) .setContent(configBean.getUpdateDes()) - .setConfrimString(WordUtil.getString(R.string.version_immediate_use)) - .setCancelString(WordUtil.getString(R.string.version_not_update)) + .setConfrimString(context.getString(R.string.version_immediate_use)) + .setCancelString(context.getString(R.string.version_not_update)) .setCancelable(false) .setClickCallback(new DialogUitl.SimpleCallback2() { public void onCancelClick() { @@ -109,10 +109,10 @@ public class VersionUtil { //谷歌强制更新 if (configBean.getGoogle_isup().equals("1")) { DialogUitl.Builder builder = new DialogUitl.Builder(context); - builder.setTitle(WordUtil.getString(R.string.version_update)) + builder.setTitle(context.getString(R.string.version_update)) .setContent(configBean.getUpdateDes()) - .setConfrimString(WordUtil.getString(R.string.version_immediate_use)) - .setCancelString(WordUtil.getString(R.string.version_not_update)) + .setConfrimString(context.getString(R.string.version_immediate_use)) + .setCancelString(context.getString(R.string.version_not_update)) .setCancelable(false) .setClickCallback(new DialogUitl.SimpleCallback2() { public void onCancelClick() { @@ -132,10 +132,10 @@ public class VersionUtil { //谷歌不强制 } else { DialogUitl.Builder builder = new DialogUitl.Builder(context); - builder.setTitle(WordUtil.getString(R.string.version_update)) + builder.setTitle(context.getString(R.string.version_update)) .setContent(configBean.getUpdateDes()) - .setConfrimString(WordUtil.getString(R.string.version_immediate_use)) - .setCancelString(WordUtil.getString(R.string.version_not_update)) + .setConfrimString(context.getString(R.string.version_immediate_use)) + .setCancelString(context.getString(R.string.version_not_update)) .setCancelable(false) .setClickCallback(new DialogUitl.SimpleCallback2() { public void onCancelClick() { diff --git a/live/src/main/java/com/yunbao/live/activity/EditNameRemarksActivity.java b/live/src/main/java/com/yunbao/live/activity/EditNameRemarksActivity.java index c860d6dd9..6fa9f1412 100644 --- a/live/src/main/java/com/yunbao/live/activity/EditNameRemarksActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/EditNameRemarksActivity.java @@ -44,7 +44,7 @@ public class EditNameRemarksActivity extends AbsActivity implements View.OnClick @Override protected void main() { - setTitle(WordUtil.getString(R.string.edit_profile_update_remarks)); + setTitle(mContext.getString(R.string.edit_profile_update_remarks)); userId = getIntent().getStringExtra(NAMEREMARK); mEditText = (EditText) findViewById(R.id.edit); mEditText.setFilters(new InputFilter[]{ diff --git a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java index 793306502..f324bb145 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java @@ -911,7 +911,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL if (!mIsAnchor) { UserBean u = CommonAppConfig.getInstance().getUserBean(); if (u != null && u.getLevel() < mDanMuLevel) { - ToastUtil.show(String.format(WordUtil.getString(R.string.live_level_danmu_limit), mDanMuLevel)); + ToastUtil.show(String.format(mContext.getString(R.string.live_level_danmu_limit), mDanMuLevel)); return; } } @@ -948,7 +948,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL if (!mIsAnchor) { UserBean u = CommonAppConfig.getInstance().getUserBean(); if (u != null && u.getLevel() < mChatLevel) { - ToastUtil.show(String.format(WordUtil.getString(R.string.live_level_chat_limit), mChatLevel)); + ToastUtil.show(String.format(mContext.getString(R.string.live_level_chat_limit), mChatLevel)); return; } } @@ -1154,7 +1154,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL ClipboardManager cm = (ClipboardManager) mContext.getSystemService(CLIPBOARD_SERVICE); ClipData clipData = ClipData.newPlainText("text", link); cm.setPrimaryClip(clipData); - ToastUtil.show(WordUtil.getString(R.string.copy_success)); + ToastUtil.show(mContext.getString(R.string.copy_success)); } diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java index 788d257ce..f3d36ed6b 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java @@ -225,11 +225,11 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic if (leave == 0) { leave = 1; mLivePushViewHolder.leave.setVisibility(View.VISIBLE); - sendSystemMessage(WordUtil.getString(R.string.live_anchor_leave)); + sendSystemMessage(mContext.getString(R.string.live_anchor_leave)); } else { leave = 0; mLivePushViewHolder.leave.setVisibility(View.GONE); - sendSystemMessage(WordUtil.getString(R.string.live_anchor_come_back)); + sendSystemMessage(mContext.getString(R.string.live_anchor_come_back)); } HttpClient.getInstance().get("Live.isLeave", "Live.isLeave") .params("isleave", leave) @@ -552,7 +552,7 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic * 关闭直播 */ public void closeLive() { - DialogUitl.showSimpleDialog(mContext, WordUtil.getString(R.string.live_end_live), new DialogUitl.SimpleCallback() { + DialogUitl.showSimpleDialog(mContext, mContext.getString(R.string.live_end_live), new DialogUitl.SimpleCallback() { @Override public void onConfirmClick(Dialog dialog, String content) { endLive(); @@ -661,7 +661,7 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic @Override public Dialog createLoadingDialog() { - return DialogUitl.loadingDialog(mContext, WordUtil.getString(R.string.live_end_ing)); + return DialogUitl.loadingDialog(mContext, mContext.getString(R.string.live_end_ing)); } }); } @@ -728,7 +728,7 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic mLiveRoomViewHolder.anchorPause(); } super.onPause(); - sendSystemMessage(WordUtil.getString(R.string.live_anchor_leave)); + sendSystemMessage(mContext.getString(R.string.live_anchor_leave)); mPaused = true; } @@ -739,7 +739,7 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic if (mLiveRoomViewHolder != null) { mLiveRoomViewHolder.anchorResume(); } - sendSystemMessage(WordUtil.getString(R.string.live_anchor_come_back)); + sendSystemMessage(mContext.getString(R.string.live_anchor_come_back)); CommonHttpUtil.checkTokenInvalid(); } mPaused = false; @@ -761,7 +761,7 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic @Override public void onSuperCloseLive() { endLive(); - DialogUitl.showSimpleTipDialog(mContext, WordUtil.getString(R.string.live_illegal)); + DialogUitl.showSimpleTipDialog(mContext, mContext.getString(R.string.live_illegal)); } @Subscribe(threadMode = ThreadMode.MAIN) @@ -1073,7 +1073,7 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic printLog(DateFormatUtil.getCurTimeString2() + " <=== " + mReqCount + "----status=" + status + "\n"); if (status == 0) { NotCancelableDialog dialog = new NotCancelableDialog(); - dialog.setContent(WordUtil.getString(R.string.live_anchor_error)); + dialog.setContent(mContext.getString(R.string.live_anchor_error)); dialog.setActionListener(new NotCancelableDialog.ActionListener() { @Override public void onConfirmClick(Context context, DialogFragment dialog) { diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index 04f310dbd..8f40dd063 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -1228,7 +1228,7 @@ public class LiveAudienceActivity extends LiveActivity { if (micListener != null) { micListener.updateMicList(mMicQueueList); DialogUitl.showSimpleDialog(mContext, - String.format(WordUtil.getString(R.string.live_mic_user_apply), ((LinkMicUserBean) event.getObject()).getUname()), + String.format(mContext.getString(R.string.live_mic_user_apply), ((LinkMicUserBean) event.getObject()).getUname()), new DialogUitl.SimpleCallback() { @Override public void onConfirmClick(Dialog dialog, String content) { diff --git a/live/src/main/java/com/yunbao/live/activity/LiveBlackActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveBlackActivity.java index e057c0d5f..60c404aae 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveBlackActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveBlackActivity.java @@ -48,7 +48,7 @@ public class LiveBlackActivity extends AbsActivity implements OnItemClickListene @Override protected void main() { - setTitle(WordUtil.getString(R.string.live_user_black_list)); + setTitle(mContext.getString(R.string.live_user_black_list)); mLiveUid = getIntent().getStringExtra(Constants.LIVE_UID); if (TextUtils.isEmpty(mLiveUid)) { return; diff --git a/live/src/main/java/com/yunbao/live/activity/LiveChooseClassActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveChooseClassActivity.java index f8a4a47f8..8df3190ed 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveChooseClassActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveChooseClassActivity.java @@ -34,7 +34,7 @@ public class LiveChooseClassActivity extends AbsActivity implements OnItemClickL @Override protected void main() { - setTitle(WordUtil.getString(R.string.live_class_choose)); + setTitle(mContext.getString(R.string.live_class_choose)); mRecyclerView = (RecyclerView) findViewById(R.id.recyclerView); mRecyclerView.setHasFixedSize(true); mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false)); diff --git a/live/src/main/java/com/yunbao/live/activity/LiveGuardListActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveGuardListActivity.java index 814b1bd30..1fcd45a44 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveGuardListActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveGuardListActivity.java @@ -45,7 +45,7 @@ public class LiveGuardListActivity extends AbsActivity { @Override protected void main() { - setTitle(WordUtil.getString(R.string.guard_list)); + setTitle(mContext.getString(R.string.guard_list)); mToUid = getIntent().getStringExtra(Constants.TO_UID); if (TextUtils.isEmpty(mToUid)) { return; diff --git a/live/src/main/java/com/yunbao/live/activity/LiveRecordActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveRecordActivity.java index ddd9fefee..65adde769 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveRecordActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveRecordActivity.java @@ -35,7 +35,7 @@ public class LiveRecordActivity extends AbsActivity { @Override protected void main() { - setTitle(WordUtil.getString(R.string.live_record)); + setTitle(mContext.getString(R.string.live_record)); mUserBean = getIntent().getParcelableExtra(Constants.USER_BEAN); if (mUserBean == null) { return; diff --git a/live/src/main/java/com/yunbao/live/activity/LiveReportActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveReportActivity.java index 0dd22801c..7264b176b 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveReportActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveReportActivity.java @@ -71,7 +71,7 @@ public class LiveReportActivity extends AbsActivity implements LiveReportAdapter @Override protected void main() { - setTitle(WordUtil.getString(R.string.report)); + setTitle(mContext.getString(R.string.report)); mToUid = getIntent().getStringExtra(Constants.TO_UID); mVideoId = getIntent().getStringExtra(Constants.VIDEO_ID); mIntoIndex = getIntent().getIntExtra(Constants.INTOINDEX, 0); diff --git a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java index 29e0454e3..3eb811a62 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java @@ -168,7 +168,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl @Override public void onTimer(String time) { if (mLiveRoomViewHolder != null) { - mLiveRoomViewHolder.setRandomPkTimer(String.format(WordUtil.getString(R.string.random_pk_info_btn_ing), time)); + mLiveRoomViewHolder.setRandomPkTimer(String.format(mContext.getString(R.string.random_pk_info_btn_ing), time)); } } @@ -539,7 +539,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition transition) { boolean ret = RCRTCEngine.getInstance().getDefaultVideoStream().setWatermark(BitmapUtil.getInstance().convertMirror(resource), rect); - sendSystemMessage(WordUtil.getString(R.string.live_anchor_leave)); + sendSystemMessage(mContext.getString(R.string.live_anchor_leave)); } @Override @@ -552,7 +552,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl leave_img.setVisibility(View.GONE); // 清除水印 boolean ret = RCRTCEngine.getInstance().getDefaultVideoStream().setWatermark(null, rect); - sendSystemMessage(WordUtil.getString(R.string.live_anchor_come_back)); + sendSystemMessage(mContext.getString(R.string.live_anchor_come_back)); } HttpClient.getInstance().get("Live.isLeave", "Live.isLeave") @@ -861,7 +861,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl * 关闭直播 */ public void closeLive() { - DialogUitl.showSimpleDialog(mContext, WordUtil.getString(R.string.live_end_live), new DialogUitl.SimpleCallback() { + DialogUitl.showSimpleDialog(mContext,mContext.getString(R.string.live_end_live), new DialogUitl.SimpleCallback() { @Override public void onConfirmClick(Dialog dialog, String content) { PKing = false; @@ -990,7 +990,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl @Override public Dialog createLoadingDialog() { - return DialogUitl.loadingDialog(mContext, WordUtil.getString(R.string.live_end_ing)); + return DialogUitl.loadingDialog(mContext,mContext.getString(R.string.live_end_ing)); } }); } @@ -1088,7 +1088,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl // } super.onPause(); // if (isKeyBack) { -// sendSystemMessage(WordUtil.getString(R.string.live_anchor_leave)); +// sendSystemMessage(mContext.getString(R.string.live_anchor_leave)); // } // mPaused = true; } @@ -1100,7 +1100,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl // if (mLiveRoomViewHolder != null) { // mLiveRoomViewHolder.anchorResume(); // } -// sendSystemMessage(WordUtil.getString(R.string.live_anchor_come_back)); +// sendSystemMessage(mContext.getString(R.string.live_anchor_come_back)); // CommonHttpUtil.checkTokenInvalid(); // } // mPaused = false; @@ -1122,7 +1122,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl @Override public void onSuperCloseLive() { endLive(); - DialogUitl.showSimpleTipDialog(mContext, WordUtil.getString(R.string.live_illegal)); + DialogUitl.showSimpleTipDialog(mContext,mContext.getString(R.string.live_illegal)); } @Subscribe(threadMode = ThreadMode.MAIN) @@ -1443,7 +1443,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl printLog(DateFormatUtil.getCurTimeString2() + " <=== " + mReqCount + "----status=" + status + "\n"); if (status == 0) { NotCancelableDialog dialog = new NotCancelableDialog(); - dialog.setContent(WordUtil.getString(R.string.live_anchor_error)); + dialog.setContent(mContext.getString(R.string.live_anchor_error)); dialog.setActionListener(new NotCancelableDialog.ActionListener() { @Override public void onConfirmClick(Context context, DialogFragment dialog) { @@ -1526,7 +1526,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl if (micListener != null) { micListener.updateMicList(mMicQueueList); DialogUitl.showSimpleDialog(mContext, - String.format(WordUtil.getString(R.string.live_mic_user_apply), ((LinkMicUserBean) event.getObject()).getUname()), + String.format(mContext.getString(R.string.live_mic_user_apply), ((LinkMicUserBean) event.getObject()).getUname()), new DialogUitl.SimpleCallback() { @Override public void onConfirmClick(Dialog dialog, String content) { diff --git a/live/src/main/java/com/yunbao/live/activity/LiveShutUpActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveShutUpActivity.java index 030d92c8b..846b9e443 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveShutUpActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveShutUpActivity.java @@ -48,7 +48,7 @@ public class LiveShutUpActivity extends AbsActivity implements OnItemClickListen @Override protected void main() { - setTitle(WordUtil.getString(R.string.live_user_shut_up_list)); + setTitle(mContext.getString(R.string.live_user_shut_up_list)); mLiveUid = getIntent().getStringExtra(Constants.LIVE_UID); if (TextUtils.isEmpty(mLiveUid)) { return; diff --git a/live/src/main/java/com/yunbao/live/activity/LiveTRTCAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveTRTCAnchorActivity.java index 205fd0032..b4997a923 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveTRTCAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveTRTCAnchorActivity.java @@ -340,7 +340,7 @@ public class LiveTRTCAnchorActivity extends TRTCBaseActivity { * 密码房间 */ private void onLiveTypePwd(final LiveRoomTypeBean bean) { - DialogUitl.showSimpleInputDialog(this, WordUtil.getString(R.string.live_set_pwd), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, 8, new DialogUitl.SimpleCallback() { + DialogUitl.showSimpleInputDialog(this, getApplicationContext().getString(R.string.live_set_pwd), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, 8, new DialogUitl.SimpleCallback() { @Override public void onConfirmClick(Dialog dialog, String content) { if (TextUtils.isEmpty(content)) { diff --git a/live/src/main/java/com/yunbao/live/activity/MedalQuestionWebViewActivity.java b/live/src/main/java/com/yunbao/live/activity/MedalQuestionWebViewActivity.java index d79d40ade..1db2d7681 100644 --- a/live/src/main/java/com/yunbao/live/activity/MedalQuestionWebViewActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/MedalQuestionWebViewActivity.java @@ -133,7 +133,7 @@ public class MedalQuestionWebViewActivity extends AbsActivity { intent.setData(MediaStore.Images.Media.EXTERNAL_CONTENT_URI); } intent.setType("image/*"); - startActivityForResult(Intent.createChooser(intent, WordUtil.getString(R.string.choose_flie)), CHOOSE); + startActivityForResult(Intent.createChooser(intent, mContext.getString(R.string.choose_flie)), CHOOSE); } @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) diff --git a/live/src/main/java/com/yunbao/live/activity/RoomManageActivity.java b/live/src/main/java/com/yunbao/live/activity/RoomManageActivity.java index d5bbd6d50..63aae5519 100644 --- a/live/src/main/java/com/yunbao/live/activity/RoomManageActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/RoomManageActivity.java @@ -80,7 +80,7 @@ public class RoomManageActivity extends AbsActivity { }); mViewHolders = new AbsCommonViewHolder[PAGE_COUNT]; mIndicator = (MagicIndicator) findViewById(R.id.indicator); - final String[] titles = new String[]{WordUtil.getString(R.string.live_my_live_room), WordUtil.getString(R.string.live_my_room)}; + final String[] titles = new String[]{mContext.getString(R.string.live_my_live_room),mContext.getString(R.string.live_my_room)}; CommonNavigator commonNavigator = new CommonNavigator(mContext); commonNavigator.setAdapter(new CommonNavigatorAdapter() { diff --git a/live/src/main/java/com/yunbao/live/activity/RoomManageDetailActivity.java b/live/src/main/java/com/yunbao/live/activity/RoomManageDetailActivity.java index afd201ba8..280c05f97 100644 --- a/live/src/main/java/com/yunbao/live/activity/RoomManageDetailActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/RoomManageDetailActivity.java @@ -37,7 +37,7 @@ public class RoomManageDetailActivity extends AbsActivity implements View.OnClic if (mAdminRoomBean == null) { return; } - setTitle(StringUtil.contact(mAdminRoomBean.getUserNiceName(), WordUtil.getString(R.string.live_admin_room))); + setTitle(StringUtil.contact(mAdminRoomBean.getUserNiceName(), mContext.getString(R.string.live_admin_room))); findViewById(R.id.btn_user_shut_up).setOnClickListener(this); findViewById(R.id.btn_user_black).setOnClickListener(this); } diff --git a/live/src/main/java/com/yunbao/live/activity/WebViewActivityMedal.java b/live/src/main/java/com/yunbao/live/activity/WebViewActivityMedal.java index e9e98e524..d2456827f 100644 --- a/live/src/main/java/com/yunbao/live/activity/WebViewActivityMedal.java +++ b/live/src/main/java/com/yunbao/live/activity/WebViewActivityMedal.java @@ -212,7 +212,7 @@ public class WebViewActivityMedal extends AbsActivity { intent.setData(MediaStore.Images.Media.EXTERNAL_CONTENT_URI); } intent.setType("image/*"); - startActivityForResult(Intent.createChooser(intent, WordUtil.getString(R.string.choose_flie)), CHOOSE); + startActivityForResult(Intent.createChooser(intent, mContext.getString(R.string.choose_flie)), CHOOSE); } @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) diff --git a/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java b/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java index 29a15a830..e4511553d 100644 --- a/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java @@ -215,7 +215,7 @@ public class ZhuangBanActivity extends AbsActivity { intent.setData(MediaStore.Images.Media.EXTERNAL_CONTENT_URI); } intent.setType("image/*"); - startActivityForResult(Intent.createChooser(intent, WordUtil.getString(R.string.choose_flie)), CHOOSE); + startActivityForResult(Intent.createChooser(intent,mContext.getString(R.string.choose_flie)), CHOOSE); } @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) diff --git a/live/src/main/java/com/yunbao/live/adapter/AnchorUserMicInfoAdapter.java b/live/src/main/java/com/yunbao/live/adapter/AnchorUserMicInfoAdapter.java index f6a403849..c45181bbb 100644 --- a/live/src/main/java/com/yunbao/live/adapter/AnchorUserMicInfoAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/AnchorUserMicInfoAdapter.java @@ -125,14 +125,14 @@ public class AnchorUserMicInfoAdapter extends RefreshAdapter { if (length <= 4) { if (tag.getType() == TYPE_MIC_REQUEST) { applyMic(tag, 4, createSocketSendBean()); - ToastUtil.show(WordUtil.getString(R.string.live_mic_request)); + ToastUtil.show(mContext.getString(R.string.live_mic_request)); } else if (tag.getType() == TYPE_MIC_INVITE) { SocketSendBean bean = createSocketSendBean().param("targetId", tag.getId()); applyMic(tag, 1, bean); - ToastUtil.show(WordUtil.getString(R.string.live_mic_invite)); + ToastUtil.show(mContext.getString(R.string.live_mic_invite)); } } else { - ToastUtil.show(WordUtil.getString(R.string.live_mic_max)); + ToastUtil.show(mContext.getString(R.string.live_mic_max)); } } }); @@ -149,7 +149,7 @@ public class AnchorUserMicInfoAdapter extends RefreshAdapter { @Override public void accept(ResponseModel stringResponseModel) throws Exception { applyMic((MicUserBean) v.getTag(), 8, createSocketSendBean()); - ToastUtil.show(WordUtil.getString(R.string.live_mic_user_down)); + ToastUtil.show(mContext.getString(R.string.live_mic_user_down)); } }, Throwable::printStackTrace).isDisposed(); diff --git a/live/src/main/java/com/yunbao/live/adapter/GuardAdapter.java b/live/src/main/java/com/yunbao/live/adapter/GuardAdapter.java index 119bb244c..378b172d1 100644 --- a/live/src/main/java/com/yunbao/live/adapter/GuardAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/GuardAdapter.java @@ -44,7 +44,7 @@ public class GuardAdapter extends RefreshAdapter { this.isShowTitle = isShowTitle; mDialog = dialog; mVotesName = CommonAppConfig.getInstance().getVotesName(); - mWeekContributeString = WordUtil.getString(R.string.guard_week_con); + mWeekContributeString =mContext.getString(R.string.guard_week_con); mGuardDrawable0 = ContextCompat.getDrawable(context, R.mipmap.icon_guard_type_0); mGuardDrawable1 = ContextCompat.getDrawable(context, R.mipmap.icon_guard_type_1); mGuardDrawable2 = ContextCompat.getDrawable(context, R.mipmap.icon_guard_type_2); diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveAdminRoomAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveAdminRoomAdapter.java index 483e50e4d..a3162ea43 100644 --- a/live/src/main/java/com/yunbao/live/adapter/LiveAdminRoomAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/LiveAdminRoomAdapter.java @@ -24,7 +24,7 @@ public class LiveAdminRoomAdapter extends RefreshAdapter { public LiveAdminRoomAdapter(Context context) { super(context); - mSuffix = WordUtil.getString(R.string.live_admin_room); + mSuffix =mContext.getString(R.string.live_admin_room); mOnClickListener = new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveAnchorEditCallMeAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveAnchorEditCallMeAdapter.java index 10795d7c0..c737e98a2 100644 --- a/live/src/main/java/com/yunbao/live/adapter/LiveAnchorEditCallMeAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/LiveAnchorEditCallMeAdapter.java @@ -177,7 +177,7 @@ public class LiveAnchorEditCallMeAdapter extends RecyclerView.Adapter { if (StringUtil.isEmpty((String) contact.getTag())) { - ToastUtil.show(WordUtil.getString(R.string.live_anchor_edit_call_me_not_filled_toash)); + ToastUtil.show(mContext.getString(R.string.live_anchor_edit_call_me_not_filled_toash)); return; } int tag = (int) v.getTag(); @@ -286,7 +286,7 @@ public class LiveAnchorEditCallMeAdapter extends RecyclerView.Adapter { @Override public void callback(File bean) { if(bean==null){ - ToastUtil.show(WordUtil.getString(R.string.load_failure_2)); + ToastUtil.show(mContext.getString(R.string.load_failure_2)); mLoading.setImageResource(R.mipmap.icon_download_gift); animation.setRepeatCount(0); animation.setDuration(0); diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveNewGuardBuyItemsAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveNewGuardBuyItemsAdapter.java index 4a5632e97..343febbb1 100644 --- a/live/src/main/java/com/yunbao/live/adapter/LiveNewGuardBuyItemsAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/LiveNewGuardBuyItemsAdapter.java @@ -114,7 +114,7 @@ public class LiveNewGuardBuyItemsAdapter extends RecyclerView.Adapter { } }; mLivePkInviteString = "PK"; - mLivePkInviteString2 = WordUtil.getString(R.string.live_pk_invite_2); + mLivePkInviteString2 =mContext.getString(R.string.live_pk_invite_2); } @NonNull diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveTaskRecyclerAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveTaskRecyclerAdapter.java index 86b1408b8..0548f68c9 100644 --- a/live/src/main/java/com/yunbao/live/adapter/LiveTaskRecyclerAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/LiveTaskRecyclerAdapter.java @@ -110,8 +110,8 @@ public class LiveTaskRecyclerAdapter extends RecyclerView.Adapter" + WordUtil.getString(R.string.live_task_item_hot) + "  " + task.getHot() + "")); - xp.setText(Html.fromHtml("" + WordUtil.getString(R.string.live_task_item_xp) + "  " + task.getExp() + "")); + hot.setText(Html.fromHtml("" +itemView.getContext().getString(R.string.live_task_item_hot) + "  " + task.getHot() + "")); + xp.setText(Html.fromHtml("" +itemView.getContext().getString(R.string.live_task_item_xp) + "  " + task.getExp() + "")); } } } diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveUserAnchorMailBoxAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveUserAnchorMailBoxAdapter.java index 825ae16bf..82aabb89c 100644 --- a/live/src/main/java/com/yunbao/live/adapter/LiveUserAnchorMailBoxAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/LiveUserAnchorMailBoxAdapter.java @@ -88,14 +88,14 @@ public class LiveUserAnchorMailBoxAdapter extends RecyclerView.Adapter { new DialogUitl.Builder(mContext) - .setTitle(WordUtil.getString(R.string.live_user_letter_dialog_title)) - .setContent(WordUtil.getString(R.string.live_user_letter_dialog_content)) - .setConfrimString(WordUtil.getString(R.string.live_user_letter_dialog_yes)) - .setCancelString(WordUtil.getString(R.string.live_user_letter_dialog_no)) + .setTitle(mContext.getString(R.string.live_user_letter_dialog_title)) + .setContent(mContext.getString(R.string.live_user_letter_dialog_content)) + .setConfrimString(mContext.getString(R.string.live_user_letter_dialog_yes)) + .setCancelString(mContext.getString(R.string.live_user_letter_dialog_no)) .setView(R.layout.dialog_live_random_pk) .setCancelable(true) .setClickCallback((dialog, content) -> LiveNetManager.get(mContext).delContactInfo(box.getId(), new HttpCallback() { diff --git a/live/src/main/java/com/yunbao/live/adapter/RedPackAdapter.java b/live/src/main/java/com/yunbao/live/adapter/RedPackAdapter.java index 87bb3be00..2a6b09243 100644 --- a/live/src/main/java/com/yunbao/live/adapter/RedPackAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/RedPackAdapter.java @@ -44,8 +44,8 @@ public class RedPackAdapter extends RecyclerView.Adapter { mContext=context; mList = list; mInflater = LayoutInflater.from(context); - mTypeString1 = WordUtil.getString(R.string.red_pack_11); - mTypeString2 = WordUtil.getString(R.string.red_pack_12); + mTypeString1 =mContext.getString(R.string.red_pack_11); + mTypeString2 =mContext.getString(R.string.red_pack_12); mOnClickListener = new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/live/src/main/java/com/yunbao/live/bean/GuardBuyBean.java b/live/src/main/java/com/yunbao/live/bean/GuardBuyBean.java index 1aa495bdb..f03573c50 100644 --- a/live/src/main/java/com/yunbao/live/bean/GuardBuyBean.java +++ b/live/src/main/java/com/yunbao/live/bean/GuardBuyBean.java @@ -1,5 +1,7 @@ package com.yunbao.live.bean; +import android.content.Context; + import com.yunbao.common.utils.WordUtil; import com.yunbao.live.R; @@ -58,14 +60,14 @@ public class GuardBuyBean { this.privilege = privilege; } - public String getShopName() { + public String getShopName(Context mContext) { switch (this.id) { case 1: - return WordUtil.getString(R.string.guard_name_1); + return mContext.getString(R.string.guard_name_1); case 2: - return WordUtil.getString(R.string.guard_name_2); + return mContext.getString(R.string.guard_name_2); case 3: - return WordUtil.getString(R.string.guard_name_3); + return mContext.getString(R.string.guard_name_3); } return ""; } diff --git a/live/src/main/java/com/yunbao/live/dialog/GiftPrizePoolFragment.java b/live/src/main/java/com/yunbao/live/dialog/GiftPrizePoolFragment.java index 96203007f..0602c6ab1 100644 --- a/live/src/main/java/com/yunbao/live/dialog/GiftPrizePoolFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/GiftPrizePoolFragment.java @@ -66,7 +66,7 @@ public class GiftPrizePoolFragment extends AbsDialogFragment implements View.OnC if (code == 0 && info.length > 0) { JSONObject obj = JSON.parseObject(info[0]); if (mLevel != null) { - mLevel.setText(String.format(WordUtil.getString(R.string.live_gift_prize_pool_3), + mLevel.setText(String.format(mContext.getString(R.string.live_gift_prize_pool_3), obj.getString("level"))); } if (mCoin != null) { diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveBeautyDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveBeautyDialogFragment.java index 1ed4c391a..6d4051766 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveBeautyDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveBeautyDialogFragment.java @@ -325,7 +325,7 @@ public class LiveBeautyDialogFragment extends AbsDialogFragment { // } // } else { BeautyFaceBean AUTOBEAUTY_NATURAL = new BeautyFaceBean(); - AUTOBEAUTY_NATURAL.setTitle(WordUtil.getString(R.string.light)); + AUTOBEAUTY_NATURAL.setTitle(mContext.getString(R.string.light)); AUTOBEAUTY_NATURAL.setB_name(AutoBeautyType.AUTOBEAUTY_NATURAL); AUTOBEAUTY_NATURAL.setImg_id(R.mipmap.beauty_ziran); AUTOBEAUTY_NATURAL.setValue(0); @@ -333,21 +333,21 @@ public class LiveBeautyDialogFragment extends AbsDialogFragment { beautifulList.add(AUTOBEAUTY_NATURAL); BeautyFaceBean AUTOBEAUTY_CUTE = new BeautyFaceBean(); - AUTOBEAUTY_CUTE.setTitle(WordUtil.getString(R.string.cute)); + AUTOBEAUTY_CUTE.setTitle(mContext.getString(R.string.cute)); AUTOBEAUTY_CUTE.setB_name(AutoBeautyType.AUTOBEAUTY_CUTE); AUTOBEAUTY_CUTE.setImg_id(R.mipmap.beauty_keai); AUTOBEAUTY_CUTE.setValue(0); beautifulList.add(AUTOBEAUTY_CUTE); BeautyFaceBean AUTOBEAUTY_GODDESS = new BeautyFaceBean(); - AUTOBEAUTY_GODDESS.setTitle(WordUtil.getString(R.string.goddess)); + AUTOBEAUTY_GODDESS.setTitle(mContext.getString(R.string.goddess)); AUTOBEAUTY_GODDESS.setB_name(AutoBeautyType.AUTOBEAUTY_GODDESS); AUTOBEAUTY_GODDESS.setImg_id(R.mipmap.beauty_nvshen); AUTOBEAUTY_GODDESS.setValue(0); beautifulList.add(AUTOBEAUTY_GODDESS); BeautyFaceBean AUTOBEAUTY_PUREWHITE = new BeautyFaceBean(); - AUTOBEAUTY_PUREWHITE.setTitle(WordUtil.getString(R.string.white1)); + AUTOBEAUTY_PUREWHITE.setTitle(mContext.getString(R.string.white1)); AUTOBEAUTY_PUREWHITE.setB_name(AutoBeautyType.AUTOBEAUTY_PUREWHITE); AUTOBEAUTY_PUREWHITE.setImg_id(R.mipmap.beauty_jingbai); AUTOBEAUTY_PUREWHITE.setValue(0); @@ -366,7 +366,7 @@ public class LiveBeautyDialogFragment extends AbsDialogFragment { beauty_seek.setProgress(beautyFaceList.get(0).getValue()); } else { BeautyFaceBean RUDDY = new BeautyFaceBean(); - RUDDY.setTitle(WordUtil.getString(R.string.rosy)); + RUDDY.setTitle(mContext.getString(R.string.rosy)); RUDDY.setName(SimpleBeautyType.RUDDY); RUDDY.setImg_id(R.mipmap.ruddy); RUDDY.setValue(64); @@ -374,42 +374,42 @@ public class LiveBeautyDialogFragment extends AbsDialogFragment { beautyFaceList.add(RUDDY); BeautyFaceBean SKIN_WHITENING = new BeautyFaceBean(); - SKIN_WHITENING.setTitle(WordUtil.getString(R.string.skin)); + SKIN_WHITENING.setTitle(mContext.getString(R.string.skin)); SKIN_WHITENING.setImg_id(R.mipmap.momo_mb); SKIN_WHITENING.setName(SimpleBeautyType.SKIN_WHITENING); SKIN_WHITENING.setValue(55); beautyFaceList.add(SKIN_WHITENING); BeautyFaceBean SKIN_SMOOTH = new BeautyFaceBean(); - SKIN_SMOOTH.setTitle(WordUtil.getString(R.string.smooth)); + SKIN_SMOOTH.setTitle(mContext.getString(R.string.smooth)); SKIN_SMOOTH.setImg_id(R.mipmap.momo_mp); SKIN_SMOOTH.setName(SimpleBeautyType.SKIN_SMOOTH); SKIN_SMOOTH.setValue(58); beautyFaceList.add(SKIN_SMOOTH); BeautyFaceBean BIG_EYE = new BeautyFaceBean(); - BIG_EYE.setTitle(WordUtil.getString(R.string.big_eyes)); + BIG_EYE.setTitle(mContext.getString(R.string.big_eyes)); BIG_EYE.setImg_id(R.mipmap.momo_dy); BIG_EYE.setName(SimpleBeautyType.BIG_EYE); BIG_EYE.setValue(52); beautyFaceList.add(BIG_EYE); BeautyFaceBean THIN_FACE = new BeautyFaceBean(); - THIN_FACE.setTitle(WordUtil.getString(R.string.slim_face)); + THIN_FACE.setTitle(mContext.getString(R.string.slim_face)); THIN_FACE.setImg_id(R.mipmap.momo_sl); THIN_FACE.setName(SimpleBeautyType.THIN_FACE); THIN_FACE.setValue(52); beautyFaceList.add(THIN_FACE); BeautyFaceBean JAW_SHAPE = new BeautyFaceBean(); - JAW_SHAPE.setTitle(WordUtil.getString(R.string.thin_face)); + JAW_SHAPE.setTitle(mContext.getString(R.string.thin_face)); JAW_SHAPE.setImg_id(R.mipmap.momo_xl); JAW_SHAPE.setName(SimpleBeautyType.JAW_SHAPE); JAW_SHAPE.setValue(38); beautyFaceList.add(JAW_SHAPE); BeautyFaceBean CHIN_LENGTH = new BeautyFaceBean(); - CHIN_LENGTH.setTitle(WordUtil.getString(R.string.chin)); + CHIN_LENGTH.setTitle(mContext.getString(R.string.chin)); CHIN_LENGTH.setName(SimpleBeautyType.CHIN_LENGTH); CHIN_LENGTH.setImg_id(R.mipmap.chin); CHIN_LENGTH.setValue(39); @@ -417,7 +417,7 @@ public class LiveBeautyDialogFragment extends AbsDialogFragment { BeautyFaceBean NOSE_SIZE = new BeautyFaceBean(); - NOSE_SIZE.setTitle(WordUtil.getString(R.string.nose)); + NOSE_SIZE.setTitle(mContext.getString(R.string.nose)); NOSE_SIZE.setName(SimpleBeautyType.NOSE_SIZE); NOSE_SIZE.setImg_id(R.mipmap.nose_size); NOSE_SIZE.setValue(55); @@ -425,21 +425,21 @@ public class LiveBeautyDialogFragment extends AbsDialogFragment { BeautyFaceBean MOUTH_SIZE = new BeautyFaceBean(); - MOUTH_SIZE.setTitle(WordUtil.getString(R.string.lips)); + MOUTH_SIZE.setTitle(mContext.getString(R.string.lips)); MOUTH_SIZE.setName(SimpleBeautyType.MOUTH_SIZE); MOUTH_SIZE.setImg_id(R.mipmap.lip_size); MOUTH_SIZE.setValue(45); beautyFaceList.add(MOUTH_SIZE); BeautyFaceBean EYE_BRIGHT = new BeautyFaceBean(); - EYE_BRIGHT.setTitle(WordUtil.getString(R.string.bright_eyes)); + EYE_BRIGHT.setTitle(mContext.getString(R.string.bright_eyes)); EYE_BRIGHT.setName(SimpleBeautyType.EYE_BRIGHT); EYE_BRIGHT.setImg_id(R.mipmap.bright_eyes); EYE_BRIGHT.setValue(36); beautyFaceList.add(EYE_BRIGHT); BeautyFaceBean TEETH_WHITE = new BeautyFaceBean(); - TEETH_WHITE.setTitle(WordUtil.getString(R.string.teeth)); + TEETH_WHITE.setTitle(mContext.getString(R.string.teeth)); TEETH_WHITE.setName(SimpleBeautyType.TEETH_WHITE); TEETH_WHITE.setImg_id(R.mipmap.white_teeth); TEETH_WHITE.setValue(39); @@ -461,7 +461,7 @@ public class LiveBeautyDialogFragment extends AbsDialogFragment { } } else { BeautyFaceBean ZR = new BeautyFaceBean(); - ZR.setTitle(WordUtil.getString(R.string.light)); + ZR.setTitle(mContext.getString(R.string.light)); ZR.setPaths("zr"); ZR.setValue(0); ZR.setImg_id(R.mipmap.filter_ziran); @@ -469,28 +469,28 @@ public class LiveBeautyDialogFragment extends AbsDialogFragment { filterList.add(ZR); BeautyFaceBean BX = new BeautyFaceBean(); - BX.setTitle(WordUtil.getString(R.string.white)); + BX.setTitle(mContext.getString(R.string.white)); BX.setPaths("bx"); BX.setValue(0); BX.setImg_id(R.mipmap.filter_baixixx); filterList.add(BX); BeautyFaceBean RX = new BeautyFaceBean(); - RX.setTitle(WordUtil.getString(R.string.jp)); + RX.setTitle(mContext.getString(R.string.jp)); RX.setPaths("rx"); RX.setValue(0); RX.setImg_id(R.mipmap.filter_rii); filterList.add(RX); BeautyFaceBean HB = new BeautyFaceBean(); - HB.setTitle(WordUtil.getString(R.string.bw)); + HB.setTitle(mContext.getString(R.string.bw)); HB.setPaths("hb"); HB.setImg_id(R.mipmap.filter_heibai); HB.setValue(0); filterList.add(HB); BeautyFaceBean RH = new BeautyFaceBean(); - RH.setTitle(WordUtil.getString(R.string.soft)); + RH.setTitle(mContext.getString(R.string.soft)); RX.setPaths("rh"); RH.setImg_id(R.mipmap.filter_rouhe); @@ -498,14 +498,14 @@ public class LiveBeautyDialogFragment extends AbsDialogFragment { filterList.add(RH); BeautyFaceBean RG = new BeautyFaceBean(); - RG.setTitle(WordUtil.getString(R.string.warmth)); + RG.setTitle(mContext.getString(R.string.warmth)); RG.setImg_id(R.mipmap.filter_nuanguang); RG.setPaths("rg"); RG.setValue(0); filterList.add(RG); BeautyFaceBean FG = new BeautyFaceBean(); - FG.setTitle(WordUtil.getString(R.string.retro)); + FG.setTitle(mContext.getString(R.string.retro)); FG.setPaths("fg"); FG.setImg_id(R.mipmap.filter_fugu); FG.setValue(0); @@ -513,7 +513,7 @@ public class LiveBeautyDialogFragment extends AbsDialogFragment { BeautyFaceBean HX = new BeautyFaceBean(); - HX.setTitle(WordUtil.getString(R.string.flower)); + HX.setTitle(mContext.getString(R.string.flower)); HX.setPaths("hx"); HX.setImg_id(R.mipmap.filter_huaxiang); HX.setValue(0); @@ -521,49 +521,49 @@ public class LiveBeautyDialogFragment extends AbsDialogFragment { BeautyFaceBean QY = new BeautyFaceBean(); - QY.setTitle(WordUtil.getString(R.string.easy)); + QY.setTitle(mContext.getString(R.string.easy)); QY.setPaths("qy"); QY.setImg_id(R.mipmap.filter_qingyang); QY.setValue(0); filterList.add(QY); BeautyFaceBean YQ = new BeautyFaceBean(); - YQ.setTitle(WordUtil.getString(R.string.vitality)); + YQ.setTitle(mContext.getString(R.string.vitality)); YQ.setPaths("yq"); YQ.setImg_id(R.mipmap.filter_yuanqi); YQ.setValue(0); filterList.add(YQ); BeautyFaceBean XM = new BeautyFaceBean(); - XM.setTitle(WordUtil.getString(R.string.bright)); + XM.setTitle(mContext.getString(R.string.bright)); XM.setPaths("xm"); XM.setImg_id(R.mipmap.filter_xianming); XM.setValue(0); filterList.add(XM); BeautyFaceBean ML = new BeautyFaceBean(); - ML.setTitle(WordUtil.getString(R.string.bright)); + ML.setTitle(mContext.getString(R.string.bright)); ML.setPaths("ml"); ML.setImg_id(R.mipmap.filter_mingliang); ML.setValue(0); filterList.add(ML); BeautyFaceBean SH = new BeautyFaceBean(); - SH.setTitle(WordUtil.getString(R.string.deep)); + SH.setTitle(mContext.getString(R.string.deep)); SH.setPaths("sh"); SH.setImg_id(R.mipmap.filter_shenhai); SH.setValue(0); filterList.add(SH); BeautyFaceBean XY = new BeautyFaceBean(); - XY.setTitle(WordUtil.getString(R.string.sunset)); + XY.setTitle(mContext.getString(R.string.sunset)); XY.setPaths("xy"); XY.setImg_id(R.mipmap.filter_xiyang); XY.setValue(0); filterList.add(XY); BeautyFaceBean ZY = new BeautyFaceBean(); - ZY.setTitle(WordUtil.getString(R.string.cure)); + ZY.setTitle(mContext.getString(R.string.cure)); ZY.setPaths("zy"); ZY.setImg_id(R.mipmap.filter_zhiyu); ZY.setValue(0); diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveDataInfoDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveDataInfoDialog.java index 9d4dad966..cb5caf834 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveDataInfoDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveDataInfoDialog.java @@ -62,28 +62,28 @@ public class LiveDataInfoDialog extends AbsDialogPopupWindow { private void initData() { list = new ArrayList<>(); - list.add(new LiveDataInfoModel("#00FFFF", WordUtil.getString(R.string.live_data_coin), WordUtil.getString(R.string.live_data_loading))); - list.add(new LiveDataInfoModel("#FFF69F", WordUtil.getString(R.string.live_data_gold), WordUtil.getString(R.string.live_data_loading))); - list.add(new LiveDataInfoModel(WordUtil.getString(R.string.live_data_accept), WordUtil.getString(R.string.live_data_loading))); - list.add(new LiveDataInfoModel(WordUtil.getString(R.string.live_data_enter), WordUtil.getString(R.string.live_data_loading))); - list.add(new LiveDataInfoModel(WordUtil.getString(R.string.live_data_attention), WordUtil.getString(R.string.live_data_loading))); - list.add(new LiveDataInfoModel(WordUtil.getString(R.string.live_data_attention_rate), WordUtil.getString(R.string.live_data_loading))); - list.add(new LiveDataInfoModel(WordUtil.getString(R.string.live_data_fan_group), WordUtil.getString(R.string.live_data_loading))); - list.add(new LiveDataInfoModel(WordUtil.getString(R.string.live_data_fan_group_rate), WordUtil.getString(R.string.live_data_loading))); + list.add(new LiveDataInfoModel("#00FFFF",getContext().getString(R.string.live_data_coin),getContext().getString(R.string.live_data_loading))); + list.add(new LiveDataInfoModel("#FFF69F",getContext().getString(R.string.live_data_gold),getContext().getString(R.string.live_data_loading))); + list.add(new LiveDataInfoModel(getContext().getString(R.string.live_data_accept),getContext().getString(R.string.live_data_loading))); + list.add(new LiveDataInfoModel(getContext().getString(R.string.live_data_enter),getContext().getString(R.string.live_data_loading))); + list.add(new LiveDataInfoModel(getContext().getString(R.string.live_data_attention),getContext().getString(R.string.live_data_loading))); + list.add(new LiveDataInfoModel(getContext().getString(R.string.live_data_attention_rate),getContext().getString(R.string.live_data_loading))); + list.add(new LiveDataInfoModel(getContext().getString(R.string.live_data_fan_group),getContext().getString(R.string.live_data_loading))); + list.add(new LiveDataInfoModel(getContext().getString(R.string.live_data_fan_group_rate),getContext().getString(R.string.live_data_loading))); adapter.setList(list); LiveNetManager.get(getContext()) .getLiveData(liveUid, new HttpCallback() { @Override public void onSuccess(com.yunbao.common.bean.LiveDataInfoModel data) { list.clear(); - list.add(new LiveDataInfoModel("#00FFFF", WordUtil.getString(R.string.live_data_coin), data.getTotalCoin() + "")); - list.add(new LiveDataInfoModel("#FFF69F", WordUtil.getString(R.string.live_data_gold), data.getTotalGold() + "")); - list.add(new LiveDataInfoModel(WordUtil.getString(R.string.live_data_accept), data.getAcceptNum() + "")); - list.add(new LiveDataInfoModel(WordUtil.getString(R.string.live_data_enter), data.getEnterNum() + "")); - list.add(new LiveDataInfoModel(WordUtil.getString(R.string.live_data_attention), data.getAttentionNum() + "")); - list.add(new LiveDataInfoModel(WordUtil.getString(R.string.live_data_attention_rate), data.getAttentionNumRate() + "")); - list.add(new LiveDataInfoModel(WordUtil.getString(R.string.live_data_fan_group), data.getFanGroupNum() + "")); - list.add(new LiveDataInfoModel(WordUtil.getString(R.string.live_data_fan_group_rate), data.getFanGroupNumRate() + "")); + list.add(new LiveDataInfoModel("#00FFFF",getContext().getString(R.string.live_data_coin), data.getTotalCoin() + "")); + list.add(new LiveDataInfoModel("#FFF69F",getContext().getString(R.string.live_data_gold), data.getTotalGold() + "")); + list.add(new LiveDataInfoModel(getContext().getString(R.string.live_data_accept), data.getAcceptNum() + "")); + list.add(new LiveDataInfoModel(getContext().getString(R.string.live_data_enter), data.getEnterNum() + "")); + list.add(new LiveDataInfoModel(getContext().getString(R.string.live_data_attention), data.getAttentionNum() + "")); + list.add(new LiveDataInfoModel(getContext().getString(R.string.live_data_attention_rate), data.getAttentionNumRate() + "")); + list.add(new LiveDataInfoModel(getContext().getString(R.string.live_data_fan_group), data.getFanGroupNum() + "")); + list.add(new LiveDataInfoModel(getContext().getString(R.string.live_data_fan_group_rate), data.getFanGroupNumRate() + "")); adapter.setList(list); } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveFansMedalDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveFansMedalDialogFragment.java index 8847fded8..6774e4843 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveFansMedalDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveFansMedalDialogFragment.java @@ -181,14 +181,14 @@ public class LiveFansMedalDialogFragment extends AbsDialogFragment implements Vi // mFans.setText(LiveTextRender.renderLiveUserDialogData(obj.getLongValue("fans"))); // mConsume.setText(LiveTextRender.renderLiveUserDialogData(obj.getLongValue("consumption"))); // mVotes.setText(LiveTextRender.renderLiveUserDialogData(obj.getLongValue("votestotal"))); -// mConsumeTip.setText(WordUtil.getString(R.string.live_user_send) + appConfig.getCoinName()); -// mVotesTip.setText(WordUtil.getString(R.string.live_user_get) + appConfig.getVotesName()); +// mConsumeTip.setText(mContext.getString(R.string.live_user_send) + appConfig.getCoinName()); +// mVotesTip.setText(mContext.getString(R.string.live_user_get) + appConfig.getVotesName()); // if (mType == TYPE_AUD_ANC) { // showImpress(obj.getString("label")); // } // mFollowing = obj.getIntValue("isattention") == 1; // if (mFollowText != null) { -// mFollowText.setText(mFollowing ? WordUtil.getString(R.string.following) : WordUtil.getString(R.string.follow)); +// mFollowText.setText(mFollowing ?mContext.getString(R.string.following) :mContext.getString(R.string.follow)); // } // if (mFollowImage != null) { // mFollowImage.setImageDrawable(mFollowing ? mFollowDrawable : mUnFollowDrawable); @@ -306,7 +306,7 @@ public class LiveFansMedalDialogFragment extends AbsDialogFragment implements Vi // } // if (isAttention == 1 && mLiveUid.equals(mToUid)) {//关注了主播 // ((LiveActivity) mContext).sendSystemMessage( -// CommonAppConfig.getInstance().getUserBean().getUserNiceName() + WordUtil.getString(R.string.live_follow_anchor)); +// CommonAppConfig.getInstance().getUserBean().getUserNiceName() +mContext.getString(R.string.live_follow_anchor)); // } // } // }; diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGuardBuyDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveGuardBuyDialogFragment.java index ee759acc5..61266948f 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGuardBuyDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGuardBuyDialogFragment.java @@ -127,9 +127,9 @@ public class LiveGuardBuyDialogFragment extends AbsDialogFragment implements Vie if (bundle != null) { mLiveUid = bundle.getString(Constants.LIVE_UID); mStream = bundle.getString(Constants.STREAM); - String coinName = WordUtil.getString(R.string.diamond); + String coinName =mContext.getString(R.string.diamond); mCoinName = coinName; - mCoinNameTextView.setText(WordUtil.getString(R.string.guard_my) + coinName + ":"); + mCoinNameTextView.setText(mContext.getString(R.string.guard_my) + coinName + ":"); } LiveHttpUtil.getGuardBuyList(new HttpCallback() { @Override @@ -258,7 +258,7 @@ public class LiveGuardBuyDialogFragment extends AbsDialogFragment implements Vie } Log.d("ffffff", "" + mLiveGuardInfo.getMyGuardType() + " " + mTargetBuyBean.getType()); if (mLiveGuardInfo.getMyGuardType() == Constants.GUARD_TYPE_MONTH && mTargetBuyBean.getType() == Constants.GUARD_TYPE_DAY) { - DialogUitl.showSimpleTipDialog(mContext, WordUtil.getString(R.string.guard_buy_tip)); + DialogUitl.showSimpleTipDialog(mContext,mContext.getString(R.string.guard_buy_tip)); return; } else if (mLiveGuardInfo.getMyGuardType() == Constants.GUARD_TYPE_YEAR && mTargetBuyBean.getType() == Constants.GUARD_TYPE_DAY) { DialogUitl.showSimpleTipDialog(mContext, "您為當前主播的年守護無法開通周守護"); @@ -269,7 +269,7 @@ public class LiveGuardBuyDialogFragment extends AbsDialogFragment implements Vie } else { if (mLiveGuardInfo.getMyGuardType() == Constants.GUARD_TYPE_MONTH && mTargetBuyBean.getType() == Constants.GUARD_TYPE_YEAR) { - DialogUitl.showSimpleDialog(mContext, WordUtil.getString(R.string.guard_buy_tip_2), new DialogUitl.SimpleCallback() { + DialogUitl.showSimpleDialog(mContext,mContext.getString(R.string.guard_buy_tip_2), new DialogUitl.SimpleCallback() { @Override public void onConfirmClick(Dialog dialog, String content) { doBuyGuard(); @@ -308,7 +308,7 @@ public class LiveGuardBuyDialogFragment extends AbsDialogFragment implements Vie return; } DialogUitl.showSimpleDialog(mContext, - String.format(WordUtil.getString(R.string.guard_buy_tip_3), mTargetBuyBean.getCoin(), mCoinName, mTargetBuyBean.getShopName()), + String.format(mContext.getString(R.string.guard_buy_tip_3), mTargetBuyBean.getCoin(), mCoinName, mTargetBuyBean.getShopName(getContext())), new DialogUitl.SimpleCallback() { @Override diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGuardDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveGuardDialogFragment.java index d7303b322..7367f567d 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGuardDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGuardDialogFragment.java @@ -87,7 +87,7 @@ public class LiveGuardDialogFragment extends AbsDialogFragment implements View.O if (mIsAnchor) { mBottom.setVisibility(View.GONE); if (mLiveGuardInfo != null) { - mGuardNum.setText(WordUtil.getString(R.string.guard_guard) + "(" + mLiveGuardInfo.getGuardNum() + ")"); + mGuardNum.setText(mContext.getString(R.string.guard_guard) + "(" + mLiveGuardInfo.getGuardNum() + ")"); } } else { mTip = (TextView) mRootView.findViewById(R.id.tip); @@ -100,18 +100,18 @@ public class LiveGuardDialogFragment extends AbsDialogFragment implements View.O return false; });*/ if (mLiveGuardInfo != null) { - mGuardNum.setText(WordUtil.getString(R.string.guard_guard) + "(" + mLiveGuardInfo.getGuardNum() + ")"); + mGuardNum.setText(mContext.getString(R.string.guard_guard) + "(" + mLiveGuardInfo.getGuardNum() + ")"); int guardType = mLiveGuardInfo.getMyGuardType(); if (guardType == Constants.GUARD_TYPE_NONE) { mTip.setText(R.string.guard_tip_0); } else if (guardType == Constants.GUARD_TYPE_DAY) { - mTip.setText(WordUtil.getString(R.string.guard_tip_day) + mLiveGuardInfo.getMyGuardEndTime()); + mTip.setText(mContext.getString(R.string.guard_tip_day) + mLiveGuardInfo.getMyGuardEndTime()); mBtnBuy.setText(R.string.guard_buy_3); } else if (guardType == Constants.GUARD_TYPE_MONTH) { - mTip.setText(WordUtil.getString(R.string.guard_tip_1) + mLiveGuardInfo.getMyGuardEndTime()); + mTip.setText(mContext.getString(R.string.guard_tip_1) + mLiveGuardInfo.getMyGuardEndTime()); mBtnBuy.setText(R.string.guard_buy_3); } else if (guardType == Constants.GUARD_TYPE_YEAR) { - mTip.setText(WordUtil.getString(R.string.guard_tip_2) + mLiveGuardInfo.getMyGuardEndTime()); + mTip.setText(mContext.getString(R.string.guard_tip_2) + mLiveGuardInfo.getMyGuardEndTime()); mBtnBuy.setText(R.string.guard_buy_3); } } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java index ee23dd050..3df086e38 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java @@ -169,8 +169,8 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O String danmuPrice = bundle.getString(Constants.LIVE_DANMU_PRICE); String coinName = bundle.getString(Constants.COIN_NAME); mLiveUid = bundle.getString(Constants.LIVE_UID); - mHint1 = WordUtil.getString(R.string.live_open_alba) + danmuPrice + coinName + "/" + WordUtil.getString(R.string.live_tiao); - mHint2 = WordUtil.getString(R.string.live_say_something); + mHint1 =mContext.getString(R.string.live_open_alba) + danmuPrice + coinName + "/" +mContext.getString(R.string.live_tiao); + mHint2 =mContext.getString(R.string.live_say_something); mCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton button, boolean isChecked) { @@ -312,7 +312,7 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O messageType = SendMessageType.POPUPSCREEN; } else { radioButton.setCompoundDrawablesRelativeWithIntrinsicBounds(worldHornP, null, null, null); - mInput.setHint(String.format(WordUtil.getString(R.string.whole_station_horn_hint), trumpetNum)); + mInput.setHint(String.format(mContext.getString(R.string.whole_station_horn_hint), trumpetNum)); messageType = SendMessageType.WORLDHORN; } } else { diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardBuyDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardBuyDialogFragment.java index 1d5fbd961..b84836937 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardBuyDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardBuyDialogFragment.java @@ -1,5 +1,6 @@ package com.yunbao.live.dialog; +import android.annotation.SuppressLint; import android.app.Dialog; import android.os.Bundle; import android.text.Html; @@ -173,10 +174,10 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements mAncherIcon = bundle.getString(Constants.LIVE_ANCHER_ICON); mUserIcon = bundle.getString(Constants.USER_ICON); showBuyView = bundle.getBoolean("showBuyView", true); - String coinName = WordUtil.getString(R.string.diamond); + String coinName =mContext.getString(R.string.diamond); mCoinName = coinName; isEmpty = bundle.getBoolean("guard", true); - // mCoinNameTextView.setText(WordUtil.getString(R.string.guard_my) + coinName + ":"); + // mCoinNameTextView.setText(mContext.getString(R.string.guard_my) + coinName + ":"); mCoinNameTextView.setText(R.string.favoriteanchor); anchorName.setText(String.format(mContext.getString(R.string.theguardianof), mAncherName)); } @@ -193,7 +194,7 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements e.printStackTrace(); } mCoin.setText(String.valueOf(mCoinVal)); - guardCoin2.setText(WordUtil.getString(R.string.guard_my) + mCoinName + ":" + mCoinVal); + guardCoin2.setText(mContext.getString(R.string.guard_my) + mCoinName + ":" + mCoinVal); buyItemsAdapter.setItems(mBuyList); mGuardRightAdapter.setList(mRightList); buyItemsAdapter.notifyDataSetChanged(); @@ -326,7 +327,7 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements } Log.d("ffffff", "" + mLiveGuardInfo.getMyGuardType() + " " + mTargetBuyBean.getType()); if (mLiveGuardInfo.getMyGuardType() == Constants.GUARD_TYPE_MONTH && mTargetBuyBean.getType() == Constants.GUARD_TYPE_DAY) { - DialogUitl.showSimpleTipDialog(mContext, WordUtil.getString(R.string.guard_buy_tip)); + DialogUitl.showSimpleTipDialog(mContext,mContext.getString(R.string.guard_buy_tip)); return; } else if (mLiveGuardInfo.getMyGuardType() == Constants.GUARD_TYPE_YEAR && mTargetBuyBean.getType() == Constants.GUARD_TYPE_DAY) { DialogUitl.showSimpleTipDialog(mContext, "您為當前主播的年守護無法開通周守護"); @@ -337,7 +338,7 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements } else { if (mLiveGuardInfo.getMyGuardType() == Constants.GUARD_TYPE_MONTH && mTargetBuyBean.getType() == Constants.GUARD_TYPE_YEAR) { - DialogUitl.showSimpleDialog(mContext, WordUtil.getString(R.string.guard_buy_tip_2), new DialogUitl.SimpleCallback() { + DialogUitl.showSimpleDialog(mContext,mContext.getString(R.string.guard_buy_tip_2), new DialogUitl.SimpleCallback() { @Override public void onConfirmClick(Dialog dialog, String content) { doBuyGuard(); @@ -418,7 +419,7 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements bean = datum; } } - String str = String.format(WordUtil.getString(R.string.live_use_discount_content), + String str = String.format(mContext.getString(R.string.live_use_discount_content), bean.getName(), "###",//占位符 "###" @@ -435,9 +436,9 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements Dialog dialog = new DialogUitl.Builder(mContext) .setHtmlCode(content) .setView(R.layout.dialog_live_random_pk) - .setTitle(WordUtil.getString(R.string.dialog_tip)) - .setCancelString(WordUtil.getString(R.string.live_use_discount_no)) - .setConfrimString(WordUtil.getString(R.string.live_use_discount_yes)) + .setTitle(mContext.getString(R.string.dialog_tip)) + .setCancelString(mContext.getString(R.string.live_use_discount_no)) + .setConfrimString(mContext.getString(R.string.live_use_discount_yes)) .setClickCallback(new DialogUitl.SimpleCallback2() { @Override public void onCancelClick() { @@ -463,7 +464,7 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements private void buy() { DialogUitl.showSimpleDialog(mContext, - String.format(WordUtil.getString(R.string.guard_buy_tip_3), mTargetBuyBean.getCoin(), mCoinName, mTargetBuyBean.getShopName()), + String.format(mContext.getString(R.string.guard_buy_tip_3), mTargetBuyBean.getCoin(), mCoinName, mTargetBuyBean.getShopName(getContext())), new DialogUitl.SimpleCallback() { @Override diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardListDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardListDialogFragment.java index cd2c35fae..1f96fd9e3 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardListDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardListDialogFragment.java @@ -194,7 +194,7 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements ImgLoader.display(mContext, bean.getAvatar(), guardIcon); guardIcon.setVisibility(View.VISIBLE); userName.setText(bean.getUserNiceName()); - String guardString = WordUtil.getString(R.string.guard_week_con); + String guardString = mContext.getString(R.string.guard_week_con); userGuard.setText(guardString + " " + bean.getContribute()); userSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex())); LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel()); @@ -207,13 +207,13 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements if (guardType == Constants.GUARD_TYPE_NONE) { tip1.setText(R.string.guard_tip_0); } else if (guardType == Constants.GUARD_TYPE_DAY) { - tip1.setText(WordUtil.getString(R.string.guard_tip_day) + mLiveGuardInfo.getMyGuardEndTime()); + tip1.setText(mContext.getString(R.string.guard_tip_day) + mLiveGuardInfo.getMyGuardEndTime()); mBtnBuy.setText(R.string.guard_buy_3); } else if (guardType == Constants.GUARD_TYPE_MONTH) { - tip1.setText(WordUtil.getString(R.string.guard_tip_1) + mLiveGuardInfo.getMyGuardEndTime()); + tip1.setText(mContext.getString(R.string.guard_tip_1) + mLiveGuardInfo.getMyGuardEndTime()); mBtnBuy.setText(R.string.guard_buy_3); } else if (guardType == Constants.GUARD_TYPE_YEAR) { - tip1.setText(WordUtil.getString(R.string.guard_tip_2) + mLiveGuardInfo.getMyGuardEndTime()); + tip1.setText(mContext.getString(R.string.guard_tip_2) + mLiveGuardInfo.getMyGuardEndTime()); mBtnBuy.setText(R.string.guard_buy_3); } } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveNewRoomTypeDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveNewRoomTypeDialogFragment.java index 946af6304..db5fe016a 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveNewRoomTypeDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveNewRoomTypeDialogFragment.java @@ -81,7 +81,7 @@ public class LiveNewRoomTypeDialogFragment extends AbsDialogFragment implements pwd.setOnClickListener(view -> select(false)); submit.setOnClickListener(view -> { if (isSelectPublic) { - LiveRoomTypeBean bean = new LiveRoomTypeBean(0, WordUtil.getString(R.string.live_room_public)); + LiveRoomTypeBean bean = new LiveRoomTypeBean(0,mContext.getString(R.string.live_room_public)); if(mCallback!=null) { mCallback.callback(bean); } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveOldUserDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveOldUserDialogFragment.java index 2407a5453..888e88cd7 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveOldUserDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveOldUserDialogFragment.java @@ -455,14 +455,14 @@ public class LiveOldUserDialogFragment extends AbsDialogFragment implements View mFans.setText(new LiveTextRender().renderLiveUserDialogData(obj.getLongValue("fans"))); mConsume.setText(new LiveTextRender().renderLiveUserDialogData(obj.getLongValue("consumption"))); mVotes.setText(new LiveTextRender().renderLiveUserDialogData(obj.getLongValue("votestotal"))); - mConsumeTip.setText(WordUtil.getString(R.string.live_user_send) + appConfig.getCoinName()); - mVotesTip.setText(WordUtil.getString(R.string.live_user_get) + appConfig.getVotesName()); + mConsumeTip.setText(mContext.getString(R.string.live_user_send) + appConfig.getCoinName()); + mVotesTip.setText(mContext.getString(R.string.live_user_get) + appConfig.getVotesName()); if (mType == TYPE_AUD_ANC) { showImpress(obj.getString("label")); } mFollowing = obj.getIntValue("isattention") == 1; if (mFollowText != null) { - mFollowText.setText(mFollowing ? WordUtil.getString(R.string.following) : WordUtil.getString(R.string.follow)); + mFollowText.setText(mFollowing ?mContext.getString(R.string.following) :mContext.getString(R.string.follow)); } if (mFollowImage != null) { mFollowImage.setImageDrawable(mFollowing ? mFollowDrawable : mUnFollowDrawable); @@ -575,7 +575,7 @@ public class LiveOldUserDialogFragment extends AbsDialogFragment implements View } if (isAttention == 1 && mLiveUid.equals(mToUid)) {//关注了主播 ((LiveActivity) mContext).sendSystemMessage( - CommonAppConfig.getInstance().getUserBean().getUserNiceName() + WordUtil.getString(R.string.live_follow_anchor)); + CommonAppConfig.getInstance().getUserBean().getUserNiceName() +mContext.getString(R.string.live_follow_anchor)); } } }; diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveRedPackListDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveRedPackListDialogFragment.java index 2b3c39536..8940050ea 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveRedPackListDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveRedPackListDialogFragment.java @@ -89,7 +89,7 @@ public class LiveRedPackListDialogFragment extends AbsDialogFragment implements mRedPackAdapter = new RedPackAdapter(mContext, list); mRedPackAdapter.setOnItemClickListener(LiveRedPackListDialogFragment.this); mRecyclerView.setAdapter(mRedPackAdapter); - mCount.setText(String.format(WordUtil.getString(R.string.red_pack_9), String.valueOf(list.size()))); + mCount.setText(String.format(mContext.getString(R.string.red_pack_9), String.valueOf(list.size()))); } else { ToastUtil.show(msg); } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveRedPackResultDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveRedPackResultDialogFragment.java index fdf446446..8a23d8820 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveRedPackResultDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveRedPackResultDialogFragment.java @@ -110,10 +110,10 @@ public class LiveRedPackResultDialogFragment extends AbsDialogFragment { ImgLoader.displayAvatar(mContext,redPackInfo.getString("avatar"), mAvatar); } if (mName != null) { - mName.setText(String.format(WordUtil.getString(R.string.red_pack_17), redPackInfo.getString("user_nicename"))); + mName.setText(String.format(mContext.getString(R.string.red_pack_17), redPackInfo.getString("user_nicename"))); } if (mNum != null) { - mNum.setText(String.format(WordUtil.getString(R.string.red_pack_19), + mNum.setText(String.format(mContext.getString(R.string.red_pack_19), redPackInfo.getString("nums_rob") + "/" + redPackInfo.getString("nums"), redPackInfo.getString("coin_rob") + "/" + redPackInfo.getString("coin"), mCoinName)); @@ -132,7 +132,7 @@ public class LiveRedPackResultDialogFragment extends AbsDialogFragment { mWinCoin.setText(winCoinVal); } if (mCoinNameTextView != null) { - mCoinNameTextView.setText(String.format(WordUtil.getString(R.string.red_pack_18), mCoinName)); + mCoinNameTextView.setText(String.format(mContext.getString(R.string.red_pack_18), mCoinName)); } } if (mRecyclerView != null) { diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveRedPackRobDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveRedPackRobDialogFragment.java index 8b8cf74c9..91599c4b1 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveRedPackRobDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveRedPackRobDialogFragment.java @@ -208,7 +208,7 @@ public class LiveRedPackRobDialogFragment extends AbsDialogFragment implements V mWinCoin.setText(winCoin); } if (mWinTip != null) { - mWinTip.setText(String.format(WordUtil.getString(R.string.red_pack_16), mRedPackBean.getUserNiceName(), mCoinName)); + mWinTip.setText(String.format(mContext.getString(R.string.red_pack_16), mRedPackBean.getUserNiceName(), mCoinName)); } } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveRedPackSendDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveRedPackSendDialogFragment.java index 56d6d0537..8f05ee19f 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveRedPackSendDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveRedPackSendDialogFragment.java @@ -87,7 +87,7 @@ public class LiveRedPackSendDialogFragment extends AbsDialogFragment implements if (TextUtils.isEmpty(mStream)) { return; } - mSendRedPackString = WordUtil.getString(R.string.red_pack_6) + " "; + mSendRedPackString =mContext.getString(R.string.red_pack_6) + " "; mCoinName1 = mRootView.findViewById(R.id.coin_name_1); mCoinName2 = mRootView.findViewById(R.id.coin_name_2); mCoinName = CommonAppConfig.getInstance().getCoinName(); diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveTaskDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveTaskDialog.java index d09fba828..8f94745d8 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveTaskDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveTaskDialog.java @@ -243,11 +243,11 @@ public class LiveTaskDialog extends AbsDialogPopupWindow { LiveTaskModel.Task task = new LiveTaskModel.Task(); LiveTaskModel.Task task2 = new LiveTaskModel.Task(); if (type == 1) { - task.setTaskName(WordUtil.getString(R.string.live_task_no1)); - task2.setTaskName(WordUtil.getString(R.string.live_task_no2)); + task.setTaskName(getContext().getString(R.string.live_task_no1)); + task2.setTaskName(getContext().getString(R.string.live_task_no2)); } else { - task.setTaskName(WordUtil.getString(R.string.live_task_fans_no1)); - task2.setTaskName(WordUtil.getString(R.string.live_task_fans_no2)); + task.setTaskName(getContext().getString(R.string.live_task_fans_no1)); + task2.setTaskName(getContext().getString(R.string.live_task_fans_no2)); } task.setType(LiveTaskModel.TASK_TYPE_TIP); task2.setType(LiveTaskModel.TASK_TYPE_TIP); diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveUserAnchorMailBoxWebInfoPopDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveUserAnchorMailBoxWebInfoPopDialog.java index 4543e2f9b..778db921d 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveUserAnchorMailBoxWebInfoPopDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveUserAnchorMailBoxWebInfoPopDialog.java @@ -62,7 +62,7 @@ public class LiveUserAnchorMailBoxWebInfoPopDialog extends AbsDialogPopupWindow Bus.getOn(this); mWebView = findViewById(R.id.webView); textView = findViewById(R.id.title); - textView.setText(String.format(WordUtil.getString(R.string.live_user_mailbox_web_title), anchorName)); + textView.setText(String.format(getContext().getString(R.string.live_user_mailbox_web_title), anchorName)); mWebView.addJavascriptInterface(JavascriptInterfaceUtils.getInstance() .setDialogClose(true) .setmContext(CommonAppContext.getTopActivity(), mWebView), "androidObject"); diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java index 1f634108a..e91e38c26 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java @@ -412,8 +412,8 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On mNoble.setVisibility(View.GONE); } mGuard.setText(String.format(mGuard.getText().toString(), obj.getInteger("guard_num"))); - mFansVal.setText(WordUtil.getString(R.string.fans) + ":" + mUserBean.getFans()); - mPraise.setText(WordUtil.getString(R.string.praise) + ":" + obj.getInteger("user_love_num")); + mFansVal.setText(mContext.getString(R.string.fans) + ":" + mUserBean.getFans()); + mPraise.setText(mContext.getString(R.string.praise) + ":" + obj.getInteger("user_love_num")); mSignDesc.setText(mUserBean.getSignature()); if (isAnchor) { mNobleVal.setText("" + obj.getInteger("level_fans_num")); @@ -533,9 +533,9 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On private void setAttention() { if (mFollowing) { DialogUitl.Builder builder = new DialogUitl.Builder(mContext) - .setContent(WordUtil.getString(R.string.unfollow)) - .setConfrimString(WordUtil.getString(R.string.unfollow_confrim)) - .setCancelString(WordUtil.getString(R.string.unfollow_cancel)) + .setContent(mContext.getString(R.string.unfollow)) + .setConfrimString(mContext.getString(R.string.unfollow_confrim)) + .setCancelString(mContext.getString(R.string.unfollow_cancel)) .setView(R.layout.dialog_live_unfollow) .setClickCallback3(new DialogUitl.SimpleCallback3() { @@ -565,7 +565,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On updateFollow(); if (isAttention == 1 && mLiveUid.equals(mToUid)) {//关注了主播 ((LiveActivity) mContext).sendSystemMessage( - CommonAppConfig.getInstance().getUserBean().getUserNiceName() + WordUtil.getString(R.string.live_follow_anchor)); + CommonAppConfig.getInstance().getUserBean().getUserNiceName() +mContext.getString(R.string.live_follow_anchor)); } } }); diff --git a/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java index 021e83403..2059c2917 100644 --- a/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java @@ -46,7 +46,7 @@ public class RandomPkDialogFragment extends AbsDialogFragment implements View.On return; } Log.i(TAG, "onTimer: " + time); - mPkBtnTitle.setText(String.format(WordUtil.getString(R.string.random_pk_info_btn_ing), time)); + mPkBtnTitle.setText(String.format(mContext.getString(R.string.random_pk_info_btn_ing), time)); mPkBtnDesc.setText(R.string.random_pk_info_btn_end_desc); mPkBtnDesc.setVisibility(View.VISIBLE); mPkBtn.setBackgroundResource(R.drawable.bg_live_room_random_pk_timer); @@ -72,7 +72,7 @@ public class RandomPkDialogFragment extends AbsDialogFragment implements View.On @Override public void onPkEndTimer(String time) { super.onPkEndTimer(time); - mPkBtnTitle.setText(String.format(WordUtil.getString(R.string.random_pk_info_btn_end), time)); + mPkBtnTitle.setText(String.format(mContext.getString(R.string.random_pk_info_btn_end), time)); mPkBtnDesc.setText(R.string.random_pk_info_btn_end_desc); mPkBtn.setEnabled(false); } @@ -152,12 +152,12 @@ public class RandomPkDialogFragment extends AbsDialogFragment implements View.On RandomPkManager.getInstance().addOnRandomPkTimer(randomPkTimer); initPkSwitch(); if (RandomPkManager.getInstance().isRequestPk()) { - mPkBtnTitle.setText(String.format(WordUtil.getString(R.string.random_pk_info_btn_ing), RandomPkManager.getInstance().getTimer())); + mPkBtnTitle.setText(String.format(mContext.getString(R.string.random_pk_info_btn_ing), RandomPkManager.getInstance().getTimer())); mPkBtnDesc.setText(R.string.random_pk_info_btn_end_desc); mPkBtnDesc.setVisibility(View.VISIBLE); mPkBtn.setBackgroundResource(R.drawable.bg_live_room_random_pk_timer); } else if (RandomPkManager.getInstance().isExiting()) { - mPkBtnTitle.setText(String.format(WordUtil.getString(R.string.random_pk_info_btn_end), RandomPkManager.getInstance().getExitTimer())); + mPkBtnTitle.setText(String.format(mContext.getString(R.string.random_pk_info_btn_end), RandomPkManager.getInstance().getExitTimer())); mPkBtnDesc.setText(R.string.random_pk_info_btn_end_desc); mPkBtn.setEnabled(false); } diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java index fb2b2ea0c..4b31c8926 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java @@ -933,7 +933,7 @@ public class LiveGiftAnimPresenter { } String text = mTempGifGiftBean.getUserNiceName() + " " - + WordUtil.getString(R.string.live_send_buy_zuoji_1) + +mContext.getString(R.string.live_send_buy_zuoji_1) + " " + (mTempGifGiftBean.getCarName()); Spanned spanned = Html.fromHtml(text, null, new HtmlTagHandler("myfont")); mGifGiftTipBuyZuoji.setText(spanned); @@ -974,7 +974,7 @@ public class LiveGiftAnimPresenter { } String text = mTempGifGiftBean.getUserNiceName() + " " - + WordUtil.getString(R.string.live_send_buy_liang_name_1) + +mContext.getString(R.string.live_send_buy_liang_name_1) + " " + mTempGifGiftBean.getLiangName(); Spanned spanned = Html.fromHtml(text, null, new HtmlTagHandler("myfont")); mGifGiftTipBuyLiangName.setText(spanned); @@ -1622,7 +1622,7 @@ public class LiveGiftAnimPresenter { }); } - mPrizePoolLevel.setText(String.format(WordUtil.getString(R.string.live_gift_prize_pool_3), level)); + mPrizePoolLevel.setText(String.format(mContext.getString(R.string.live_gift_prize_pool_3), level)); mPrizePoolGuang.startAnimation(mPrizePoolGuangAnim); } diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicAnchorPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicAnchorPresenter.java index e32a32c7d..83fa3fc26 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicAnchorPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicAnchorPresenter.java @@ -85,7 +85,7 @@ public class LiveLinkMicAnchorPresenter implements View.OnClickListener { mPkContainer = linkMicViewHolder.getPkContainer(); - mLinkMicWaitString = WordUtil.getString(R.string.link_mic_wait); + mLinkMicWaitString =mContext.getString(R.string.link_mic_wait); mHandler = new Handler() { @Override public void handleMessage(Message msg) { @@ -280,7 +280,7 @@ public class LiveLinkMicAnchorPresenter implements View.OnClickListener { */ private void acceptLinkMic() { if (((LiveAnchorActivity) mContext).isBgmPlaying()) { - DialogUitl.showSimpleDialog(mContext, WordUtil.getString(R.string.link_mic_close_bgm), new DialogUitl.SimpleCallback() { + DialogUitl.showSimpleDialog(mContext,mContext.getString(R.string.link_mic_close_bgm), new DialogUitl.SimpleCallback() { @Override public void onConfirmClick(Dialog dialog, String content) { ((LiveAnchorActivity) mContext).stopBgm(); @@ -494,7 +494,7 @@ public class LiveLinkMicAnchorPresenter implements View.OnClickListener { */ public void onlinkMicPlayGaming() { mLastApplyLinkMicTime = 0; - DialogUitl.showSimpleTipDialog(mContext, WordUtil.getString(R.string.link_mic_play_game)); + DialogUitl.showSimpleTipDialog(mContext,mContext.getString(R.string.link_mic_play_game)); } public void setLiveSdk(int mLiveSDK) { diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicPkPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicPkPresenter.java index 449bb0a38..61409af18 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicPkPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicPkPresenter.java @@ -111,7 +111,7 @@ public class LiveLinkMicPkPresenter implements View.OnClickListener { mIsAnchor = isAnchor; mRoot = root; mPkContainer = linkMicViewHolder.getPkContainer(); - mPkTimeString2 = WordUtil.getString(R.string.live_pk_time_2); + mPkTimeString2 =mContext.getString(R.string.live_pk_time_2); //从本地取数据 String pkTime = CommonAppConfig.getInstance().getAnchorPkTime(); diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicPresenter.java index adab13ca6..78572c7d9 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicPresenter.java @@ -184,7 +184,7 @@ public class LiveLinkMicPresenter implements View.OnClickListener { mLinkMicTip = btnLinkMic.findViewById(R.id.link_mic_tip); } - mLinkMicWaitString = WordUtil.getString(R.string.link_mic_wait); + mLinkMicWaitString =mContext.getString(R.string.link_mic_wait); mHandler = new Handler() { @Override public void handleMessage(Message msg) { @@ -284,7 +284,7 @@ public class LiveLinkMicPresenter implements View.OnClickListener { @Override public void onPushFailed() {//推流失败的回调 - DialogUitl.showSimpleDialog(mContext, WordUtil.getString(R.string.link_mic_failed_2), null); + DialogUitl.showSimpleDialog(mContext,mContext.getString(R.string.link_mic_failed_2), null); SocketLinkMicUtil.audienceCloseLinkMic(mSocketClient); } }); @@ -363,7 +363,7 @@ public class LiveLinkMicPresenter implements View.OnClickListener { */ private void closeLinkMic(String uid, String uname) { if (!TextUtils.isEmpty(uid) && uid.equals(mLinkMicUid)) { - ToastUtil.show(uname + WordUtil.getString(R.string.link_mic_exit)); + ToastUtil.show(uname +mContext.getString(R.string.link_mic_exit)); if (!mIsAnchor && !TextUtils.isEmpty(mLinkMicUid) && mLinkMicUid.equals(CommonAppConfig.getInstance().getUid())) {//参与连麦的是自己 if (mLiveLinkMicPushViewHolder != null) { mLiveLinkMicPushViewHolder.release(); @@ -682,7 +682,7 @@ public class LiveLinkMicPresenter implements View.OnClickListener { */ private void anchorAcceptLinkMicApply() { if (((LiveAnchorActivity) mContext).isBgmPlaying()) { - DialogUitl.showSimpleDialog(mContext, WordUtil.getString(R.string.link_mic_close_bgm), new DialogUitl.SimpleCallback() { + DialogUitl.showSimpleDialog(mContext,mContext.getString(R.string.link_mic_close_bgm), new DialogUitl.SimpleCallback() { @Override public void onConfirmClick(Dialog dialog, String content) { ((LiveAnchorActivity) mContext).stopBgm(); diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveRoomCheckLivePresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveRoomCheckLivePresenter.java index 3a2cebade..ce2690916 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveRoomCheckLivePresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveRoomCheckLivePresenter.java @@ -60,7 +60,7 @@ public class LiveRoomCheckLivePresenter { @Override public void forwardPwdRoom(CheckLiveModel model) { - DialogUitl.showSimpleInputDialog(context, WordUtil.getString(R.string.live_input_password), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, new DialogUitl.SimpleCallback2() { + DialogUitl.showSimpleInputDialog(context,mContext.getString(R.string.live_input_password), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, new DialogUitl.SimpleCallback2() { @Override public void onCancelClick() { if (mContext instanceof Activity) { @@ -71,7 +71,7 @@ public class LiveRoomCheckLivePresenter { @Override public void onConfirmClick(Dialog dialog, String content) { if (TextUtils.isEmpty(content)) { - ToastUtil.show(WordUtil.getString(R.string.live_input_password)); + ToastUtil.show(mContext.getString(R.string.live_input_password)); return; } String password = MD5Util.getMD5(content); @@ -81,7 +81,7 @@ public class LiveRoomCheckLivePresenter { actionListener.onLiveRoomChanged(liveUid, stream, model.getType(), model.getTypeVal(), model.getLiveSdk()); } } else { - ToastUtil.show(WordUtil.getString(R.string.live_password_error)); + ToastUtil.show(mContext.getString(R.string.live_password_error)); } } }); @@ -190,7 +190,7 @@ public class LiveRoomCheckLivePresenter { * 前往密码房间 */ private void forwardPwdRoom() { - DialogUitl.showSimpleInputDialog(mContext, WordUtil.getString(R.string.live_input_password), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, new DialogUitl.SimpleCallback2() { + DialogUitl.showSimpleInputDialog(mContext,mContext.getString(R.string.live_input_password), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, new DialogUitl.SimpleCallback2() { @Override public void onCancelClick() { if (mContext instanceof Activity) { @@ -201,7 +201,7 @@ public class LiveRoomCheckLivePresenter { @Override public void onConfirmClick(Dialog dialog, String content) { if (TextUtils.isEmpty(content)) { - ToastUtil.show(WordUtil.getString(R.string.live_input_password)); + ToastUtil.show(mContext.getString(R.string.live_input_password)); return; } String password = MD5Util.getMD5(content); @@ -209,7 +209,7 @@ public class LiveRoomCheckLivePresenter { dialog.dismiss(); enterLiveRoom(); } else { - ToastUtil.show(WordUtil.getString(R.string.live_password_error)); + ToastUtil.show(mContext.getString(R.string.live_password_error)); } } }); diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java index a1fed92aa..61c3e5d06 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java @@ -213,7 +213,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { mRoot = root; mPkContainer = linkMicViewHolder.getPkContainer(); mPkTimeString1 = ""; - mPkTimeString2 = WordUtil.getString(R.string.live_pk_time_2); + mPkTimeString2 =mContext.getString(R.string.live_pk_time_2); //从本地取数据 String pkTime = CommonAppConfig.getInstance().getAnchorPkTime(); if (!pkTime.isEmpty()) { @@ -254,7 +254,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { mPkContainer = linkMicViewHolder.getPkContainer(); livePushRyViewHolder = linkMicViewHolder; mPkTimeString1 = ""; - mPkTimeString2 = WordUtil.getString(R.string.live_pk_time_2); + mPkTimeString2 =mContext.getString(R.string.live_pk_time_2); //从本地取数据 String pkTime = CommonAppConfig.getInstance().getAnchorPkTime(); if (!pkTime.isEmpty()) { diff --git a/live/src/main/java/com/yunbao/live/presenter/UserHomeSharePresenter.java b/live/src/main/java/com/yunbao/live/presenter/UserHomeSharePresenter.java index 2bb6b5760..a132baac5 100644 --- a/live/src/main/java/com/yunbao/live/presenter/UserHomeSharePresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/UserHomeSharePresenter.java @@ -71,9 +71,9 @@ public class UserHomeSharePresenter { return; } // ShareData data = new ShareData(); -// String title = String.format(WordUtil.getString(R.string.home_page_share_1), mToName, WordUtil.getString(R.string.app_name)); +// String title = String.format(mContext.getString(R.string.home_page_share_1), mToName,mContext.getString(R.string.app_name)); // data.setTitle(title); -// String des = String.format(WordUtil.getString(R.string.home_page_share_2), mFansNum); +// String des = String.format(mContext.getString(R.string.home_page_share_2), mFansNum); // data.setDes(des); // data.setImgUrl(mToAvatarThumb); // String webUrl = HtmlConfig.SHARE_HOME_PAGE + mToUid; diff --git a/live/src/main/java/com/yunbao/live/socket/SocketChatUtil.java b/live/src/main/java/com/yunbao/live/socket/SocketChatUtil.java index c7990935d..c78c0d62a 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketChatUtil.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketChatUtil.java @@ -146,7 +146,7 @@ public class SocketChatUtil { .param("medal_name", u.getMedalName()) .param("medal_level", u.getMedalLevel()) .param("good_num", u.getGoodnum()) - .param("ct", WordUtil.getString(R.string.live_lighted)); + .param("ct",WordUtil.getString(R.string.live_lighted)); msg.create(); V2TIMManager.getInstance().sendGroupTextMessage(msg.mResult.toString(), "g" + mLiveUid, V2TIMMessage.V2TIM_PRIORITY_NORMAL, new V2TIMSendCallback() { @Override @@ -321,7 +321,7 @@ public class SocketChatUtil { .param("uid", u.getId()) .param("touid", toUid) .param("toname", toName) - .param("ct", toName + WordUtil.getString(R.string.live_kicked)); + .param("ct", toName +WordUtil.getString(R.string.live_kicked)); msg.create(); V2TIMManager.getInstance().sendGroupTextMessage(msg.mResult.toString(), "g" + mLiveUid, V2TIMMessage.V2TIM_PRIORITY_NORMAL, new V2TIMSendCallback() { @Override @@ -364,7 +364,7 @@ public class SocketChatUtil { .param("uid", u.getId()) .param("touid", toUid) .param("toname", toName) - .param("ct", toName + WordUtil.getString(type == 0 ? R.string.live_shut : R.string.live_shut_2)); + .param("ct", toName +WordUtil.getString(type == 0 ? R.string.live_shut : R.string.live_shut_2)); msg.create(); V2TIMManager.getInstance().sendGroupTextMessage(msg.mResult.toString(), "g" + mLiveUid, V2TIMMessage.V2TIM_PRIORITY_NORMAL, new V2TIMSendCallback() { @Override @@ -396,7 +396,7 @@ public class SocketChatUtil { if (u == null) { return; } - String s = action == 1 ? WordUtil.getString(R.string.live_set_admin) : WordUtil.getString(R.string.live_set_admin_cancel); + String s = action == 1 ?WordUtil.getString(R.string.live_set_admin) :WordUtil.getString(R.string.live_set_admin_cancel); final SocketSendBean msg = new SocketSendBean() .param("_method_", Constants.SOCKET_SET_ADMIN) .param("action", action) @@ -644,7 +644,7 @@ public class SocketChatUtil { .param("msgtype", 0) .param("uid", u.getId()) .param("uname", u.getUserNiceName()) - .param("ct", WordUtil.getString(R.string.red_pack_22) + .param("ct",WordUtil.getString(R.string.red_pack_22) ); msg.create(); V2TIMManager.getInstance().sendGroupTextMessage(msg.mResult.toString(), "g" + mLiveUid, V2TIMMessage.V2TIM_PRIORITY_NORMAL, new V2TIMSendCallback() { diff --git a/live/src/main/java/com/yunbao/live/socket/SocketClient.java b/live/src/main/java/com/yunbao/live/socket/SocketClient.java index f7933e897..d23b3e297 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketClient.java @@ -258,7 +258,7 @@ public class SocketClient { LiveChatBean liveChatBean = new LiveChatBean(); liveChatBean.setType(LiveChatBean.RED_PACK); liveChatBean.setId(uid); - String name = uid.equals(mLiveUid) ? WordUtil.getString(R.string.live_anchor) : map.getString("uname"); + String name = uid.equals(mLiveUid) ?WordUtil.getString(R.string.live_anchor) : map.getString("uname"); liveChatBean.setContent(name + map.getString("ct")); mListener.onRedPack(liveChatBean); break; @@ -545,9 +545,9 @@ public class SocketClient { //聊天列表显示 玩家名 送 1 个 礼物名 if (CommonAppContext.lang.equals("chinese")) { - chatBean.setContent(WordUtil.getString(R.string.live_send_gift_1) + receiveGiftBean.getGiftCount() + WordUtil.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftName()); + chatBean.setContent(WordUtil.getString(R.string.live_send_gift_1) + receiveGiftBean.getGiftCount() +WordUtil.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftName()); } else { - chatBean.setContent(WordUtil.getString(R.string.live_send_gift_1) + " " + +receiveGiftBean.getGiftCount() + " " + WordUtil.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftnameen()); + chatBean.setContent(WordUtil.getString(R.string.live_send_gift_1) + " " + +receiveGiftBean.getGiftCount() + " " +WordUtil.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftnameen()); } @@ -612,9 +612,9 @@ public class SocketClient { chatBean.setGuardType(map.getInteger("guard_type")); } if (CommonAppContext.lang.equals("chinese")) { - chatBean.setContent(WordUtil.getString(R.string.live_send_gift_1) + receiveGiftBean.getGiftCount() + WordUtil.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftName()); + chatBean.setContent(WordUtil.getString(R.string.live_send_gift_1) + receiveGiftBean.getGiftCount() +WordUtil.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftName()); } else { - chatBean.setContent(WordUtil.getString(R.string.live_send_gift_1) + " " + +receiveGiftBean.getGiftCount() + " " + WordUtil.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftnameen()); + chatBean.setContent(WordUtil.getString(R.string.live_send_gift_1) + " " + +receiveGiftBean.getGiftCount() + " " +WordUtil.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftnameen()); } //增加粉丝徽章信息 diff --git a/live/src/main/java/com/yunbao/live/socket/SocketRyChatUtil.java b/live/src/main/java/com/yunbao/live/socket/SocketRyChatUtil.java index 17a1df676..25a3d2635 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyChatUtil.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyChatUtil.java @@ -165,7 +165,7 @@ public class SocketRyChatUtil { .param("medal_name", u.getMedalName()) .param("medal_level", u.getMedalLevel()) .param("good_num", u.getGoodnum()) - .param("ct", WordUtil.getString(R.string.live_lighted)); + .param("ct",WordUtil.getString(R.string.live_lighted)); msg.create(); String targetId = "g" + mLiveUid; Conversation.ConversationType conversationType = Conversation.ConversationType.CHATROOM; @@ -356,7 +356,7 @@ public class SocketRyChatUtil { .param("uid", u.getId()) .param("touid", toUid) .param("toname", toName) - .param("ct", toName + WordUtil.getString(R.string.live_kicked)); + .param("ct", toName +WordUtil.getString(R.string.live_kicked)); msg.create(); String targetId = "g" + mLiveUid; Conversation.ConversationType conversationType = Conversation.ConversationType.CHATROOM; @@ -403,7 +403,7 @@ public class SocketRyChatUtil { .param("uid", u.getId()) .param("touid", toUid) .param("toname", toName) - .param("ct", toName + WordUtil.getString(type == 0 ? R.string.live_shut : R.string.live_shut_2)); + .param("ct", toName +WordUtil.getString(type == 0 ? R.string.live_shut : R.string.live_shut_2)); msg.create(); String targetId = "g" + mLiveUid; Conversation.ConversationType conversationType = Conversation.ConversationType.CHATROOM; @@ -440,7 +440,7 @@ public class SocketRyChatUtil { if (u == null) { return; } - String s = action == 1 ? WordUtil.getString(R.string.live_set_admin) : WordUtil.getString(R.string.live_set_admin_cancel); + String s = action == 1 ?WordUtil.getString(R.string.live_set_admin) :WordUtil.getString(R.string.live_set_admin_cancel); final SocketSendBean msg = new SocketSendBean() .param("_method_", Constants.SOCKET_SET_ADMIN) .param("action", action) @@ -710,7 +710,7 @@ public class SocketRyChatUtil { .param("msgtype", 0) .param("uid", u.getId()) .param("uname", u.getUserNiceName()) - .param("ct", WordUtil.getString(R.string.red_pack_22) + .param("ct",WordUtil.getString(R.string.red_pack_22) ); msg.create(); String targetId = "g" + mLiveUid; diff --git a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java index 0d0ecdf50..67a9268f0 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java @@ -428,7 +428,7 @@ public class SocketRyClient { LiveChatBean liveChatBean = new LiveChatBean(); liveChatBean.setType(LiveChatBean.RED_PACK); liveChatBean.setId(uid); - String name = uid.equals(mLiveUid) ? WordUtil.getString(R.string.live_anchor) : map.getString("uname"); + String name = uid.equals(mLiveUid) ?WordUtil.getString(R.string.live_anchor) : map.getString("uname"); liveChatBean.setContent(name + map.getString("ct")); mListener.onRedPack(liveChatBean); break; @@ -864,9 +864,9 @@ public class SocketRyClient { //聊天列表显示 玩家名 送 1 个 礼物名 if (CommonAppContext.lang.equals("chinese")) { - chatBean.setContent(WordUtil.getString(R.string.live_send_gift_1) + receiveGiftBean.getGiftCount() + WordUtil.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftName()); + chatBean.setContent(WordUtil.getString(R.string.live_send_gift_1) + receiveGiftBean.getGiftCount() +WordUtil.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftName()); } else { - chatBean.setContent(WordUtil.getString(R.string.live_send_gift_1) + " " + +receiveGiftBean.getGiftCount() + " " + WordUtil.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftnameen()); + chatBean.setContent(WordUtil.getString(R.string.live_send_gift_1) + " " + +receiveGiftBean.getGiftCount() + " " +WordUtil.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftnameen()); } receiveGiftBean.setLiveChatBean(chatBean); @@ -927,9 +927,9 @@ public class SocketRyClient { chatBean.setGuardType(map.getInteger("guard_type")); } if (CommonAppContext.lang.equals("chinese")) { - chatBean.setContent(WordUtil.getString(R.string.live_send_gift_1) + receiveGiftBean.getGiftCount() + WordUtil.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftName()); + chatBean.setContent(WordUtil.getString(R.string.live_send_gift_1) + receiveGiftBean.getGiftCount() +WordUtil.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftName()); } else { - chatBean.setContent(WordUtil.getString(R.string.live_send_gift_1) + " " + +receiveGiftBean.getGiftCount() + " " + WordUtil.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftnameen()); + chatBean.setContent(WordUtil.getString(R.string.live_send_gift_1) + " " + +receiveGiftBean.getGiftCount() + " " +WordUtil.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftnameen()); } mListener.onSendGift(receiveGiftBean); @@ -967,9 +967,9 @@ public class SocketRyClient { chatBean.setGuardType(map.getInteger("guard_type")); } if (CommonAppContext.lang.equals("chinese")) { - chatBean.setContent(WordUtil.getString(R.string.live_send_gift_1) + receiveGiftBean.getGiftCount() + WordUtil.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftName()); + chatBean.setContent(WordUtil.getString(R.string.live_send_gift_1) + receiveGiftBean.getGiftCount() +WordUtil.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftName()); } else { - chatBean.setContent(WordUtil.getString(R.string.live_send_gift_1) + " " + +receiveGiftBean.getGiftCount() + " " + WordUtil.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftnameen()); + chatBean.setContent(WordUtil.getString(R.string.live_send_gift_1) + " " + +receiveGiftBean.getGiftCount() + " " +WordUtil.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftnameen()); } //增加粉丝徽章信息 diff --git a/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java b/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java index 084c357ab..8dd1edea5 100644 --- a/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java +++ b/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java @@ -147,7 +147,7 @@ public class LiveTextRender { * 幸运天使 */ public void luckyAngel(Context mContext, TextView mTextView, MsgModel msgModel) { - String msg = mContext.getString(R.string.lucky_angel); + String msg = WordUtil.getString(R.string.lucky_angel); msg = String.format(msg, msgModel.getUserName(), msgModel.getGiftName()); int unameIndexOf = msg.indexOf(msgModel.getUserName()); int giftIndexOf = msg.indexOf(msgModel.getGiftName()); @@ -164,7 +164,7 @@ public class LiveTextRender { * 幸运100%活动 */ public void lucky100(Context mContext, TextView mTextView, MsgModel msgModel) { - String msg = mContext.getString(R.string.lucky_100); + String msg = WordUtil.getString(R.string.lucky_100); msg = String.format(msg, msgModel.getUserName(), msgModel.getGiftName()); int unameIndexOf = msg.indexOf(msgModel.getUserName()); int giftIndexOf = msg.indexOf(msgModel.getGiftName()); @@ -774,7 +774,7 @@ public class LiveTextRender { public SpannableStringBuilder renderGiftInfo2(String giftName) { SpannableStringBuilder builder = new SpannableStringBuilder(); - String s1 = WordUtil.getString(R.string.live_send_gift_1); + String s1 =WordUtil.getString(R.string.live_send_gift_1); String content = s1 + " " + giftName; int index1 = s1.length(); builder.append(content); @@ -784,8 +784,8 @@ public class LiveTextRender { public SpannableStringBuilder renderGiftInfo(int giftCount, String giftName) { SpannableStringBuilder builder = new SpannableStringBuilder(); - String s1 = WordUtil.getString(R.string.live_send_gift_1); - String s2 = WordUtil.getString(R.string.live_send_gift_2) + giftName; + String s1 =WordUtil.getString(R.string.live_send_gift_1); + String s2 =WordUtil.getString(R.string.live_send_gift_2) + giftName; String content = s1 + giftCount + s2; int index1 = s1.length(); int index2 = index1 + String.valueOf(giftCount).length(); @@ -823,7 +823,7 @@ public class LiveTextRender { } SpannableStringBuilder builder = new SpannableStringBuilder(); //有时在想,海外项目的时候这个"万"怎么翻译???而且英语中也没有"万"这个单位啊。。 - String wan = " " + WordUtil.getString(R.string.num_wan); + String wan = " " +WordUtil.getString(R.string.num_wan); String s = StringUtil.toWan2(num) + wan; builder.append(s); int index2 = s.length(); diff --git a/live/src/main/java/com/yunbao/live/views/LiveAdminListViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveAdminListViewHolder.java index ef736adec..eac9460a1 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveAdminListViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveAdminListViewHolder.java @@ -73,7 +73,7 @@ public class LiveAdminListViewHolder extends AbsLivePageViewHolder implements On } private void showTip() { - mTextView.setText(WordUtil.getString(R.string.live_admin_count) + "(" + mLiveAdminListAdapter.getItemCount() + "/" + mTotalCount + ")"); + mTextView.setText(mContext.getString(R.string.live_admin_count) + "(" + mLiveAdminListAdapter.getItemCount() + "/" + mTotalCount + ")"); } diff --git a/live/src/main/java/com/yunbao/live/views/LiveGiftLuckTopViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveGiftLuckTopViewHolder.java index 0f643dcd5..369d031b6 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveGiftLuckTopViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveGiftLuckTopViewHolder.java @@ -48,7 +48,7 @@ public class LiveGiftLuckTopViewHolder extends AbsViewHolder { @Override public void init() { mQueue = new ConcurrentLinkedQueue<>(); - mTipString = WordUtil.getString(R.string.live_gift_luck_tip); + mTipString =mContext.getString(R.string.live_gift_luck_tip); mRoot = findViewById(R.id.root); mGiftTip = (TextView) findViewById(R.id.luck_gift_tip); mParentWidth = mParentView.getWidth(); diff --git a/live/src/main/java/com/yunbao/live/views/LiveLinkMicPkViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveLinkMicPkViewHolder.java index 5bc6407d8..832a4ec12 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveLinkMicPkViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveLinkMicPkViewHolder.java @@ -84,8 +84,8 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder { public void init() { mHalfScreenWidth = ScreenDimenUtil.getInstance().getScreenWdith() / 2; - mLeftString = WordUtil.getString(R.string.live_link_mic_pk_1); - mRightString = WordUtil.getString(R.string.live_link_mic_pk_2); + mLeftString =mContext.getString(R.string.live_link_mic_pk_1); + mRightString =mContext.getString(R.string.live_link_mic_pk_2); mFrameImageView = (FrameImageView) findViewById(R.id.frame_img); mFrameImageView.setImageList(LiveIconUtil.getLinkMicPkAnim());//PK开始动画 frame_img_pk = (ImageView) findViewById(R.id.frame_img_pk); diff --git a/live/src/main/java/com/yunbao/live/views/LiveLinkMicPlayTxViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveLinkMicPlayTxViewHolder.java index c2ca47236..ca40805c3 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveLinkMicPlayTxViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveLinkMicPlayTxViewHolder.java @@ -185,7 +185,7 @@ public class LiveLinkMicPlayTxViewHolder extends AbsLiveLinkMicPlayViewHolder im break; case TXLiveConstants.PLAY_ERR_NET_DISCONNECT://播放失败 case TXLiveConstants.PLAY_ERR_FILE_NOT_FOUND: - ToastUtil.show(WordUtil.getString(R.string.live_play_error)); + ToastUtil.show(mContext.getString(R.string.live_play_error)); break; } } diff --git a/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java index 8dab5bed3..c8ac7930a 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java @@ -182,7 +182,7 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl } }); if (mAvatarFile == null) { - mCoverText.setText(WordUtil.getString(R.string.live_cover_2)); + mCoverText.setText(mContext.getString(R.string.live_cover_2)); mCoverText.setBackground(ContextCompat.getDrawable(mContext, R.drawable.bg_live_cover)); } mAvatarFile = file; @@ -662,9 +662,9 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl private void switchLocation() { if (mOpenLocation) { new DialogUitl.Builder(mContext) - .setContent(WordUtil.getString(R.string.live_location_close_3)) + .setContent(mContext.getString(R.string.live_location_close_3)) .setCancelable(true) - .setConfrimString(WordUtil.getString(R.string.live_location_close_2)) + .setConfrimString(mContext.getString(R.string.live_location_close_2)) .setClickCallback(new DialogUitl.SimpleCallback() { @Override @@ -762,7 +762,7 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl /** * 选择直播类型 */ - private LiveRoomTypeBean liveRoomTypeBean = new LiveRoomTypeBean(0, WordUtil.getString(R.string.live_room_public)); + private LiveRoomTypeBean liveRoomTypeBean = new LiveRoomTypeBean(0,mContext.getString(R.string.live_room_public)); private void chooseLiveType() { Bundle bundle = new Bundle(); @@ -809,7 +809,7 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl * 密码房间 */ private void onLiveTypePwd(final LiveRoomTypeBean bean) { - DialogUitl.showSimpleInputDialog(mContext, WordUtil.getString(R.string.live_set_pwd), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, 8, new DialogUitl.SimpleCallback() { + DialogUitl.showSimpleInputDialog(mContext,mContext.getString(R.string.live_set_pwd), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, 8, new DialogUitl.SimpleCallback() { @Override public void onConfirmClick(Dialog dialog, String content) { if (TextUtils.isEmpty(content)) { @@ -831,7 +831,7 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl * 付费房间 */ private void onLiveTypePay(final LiveRoomTypeBean bean) { - DialogUitl.showSimpleInputDialog(mContext, WordUtil.getString(R.string.live_set_fee), DialogUitl.INPUT_TYPE_NUMBER, 8, new DialogUitl.SimpleCallback() { + DialogUitl.showSimpleInputDialog(mContext,mContext.getString(R.string.live_set_fee), DialogUitl.INPUT_TYPE_NUMBER, 8, new DialogUitl.SimpleCallback() { @Override public void onConfirmClick(Dialog dialog, String content) { if (TextUtils.isEmpty(content)) { diff --git a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java index 6399477ad..05c3ad1b8 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java @@ -687,7 +687,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { @Subscribe(threadMode = ThreadMode.MAIN) public void onUpdata(String str) { if ("UsertoRY".equals(str)) { - DialogUitl.showSimpleDialog(mContext, WordUtil.getString(R.string.mic_tag), new DialogUitl.SimpleCallback() { + DialogUitl.showSimpleDialog(mContext,mContext.getString(R.string.mic_tag), new DialogUitl.SimpleCallback() { @Override public void onConfirmClick(Dialog dialog, String content) { UsertoRY(); diff --git a/live/src/main/java/com/yunbao/live/views/LivePlayTxViewHolder.java b/live/src/main/java/com/yunbao/live/views/LivePlayTxViewHolder.java index 5acc92c24..5bb5c04cb 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePlayTxViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePlayTxViewHolder.java @@ -159,7 +159,7 @@ public class LivePlayTxViewHolder extends LiveRoomPlayViewHolder implements ITXL // break; // case TXLiveConstants.PLAY_ERR_NET_DISCONNECT://播放失败 // case TXLiveConstants.PLAY_ERR_FILE_NOT_FOUND: -// ToastUtil.show(WordUtil.getString(R.string.live_play_error)); +// ToastUtil.show(mContext.getString(R.string.live_play_error)); // break; // case TXLiveConstants.PLAY_EVT_PLAY_PROGRESS: // int progress = bundle.getInt("EVT_PLAY_PROGRESS_MS"); diff --git a/live/src/main/java/com/yunbao/live/views/LivePlayTxViewHolder_backup.java b/live/src/main/java/com/yunbao/live/views/LivePlayTxViewHolder_backup.java index 1227a9324..bb881e1f0 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePlayTxViewHolder_backup.java +++ b/live/src/main/java/com/yunbao/live/views/LivePlayTxViewHolder_backup.java @@ -153,7 +153,7 @@ public class LivePlayTxViewHolder_backup extends LiveRoomPlayViewHolder implemen break; case TXLiveConstants.PLAY_ERR_NET_DISCONNECT://播放失败 case TXLiveConstants.PLAY_ERR_FILE_NOT_FOUND: - ToastUtil.show(WordUtil.getString(R.string.live_play_error)); + ToastUtil.show(mContext.getString(R.string.live_play_error)); break; case TXLiveConstants.PLAY_EVT_PLAY_PROGRESS: int progress = bundle.getInt("EVT_PLAY_PROGRESS_MS"); diff --git a/live/src/main/java/com/yunbao/live/views/LivePushTxViewHolder360Beauty.java b/live/src/main/java/com/yunbao/live/views/LivePushTxViewHolder360Beauty.java index ee6488832..43eaead2c 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePushTxViewHolder360Beauty.java +++ b/live/src/main/java/com/yunbao/live/views/LivePushTxViewHolder360Beauty.java @@ -209,7 +209,7 @@ public class LivePushTxViewHolder360Beauty extends AbsLivePushViewHolder impleme File targetDir = new File(CommonAppConfig.VIDEO_TIE_ZHI_PATH+CommonAppConfig.TIEZHI_360_NAME); try { }catch (Exception e){ -// ToastUtil.show(WordUtil.getString(com.yunbao.beauty.R.string.tiezhi_unzip_failed)); +// ToastUtil.show(mContext.getString(com.yunbao.beauty.R.string.tiezhi_unzip_failed)); } } }).start(); diff --git a/live/src/main/java/com/yunbao/live/views/LiveReadyRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveReadyRyViewHolder.java index 6575c81cb..24ad829a7 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveReadyRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveReadyRyViewHolder.java @@ -131,7 +131,7 @@ public class LiveReadyRyViewHolder extends AbsViewHolder implements View.OnClick if (file != null) { ImgLoader.display(mContext, file, mAvatar); if (mAvatarFile == null) { - mCoverText.setText(WordUtil.getString(R.string.live_cover_2)); + mCoverText.setText(mContext.getString(R.string.live_cover_2)); mCoverText.setBackground(ContextCompat.getDrawable(mContext, R.drawable.bg_live_cover)); } mAvatarFile = file; @@ -229,9 +229,9 @@ public class LiveReadyRyViewHolder extends AbsViewHolder implements View.OnClick private void switchLocation() { if (mOpenLocation) { new DialogUitl.Builder(mContext) - .setContent(WordUtil.getString(R.string.live_location_close_3)) + .setContent(mContext.getString(R.string.live_location_close_3)) .setCancelable(true) - .setConfrimString(WordUtil.getString(R.string.live_location_close_2)) + .setConfrimString(mContext.getString(R.string.live_location_close_2)) .setClickCallback(new DialogUitl.SimpleCallback() { @Override @@ -252,7 +252,7 @@ public class LiveReadyRyViewHolder extends AbsViewHolder implements View.OnClick mLocationImg.setImageResource(mOpenLocation ? R.mipmap.address_choice : R.mipmap.icon_live_ready_location_0); } if (mCity != null) { - mCity.setText(mOpenLocation ? CommonAppConfig.getInstance().getCity() : WordUtil.getString(R.string.live_location_close)); + mCity.setText(mOpenLocation ? CommonAppConfig.getInstance().getCity() :mContext.getString(R.string.live_location_close)); } } @@ -341,7 +341,7 @@ public class LiveReadyRyViewHolder extends AbsViewHolder implements View.OnClick * 密码房间 */ private void onLiveTypePwd(final LiveRoomTypeBean bean) { - DialogUitl.showSimpleInputDialog(mContext, WordUtil.getString(R.string.live_set_pwd), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, 8, new DialogUitl.SimpleCallback() { + DialogUitl.showSimpleInputDialog(mContext,mContext.getString(R.string.live_set_pwd), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, 8, new DialogUitl.SimpleCallback() { @Override public void onConfirmClick(Dialog dialog, String content) { if (TextUtils.isEmpty(content)) { @@ -363,7 +363,7 @@ public class LiveReadyRyViewHolder extends AbsViewHolder implements View.OnClick * 付费房间 */ private void onLiveTypePay(final LiveRoomTypeBean bean) { - DialogUitl.showSimpleInputDialog(mContext, WordUtil.getString(R.string.live_set_fee), DialogUitl.INPUT_TYPE_NUMBER, 8, new DialogUitl.SimpleCallback() { + DialogUitl.showSimpleInputDialog(mContext,mContext.getString(R.string.live_set_fee), DialogUitl.INPUT_TYPE_NUMBER, 8, new DialogUitl.SimpleCallback() { @Override public void onConfirmClick(Dialog dialog, String content) { if (TextUtils.isEmpty(content)) { diff --git a/live/src/main/java/com/yunbao/live/views/LiveReadyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveReadyViewHolder.java index 4da9ea036..3d965ee08 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveReadyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveReadyViewHolder.java @@ -144,7 +144,7 @@ public class LiveReadyViewHolder extends AbsViewHolder implements View.OnClickLi if (file != null) { ImgLoader.display(mContext, file, mAvatar); if (mAvatarFile == null) { - mCoverText.setText(WordUtil.getString(R.string.live_cover_2)); + mCoverText.setText(mContext.getString(R.string.live_cover_2)); mCoverText.setBackground(ContextCompat.getDrawable(mContext, R.drawable.bg_live_cover)); } mAvatarFile = file; @@ -253,9 +253,9 @@ public class LiveReadyViewHolder extends AbsViewHolder implements View.OnClickLi private void switchLocation() { if (mOpenLocation) { new DialogUitl.Builder(mContext) - .setContent(WordUtil.getString(R.string.live_location_close_3)) + .setContent(mContext.getString(R.string.live_location_close_3)) .setCancelable(true) - .setConfrimString(WordUtil.getString(R.string.live_location_close_2)) + .setConfrimString(mContext.getString(R.string.live_location_close_2)) .setClickCallback(new DialogUitl.SimpleCallback() { @Override @@ -276,7 +276,7 @@ public class LiveReadyViewHolder extends AbsViewHolder implements View.OnClickLi mLocationImg.setImageResource(mOpenLocation ? R.mipmap.address_choice : R.mipmap.icon_live_ready_location_0); } if (mCity != null) { - mCity.setText(mOpenLocation ? CommonAppConfig.getInstance().getCity() : WordUtil.getString(R.string.live_location_close)); + mCity.setText(mOpenLocation ? CommonAppConfig.getInstance().getCity() :mContext.getString(R.string.live_location_close)); } } @@ -365,7 +365,7 @@ public class LiveReadyViewHolder extends AbsViewHolder implements View.OnClickLi * 密码房间 */ private void onLiveTypePwd(final LiveRoomTypeBean bean) { - DialogUitl.showSimpleInputDialog(mContext, WordUtil.getString(R.string.live_set_pwd), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, 8, new DialogUitl.SimpleCallback() { + DialogUitl.showSimpleInputDialog(mContext,mContext.getString(R.string.live_set_pwd), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, 8, new DialogUitl.SimpleCallback() { @Override public void onConfirmClick(Dialog dialog, String content) { if (TextUtils.isEmpty(content)) { @@ -387,7 +387,7 @@ public class LiveReadyViewHolder extends AbsViewHolder implements View.OnClickLi * 付费房间 */ private void onLiveTypePay(final LiveRoomTypeBean bean) { - DialogUitl.showSimpleInputDialog(mContext, WordUtil.getString(R.string.live_set_fee), DialogUitl.INPUT_TYPE_NUMBER, 8, new DialogUitl.SimpleCallback() { + DialogUitl.showSimpleInputDialog(mContext,mContext.getString(R.string.live_set_fee), DialogUitl.INPUT_TYPE_NUMBER, 8, new DialogUitl.SimpleCallback() { @Override public void onConfirmClick(Dialog dialog, String content) { if (TextUtils.isEmpty(content)) { 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 0ce17e7bf..e47000d43 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -1279,7 +1279,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis liveAudienceActivity.pausePlay(); if (code == 1008) {//余额不足 liveAudienceActivity.setCoinNotEnough(true); - DialogUitl.showSimpleDialog(mContext, WordUtil.getString(R.string.live_coin_not_enough), false, + DialogUitl.showSimpleDialog(mContext,mContext.getString(R.string.live_coin_not_enough), false, new DialogUitl.SimpleCallback2() { @Override public void onConfirmClick(Dialog dialog, String content) { @@ -1730,7 +1730,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis if (loadingDialog != null && loadingDialog.isShowing()) { return true; } - loadingDialog = DialogUitl.loadingDialog(mContext, WordUtil.getString(R.string.login_wait)); + loadingDialog = DialogUitl.loadingDialog(mContext,mContext.getString(R.string.login_wait)); loadingDialog.show(); new Handler(Looper.getMainLooper()).postDelayed(() -> { if (loadingDialog != null) { @@ -2167,7 +2167,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis if (rank == 0) { mHourRank.setText(R.string.no_rank_data); } else { - mHourRank.setText(String.format(WordUtil.getString(R.string.hour_rank), formatBigNum.formatBigNum(rank + ""))); + mHourRank.setText(String.format(mContext.getString(R.string.hour_rank), formatBigNum.formatBigNum(rank + ""))); } } } @@ -2557,7 +2557,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public void setGuardNum(int guardNum) { if (mGuardNum != null) { if (guardNum > 0) { - mGuardNum.setText(WordUtil.getString(R.string.live_guard) + " " + guardNum); + mGuardNum.setText(mContext.getString(R.string.live_guard) + " " + guardNum); } else { mGuardNum.setText(R.string.main_list_no_data); } @@ -2570,9 +2570,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public static void setFansNum(int fansNum) { if (fans != null) { if (fansNum > 0) { - fans.setText(WordUtil.getString(R.string.fans) + " " + fansNum); + fans.setText(Contexts.getString(R.string.fans) + " " + fansNum); } else { - fans.setText(WordUtil.getString(R.string.fans) + " 0"); + fans.setText(Contexts.getString(R.string.fans) + " 0"); } } } @@ -2876,7 +2876,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public void callback(Integer isAttention) { if (isAttention == 1) { LiveActivity.sendSystemMessage( - CommonAppConfig.getInstance().getUserBean().getUserNiceName() + WordUtil.getString(R.string.live_follow_anchor)); + CommonAppConfig.getInstance().getUserBean().getUserNiceName() +Contexts.getString(R.string.live_follow_anchor)); } } }); diff --git a/live/src/main/java/com/yunbao/live/views/LuckLiveGiftViewHolder.java b/live/src/main/java/com/yunbao/live/views/LuckLiveGiftViewHolder.java index 0f3bda722..b856e4782 100644 --- a/live/src/main/java/com/yunbao/live/views/LuckLiveGiftViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LuckLiveGiftViewHolder.java @@ -79,7 +79,7 @@ public class LuckLiveGiftViewHolder extends AbsViewHolder { mStar = findViewById(R.id.star); mAvatar = (ImageView) findViewById(R.id.avatar); mZhong = (TextView) findViewById(R.id.zhong); - mXiZhong = WordUtil.getString(R.string.live_gift_xi_zhong); + mXiZhong =mContext.getString(R.string.live_gift_xi_zhong); mName = (TextView) findViewById(R.id.name); mContent = (TextView) findViewById(R.id.content); mGiftIcon = (ImageView) findViewById(R.id.gift_icon); diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index 2a86d0c06..7b8c24976 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -1214,7 +1214,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe public void onKick(String touid) { if (!TextUtils.isEmpty(touid) && touid.equals(CommonAppConfig.getInstance().getUid())) {//被踢的是自己 kick = true; - ToastUtil.show(WordUtil.getString(R.string.live_kicked_2)); + ToastUtil.show(mContext.getString(R.string.live_kicked_2)); onRemove(true); } } @@ -1781,7 +1781,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe } else { if (code == 1008) {//余额不足 mCoinNotEnough = true; - DialogUitl.showSimpleDialog(mContext, WordUtil.getString(R.string.live_coin_not_enough), false, + DialogUitl.showSimpleDialog(mContext,mContext.getString(R.string.live_coin_not_enough), false, new DialogUitl.SimpleCallback2() { @Override public void onConfirmClick(Dialog dialog, String content) { diff --git a/main/src/main/java/com/yunbao/main/activity/BindUserActivity.java b/main/src/main/java/com/yunbao/main/activity/BindUserActivity.java index e90e50ae2..7239c3144 100644 --- a/main/src/main/java/com/yunbao/main/activity/BindUserActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/BindUserActivity.java @@ -86,7 +86,7 @@ public class BindUserActivity extends AbsActivity { @Override protected void main() { -// setTitle(WordUtil.getString(R.string.reg_register)); +// setTitle(mContext.getString(R.string.reg_register)); getPromoCode(); webview = (WebView) findViewById(R.id.webview); lt_first_bind = (LinearLayout) findViewById(R.id.lt_first_bind); @@ -107,8 +107,8 @@ public class BindUserActivity extends AbsActivity { btn_goto_updata = findViewById(R.id.btn_goto_updata); tv_title = findViewById(R.id.tv_title); - mGetCode = WordUtil.getString(R.string.reg_get_code); - mGetCodeAgain = WordUtil.getString(R.string.reg_get_code_again); + mGetCode =mContext.getString(R.string.reg_get_code); + mGetCodeAgain =mContext.getString(R.string.reg_get_code_again); mTvCountryCodeClick(); mEditPhone.addTextChangedListener(new TextWatcher() { @Override @@ -292,14 +292,14 @@ public class BindUserActivity extends AbsActivity { private void getMessageCode(String Randstr, String Ticket) { String phoneNum = mEditPhone.getText().toString().trim(); if (TextUtils.isEmpty(phoneNum)) { - mEditPhone.setError(WordUtil.getString(R.string.reg_input_phone)); + mEditPhone.setError(mContext.getString(R.string.reg_input_phone)); mEditPhone.requestFocus(); return; } //屏蔽,原因:国外手机号无法校验合法性 // if (!ValidatePhoneUtil.validateMobileNumber(phoneNum)) // { -// mEditPhone.setError(WordUtil.getString(R.string.login_phone_error)); +// mEditPhone.setError(mContext.getString(R.string.login_phone_error)); // mEditPhone.requestFocus(); // return; // } @@ -330,37 +330,37 @@ public class BindUserActivity extends AbsActivity { private void register() { final String phoneNum = mEditPhone.getText().toString().trim(); if (TextUtils.isEmpty(phoneNum)) { - mEditPhone.setError(WordUtil.getString(R.string.reg_input_phone)); + mEditPhone.setError(mContext.getString(R.string.reg_input_phone)); mEditPhone.requestFocus(); return; } //屏蔽,原因:国外手机号无法校验合法性 // if (!ValidatePhoneUtil.validateMobileNumber(phoneNum)) { -// mEditPhone.setError(WordUtil.getString(R.string.login_phone_error)); +// mEditPhone.setError(mContext.getString(R.string.login_phone_error)); // mEditPhone.requestFocus(); // return; // } String code = mEditCode.getText().toString().trim(); if (TextUtils.isEmpty(code)) { - mEditCode.setError(WordUtil.getString(R.string.reg_input_code)); + mEditCode.setError(mContext.getString(R.string.reg_input_code)); mEditCode.requestFocus(); return; } if ("0".equals(isBind)) { final String pwd = mEditPwd1.getText().toString().trim(); if (TextUtils.isEmpty(pwd)) { - mEditPwd1.setError(WordUtil.getString(R.string.reg_input_pwd_1)); + mEditPwd1.setError(mContext.getString(R.string.reg_input_pwd_1)); mEditPwd1.requestFocus(); return; } String pwd2 = mEditPwd2.getText().toString().trim(); if (TextUtils.isEmpty(pwd2)) { - mEditPwd2.setError(WordUtil.getString(R.string.reg_input_pwd_2)); + mEditPwd2.setError(mContext.getString(R.string.reg_input_pwd_2)); mEditPwd2.requestFocus(); return; } if (!pwd.equals(pwd2)) { - mEditPwd2.setError(WordUtil.getString(R.string.reg_pwd_error)); + mEditPwd2.setError(mContext.getString(R.string.reg_pwd_error)); mEditPwd2.requestFocus(); return; } diff --git a/main/src/main/java/com/yunbao/main/activity/CashActivity.java b/main/src/main/java/com/yunbao/main/activity/CashActivity.java index 8c90cbd18..dd9561b87 100644 --- a/main/src/main/java/com/yunbao/main/activity/CashActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/CashActivity.java @@ -132,7 +132,7 @@ public class CashActivity extends AbsActivity implements View.OnClickListener, C @Override public void onItemDelete(final CashAccountBean bean, final int position) { - DialogUitl.showSimpleDialog(mContext, WordUtil.getString(R.string.cash_delete), new DialogUitl.SimpleCallback() { + DialogUitl.showSimpleDialog(mContext,mContext.getString(R.string.cash_delete), new DialogUitl.SimpleCallback() { @Override public void onConfirmClick(Dialog dialog, String content) { MainHttpUtil.deleteCashAccount(bean.getId(), new HttpCallback() { diff --git a/main/src/main/java/com/yunbao/main/activity/ChatRoomActivity.java b/main/src/main/java/com/yunbao/main/activity/ChatRoomActivity.java index 1c25c139b..add768128 100644 --- a/main/src/main/java/com/yunbao/main/activity/ChatRoomActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/ChatRoomActivity.java @@ -305,7 +305,7 @@ public class ChatRoomActivity extends AbsActivity implements KeyBoardHeightChang // mChatRoomViewHolder.sendLocation(lat, lng, scale, address); // } // } else { -// ToastUtil.show(WordUtil.getString(R.string.im_get_location_failed)); +// ToastUtil.show(mContext.getString(R.string.im_get_location_failed)); // } // } // } diff --git a/main/src/main/java/com/yunbao/main/activity/EditNameActivity.java b/main/src/main/java/com/yunbao/main/activity/EditNameActivity.java index af6cf0e45..9be090ed0 100644 --- a/main/src/main/java/com/yunbao/main/activity/EditNameActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/EditNameActivity.java @@ -38,7 +38,7 @@ public class EditNameActivity extends AbsActivity implements View.OnClickListene @Override protected void main() { - setTitle(WordUtil.getString(R.string.edit_profile_update_nickname)); + setTitle(mContext.getString(R.string.edit_profile_update_nickname)); mEditText = (EditText) findViewById(R.id.edit); mEditText.setFilters(new InputFilter[]{ new InputFilter.LengthFilter(8) diff --git a/main/src/main/java/com/yunbao/main/activity/EditProfileActivity.java b/main/src/main/java/com/yunbao/main/activity/EditProfileActivity.java index bb00765df..1864a8329 100644 --- a/main/src/main/java/com/yunbao/main/activity/EditProfileActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/EditProfileActivity.java @@ -78,7 +78,7 @@ public class EditProfileActivity extends AbsActivity { @Override protected void main() { - setTitle(WordUtil.getString(R.string.edit_profile)); + setTitle(mContext.getString(R.string.edit_profile)); mAvatar = (ImageView) findViewById(R.id.avatar); mName = (TextView) findViewById(R.id.name); mSign = (TextView) findViewById(R.id.sign); diff --git a/main/src/main/java/com/yunbao/main/activity/EditSexActivity.java b/main/src/main/java/com/yunbao/main/activity/EditSexActivity.java index 7fb0d8ec6..8b6c73944 100644 --- a/main/src/main/java/com/yunbao/main/activity/EditSexActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/EditSexActivity.java @@ -35,7 +35,7 @@ public class EditSexActivity extends AbsActivity implements View.OnClickListener @Override protected void main() { - setTitle(WordUtil.getString(R.string.edit_profile_sex)); + setTitle(mContext.getString(R.string.edit_profile_sex)); mBtnMale = (RadioButton)findViewById(R.id.btn_male); mBtnFeMale = (RadioButton)findViewById(R.id.btn_female); mBtnMale.setOnClickListener(this); diff --git a/main/src/main/java/com/yunbao/main/activity/EditSignActivity.java b/main/src/main/java/com/yunbao/main/activity/EditSignActivity.java index 33ba9cbdc..b71da0aa3 100644 --- a/main/src/main/java/com/yunbao/main/activity/EditSignActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/EditSignActivity.java @@ -35,7 +35,7 @@ public class EditSignActivity extends AbsActivity implements View.OnClickListene @Override protected void main() { - setTitle(WordUtil.getString(R.string.edit_profile_update_sign)); + setTitle(mContext.getString(R.string.edit_profile_update_sign)); mEditText = (EditText) findViewById(R.id.edit); mEditText.setFilters(new InputFilter[]{ new InputFilter.LengthFilter(20) diff --git a/main/src/main/java/com/yunbao/main/activity/EntryActivity.java b/main/src/main/java/com/yunbao/main/activity/EntryActivity.java index aa2fe66f6..6db950215 100644 --- a/main/src/main/java/com/yunbao/main/activity/EntryActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/EntryActivity.java @@ -716,7 +716,7 @@ public class EntryActivity extends AppCompatActivity { if (mBtnClick) { return; } - loginLoadingDialog = DialogUitl.loadingDialog(EntryActivity.this, WordUtil.getString(R.string.login_wait)); + loginLoadingDialog = DialogUitl.loadingDialog(EntryActivity.this,getString(R.string.login_wait)); loginLoadingDialog.show(); new Timer().schedule(new TimerTask() { @Override diff --git a/main/src/main/java/com/yunbao/main/activity/FansActivity.java b/main/src/main/java/com/yunbao/main/activity/FansActivity.java index 9a8ea0be8..2e72c5114 100644 --- a/main/src/main/java/com/yunbao/main/activity/FansActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/FansActivity.java @@ -60,10 +60,10 @@ public class FansActivity extends AbsActivity implements OnItemClickListener list = JSON.parseArray(Arrays.toString(info), SettingBean.class); SettingBean data1 = new SettingBean(); data1.setId(19); - data1.setName(WordUtil.getString(R.string.versions)); + data1.setName(mContext.getString(R.string.versions)); list.add(data1); SettingBean data2 = new SettingBean(); data2.setId(25); - data2.setName(WordUtil.getString(R.string.check_the_new_version)); + data2.setName(mContext.getString(R.string.check_the_new_version)); list.add(data2); SettingBean bean = new SettingBean(); - bean.setName(WordUtil.getString(R.string.setting_exit)); + bean.setName(mContext.getString(R.string.setting_exit)); bean.setLast(true); list.add(bean); diff --git a/main/src/main/java/com/yunbao/main/activity/ThreeDistributActivity.java b/main/src/main/java/com/yunbao/main/activity/ThreeDistributActivity.java index a1babe459..e55b94ae6 100644 --- a/main/src/main/java/com/yunbao/main/activity/ThreeDistributActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/ThreeDistributActivity.java @@ -196,7 +196,7 @@ public class ThreeDistributActivity extends AbsActivity implements View.OnClickL intent.setData(MediaStore.Images.Media.EXTERNAL_CONTENT_URI); } intent.setType("image/*"); - startActivityForResult(Intent.createChooser(intent, WordUtil.getString(com.yunbao.common.R.string.choose_flie)), CHOOSE); + startActivityForResult(Intent.createChooser(intent,mContext.getString(com.yunbao.common.R.string.choose_flie)), CHOOSE); } @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) diff --git a/main/src/main/java/com/yunbao/main/activity/WeekWebViewActivity.java b/main/src/main/java/com/yunbao/main/activity/WeekWebViewActivity.java index e893de283..b985b053a 100644 --- a/main/src/main/java/com/yunbao/main/activity/WeekWebViewActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/WeekWebViewActivity.java @@ -196,7 +196,7 @@ public class WeekWebViewActivity extends AbsActivity { intent.setData(MediaStore.Images.Media.EXTERNAL_CONTENT_URI); } intent.setType("image/*"); - startActivityForResult(Intent.createChooser(intent, WordUtil.getString(com.yunbao.common.R.string.choose_flie)), CHOOSE); + startActivityForResult(Intent.createChooser(intent,mContext.getString(com.yunbao.common.R.string.choose_flie)), CHOOSE); } @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) diff --git a/main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java b/main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java index d91d3f819..5faf2af1c 100644 --- a/main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java @@ -195,7 +195,7 @@ public class ZhuangBanActivity extends AbsActivity { intent.setData(MediaStore.Images.Media.EXTERNAL_CONTENT_URI); } intent.setType("image/*"); - startActivityForResult(Intent.createChooser(intent, WordUtil.getString(R.string.choose_flie)), CHOOSE); + startActivityForResult(Intent.createChooser(intent,mContext.getString(R.string.choose_flie)), CHOOSE); } @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) diff --git a/main/src/main/java/com/yunbao/main/adapter/CoinAdapter.java b/main/src/main/java/com/yunbao/main/adapter/CoinAdapter.java index a65cd79f2..dcef843d9 100644 --- a/main/src/main/java/com/yunbao/main/adapter/CoinAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/CoinAdapter.java @@ -50,7 +50,7 @@ public class CoinAdapter extends RecyclerView.Adapter { mInflater = LayoutInflater.from(context); mHeadView = mInflater.inflate(R.layout.item_coin_head, null); mHeadView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); - mGiveString = WordUtil.getString(R.string.coin_give); + mGiveString =context.getString(R.string.coin_give); mOnClickListener = new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/main/src/main/java/com/yunbao/main/adapter/MainListAdapter.java b/main/src/main/java/com/yunbao/main/adapter/MainListAdapter.java index e222d942c..e2729f123 100644 --- a/main/src/main/java/com/yunbao/main/adapter/MainListAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/MainListAdapter.java @@ -58,8 +58,8 @@ public class MainListAdapter extends RefreshAdapter { super(context); mType = type; mTopList = new ArrayList<>(); - mFollow = (WordUtil.getString(R.string.follow)); - mFollowing = WordUtil.getString(R.string.following); + mFollow = (mContext.getString(R.string.follow)); + mFollowing =mContext.getString(R.string.following); mItemClickListener = v -> { Object tag = v.getTag(); if (tag != null && mOnItemClickListener != null) { diff --git a/main/src/main/java/com/yunbao/main/adapter/SearchAdapter.java b/main/src/main/java/com/yunbao/main/adapter/SearchAdapter.java index 216924177..9a3f901d0 100644 --- a/main/src/main/java/com/yunbao/main/adapter/SearchAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/SearchAdapter.java @@ -48,8 +48,8 @@ public class SearchAdapter extends RefreshAdapter { public SearchAdapter(Context context, int from) { super(context); mFrom = from; - mFollow = WordUtil.getString(R.string.follow); - mFollowing = WordUtil.getString(R.string.following); + mFollow =mContext.getString(R.string.follow); + mFollowing =mContext.getString(R.string.following); mFollowClickListener = new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/main/src/main/java/com/yunbao/main/dialog/OneLoginDialog.java b/main/src/main/java/com/yunbao/main/dialog/OneLoginDialog.java index 54e359688..fefcd9b9f 100644 --- a/main/src/main/java/com/yunbao/main/dialog/OneLoginDialog.java +++ b/main/src/main/java/com/yunbao/main/dialog/OneLoginDialog.java @@ -80,11 +80,11 @@ public class OneLoginDialog extends AbsDialogFragment { return; } ImgLoader.displayAvatar(mContext, CommonAppConfig.getInstance().getUserBean().getAvatar(), avatar); - text_username.setText(WordUtil.getString(R.string.edit_profile_nickname) + ":" + bundle.getString("name")); + text_username.setText(mContext.getString(R.string.edit_profile_nickname) + ":" + bundle.getString("name")); if (!bundle.getString("code").equals("")) { - text_code.setText(WordUtil.getString(R.string.invite_code) + ":" + bundle.getString("code")); + text_code.setText(mContext.getString(R.string.invite_code) + ":" + bundle.getString("code")); } else { - text_code.setText(WordUtil.getString(R.string.invite_code) + ":無"); + text_code.setText(mContext.getString(R.string.invite_code) + ":無"); } btn_enter.setOnClickListener(new View.OnClickListener() { diff --git a/main/src/main/java/com/yunbao/main/views/AbsMainListChildViewHolder.java b/main/src/main/java/com/yunbao/main/views/AbsMainListChildViewHolder.java index 84644df8c..831135ffb 100644 --- a/main/src/main/java/com/yunbao/main/views/AbsMainListChildViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/AbsMainListChildViewHolder.java @@ -335,7 +335,7 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple setVisibility(bean.isHide() ? View.GONE : View.VISIBLE, position, mBtnFollow1, mBtnFollow2, mBtnFollow3); if (bean.getAttention() != 1) { getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).doChecked(true); - getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setText("+" + WordUtil.getString(R.string.follow)); + getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setText("+" +mContext.getString(R.string.follow)); if (isRankOne) { getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setBackgroundResource(R.drawable.background_ffff79c2); getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setTextColor(Color.parseColor("#FFFFFF")); diff --git a/main/src/main/java/com/yunbao/main/views/BonusViewHolder.java b/main/src/main/java/com/yunbao/main/views/BonusViewHolder.java index 4b984ad58..4da6f0b26 100644 --- a/main/src/main/java/com/yunbao/main/views/BonusViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/BonusViewHolder.java @@ -79,7 +79,7 @@ public class BonusViewHolder extends AbsViewHolder implements View.OnClickListen public void setData(List list, int day, String continueDay) { mList = list; mDay = day; - String s = WordUtil.getString(R.string.bonus_sign_1) + "" + continueDay + "" + WordUtil.getString(R.string.bonus_day); + String s =mContext.getString(R.string.bonus_sign_1) + "" + continueDay + "" +mContext.getString(R.string.bonus_day); mDayView.setText(Html.fromHtml(s)); for (int i = 0, length = mItemViews.length; i < length; i++) { if (i <= mDay - 1) { diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java index 1bb04c52b..a6dad1d3c 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java @@ -1,7 +1,6 @@ package com.yunbao.main.views; import static android.content.Context.CLIPBOARD_SERVICE; -import static com.yunbao.common.utils.WordUtil.getString; import android.content.ClipData; import android.content.ClipboardManager; @@ -269,8 +268,8 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl intent.setData(MediaStore.Images.Media.EXTERNAL_CONTENT_URI); } intent.setType("image/*"); - nowMainActivity.startActivityMain(Intent.createChooser(intent, WordUtil.getString(R.string.choose_flie)), CHOOSE); -// startActivityForResult(Intent.createChooser(intent, WordUtil.getString(R.string.choose_flie)), CHOOSE); + nowMainActivity.startActivityMain(Intent.createChooser(intent,mContext.getString(R.string.choose_flie)), CHOOSE); +// startActivityForResult(Intent.createChooser(intent,mContext.getString(R.string.choose_flie)), CHOOSE); } @@ -295,7 +294,7 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl ClipboardManager cm = (ClipboardManager) mContext.getSystemService(CLIPBOARD_SERVICE); ClipData clipData = ClipData.newPlainText("text", content); cm.setPrimaryClip(clipData); - ToastUtil.show(getString(R.string.copy_success)); + ToastUtil.show(mContext.getString(R.string.copy_success)); } public void closeFinger() { diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeCsdViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeCsdViewHolder.java index e5030a341..bee4c2fb8 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeCsdViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeCsdViewHolder.java @@ -29,7 +29,6 @@ import com.yunbao.common.bean.LiveBean; import com.yunbao.main.R; import static android.content.Context.CLIPBOARD_SERVICE; -import static com.yunbao.common.utils.WordUtil.getString; /** * Created by cxf on 2018/9/22. @@ -145,6 +144,6 @@ public class MainHomeCsdViewHolder extends AbsMainHomeChildViewHolder implements ClipboardManager cm = (ClipboardManager) mContext.getSystemService(CLIPBOARD_SERVICE); ClipData clipData = ClipData.newPlainText("text", content); cm.setPrimaryClip(clipData); - ToastUtil.show(getString(com.yunbao.common.R.string.copy_success)); + ToastUtil.show(mContext.getString(com.yunbao.common.R.string.copy_success)); } } \ No newline at end of file diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeShopViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeShopViewHolder.java index 884016223..10420db5c 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeShopViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeShopViewHolder.java @@ -27,7 +27,6 @@ import com.yunbao.main.R; import com.yunbao.main.utils.BottomBarUtil; import static android.content.Context.CLIPBOARD_SERVICE; -import static com.yunbao.common.utils.WordUtil.getString; /** * Created by cxf on 2018/9/22. @@ -142,7 +141,7 @@ public class MainHomeShopViewHolder extends AbsMainHomeChildViewHolder implement ClipboardManager cm = (ClipboardManager) mContext.getSystemService(CLIPBOARD_SERVICE); ClipData clipData = ClipData.newPlainText("text", content); cm.setPrimaryClip(clipData); - ToastUtil.show(getString(com.yunbao.common.R.string.copy_success)); + ToastUtil.show(mContext.getString(com.yunbao.common.R.string.copy_success)); } } diff --git a/main/src/main/java/com/yunbao/main/views/MainListViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainListViewHolder.java index ed087eeba..789a6595e 100644 --- a/main/src/main/java/com/yunbao/main/views/MainListViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainListViewHolder.java @@ -85,8 +85,8 @@ public class MainListViewHolder extends AbsMainViewHolder { }); mIndicator = (MagicIndicator) findViewById(R.id.indicator); final String[] titles = new String[]{ - WordUtil.getString(R.string.main_list_profit), - WordUtil.getString(R.string.main_list_contribute) + mContext.getString(R.string.main_list_profit), + mContext.getString(R.string.main_list_contribute) }; CommonNavigator commonNavigator = new CommonNavigator(mContext); commonNavigator.setAdapter(new CommonNavigatorAdapter() { diff --git a/main/src/main/java/com/yunbao/main/views/MainNearViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainNearViewHolder.java index 622d75aa1..c3026b7a6 100644 --- a/main/src/main/java/com/yunbao/main/views/MainNearViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainNearViewHolder.java @@ -62,7 +62,7 @@ public class MainNearViewHolder extends AbsMainHomeParentViewHolder { @Override protected String[] getTitles() { return new String[]{ - WordUtil.getString(R.string.near) + mContext.getString(R.string.near) }; } diff --git a/main/src/main/java/com/yunbao/main/views/UserHomeDetailViewHolder.java b/main/src/main/java/com/yunbao/main/views/UserHomeDetailViewHolder.java index 91b554011..8da0406e3 100644 --- a/main/src/main/java/com/yunbao/main/views/UserHomeDetailViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/UserHomeDetailViewHolder.java @@ -170,7 +170,7 @@ public class UserHomeDetailViewHolder extends AbsUserHomeViewHolder implements V UserHomeViewHolder2.mSign.setText(userBean.getSignature()); } if (mVotesName != null) { - mVotesName.setText(StringUtil.contact(CommonAppConfig.getInstance().getVotesName(), WordUtil.getString(R.string.live_user_home_con))); + mVotesName.setText(StringUtil.contact(CommonAppConfig.getInstance().getVotesName(),mContext.getString(R.string.live_user_home_con))); } if (mBirthday != null) { mBirthday.setText(obj.getString("birthday")); @@ -187,10 +187,10 @@ public class UserHomeDetailViewHolder extends AbsUserHomeViewHolder implements V UserHomeViewHolder2.mSign.setText(userBean.getSignature()); } if (mBirthday != null) { - mBirthday.setText(StringUtil.contact(WordUtil.getString(R.string.edit_profile_birthday), ": ", obj.getString("birthday"))); + mBirthday.setText(StringUtil.contact(mContext.getString(R.string.edit_profile_birthday), ": ", obj.getString("birthday"))); } if (mCity != null) { - mCity.setText(StringUtil.contact(WordUtil.getString(R.string.edit_profile_city), ": ", obj.getString("location"))); + mCity.setText(StringUtil.contact(mContext.getString(R.string.edit_profile_city), ": ", obj.getString("location"))); } } diff --git a/main/src/main/java/com/yunbao/main/views/UserHomeViewHolder.java b/main/src/main/java/com/yunbao/main/views/UserHomeViewHolder.java index ba38d56c0..2956722ba 100644 --- a/main/src/main/java/com/yunbao/main/views/UserHomeViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/UserHomeViewHolder.java @@ -205,8 +205,8 @@ public class UserHomeViewHolder extends AbsLivePageViewHolder implements AppBarL } }); - mVideoString = WordUtil.getString(R.string.video); - mLiveString = WordUtil.getString(R.string.live); + mVideoString =mContext.getString(R.string.video); + mLiveString =mContext.getString(R.string.live); mIndicator = (MagicIndicator) findViewById(R.id.indicator); final String[] titles = new String[]{mVideoString, mLiveString}; CommonNavigator commonNavigator = new CommonNavigator(mContext); @@ -361,8 +361,8 @@ public class UserHomeViewHolder extends AbsLivePageViewHolder implements AppBarL mID.setText(userBean.getLiangNameTip()); String fansNum = StringUtil.toWan(userBean.getFans()); - mBtnFans.setText(fansNum + " " + WordUtil.getString(R.string.fans)); - mBtnFollow.setText(StringUtil.toWan(userBean.getFollows()) + " " + WordUtil.getString(R.string.follow)); + mBtnFans.setText(fansNum + " " +mContext.getString(R.string.fans)); + mBtnFollow.setText(StringUtil.toWan(userBean.getFollows()) + " " +mContext.getString(R.string.follow)); mSign.setText(userBean.getSignature()); mBtnFollow2.setText(obj.getIntValue("isattention") == 1 ? R.string.following : R.string.follow); mBtnBlack.setText(obj.getIntValue("isblack") == 1 ? R.string.black_ing : R.string.black); @@ -374,7 +374,7 @@ public class UserHomeViewHolder extends AbsLivePageViewHolder implements AppBarL mLiveCountTextView.setText(mLiveString + " " + obj.getString("livenums")); } showImpress(obj.getString("label")); - mVotesName.setText(appConfig.getVotesName() + WordUtil.getString(R.string.live_user_home_con)); + mVotesName.setText(appConfig.getVotesName() +mContext.getString(R.string.live_user_home_con)); mUserHomeSharePresenter.setToUid(mToUid).setToName(toName).setAvatarThumb(userBean.getAvatarThumb()).setFansNum(fansNum); showContribute(obj.getString("contribute")); showGuardList(obj.getString("guardlist")); @@ -396,7 +396,7 @@ public class UserHomeViewHolder extends AbsLivePageViewHolder implements AppBarL } if (!mSelf) { ImpressBean lastBean = new ImpressBean(); - lastBean.setName("+ " + WordUtil.getString(R.string.impress_add)); + lastBean.setName("+ " +mContext.getString(R.string.impress_add)); lastBean.setColor("#ffdd00"); list.add(lastBean); } else { diff --git a/main/src/main/java/com/yunbao/main/views/UserHomeViewHolder2.java b/main/src/main/java/com/yunbao/main/views/UserHomeViewHolder2.java index 05dde04f2..522c28789 100644 --- a/main/src/main/java/com/yunbao/main/views/UserHomeViewHolder2.java +++ b/main/src/main/java/com/yunbao/main/views/UserHomeViewHolder2.java @@ -167,7 +167,7 @@ public class UserHomeViewHolder2 extends AbsLivePageViewHolder implements LiveSh } - String s = WordUtil.getString(R.string.black); + String s =mContext.getString(R.string.black); @Override public void init() { @@ -317,11 +317,11 @@ public class UserHomeViewHolder2 extends AbsLivePageViewHolder implements LiveSh } }); - mVideoString = WordUtil.getString(R.string.video); - mLiveString = WordUtil.getString(R.string.honor); + mVideoString =mContext.getString(R.string.video); + mLiveString =mContext.getString(R.string.honor); mIndicator = (MagicIndicator) findViewById(R.id.indicator); - final String[] titles = new String[]{WordUtil.getString(R.string.live_user_home_detail), mLiveString, mVideoString,}; -// final String[] titles = new String[]{WordUtil.getString(R.string.live_user_home_detail), mVideoString}; //mxj update 2019-9-19 + final String[] titles = new String[]{mContext.getString(R.string.live_user_home_detail), mLiveString, mVideoString,}; +// final String[] titles = new String[]{mContext.getString(R.string.live_user_home_detail), mVideoString}; //mxj update 2019-9-19 CommonNavigator commonNavigator = new CommonNavigator(mContext); commonNavigator.setAdapter(new CommonNavigatorAdapter() { @@ -516,8 +516,8 @@ public class UserHomeViewHolder2 extends AbsLivePageViewHolder implements LiveSh } // mID.setText(" "+userBean.getLiangNameTip()); String fansNum = StringUtil.toWan(userBean.getFans()); - mBtnFans.setText(fansNum + " " + WordUtil.getString(R.string.fans)); - mBtnFollow.setText(StringUtil.toWan(userBean.getFollows()) + " " + WordUtil.getString(R.string.follow)); + mBtnFans.setText(fansNum + " " +mContext.getString(R.string.fans)); + mBtnFollow.setText(StringUtil.toWan(userBean.getFollows()) + " " +mContext.getString(R.string.follow)); if (obj.getIntValue("isattention") == 1) { if (mFollowImage != null) { @@ -865,8 +865,8 @@ public class UserHomeViewHolder2 extends AbsLivePageViewHolder implements LiveSh mSex.setImageResource(CommonIconUtil.getSexIcon(userBean.getSex())); mID.setText(userBean.getLiangNameTip()); String fansNum = StringUtil.toWan(userBean.getFans()); - mBtnFans.setText(fansNum + " " + WordUtil.getString(R.string.fans)); - mBtnFollow.setText(StringUtil.toWan(userBean.getFollows()) + " " + WordUtil.getString(R.string.follow)); + mBtnFans.setText(fansNum + " " +mContext.getString(R.string.fans)); + mBtnFollow.setText(StringUtil.toWan(userBean.getFollows()) + " " +mContext.getString(R.string.follow)); if (mDetailViewHolder != null) { mDetailViewHolder.refreshData(userBean, obj); } diff --git a/video/src/main/java/com/yunbao/video/activity/AbsVideoPlayActivity.java b/video/src/main/java/com/yunbao/video/activity/AbsVideoPlayActivity.java index 7a5a90f3d..ed8457dc3 100644 --- a/video/src/main/java/com/yunbao/video/activity/AbsVideoPlayActivity.java +++ b/video/src/main/java/com/yunbao/video/activity/AbsVideoPlayActivity.java @@ -75,7 +75,7 @@ public abstract class AbsVideoPlayActivity extends AbsVideoCommentActivity { } ClipData clipData = ClipData.newPlainText("text", videoBean.getHref()); mClipboardManager.setPrimaryClip(clipData); - ToastUtil.show(WordUtil.getString(R.string.copy_success)); + ToastUtil.show(mContext.getString(R.string.copy_success)); } /** diff --git a/video/src/main/java/com/yunbao/video/activity/VideoChooseActivity.java b/video/src/main/java/com/yunbao/video/activity/VideoChooseActivity.java index 1bb6dce6f..b968f7f16 100644 --- a/video/src/main/java/com/yunbao/video/activity/VideoChooseActivity.java +++ b/video/src/main/java/com/yunbao/video/activity/VideoChooseActivity.java @@ -38,7 +38,7 @@ public class VideoChooseActivity extends AbsActivity implements OnItemClickListe @Override protected void main() { - setTitle(WordUtil.getString(R.string.video_local)); + setTitle(mContext.getString(R.string.video_local)); mMaxDuration = getIntent().getLongExtra(Constants.VIDEO_DURATION, 15000); mNoData = findViewById(R.id.no_data); mRecyclerView = (RecyclerView) findViewById(R.id.recyclerView); diff --git a/video/src/main/java/com/yunbao/video/activity/VideoEditActivity.java b/video/src/main/java/com/yunbao/video/activity/VideoEditActivity.java index 3ee2e0d5d..833ee5299 100644 --- a/video/src/main/java/com/yunbao/video/activity/VideoEditActivity.java +++ b/video/src/main/java/com/yunbao/video/activity/VideoEditActivity.java @@ -129,7 +129,7 @@ public class VideoEditActivity extends AbsActivity implements mFromRecord = intent.getBooleanExtra(Constants.VIDEO_FROM_RECORD, false); mHasOriginBgm = intent.getBooleanExtra(Constants.VIDEO_HAS_BGM, false); if (mVideoDuration <= 0 || TextUtils.isEmpty(mOriginVideoPath)) { - ToastUtil.show(WordUtil.getString(R.string.video_edit_status_error)); + ToastUtil.show(mContext.getString(R.string.video_edit_status_error)); deleteOriginVideoFile(); finish(); return; @@ -596,7 +596,7 @@ public class VideoEditActivity extends AbsActivity implements mBtnNext.setEnabled(false); mVideoEditer.stopPlay(); mVideoEditer.cancel(); - mVideoGenerateViewHolder = new VideoProcessViewHolder(mContext, mRoot, WordUtil.getString(R.string.video_process_2)); + mVideoGenerateViewHolder = new VideoProcessViewHolder(mContext, mRoot,mContext.getString(R.string.video_process_2)); mVideoGenerateViewHolder.setActionListener(new VideoProcessViewHolder.ActionListener() { @Override public void onCancelProcessClick() { @@ -624,7 +624,7 @@ public class VideoEditActivity extends AbsActivity implements @Override public void onBackPressed() { - DialogUitl.showSimpleDialog(mContext, WordUtil.getString(R.string.video_edit_exit), new DialogUitl.SimpleCallback() { + DialogUitl.showSimpleDialog(mContext,mContext.getString(R.string.video_edit_exit), new DialogUitl.SimpleCallback() { @Override public void onConfirmClick(Dialog dialog, String content) { exit(); @@ -741,7 +741,7 @@ public class VideoEditActivity extends AbsActivity implements * 开始预处理 */ private void startPreProcess() { - mVideoProcessViewHolder = new VideoProcessViewHolder(mContext, mRoot, WordUtil.getString(R.string.video_process_1)); + mVideoProcessViewHolder = new VideoProcessViewHolder(mContext, mRoot,mContext.getString(R.string.video_process_1)); mVideoProcessViewHolder.addToParent(); mVideoProcessViewHolder.setActionListener(this); if (mHandler == null) { @@ -840,7 +840,7 @@ public class VideoEditActivity extends AbsActivity implements */ @Override public void onCancelProcessClick() { - ToastUtil.show(WordUtil.getString(R.string.video_process_cancel)); + ToastUtil.show(mContext.getString(R.string.video_process_cancel)); deleteOriginVideoFile(); release(); finish(); diff --git a/video/src/main/java/com/yunbao/video/activity/VideoPublishActivity.java b/video/src/main/java/com/yunbao/video/activity/VideoPublishActivity.java index 0e5fd5a0c..4e927d95e 100644 --- a/video/src/main/java/com/yunbao/video/activity/VideoPublishActivity.java +++ b/video/src/main/java/com/yunbao/video/activity/VideoPublishActivity.java @@ -102,7 +102,7 @@ public class VideoPublishActivity extends AbsActivity implements ITXLivePlayList @Override protected void main() { getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); - setTitle(WordUtil.getString(R.string.video_pub)); + setTitle(mContext.getString(R.string.video_pub)); Intent intent = getIntent(); mVideoPath = intent.getStringExtra(Constants.VIDEO_PATH); mSaveType = intent.getIntExtra(Constants.VIDEO_SAVE_TYPE, Constants.VIDEO_SAVE_SAVE_AND_PUB); @@ -253,7 +253,7 @@ public class VideoPublishActivity extends AbsActivity implements ITXLivePlayList @Override public void onBackPressed() { - DialogUitl.showSimpleDialog(mContext, WordUtil.getString(R.string.video_give_up_pub), new DialogUitl.SimpleCallback() { + DialogUitl.showSimpleDialog(mContext,mContext.getString(R.string.video_give_up_pub), new DialogUitl.SimpleCallback() { @Override public void onConfirmClick(Dialog dialog, String content) { if (mSaveType == Constants.VIDEO_SAVE_PUB) { @@ -297,7 +297,7 @@ public class VideoPublishActivity extends AbsActivity implements ITXLivePlayList mLocation.setText(CommonAppConfig.getInstance().getCity()); } else { mLocation.setEnabled(false); - mLocation.setText(WordUtil.getString(R.string.mars)); + mLocation.setText(mContext.getString(R.string.mars)); } } @@ -320,7 +320,7 @@ public class VideoPublishActivity extends AbsActivity implements ITXLivePlayList if (TextUtils.isEmpty(mVideoPath)) { return; } - mLoading = DialogUitl.loadingDialog(mContext, WordUtil.getString(R.string.video_pub_ing)); + mLoading = DialogUitl.loadingDialog(mContext,mContext.getString(R.string.video_pub_ing)); mLoading.show(); Bitmap bitmap = null; //生成视频封面图 diff --git a/video/src/main/java/com/yunbao/video/activity/VideoReportActivity.java b/video/src/main/java/com/yunbao/video/activity/VideoReportActivity.java index 24b0ae0c7..e905dc994 100644 --- a/video/src/main/java/com/yunbao/video/activity/VideoReportActivity.java +++ b/video/src/main/java/com/yunbao/video/activity/VideoReportActivity.java @@ -48,7 +48,7 @@ public class VideoReportActivity extends AbsActivity implements VideoReportAdapt @Override protected void main() { - setTitle(WordUtil.getString(R.string.report)); + setTitle(mContext.getString(R.string.report)); mVideoId = getIntent().getStringExtra(Constants.VIDEO_ID); mRecyclerView = findViewById(R.id.recyclerView); mRecyclerView.setHasFixedSize(true); diff --git a/video/src/main/java/com/yunbao/video/bean/VideoCommentBean.java b/video/src/main/java/com/yunbao/video/bean/VideoCommentBean.java index d59e57480..ce1c10d45 100644 --- a/video/src/main/java/com/yunbao/video/bean/VideoCommentBean.java +++ b/video/src/main/java/com/yunbao/video/bean/VideoCommentBean.java @@ -18,7 +18,7 @@ import java.util.List; public class VideoCommentBean implements Parcelable { - private static final String REPLY = WordUtil.getString(R.string.video_comment_reply) + " "; + private static final String REPLY =WordUtil.getString(R.string.video_comment_reply) + " "; private String mId; private String mUid; diff --git a/video/src/main/java/com/yunbao/video/dialog/VideoInputDialogFragment.java b/video/src/main/java/com/yunbao/video/dialog/VideoInputDialogFragment.java index b7bafef5e..2f6b64334 100644 --- a/video/src/main/java/com/yunbao/video/dialog/VideoInputDialogFragment.java +++ b/video/src/main/java/com/yunbao/video/dialog/VideoInputDialogFragment.java @@ -109,7 +109,7 @@ public class VideoInputDialogFragment extends AbsDialogFragment implements View. if (mVideoCommentBean != null) { UserBean replyUserBean = mVideoCommentBean.getUserBean();//要回复的人 if (replyUserBean != null) { - mInput.setHint(WordUtil.getString(R.string.video_comment_reply) + replyUserBean.getUserNiceName()); + mInput.setHint(mContext.getString(R.string.video_comment_reply) + replyUserBean.getUserNiceName()); } } } diff --git a/video/src/main/java/com/yunbao/video/views/VideoCommentViewHolder.java b/video/src/main/java/com/yunbao/video/views/VideoCommentViewHolder.java index 0898755a2..d085f55e7 100644 --- a/video/src/main/java/com/yunbao/video/views/VideoCommentViewHolder.java +++ b/video/src/main/java/com/yunbao/video/views/VideoCommentViewHolder.java @@ -114,7 +114,7 @@ public class VideoCommentViewHolder extends AbsViewHolder implements View.OnClic findViewById(R.id.btn_close).setOnClickListener(this); findViewById(R.id.input).setOnClickListener(this); findViewById(R.id.btn_face).setOnClickListener(this); - mCommentString = WordUtil.getString(R.string.video_comment); + mCommentString =mContext.getString(R.string.video_comment); mCommentNum = (TextView) findViewById(R.id.comment_num); mRefreshView = (CommonRefreshView) findViewById(R.id.refreshView); mRefreshView.setEmptyLayoutId(R.layout.view_no_data_comment); From d0e2278df743a39e64720485859405aa2c7f013e Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Tue, 18 Apr 2023 13:45:21 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=A4=9A=E8=AF=AD=E8=A8=80=E5=88=87?= =?UTF-8?q?=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" /> From 293c9dcf9e979d0e6a93b0167492daecb5f2ac9d Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Tue, 18 Apr 2023 14:51:26 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=A4=9A=E8=AF=AD=E8=A8=80=E5=88=87?= =?UTF-8?q?=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 | 2 ++ common/src/main/res/values-zh-rHK/strings.xml | 2 ++ common/src/main/res/values-zh-rTW/strings.xml | 1 + common/src/main/res/values-zh/strings.xml | 2 ++ common/src/main/res/values/strings.xml | 2 ++ config.gradle | 4 ++-- .../java/com/yunbao/live/dialog/LiveUserDialogFragment.java | 2 +- .../main/java/com/yunbao/live/views/LiveRoomViewHolder.java | 2 +- main/src/main/res/layout/view_main_encourage.xml | 2 +- 9 files changed, 14 insertions(+), 5 deletions(-) diff --git a/common/src/main/res/values-en-rUS/string.xml b/common/src/main/res/values-en-rUS/string.xml index 7c70e1247..32c917fe3 100644 --- a/common/src/main/res/values-en-rUS/string.xml +++ b/common/src/main/res/values-en-rUS/string.xml @@ -1137,4 +1137,6 @@ Limited ride And limited avatar frame New activity, system message Broadcast notice Get live notification after opening + PK Ladder Race + Confirm whether to go to the other party\'s studio? diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index 6cd79c545..3eacbccf5 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1132,4 +1132,6 @@ 新活動、系統消息 開播通知 開啟後獲得直播通知 + PK天梯赛 + 是否確認前往對方直播間? diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index 6cd79c545..c45652227 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1132,4 +1132,5 @@ 新活動、系統消息 開播通知 開啟後獲得直播通知 + PK天梯赛 diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index 6cd79c545..3eacbccf5 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1132,4 +1132,6 @@ 新活動、系統消息 開播通知 開啟後獲得直播通知 + PK天梯赛 + 是否確認前往對方直播間? diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 7c70e1247..0861562ec 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1136,5 +1136,7 @@ Limited ride And limited avatar frame System notification New activity, system message Broadcast notice + PK Ladder Race Get live notification after opening + Confirm whether to go to the other party\'s studio? diff --git a/config.gradle b/config.gradle index 367862767..82f2a343d 100644 --- a/config.gradle +++ b/config.gradle @@ -9,9 +9,9 @@ ext { ] manifestPlaceholders = [ //正式、 -// serverHost : "https://napi.yaoulive.com", + serverHost : "https://napi.yaoulive.com", //测试 - serverHost : "https://ceshi.yaoulive.com", +// serverHost : "https://ceshi.yaoulive.com", //腾讯地图 txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB", diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java index e91e38c26..44a868bb7 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java @@ -589,7 +589,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On private void gotoLive(String live_id) { - DialogUitl.showSimpleDialog(mContext, "是否確認前往對方直播間?", new DialogUitl.SimpleCallback() { + DialogUitl.showSimpleDialog(mContext, mContext.getString(R.string.party_studio), new DialogUitl.SimpleCallback() { @Override public void onConfirmClick(Dialog dialog, String content) { LiveUserDialogFragment.this.dismiss(); 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 e47000d43..35fc45d1f 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -2054,7 +2054,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis mPkRankText.setLayoutParams(textParams); mPkRankText.setGravity(Gravity.START); ImgLoader.display(mContext, bean.getVsImgUrl(), titleIcon); - titleText.setText("PK天梯赛"); + titleText.setText(R.string.PK_Ladder_Race); titleText.setLayoutParams(textParams); titleIcon.setLayoutParams(params); mPkRankIcon.setLayoutParams(params); diff --git a/main/src/main/res/layout/view_main_encourage.xml b/main/src/main/res/layout/view_main_encourage.xml index e661f061a..387eb2bb5 100644 --- a/main/src/main/res/layout/view_main_encourage.xml +++ b/main/src/main/res/layout/view_main_encourage.xml @@ -8,7 +8,7 @@ android:id="@+id/rootView" android:layout_width="match_parent" android:layout_height="match_parent" - android:orientation="vertical"/> + android:orientation="vertical" /> Date: Wed, 19 Apr 2023 10:16:56 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=A4=9A=E8=AF=AD=E8=A8=80=E5=88=87?= =?UTF-8?q?=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/common/utils/RouteUtil.java | 5 ++- config.gradle | 4 +-- .../live/activity/LiveAnchorActivity.java | 19 ++++++---- .../live/activity/WebViewActivityMedal.java | 5 ++- .../LiveTurnTableDialogFragment4Audience.java | 5 ++- .../LiveWishListDialogFragment4Audience.java | 5 ++- .../live/presenter/LiveGiftAnimPresenter.java | 5 +-- .../presenter/UserHomeSharePresenter.java | 5 ++- .../live/views/LiveContributeViewHolder.java | 5 ++- .../live/views/LiveMedalRankViewHolder.java | 5 ++- .../yunbao/live/views/LiveRoomViewHolder.java | 35 +++++++++++++------ .../live/views/TurnTableWebViewHolder.java | 5 ++- .../activity/LanguageSettingActivity.java | 2 +- .../yunbao/main/activity/MyCoinActivity.java | 6 ++-- .../main/activity/MyProfitActivity.java | 5 ++- .../views/MainHomeCommunityViewHolder.java | 11 +++--- .../yunbao/main/views/MainMeViewHolder.java | 3 +- 17 files changed, 90 insertions(+), 40 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/utils/RouteUtil.java b/common/src/main/java/com/yunbao/common/utils/RouteUtil.java index c8a3c2645..e4231fe8b 100644 --- a/common/src/main/java/com/yunbao/common/utils/RouteUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/RouteUtil.java @@ -10,6 +10,9 @@ import com.yunbao.common.CommonAppContext; import com.yunbao.common.Constants; import com.yunbao.common.HtmlConfig; import com.yunbao.common.bean.LiveBean; +import com.yunbao.common.manager.IMLoginManager; + +import java.util.Locale; /** * Created by cxf on 2019/2/25. @@ -109,7 +112,7 @@ public class RouteUtil { if (!"".equals(Constants.chatActionUrl)) { url = Constants.chatActionUrl; } - Constants.myUrl = url + "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&t=" + System.currentTimeMillis(); + Constants.myUrl = url + "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&t=" + System.currentTimeMillis() + "&isZh=" + ((IMLoginManager.get(context).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"); ARouter.getInstance().build(PATH_MYWEBVIEWACTIVTITY) .withString(Constants.URL, url) .navigation(); diff --git a/config.gradle b/config.gradle index 82f2a343d..367862767 100644 --- a/config.gradle +++ b/config.gradle @@ -9,9 +9,9 @@ ext { ] manifestPlaceholders = [ //正式、 - serverHost : "https://napi.yaoulive.com", +// serverHost : "https://napi.yaoulive.com", //测试 -// serverHost : "https://ceshi.yaoulive.com", + serverHost : "https://ceshi.yaoulive.com", //腾讯地图 txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB", diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java index f3d36ed6b..bbec22ae4 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java @@ -1,5 +1,9 @@ package com.yunbao.live.activity; +import static com.tencent.trtc.TRTCCloudDef.TRTC_VIDEO_MIRROR_TYPE_DISABLE; +import static com.tencent.trtc.TRTCCloudDef.TRTC_VIDEO_MIRROR_TYPE_ENABLE; +import static com.yunbao.live.views.LivePushTxViewHolder.mTRTCCloud; + import android.app.Dialog; import android.content.Context; import android.content.Intent; @@ -24,6 +28,7 @@ import com.tencent.trtc.TRTCCloudDef; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppContext; import com.yunbao.common.Constants; +import com.yunbao.common.bean.LiveBean; import com.yunbao.common.bean.UserBean; import com.yunbao.common.dialog.NotCancelableDialog; import com.yunbao.common.event.LoginInvalidEvent; @@ -32,14 +37,13 @@ import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpClient; import com.yunbao.common.http.JsonBean; +import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.DateFormatUtil; import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.L; import com.yunbao.common.utils.LogUtil; import com.yunbao.common.utils.ToastUtil; -import com.yunbao.common.utils.WordUtil; import com.yunbao.live.R; -import com.yunbao.common.bean.LiveBean; import com.yunbao.live.bean.LiveGuardInfo; import com.yunbao.live.bean.LiveKsyConfigBean; import com.yunbao.live.dialog.LiveBeautyDialogFragment; @@ -72,13 +76,10 @@ import org.greenrobot.eventbus.ThreadMode; import java.io.File; import java.util.List; +import java.util.Locale; import pl.droidsonroids.gif.GifImageView; -import static com.tencent.trtc.TRTCCloudDef.TRTC_VIDEO_MIRROR_TYPE_DISABLE; -import static com.tencent.trtc.TRTCCloudDef.TRTC_VIDEO_MIRROR_TYPE_ENABLE; -import static com.yunbao.live.views.LivePushTxViewHolder.mTRTCCloud; - /** * Created by cxf on 2018/10/7. * 主播直播间 @@ -276,7 +277,11 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic }); break; case Constants.LIVE_FUNC_WKS: - String url = CommonAppConfig.HOST + "/h5/activity/weekStar/index.html?&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid; + String url = CommonAppConfig.HOST + + "/h5/activity/weekStar/index.html?&uid=" + + CommonAppConfig.getInstance().getUid() + "&token=" + + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid + + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"); ZhuangBanActivity.forward(mContext, url, false); break; case Constants.LIVE_FUNC_LINK_MIC://连麦 diff --git a/live/src/main/java/com/yunbao/live/activity/WebViewActivityMedal.java b/live/src/main/java/com/yunbao/live/activity/WebViewActivityMedal.java index d2456827f..1f2dec0b1 100644 --- a/live/src/main/java/com/yunbao/live/activity/WebViewActivityMedal.java +++ b/live/src/main/java/com/yunbao/live/activity/WebViewActivityMedal.java @@ -31,6 +31,7 @@ import com.yunbao.common.activity.AbsActivity; import com.yunbao.common.bean.LiveBean; import com.yunbao.common.event.JavascriptInterfaceEvent; import com.yunbao.common.http.HttpCallback; +import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.JavascriptInterfaceUtils; @@ -45,6 +46,8 @@ import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; +import java.util.Locale; + /** * Created by cxf on 2018/9/25. * 我的徽章 h5页面 @@ -152,7 +155,7 @@ public class WebViewActivityMedal extends AbsActivity { mIvQuestion.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - MedalQuestionWebViewActivity.forward(mContext, HtmlConfig.MEDAL_QUESTION); + MedalQuestionWebViewActivity.forward(mContext, HtmlConfig.MEDAL_QUESTION + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); } }); } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveTurnTableDialogFragment4Audience.java b/live/src/main/java/com/yunbao/live/dialog/LiveTurnTableDialogFragment4Audience.java index 2e2945509..732de5034 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveTurnTableDialogFragment4Audience.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveTurnTableDialogFragment4Audience.java @@ -12,6 +12,7 @@ import com.yunbao.common.Constants; import com.yunbao.common.HtmlConfig; import com.yunbao.common.bean.JsTurnTableBean; import com.yunbao.common.dialog.AbsDialogFragment; +import com.yunbao.common.manager.IMLoginManager; import com.yunbao.live.R; import com.yunbao.live.views.TurnTableWebViewHolder; @@ -19,6 +20,8 @@ import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; +import java.util.Locale; + import cn.qqtheme.framework.util.ScreenUtils; @@ -73,7 +76,7 @@ public class LiveTurnTableDialogFragment4Audience extends AbsDialogFragment { if (mTurnTableViewHolder == null) { String url = HtmlConfig.TURNTABLE_URL; url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" - + CommonAppConfig.getInstance().getToken() + "&liveUid=" + mLiveUid; + + CommonAppConfig.getInstance().getToken() + "&liveUid=" + mLiveUid + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"); mTurnTableViewHolder = new TurnTableWebViewHolder(getActivity(), rlWebview, url); mTurnTableViewHolder.subscribeActivityLifeCycle(); mTurnTableViewHolder.addToParent(); diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveWishListDialogFragment4Audience.java b/live/src/main/java/com/yunbao/live/dialog/LiveWishListDialogFragment4Audience.java index c1a4aafe4..168dfdf9e 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveWishListDialogFragment4Audience.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveWishListDialogFragment4Audience.java @@ -11,6 +11,7 @@ import com.yunbao.common.Constants; import com.yunbao.common.HtmlConfig; import com.yunbao.common.bean.JsWishBean; import com.yunbao.common.dialog.AbsDialogFragment; +import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.DpUtil; import com.yunbao.live.R; import com.yunbao.live.activity.LiveAudienceActivity; @@ -20,6 +21,8 @@ import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; +import java.util.Locale; + /** * Created by cxf on 2018/10/19. * 观众查看 心愿单弹窗 @@ -69,7 +72,7 @@ public class LiveWishListDialogFragment4Audience extends AbsDialogFragment { if (mWishWebViewHolder == null) { String url = HtmlConfig.WISHLIST_URL; url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" - + CommonAppConfig.getInstance().getToken() + "&liveUid=" + mLiveUid; + + CommonAppConfig.getInstance().getToken() + "&liveUid=" + mLiveUid + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"); mWishWebViewHolder = new WishlistWebViewHolder(mContext, rlWebview, url); mWishWebViewHolder.subscribeActivityLifeCycle(); mWishWebViewHolder.addToParent(); diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java index 4b31c8926..b91798350 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java @@ -72,6 +72,7 @@ import java.io.File; import java.io.FileInputStream; import java.lang.ref.SoftReference; import java.util.HashMap; +import java.util.Locale; import java.util.Map; import java.util.concurrent.ConcurrentLinkedQueue; @@ -339,7 +340,7 @@ public class LiveGiftAnimPresenter { mGifGiftTipGroupBuyZuoji.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - WebViewActivity.forward(mContext, HtmlConfig.SHOP); + WebViewActivity.forward(mContext, HtmlConfig.SHOP + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); } }); } @@ -348,7 +349,7 @@ public class LiveGiftAnimPresenter { mGifGiftTipGroupBuyLiangName.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - WebViewActivity.forward(mContext, HtmlConfig.SHOP); + WebViewActivity.forward(mContext, HtmlConfig.SHOP + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); } }); } diff --git a/live/src/main/java/com/yunbao/live/presenter/UserHomeSharePresenter.java b/live/src/main/java/com/yunbao/live/presenter/UserHomeSharePresenter.java index a132baac5..204ec3452 100644 --- a/live/src/main/java/com/yunbao/live/presenter/UserHomeSharePresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/UserHomeSharePresenter.java @@ -6,10 +6,13 @@ import android.content.Context; import android.text.TextUtils; import com.yunbao.common.HtmlConfig; +import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.live.R; +import java.util.Locale; + /** * Created by cxf on 2018/10/30. */ @@ -56,7 +59,7 @@ public class UserHomeSharePresenter { return; } String link = HtmlConfig.SHARE_HOME_PAGE + mToUid; - ClipboardManager cm = (ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE); + ClipboardManager cm = (ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); ClipData clipData = ClipData.newPlainText("text", link); cm.setPrimaryClip(clipData); ToastUtil.show(R.string.copy_success); diff --git a/live/src/main/java/com/yunbao/live/views/LiveContributeViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveContributeViewHolder.java index f79ddf200..6afd4c7f6 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveContributeViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveContributeViewHolder.java @@ -14,11 +14,14 @@ import android.widget.ProgressBar; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.HtmlConfig; +import com.yunbao.common.manager.IMLoginManager; import com.yunbao.live.R; import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.activity.LiveContributeActivity; import com.yunbao.common.utils.L; +import java.util.Locale; + /** * Created by cxf on 2018/10/15. * 直播间粉丝排行榜 @@ -79,7 +82,7 @@ public class LiveContributeViewHolder extends AbsLivePageViewHolder implements V public void loadData() { if (!mLoad) { mLoad = true; - mWebView.loadUrl(HtmlConfig.LIVE_LIST + mLiveUid); + mWebView.loadUrl(HtmlConfig.LIVE_LIST + mLiveUid + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); } else { mWebView.reload(); } diff --git a/live/src/main/java/com/yunbao/live/views/LiveMedalRankViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveMedalRankViewHolder.java index 1d8c2c1e1..b70223ee1 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveMedalRankViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveMedalRankViewHolder.java @@ -13,11 +13,14 @@ import android.widget.ProgressBar; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.HtmlConfig; +import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.L; import com.yunbao.live.R; import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.activity.LiveContributeActivity; +import java.util.Locale; + /** * Created by cxf on 2018/10/15. * 直播间粉丝排行榜 @@ -78,7 +81,7 @@ public class LiveMedalRankViewHolder extends AbsLivePageViewHolder implements Vi public void loadData() { if (!mLoad) { mLoad = true; - mWebView.loadUrl(HtmlConfig.LIVE_FANS_MEDAL_RANKING + mLiveUid); + mWebView.loadUrl(HtmlConfig.LIVE_FANS_MEDAL_RANKING + mLiveUid + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); } else { mWebView.reload(); } 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 35fc45d1f..c451154f3 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -110,7 +110,6 @@ import com.yunbao.common.utils.ScreenDimenUtil; import com.yunbao.common.utils.SpUtil; import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; -import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.formatBigNum; import com.yunbao.common.views.AbsViewHolder; import com.yunbao.common.views.weight.ClipPathCircleImage; @@ -1279,7 +1278,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis liveAudienceActivity.pausePlay(); if (code == 1008) {//余额不足 liveAudienceActivity.setCoinNotEnough(true); - DialogUitl.showSimpleDialog(mContext,mContext.getString(R.string.live_coin_not_enough), false, + DialogUitl.showSimpleDialog(mContext, mContext.getString(R.string.live_coin_not_enough), false, new DialogUitl.SimpleCallback2() { @Override public void onConfirmClick(Dialog dialog, String content) { @@ -1621,7 +1620,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .append("&uid=") .append(userInfo.getId()) .append("&k=") - .append(System.currentTimeMillis()); + .append(System.currentTimeMillis()) + .append("&isZh=") + .append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); + } else { type = bean.getShow_type(); htmlUrl.append(bean.getLink()) @@ -1632,7 +1634,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .append("&anchorUid=") .append(mLiveUid) .append("&t=") - .append(System.currentTimeMillis()); + .append(System.currentTimeMillis()) + .append("&isZh=") + .append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); } if (TextUtils.equals(type, "1")) { ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false); @@ -1680,7 +1684,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .append("&uid=") .append(userInfo.getId()) .append("&k=") - .append(System.currentTimeMillis()); + .append(System.currentTimeMillis()) + .append("&isZh=") + .append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); } else { type = bean.getShow_type(); htmlUrl.append(bean.getLink()) @@ -1694,7 +1700,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .append(mLiveUid) .append("&t=") .append(System.currentTimeMillis()) - .append("&g=Appapi&m=Wish&a=index"); + .append("&g=Appapi&m=Wish&a=index") + .append("&isZh=") + .append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); } if (TextUtils.equals(type, "1")) { ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false); @@ -1730,7 +1738,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis if (loadingDialog != null && loadingDialog.isShowing()) { return true; } - loadingDialog = DialogUitl.loadingDialog(mContext,mContext.getString(R.string.login_wait)); + loadingDialog = DialogUitl.loadingDialog(mContext, mContext.getString(R.string.login_wait)); loadingDialog.show(); new Handler(Looper.getMainLooper()).postDelayed(() -> { if (loadingDialog != null) { @@ -2024,7 +2032,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } String url = CommonAppConfig.HOST + path; url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" - + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid; + + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid + + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"); bundle.putString("url", url); bundle.putInt("height", DpUtil.dp2px(500)); bundle.putInt("show_type", 0); @@ -2876,7 +2885,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public void callback(Integer isAttention) { if (isAttention == 1) { LiveActivity.sendSystemMessage( - CommonAppConfig.getInstance().getUserBean().getUserNiceName() +Contexts.getString(R.string.live_follow_anchor)); + CommonAppConfig.getInstance().getUserBean().getUserNiceName() + Contexts.getString(R.string.live_follow_anchor)); } } }); @@ -4875,7 +4884,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .append(mLiveUid) .append("&t=") .append(System.currentTimeMillis()) - .append("&g=Appapi&m=Wish&a=index"); + .append("&g=Appapi&m=Wish&a=index") + .append("&isZh=") + .append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); if (TextUtils.equals(type, "1")) { ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false); } else { @@ -4948,7 +4959,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .append(mLiveUid) .append("&t=") .append(System.currentTimeMillis()) - .append("&g=Appapi&m=Wish&a=index"); + .append("&g=Appapi&m=Wish&a=index") + .append("&isZh=") + .append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); if (TextUtils.equals(type, "1")) { ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false); } else { diff --git a/live/src/main/java/com/yunbao/live/views/TurnTableWebViewHolder.java b/live/src/main/java/com/yunbao/live/views/TurnTableWebViewHolder.java index 74dd4981b..a433848ad 100644 --- a/live/src/main/java/com/yunbao/live/views/TurnTableWebViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/TurnTableWebViewHolder.java @@ -17,6 +17,7 @@ import com.yunbao.common.HtmlConfig; import com.yunbao.common.activity.WebViewActivity; import com.yunbao.common.bean.JsTurnTableBean; import com.yunbao.common.event.JavascriptInterfaceEvent; +import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.JavascriptInterfaceUtils; import com.yunbao.common.utils.L; @@ -26,6 +27,8 @@ import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; +import java.util.Locale; + /** * Created by cxf on 2018/10/15. * 心愿单WebView @@ -125,7 +128,7 @@ public class TurnTableWebViewHolder extends AbsLivePageViewHolder implements Vie if (!TextUtils.isEmpty(event.getMethod())) { if (TextUtils.equals(event.getMethod(), "androidMethod")) { if (event.getData() != null && !event.getData().isEmpty()) { - WebViewActivity.forward(mContext, HtmlConfig.SHOP); + WebViewActivity.forward(mContext, HtmlConfig.SHOP + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); EventBus.getDefault().post(new JsTurnTableBean(event.getData())); } } diff --git a/main/src/main/java/com/yunbao/main/activity/LanguageSettingActivity.java b/main/src/main/java/com/yunbao/main/activity/LanguageSettingActivity.java index 02431ad32..c718c736a 100644 --- a/main/src/main/java/com/yunbao/main/activity/LanguageSettingActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/LanguageSettingActivity.java @@ -70,7 +70,7 @@ public class LanguageSettingActivity extends AbsActivity { Stack allActivityStacks = AppManager.getInstance().getAllActivityStacks(); for (int i = 0; i < allActivityStacks.size(); i++) { if (!(allActivityStacks.get(i) instanceof LanguageSettingActivity)) { - LanguageUtil.shiftLanguage(locale, allActivityStacks.get(i), mContext); + allActivityStacks.get(i).finish(); } } IMLoginManager.get(mContext).setLanguage(locale != Locale.SIMPLIFIED_CHINESE); diff --git a/main/src/main/java/com/yunbao/main/activity/MyCoinActivity.java b/main/src/main/java/com/yunbao/main/activity/MyCoinActivity.java index c6be2770f..c29b6f47a 100644 --- a/main/src/main/java/com/yunbao/main/activity/MyCoinActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MyCoinActivity.java @@ -24,6 +24,7 @@ import com.yunbao.common.http.CommonHttpConsts; import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.interfaces.OnItemClickListener; +import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.pay.PayCallback; import com.yunbao.common.pay.PayPresenter; import com.yunbao.common.utils.StringUtil; @@ -38,6 +39,7 @@ import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; import java.util.List; +import java.util.Locale; /** * Created by cxf on 2018/10/23. @@ -295,10 +297,10 @@ public class MyCoinActivity extends AbsActivity implements OnItemClickListener