URL 跳转考虑是否存在?

This commit is contained in:
ningwenqiang 2024-11-02 14:57:48 +08:00
parent 1019bac085
commit 3f03230cd3
12 changed files with 66 additions and 26 deletions

View File

@ -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);
}

View File

@ -1493,4 +1493,5 @@ Limited ride And limited avatar frame</string>
<string name="interaction_type">Interaction</string>
<string name="system_msg">System Message</string>
<string name="user_login_account">Sign in with Phone number</string>
<string name="live_search_tips">Search for the hosts nickname or ID</string>
</resources>

View File

@ -1623,4 +1623,5 @@
<string name="interaction_type">互動</string>
<string name="system_msg">系統消息</string>
<string name="user_login_account">使用手機號登錄</string>
<string name="live_search_tips">搜索主播暱稱或ID</string>
</resources>

View File

@ -1432,6 +1432,6 @@ Limited ride And limited avatar frame</string>
<string name="system_msg">System Message</string>
<string name="user_login_account">Sign in with Phone number</string>
<string name="live_search_tips">Search for the hosts nickname or ID</string>
</resources>

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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,
};

View File

@ -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", "");
}

View File

@ -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);
}

View File

@ -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;

View File

@ -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" />
<TextView
@ -139,6 +140,7 @@
android:maxLines="1"
android:textColor="#99ffffff"
android:textSize="10sp"
android:visibility="gone"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/name"
app:layout_constraintStart_toStartOf="parent"
@ -162,6 +164,7 @@
android:layout_alignParentBottom="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@+id/title"
android:visibility="gone"
android:layout_marginEnd="10dp"
android:scaleType="centerCrop"
app:riv_border_color="@color/color_white"
@ -190,7 +193,7 @@
android:id="@+id/live_info_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="cover,bgs,live_type,views,tv_live_ico,tv_live_state,type,title,name,num"/>
app:constraint_referenced_ids="cover,bgs,live_type,views,tv_live_ico,tv_live_state,type,name,num"/>
<!-- 这里从下面开始布局 这里是周星榜的-->
<ViewFlipper

View File

@ -66,7 +66,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="搜主播名字"
android:text="@string/live_search_tips"
android:textColor="#99000000"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@+id/btn_search"