From e0a2f7c7987205c348d9c3c8c1b9616c69140432 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Fri, 18 Nov 2022 13:52:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=A4=A9=E6=A2=AF=E8=B5=9B?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../live/dialog/LiveHDDialogFragment.java | 2 +- .../yunbao/live/views/LiveRoomViewHolder.java | 52 ++++++++++++------- 2 files changed, 33 insertions(+), 21 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java index 0441d63b4..4cfe62d2c 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java @@ -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()); } 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 59013426f..a96375ebd 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -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);