From 3f03230cd31c0701e2d3847d21fefecfbf05c9c7 Mon Sep 17 00:00:00 2001 From: ningwenqiang Date: Sat, 2 Nov 2024 14:57:48 +0800 Subject: [PATCH] =?UTF-8?q?URL=20=E8=B7=B3=E8=BD=AC=E8=80=83=E8=99=91?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/common/activity/WebViewActivity.java | 14 +++++++++++--- common/src/main/res/values-en-rUS/strings.xml | 1 + common/src/main/res/values-zh/strings.xml | 1 + common/src/main/res/values/strings.xml | 2 +- .../live/activity/WebViewActivityMedal.java | 13 +++++++++++-- .../yunbao/main/activity/RewardActivity.java | 13 +++++++++++-- .../main/activity/ThreeDistributActivity.java | 17 ++++++++++++----- .../yunbao/main/activity/ZhuangBanActivity.java | 8 ++++++-- .../java/com/yunbao/main/http/MainHttpUtil.java | 6 +++--- .../com/yunbao/main/views/LiveOptFollAgent.java | 2 -- .../res/layout/item_main_home_lives_pola.xml | 13 ++++++++----- main/src/main/res/layout/view_main_home2.xml | 2 +- 12 files changed, 66 insertions(+), 26 deletions(-) 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 946591739..249d1deff 100644 --- a/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java +++ b/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java @@ -297,11 +297,19 @@ public class WebViewActivity extends AbsActivity { mIsLive = isLive; if (Constants.LoginKefu) { if (addArgs) { - url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0); - } + if (url.contains("?")) { + url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken(); + } else { + url += "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken(); + }} + } + if (url.contains("?")) { + url += "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"); + } else { + url += "?isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"); } Intent intent = new Intent(context, WebViewActivity.class); - intent.putExtra(Constants.URL, url + "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); + intent.putExtra(Constants.URL, url); context.startActivity(intent); } diff --git a/common/src/main/res/values-en-rUS/strings.xml b/common/src/main/res/values-en-rUS/strings.xml index cf5a573c6..79232837e 100644 --- a/common/src/main/res/values-en-rUS/strings.xml +++ b/common/src/main/res/values-en-rUS/strings.xml @@ -1493,4 +1493,5 @@ Limited ride And limited avatar frame Interaction System Message Sign in with Phone number + Search for the hosts nickname or ID diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index 3984156c5..b998459bb 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1623,4 +1623,5 @@ 互動 系統消息 使用手機號登錄 + 搜索主播暱稱或ID diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 4d82b9fb5..31d764063 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1432,6 +1432,6 @@ Limited ride And limited avatar frame System Message Sign in with Phone number - + Search for the hosts nickname or ID 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 3d6e6e089..bf87bbeb3 100644 --- a/live/src/main/java/com/yunbao/live/activity/WebViewActivityMedal.java +++ b/live/src/main/java/com/yunbao/live/activity/WebViewActivityMedal.java @@ -299,10 +299,19 @@ public class WebViewActivityMedal extends AbsActivity { public static void forward(Context context, String url, boolean addArgs) { if (addArgs) { - url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken(); + if (url.contains("?")) { + url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken(); + } else { + url += "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken(); + } + } + if (url.contains("?")) { + url += "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"); + } else { + url += "?isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"); } Intent intent = new Intent(context, WebViewActivityMedal.class); - intent.putExtra(Constants.URL, url + "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); + intent.putExtra(Constants.URL, url); context.startActivity(intent); } diff --git a/main/src/main/java/com/yunbao/main/activity/RewardActivity.java b/main/src/main/java/com/yunbao/main/activity/RewardActivity.java index 47655f3bb..eb462e9e0 100644 --- a/main/src/main/java/com/yunbao/main/activity/RewardActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/RewardActivity.java @@ -319,11 +319,20 @@ public class RewardActivity extends AbsActivity { public static void forward(Context context, String url, boolean addArgs) { if (addArgs) { - url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken(); + if (url.contains("?")) { + url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken(); + } else { + url += "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken(); + } } Intent intent = new Intent(context, RewardActivity.class); + if (url.contains("?")) { + url += "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"); + } else { + url += "?isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"); + } Log.i("tag", url); - intent.putExtra(Constants.URL, url+ "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); + intent.putExtra(Constants.URL, url); context.startActivity(intent); } 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 9e4b8ddd2..9bdc5a6c0 100644 --- a/main/src/main/java/com/yunbao/main/activity/ThreeDistributActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/ThreeDistributActivity.java @@ -9,7 +9,9 @@ import android.graphics.Bitmap; import android.net.Uri; import android.os.Build; import android.provider.MediaStore; + import androidx.annotation.RequiresApi; + import android.text.TextUtils; import android.view.View; import android.view.ViewGroup; @@ -196,7 +198,7 @@ public class ThreeDistributActivity extends AbsActivity implements View.OnClickL intent.setData(MediaStore.Images.Media.EXTERNAL_CONTENT_URI); } intent.setType("image/*"); - startActivityForResult(Intent.createChooser(intent,mContext.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) @@ -271,7 +273,12 @@ public class ThreeDistributActivity extends AbsActivity implements View.OnClickL public static void forward(Context context, String title, String url) { - url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()+ "&isZh=" + (WordUtil.isNewZh() ? "1" : "0"); + if (url.contains("?")) { + url += "&uid=" + CommonAppConfig.getInstance().getUid(); + } else { + url += "?uid=" + CommonAppConfig.getInstance().getUid(); + } + url += "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0"); Intent intent = new Intent(context, ThreeDistributActivity.class); intent.putExtra(Constants.URL, url); intent.putExtra(Constants.TIP, title); @@ -311,11 +318,11 @@ public class ThreeDistributActivity extends AbsActivity implements View.OnClickL private void saveBitmapFile() { String[] permissions; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - permissions=new String[]{ + permissions = new String[]{ Manifest.permission.READ_MEDIA_IMAGES }; - }else{ - permissions=new String[]{ + } else { + permissions = new String[]{ Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, }; 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 a31db6a99..954b52657 100644 --- a/main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java @@ -322,11 +322,15 @@ public class ZhuangBanActivity extends AbsActivity { } else { url += "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0"); } - } Intent intent = new Intent(context, ZhuangBanActivity.class); + if (url.contains("?")) { + url += "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"); + } else { + url += "?isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"); + } Log.i("tag1212", url); - intent.putExtra(Constants.URL, url + "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); + intent.putExtra(Constants.URL, url); if (url.contains("Noble/index.html") || url.contains("Grade/index.html") || url.contains("Guard/index.html")) { intent.putExtra("title", ""); } diff --git a/main/src/main/java/com/yunbao/main/http/MainHttpUtil.java b/main/src/main/java/com/yunbao/main/http/MainHttpUtil.java index 21ab945b5..459d3a666 100644 --- a/main/src/main/java/com/yunbao/main/http/MainHttpUtil.java +++ b/main/src/main/java/com/yunbao/main/http/MainHttpUtil.java @@ -526,7 +526,7 @@ public class MainHttpUtil { HttpClient.getInstance().get("ylahuoquduanxiyanzhengma", MainHttpConsts.GET_REGISTER_CODE) .params("mobile", mobile) .params("sign", sign) - .params("source", "1") + .params("source", "4") .params("langue", WordUtil.isNewZh()?"chinese":"english") .execute(callback); } @@ -549,7 +549,7 @@ public class MainHttpUtil { .params("Ticket", Ticket) .params("MacAddress", macUitl.getNewMac()) .params("Imei", uuid) - .params("source", "2") + .params("source", "4") .params("langue", WordUtil.isNewZh()?"chinese":"english") .execute(callback); } @@ -659,7 +659,7 @@ public class MainHttpUtil { HttpClient.getInstance().get("ylahuoquduanxiyanzhengma", MainHttpConsts.GET_FIND_PWD_CODE) .params("mobile", mobile) .params("country_code", country_code) - .params("source", "2") + .params("source", "4") .params("langue", WordUtil.isNewZh()?"chinese":"english") .execute(callback); } diff --git a/main/src/main/java/com/yunbao/main/views/LiveOptFollAgent.java b/main/src/main/java/com/yunbao/main/views/LiveOptFollAgent.java index 46126a586..e02eee3a5 100644 --- a/main/src/main/java/com/yunbao/main/views/LiveOptFollAgent.java +++ b/main/src/main/java/com/yunbao/main/views/LiveOptFollAgent.java @@ -11,12 +11,10 @@ import com.yunbao.common.bean.AnchorRecommendModel; import com.yunbao.common.bean.LiveBean; import com.yunbao.common.custom.CommonRefreshView; import com.yunbao.common.http.HttpCallback; -import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.utils.RouteUtil; import com.yunbao.main.activity.MainActivity; import com.yunbao.main.activity.WeekWebViewActivity; import com.yunbao.main.adapter.MainHomeLiveAdapter; -import com.yunbao.main.adapter.MainHomeRemFollLiveAdapter; import com.yunbao.main.http.MainHttpConsts; import com.yunbao.main.http.MainHttpUtil; diff --git a/main/src/main/res/layout/item_main_home_lives_pola.xml b/main/src/main/res/layout/item_main_home_lives_pola.xml index d9a883917..0160e65a9 100644 --- a/main/src/main/res/layout/item_main_home_lives_pola.xml +++ b/main/src/main/res/layout/item_main_home_lives_pola.xml @@ -99,7 +99,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="10dp" - android:layout_marginBottom="10dp" + android:drawablePadding="4dp" android:gravity="center" android:singleLine="true" @@ -109,7 +109,8 @@ app:dt_left_drawable="@mipmap/ic_yola_live_fire" app:dt_left_height="14dp" app:dt_left_width="14dp" - app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintBottom_toBottomOf="@+id/name" + app:layout_constraintTop_toTopOf="@+id/name" app:layout_constraintEnd_toEndOf="parent" tools:text="880k" /> @@ -123,9 +124,9 @@ android:textColor="#fff" android:textSize="12sp" android:textStyle="bold" - app:layout_constraintBottom_toBottomOf="@+id/num" + android:layout_marginBottom="11dp" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="@+id/num" + app:layout_constraintBottom_toBottomOf="parent" tools:text="mame" /> + app:constraint_referenced_ids="cover,bgs,live_type,views,tv_live_ico,tv_live_state,type,name,num"/>