调整天梯赛点击事件

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才出现 // 这个方法在6.0才出现
int statusCode = errorResponse.getStatusCode(); int statusCode = errorResponse.getStatusCode();
if (404 == statusCode || 500 == statusCode) { if (404 == statusCode || 500 == statusCode) {
if ( !request.getUrl().toString().contains("favicon.png")){ if ( !request.getUrl().toString().contains("favicon")){
htmlError.setVisibility(View.VISIBLE); htmlError.setVisibility(View.VISIBLE);
htmlError.setText("errorCode:" + statusCode +"\n failingUrl:" + request.getUrl()); htmlError.setText("errorCode:" + statusCode +"\n failingUrl:" + request.getUrl());
} }

View File

@ -1562,23 +1562,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
pkRankVf.addView(titleView); pkRankVf.addView(titleView);
pkRankVf.addView(hourView); pkRankVf.addView(hourView);
pkRankVf.startFlipping(); 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"); pkRankVf.setTag("start");
} }
@ -1596,6 +1579,35 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
if (bean != null) { if (bean != null) {
Log.i("PK", bean.toString() + " | " + isLadders); Log.i("PK", bean.toString() + " | " + isLadders);
initPkRankView(bean); 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()); mPkRankText.setText(bean.getName());
ImgLoader.display(mContext, bean.getImg(), mPkRankIcon); ImgLoader.display(mContext, bean.getImg(), mPkRankIcon);