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 @@ 返還 暫時無人上榜,快來成為第一位上榜的人吧! 主播正在等待您的守護! + 未上榜