调整天梯赛点击事件

This commit is contained in:
zlzw 2022-11-18 13:52:06 +08:00
parent a12524dc9c
commit e0a2f7c798
2 changed files with 33 additions and 21 deletions

View File

@ -209,7 +209,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
// 这个方法在6.0才出现
int statusCode = errorResponse.getStatusCode();
if (404 == statusCode || 500 == statusCode) {
if ( !request.getUrl().toString().contains("favicon.png")){
if ( !request.getUrl().toString().contains("favicon")){
htmlError.setVisibility(View.VISIBLE);
htmlError.setText("errorCode:" + statusCode +"\n failingUrl:" + request.getUrl());
}

View File

@ -1548,13 +1548,13 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
View hourView = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null);
View titleView = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null);
ImageView titleIcon =titleView.findViewById(R.id.wish_pic);
TextView titleText =titleView.findViewById(R.id.wish_index);
ImageView titleIcon = titleView.findViewById(R.id.wish_pic);
TextView titleText = titleView.findViewById(R.id.wish_index);
mPkRankIcon = hourView.findViewById(R.id.wish_pic);
mPkRankText = hourView.findViewById(R.id.wish_index);
mPkRankText.setLayoutParams(textParams);
mPkRankText.setGravity(Gravity.START);
ImgLoader.display(mContext,bean.getVsImgUrl(),titleIcon);
ImgLoader.display(mContext, bean.getVsImgUrl(), titleIcon);
titleText.setText("PK天梯赛");
titleText.setLayoutParams(textParams);
titleIcon.setLayoutParams(params);
@ -1562,23 +1562,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
pkRankVf.addView(titleView);
pkRankVf.addView(hourView);
pkRankVf.startFlipping();
pkRankVf.setOnClickListener(v -> {
Bundle bundle = new Bundle();
String path = bean.getClickUrl();
if (!path.startsWith("/")) {
path = "/" + path;
}
String url = CommonAppConfig.HOST + path;
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token="
+ CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid;
bundle.putString("url", url);
bundle.putInt("height", DpUtil.dp2px(500));
bundle.putInt("show_type", 0);
bundle.putString("roomId", mLiveUid);
LiveHDDialogFragment liveHDDialogFragment = new LiveHDDialogFragment();
liveHDDialogFragment.setArguments(bundle);
liveHDDialogFragment.show(((AbsActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
});
pkRankVf.setTag("start");
}
@ -1596,6 +1579,35 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
if (bean != null) {
Log.i("PK", bean.toString() + " | " + isLadders);
initPkRankView(bean);
if (!StringUtil.isEmpty(bean.getClickUrl())) {
pkRankVf.setOnClickListener(v -> {
Bundle bundle = new Bundle();
String path = bean.getClickUrl();
if (!path.startsWith("/")&&!path.startsWith("http")) {
path = "/" + path;
}
String url = null;
if (path.startsWith("http") || path.startsWith("/http")) {
url = path;
} else {
url = CommonAppConfig.HOST + path;
}
if (!url.contains("?")) {
url += "?";
} else {
url += "&";
}
url += "uid=" + CommonAppConfig.getInstance().getUid() + "&token="
+ CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid;
bundle.putString("url", url);
//bundle.putInt("height", DpUtil.dp2px(600));
bundle.putInt("show_type", 0);
bundle.putString("roomId", mLiveUid);
LiveHDDialogFragment liveHDDialogFragment = new LiveHDDialogFragment();
liveHDDialogFragment.setArguments(bundle);
liveHDDialogFragment.show(((AbsActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
});
}
mPkRankText.setText(bean.getName());
ImgLoader.display(mContext, bean.getImg(), mPkRankIcon);