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