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 a044acd0f..31c97d091 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -867,8 +867,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis //点击的消息发送出去 ((LiveActivity) mContext).sendChatMessage(msg); fastMsgRecyclerView.setVisibility(View.GONE); + params1.bottomMargin = 0; + mChatRecyclerView.setLayoutParams(params1); }); - // fastMsgRecyclerView.setItemAnimator(new DefaultItemAnimator()); + + + // fastMsgRecyclerView.setItemAnimator(new DefaultItemAnimator()); } private void showBanner2() { @@ -1067,24 +1071,25 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis wishListFlipper.startFlipping(); }); } + /** * 初始化小时榜 */ - protected void initHourRankList(){ - ViewFlipper flipper= (ViewFlipper) findViewById(R.id.hour_rank_list); - LinearLayout.LayoutParams params=new LinearLayout.LayoutParams(DpUtil.dp2px(44),DpUtil.dp2px(16)); + protected void initHourRankList() { + ViewFlipper flipper = (ViewFlipper) findViewById(R.id.hour_rank_list); + LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(DpUtil.dp2px(44), DpUtil.dp2px(16)); API.get().pdLiveApi(mContext).getHourChartRank(mLiveUid) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(listResponseModel -> { List info = listResponseModel.getData().getInfo(); - if(!info.isEmpty()){ - View hotView=LayoutInflater.from(mContext).inflate(R.layout.view_wish_list,null); - View hourView=LayoutInflater.from(mContext).inflate(R.layout.view_wish_list,null); + if (!info.isEmpty()) { + View hotView = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null); + View hourView = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null); ImageView hotPic = hotView.findViewById(R.id.wish_pic); ImageView hourPic = hourView.findViewById(R.id.wish_pic); - mHotText =hotView.findViewById(R.id.wish_index); - mHourRank=hourView.findViewById(R.id.wish_index); + 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); @@ -1095,17 +1100,17 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis flipper.addView(hourView); flipper.setOnClickListener(view -> { - Bundle bundle=new Bundle(); - String path=info.get(0).getUrl(); - if(!path.startsWith("/")){ - path="/"+path; + Bundle bundle = new Bundle(); + String path = info.get(0).getUrl(); + if (!path.startsWith("/")) { + path = "/" + path; } - String url=CommonAppConfig.HOST+path; + String url = CommonAppConfig.HOST + path; url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid; System.out.println("url = " + url); bundle.putString("url", url); - // bundle.putInt("height", DpUtil.dp2px(500)); + // bundle.putInt("height", DpUtil.dp2px(500)); bundle.putInt("show_type", 0); LiveHDDialogFragment liveHDDialogFragment = new LiveHDDialogFragment(); liveHDDialogFragment.setArguments(bundle); @@ -1119,27 +1124,29 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis /** * 星光值转带k的字符 + * * @param val 值 * @retur 字符串 */ - private String starlightValToString(long val){ - if(val>1000) { - double tmp =(double)val / 1000; + private String starlightValToString(long val) { + if (val > 1000) { + double tmp = (double) val / 1000; return tmp + "k"; - }else{ - return val+""; + } else { + return val + ""; } } /** * 设置小时榜 + * * @param rank 小时榜 */ - public void setHourRankData(long rank){ - if(mHourRank!=null) { - if(rank==0){ + public void setHourRankData(long rank) { + if (mHourRank != null) { + if (rank == 0) { mHourRank.setText(R.string.no_rank_data); - }else { + } else { mHourRank.setText(formatBigNum.formatBigNum(rank + "")); } } @@ -1147,14 +1154,16 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis /** * 设置热度值 + * * @param hot 热度值 */ - public void setHotData(String hot){ - if(mHotText!=null) { + public void setHotData(String hot) { + if (mHotText != null) { mHotText.setText(hot); } } + /** * 更新心愿单进度 * @@ -1604,7 +1613,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } else if (i == R.id.ft_hot_add) { ((LiveActivity) mContext).openHotListWindow(1); } else if (i == R.id.user_guard) { - // ((LiveActivity) mContext).openUserMoreListWindow(2, true); + // ((LiveActivity) mContext).openUserMoreListWindow(2, true); ((LiveActivity) mContext).openNewGuardListWindow(); } @@ -2296,7 +2305,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } public void setFastMessage(List greetings) { + fastMsgRecyclerView.setVisibility(View.VISIBLE); fastMessageRecyclerViewAdapter.setMessage(greetings); + RelativeLayout.LayoutParams params1 = (RelativeLayout.LayoutParams) + mChatRecyclerView.getLayoutParams(); + params1.bottomMargin = 100; + mChatRecyclerView.setLayoutParams(params1); } private static class LiveRoomHandler extends Handler { diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index d065e95da..a2c057357 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -244,6 +244,7 @@ android:layout_marginBottom="4dp" android:padding="3dp" android:src="@mipmap/icon_live_close_3" /> + + android:layout_weight="0.0" + android:src="@mipmap/live_icon_wishlist" + android:visibility="gone" /> + android:outAnimation="@anim/anim_marquee_out" /> + @@ -287,18 +289,18 @@ + android:paddingRight="5dp" + android:visibility="gone"> @@ -1868,7 +1869,8 @@ android:id="@+id/room_fast_msg" android:layout_width="match_parent" android:layout_height="30dp" - android:layout_alignParentBottom="true" /> + android:layout_alignParentBottom="true" + android:visibility="gone" />