update:调整小时榜url

update:小时榜点击跳转直播间or个人中心
update:小时榜icon位置调整
update:小时榜为0的时候显示为‘未上榜’
This commit is contained in:
zlzw 2022-08-30 13:59:00 +08:00
parent c7360bea9d
commit dbd49b31db
6 changed files with 53 additions and 6 deletions

View File

@ -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);
}
}
});
}
/**

View File

@ -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,11 +1135,15 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
* 设置小时榜
* @param rank 小时榜
*/
public void setHourRankData(int rank){
public void setHourRankData(long rank){
if(mHourRank!=null) {
if(rank==0){
mHourRank.setText(R.string.no_rank_data);
}else {
mHourRank.setText(formatBigNum.formatBigNum(rank + ""));
}
}
}
/**
* 设置热度值

View File

@ -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"

View File

@ -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" />

View File

@ -2,4 +2,5 @@
<resources>
<string name="no_more_day_rank">No one is on the list at the moment</string>
<string name="no_more_guard">anchor are waiting at your guard!</string>
<string name="no_rank_data">Not on the list</string>
</resources>

View File

@ -3,4 +3,5 @@
<string name="buy_guard_back_coin" translatable="false">返還</string>
<string name="no_more_day_rank">暫時無人上榜,快來成為第一位上榜的人吧!</string>
<string name="no_more_guard">主播正在等待您的守護!</string>
<string name="no_rank_data">未上榜</string>
</resources>