From dbd49b31db4b278253a19138c25b296388285b36 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Tue, 30 Aug 2022 13:59:00 +0800 Subject: [PATCH] =?UTF-8?q?update:=E8=B0=83=E6=95=B4=E5=B0=8F=E6=97=B6?= =?UTF-8?q?=E6=A6=9Curl=20update:=E5=B0=8F=E6=97=B6=E6=A6=9C=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E8=B7=B3=E8=BD=AC=E7=9B=B4=E6=92=AD=E9=97=B4or?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83=20update=EF=BC=9A=E5=B0=8F?= =?UTF-8?q?=E6=97=B6=E6=A6=9Cicon=E4=BD=8D=E7=BD=AE=E8=B0=83=E6=95=B4=20up?= =?UTF-8?q?date=EF=BC=9A=E5=B0=8F=E6=97=B6=E6=A6=9C=E4=B8=BA0=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=E6=98=BE=E7=A4=BA=E4=B8=BA=E2=80=98=E6=9C=AA?= =?UTF-8?q?=E4=B8=8A=E6=A6=9C=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../live/dialog/LiveHDDialogFragment.java | 40 +++++++++++++++++++ .../yunbao/live/views/LiveRoomViewHolder.java | 13 ++++-- live/src/main/res/layout/view_live_room.xml | 2 +- live/src/main/res/layout/view_wish_list.xml | 2 +- live/src/main/res/values-en/strings.xml | 1 + live/src/main/res/values/strings.xml | 1 + 6 files changed, 53 insertions(+), 6 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 99ba043ce..e1b6b4d16 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java @@ -25,13 +25,19 @@ import android.widget.LinearLayout; import com.adjust.sdk.Adjust; import com.adjust.sdk.AdjustEvent; import com.alibaba.android.arouter.launcher.ARouter; +import com.alibaba.fastjson.JSON; import com.yunbao.common.Constants; import com.yunbao.common.bean.JsWishBean; import com.yunbao.common.dialog.AbsDialogFragment; +import com.yunbao.common.http.HttpCallback; import com.yunbao.common.utils.L; +import com.yunbao.common.utils.RouteUtil; import com.yunbao.live.R; import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveAudienceActivity; +import com.yunbao.live.bean.LiveBean; +import com.yunbao.live.http.LiveHttpUtil; +import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; public class LiveHDDialogFragment extends AbsDialogFragment { @@ -217,6 +223,40 @@ public class LiveHDDialogFragment extends AbsDialogFragment { public void androidGoBack(){ dismiss(); } + + + @JavascriptInterface + public void androidMethodLookToLive(String liveId) { + //看直播 + gotoLive(liveId); + } + } + private LiveRoomCheckLivePresenter mCheckLivePresenter; private void gotoLive(final String live_id) { + LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + if (code == 0 && info.length > 0) { + LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class); + + if (mCheckLivePresenter == null) { + mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, new LiveRoomCheckLivePresenter.ActionListener() { + @Override + public void onLiveRoomChanged(LiveBean liveBean, int liveType, int liveTypeVal, int liveSdk) { + if (liveBean == null) { + return; + } + + LiveAudienceActivity.forward(mContext, liveBean, liveType, liveTypeVal, "", 0, liveSdk); + + } + }); + } + mCheckLivePresenter.checkLive(liveBean); + } else { + RouteUtil.forwardUserHome(mContext, live_id, 0); + } + } + }); } /** 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 7466b5055..a044acd0f 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -1086,6 +1086,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis mHotText =hotView.findViewById(R.id.wish_index); mHourRank=hourView.findViewById(R.id.wish_index); + setHourRankData(info.get(0).getRank()); hotPic.setImageResource(R.drawable.live_tags_hot); hourPic.setImageResource(R.drawable.live_tags_hour_list); hotPic.setLayoutParams(params); @@ -1101,8 +1102,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } String url=CommonAppConfig.HOST+path; url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" - + CommonAppConfig.getInstance().getToken() + "&liveuid=" + mLiveUid; - + + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid; + System.out.println("url = " + url); bundle.putString("url", url); // bundle.putInt("height", DpUtil.dp2px(500)); bundle.putInt("show_type", 0); @@ -1134,9 +1135,13 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis * 设置小时榜 * @param rank 小时榜 */ - public void setHourRankData(int rank){ + public void setHourRankData(long rank){ if(mHourRank!=null) { - mHourRank.setText(formatBigNum.formatBigNum(rank + "")); + if(rank==0){ + mHourRank.setText(R.string.no_rank_data); + }else { + mHourRank.setText(formatBigNum.formatBigNum(rank + "")); + } } } diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index 4935bc40d..d065e95da 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -269,7 +269,7 @@ android:id="@+id/hour_rank_list" android:layout_width="wrap_content" android:layout_height="20dp" - android:layout_marginStart="6dp" + android:layout_marginStart="-2dp" android:layout_weight="2" android:flipInterval="5000" android:layout_marginEnd="6dp" diff --git a/live/src/main/res/layout/view_wish_list.xml b/live/src/main/res/layout/view_wish_list.xml index 70dacdddc..633753a5f 100644 --- a/live/src/main/res/layout/view_wish_list.xml +++ b/live/src/main/res/layout/view_wish_list.xml @@ -21,7 +21,7 @@ android:marqueeRepeatLimit="marquee_forever" android:scrollHorizontally="true" android:singleLine="true" - android:text="0" + android:text="@string/no_rank_data" android:textColor="#FFFFFFFF" android:textSize="10sp" /> diff --git a/live/src/main/res/values-en/strings.xml b/live/src/main/res/values-en/strings.xml index bcc968272..214a6519a 100644 --- a/live/src/main/res/values-en/strings.xml +++ b/live/src/main/res/values-en/strings.xml @@ -2,4 +2,5 @@ No one is on the list at the moment anchor are waiting at your guard! + Not on the list \ No newline at end of file diff --git a/live/src/main/res/values/strings.xml b/live/src/main/res/values/strings.xml index 151cc3644..fd879df16 100644 --- a/live/src/main/res/values/strings.xml +++ b/live/src/main/res/values/strings.xml @@ -3,4 +3,5 @@ 返還 暫時無人上榜,快來成為第一位上榜的人吧! 主播正在等待您的守護! + 未上榜