diff --git a/live/src/main/assets/rectangle_new.png b/live/src/main/assets/rectangle_new.png new file mode 100644 index 000000000..4909ea802 Binary files /dev/null and b/live/src/main/assets/rectangle_new.png differ diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java index c6403d0cd..0dc495d09 100644 --- a/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java @@ -373,13 +373,13 @@ public class LiveChatAdapter extends RecyclerView.Adapter { ImgLoader.display(mContext, bean.getId(), clipImage2); attentionLayout.setVisibility(View.VISIBLE); btnAttention.setVisibility(bean.isAttention() ? View.GONE : View.VISIBLE); - btnAttention.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - LiveRoomViewHolder.follow(); - btnAttention.setVisibility(View.GONE); - } - }); +// btnAttention.setOnClickListener(new View.OnClickListener() { +// @Override +// public void onClick(View v) { +// LiveRoomViewHolder.follow(); +// btnAttention.setVisibility(View.GONE); +// } +// }); } else if (bean.getType() == MSG_HOUR_RANK_CHANGE) { mBg.setBackgroundResource(R.drawable.bg_chat_automatic_item); mTextView.setText(bean.getContent()); diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveUserAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveUserAdapter.java index 9f269946f..29b6c00d2 100644 --- a/live/src/main/java/com/yunbao/live/adapter/LiveUserAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/LiveUserAdapter.java @@ -89,7 +89,7 @@ public class LiveUserAdapter extends RecyclerView.Adapter { @Override public int getItemCount() { - return Math.min(mList.size(), 5); + return Math.min(mList.size(), 3); } class Vh extends RecyclerView.ViewHolder { diff --git a/live/src/main/java/com/yunbao/live/utils/LoadDian9TuUtil.java b/live/src/main/java/com/yunbao/live/utils/LoadDian9TuUtil.java index b7c577d55..3d6100d25 100644 --- a/live/src/main/java/com/yunbao/live/utils/LoadDian9TuUtil.java +++ b/live/src/main/java/com/yunbao/live/utils/LoadDian9TuUtil.java @@ -70,6 +70,12 @@ public class LoadDian9TuUtil { setNinePathImage(context, imageView, bitmap, position); } + public void loadDian9TuAssets2(Context context, View imageView, String fileName, int position) { + Bitmap bitmap = getImageFromAssetsFile(context, fileName); + BITMAP_CACHE.add(bitmap); + setNinePathImage(context, imageView, bitmap, position); + } + /** * 从Assets中读取图片 * 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 604304be3..f25e3752f 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -148,6 +148,7 @@ import com.yunbao.live.presenter.LiveEnterRoomAnimPresenter; import com.yunbao.live.presenter.LiveGiftAnimPresenter; import com.yunbao.live.presenter.LiveLightAnimPresenter; import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; +import com.yunbao.live.utils.LoadDian9TuUtil; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; @@ -219,7 +220,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public TextView room_hot; public String touid, gotoroom; public static TextView fans; - public LinearLayout fans_btn, wishListLayout; + public LinearLayout fans_btn, wishListLayout, wishListLayout2, liveWksLayout; public static View d_pk_view; public static int isAttention = 0;//是否关注 0=没关注, public static String mNameText; @@ -309,7 +310,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis private List wishlist = new ArrayList<>(); private TextView mHourRank, mHotText; private LinearLayout msg; //默认悬浮窗布局 - private LinearLayout mAnchorLayout; + private LinearLayout mAnchorLayout, hourRankLayout, liveRankPk2; private ImageView mGoodNumberIcon; private View msg2; //悬浮窗来私信的布局 private ConstraintLayout msgLayout; //悬浮窗 @@ -318,7 +319,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis private FullServiceNotificationView fullScreen;//全副喇叭 private NobleNoticeView noble;//全副喇叭 private FaceManager manager; - private LinearLayout pkRankLayout; + private FrameLayout pkRankLayout; private ViewFlipper pkRankVf; private ImageView mPkRankIcon; private TextView mPkRankText; @@ -815,9 +816,13 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis fans = (TextView) findViewById(R.id.fans); fans_btn = (LinearLayout) findViewById(R.id.fans_btn); wishListLayout = (LinearLayout) findViewById(R.id.wish_list_layout); + wishListLayout2 = (LinearLayout) findViewById(R.id.wish_list_layout2); + liveWksLayout = (LinearLayout) findViewById(R.id.live_wks_layout2); mAnchorLayout = (LinearLayout) findViewById(R.id.group_1); + hourRankLayout = (LinearLayout) findViewById(R.id.hour_rank_layout2); + liveRankPk2 = (LinearLayout) findViewById(R.id.live_rank_pk2); mGoodNumberIcon = (ImageView) findViewById(R.id.good_nub_ico); - pkRankLayout = (LinearLayout) findViewById(R.id.live_rank_pk); + pkRankLayout = (FrameLayout) findViewById(R.id.live_rank_pk); pkRankVf = (ViewFlipper) findViewById(R.id.rank_pk_vf); mPkRankTopIcon = (ImageView) findViewById(R.id.icon_pk_top); mRedVal = (TextView) findViewById(R.id.pk_rank_red_val); @@ -940,6 +945,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis LiveRoomViewHolder.follow(); mLiveChatAdapter.removetItem(bean); } else if (bean.getType() == -2) { + if (!bean.isAttention()) { + LiveRoomViewHolder.follow(); + } mLiveChatAdapter.removetItem(bean); ((LiveActivity) mContext).sendChatMessage("Hi~", null, null); } else if (bean.getType() == -5) { @@ -1168,6 +1176,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis customFullServiceNotify = (ImageView) findViewById(R.id.custom_full_service_notify); reloadIM(); initStarChallengeStatus(); + + new LoadDian9TuUtil().loadDian9TuAssets2(mContext, liveWksLayout, "rectangle_new.png", 1); + new LoadDian9TuUtil().loadDian9TuAssets2(mContext, wishListLayout2, "rectangle_new.png", 1); + new LoadDian9TuUtil().loadDian9TuAssets2(mContext, liveRankPk2, "rectangle_new.png", 1); } /** @@ -1630,9 +1642,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis if (flipper.getChildCount() > 0) { flipper.removeAllViews(); } - LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(DpUtil.dp2px(44), DpUtil.dp2px(16)); + LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(DpUtil.dp2px(13), DpUtil.dp2px(13)); + params.leftMargin = DpUtil.dp2px(6); + params.rightMargin = DpUtil.dp2px(2); LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); - textParams.leftMargin = DpUtil.dp2px(5); + textParams.leftMargin = DpUtil.dp2px(2); 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); @@ -1645,8 +1659,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis mHotText.setGravity(Gravity.CENTER); mHourRank.setGravity(Gravity.CENTER); setHourRankData(Long.parseLong(model.getRank())); - hotPic.setImageResource(WordUtil.isZh() ? R.drawable.live_tags_hot : R.drawable.live_tags_hot_en); - hourPic.setImageResource(WordUtil.isZh() ? R.drawable.live_tags_hour_list : R.drawable.live_tags_hour_list_en); + hotPic.setImageResource(R.drawable.icon_time_new); + hourPic.setImageResource(R.drawable.icon_heat_new); hotPic.setLayoutParams(params); hourPic.setLayoutParams(params); flipper.addView(hotView); @@ -1669,6 +1683,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis liveHDDialogFragment.setArguments(bundle); liveHDDialogFragment.show(((AbsActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment"); }); + new LoadDian9TuUtil().loadDian9TuAssets2(mContext, hourRankLayout, "rectangle_new.png", 1); } /** @@ -1700,7 +1715,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis mHourRank.setGravity(Gravity.CENTER); setHourRankData(info.get(0).getRank()); hotPic.setImageResource(WordUtil.isZh() ? R.drawable.live_tags_hot : R.drawable.live_tags_hot_en); - hourPic.setImageResource(WordUtil.isZh() ? R.drawable.live_tags_hour_list : R.drawable.live_tags_hour_list_en); + hourPic.setImageResource(R.drawable.icon_heat_new); hotPic.setLayoutParams(params); hourPic.setLayoutParams(params); flipper.addView(hotView); @@ -1825,7 +1840,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis @Override public void onError(String error) { - ToastUtil.show( R.string.net_error); + ToastUtil.show(R.string.net_error); } }); @@ -4188,4 +4203,22 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } } + /** + * 横竖屏聊天框的高度 + * + * @param landscape + */ + public void changeMessageLandscape(int landscape) { + RelativeLayout.LayoutParams params1 = (RelativeLayout.LayoutParams) + mChatRecyclerView.getLayoutParams(); + if (landscape == 2) { + params1.height = DpUtil.dp2px(180); + + } else { + params1.height = DpUtil.dp2px(300); + } + mChatRecyclerView.setLayoutParams(params1); + + } + } diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index 5d1c3e7b7..2442b4f0d 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -303,6 +303,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLiveLinkMicPresenter.setLiveSdk(mLiveSDK); mLiveLinkMicAnchorPresenter.setLiveSdk(mLiveSDK); } + if (mLiveRyLinkMicPkPresenter == null) { mLiveRyLinkMicPkPresenter = new LiveRyLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null); } @@ -323,6 +324,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLivePlayViewHolder.removeDetailView(); mLivePlayViewHolder.setCover(mLiveBean.getAvatar()); mLivePlayViewHolder.setLiveBeanLandscape(mLiveBean.getLandscape()); + mLiveRoomViewHolder.changeMessageLandscape(mLiveBean.getLandscape()); //mLivePlayViewHolder.play(mLiveBean.getPull(), LiveRoomPlayViewHolder.PLAY_MODEL_DEF); mLivePlayViewHolder.setOnMicCallback(new LiveRoomPlayViewHolder.OnMicCallback() { @Override @@ -466,7 +468,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe //数据设置 if (mLiveRoomViewHolder != null) { mLiveRoomViewHolder.setLiveInfo(mLiveBean.getUid(), mLiveBean.getStream(), Integer.parseInt(data.getEnterRoomInfo().getUserlistTime()) * 4000); - mLiveRoomViewHolder.setFastMessage(greetings); +// mLiveRoomViewHolder.setFastMessage(greetings); mLiveRoomViewHolder.setVotes(data.getEnterRoomInfo().getVotestotal()); //真爱排行 数量 mLiveRoomViewHolder.setMedaRankNum(data.getEnterRoomInfo().getMedalRankNum()); diff --git a/live/src/main/res/drawable/icon_heat_new.png b/live/src/main/res/drawable/icon_heat_new.png new file mode 100644 index 000000000..a6f4784c2 Binary files /dev/null and b/live/src/main/res/drawable/icon_heat_new.png differ diff --git a/live/src/main/res/drawable/icon_time_new.png b/live/src/main/res/drawable/icon_time_new.png new file mode 100644 index 000000000..f0d2179ec Binary files /dev/null and b/live/src/main/res/drawable/icon_time_new.png differ diff --git a/live/src/main/res/drawable/rectangle_new.png b/live/src/main/res/drawable/rectangle_new.png new file mode 100644 index 000000000..4909ea802 Binary files /dev/null and b/live/src/main/res/drawable/rectangle_new.png differ diff --git a/live/src/main/res/layout/item_live_chat.xml b/live/src/main/res/layout/item_live_chat.xml index 81dfffd9a..4547f41f7 100644 --- a/live/src/main/res/layout/item_live_chat.xml +++ b/live/src/main/res/layout/item_live_chat.xml @@ -211,8 +211,6 @@ android:layout_height="26dp" android:layout_gravity="end" android:layout_margin="11dp" - android:clickable="true" - android:focusable="true" android:src="@mipmap/btn_attention" /> diff --git a/live/src/main/res/layout/item_live_user.xml b/live/src/main/res/layout/item_live_user.xml index b7d2e4a27..b5847e3cb 100644 --- a/live/src/main/res/layout/item_live_user.xml +++ b/live/src/main/res/layout/item_live_user.xml @@ -2,9 +2,9 @@ + android:layout_width="32dp" + android:layout_marginEnd="1dp" + android:layout_height="32dp"> @@ -16,8 +16,8 @@ diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index 063e7d89a..e3eee3bb8 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -19,7 +19,7 @@ @@ -136,8 +136,8 @@ @@ -153,23 +153,23 @@ @@ -217,18 +218,21 @@ - + android:orientation="horizontal"> + + @@ -250,11 +254,12 @@ - + - + + - + @@ -515,18 +526,22 @@ android:textSize="10sp" /> - + - + @@ -2307,7 +2323,7 @@ + android:layout_marginTop="60dp" + android:visibility="gone" /> \ No newline at end of file diff --git a/live/src/main/res/layout/view_noble_seat.xml b/live/src/main/res/layout/view_noble_seat.xml index dc53e7d07..8070ad8b1 100644 --- a/live/src/main/res/layout/view_noble_seat.xml +++ b/live/src/main/res/layout/view_noble_seat.xml @@ -6,27 +6,32 @@ android:orientation="vertical" tools:ignore="MissingDefaultResource"> - + + - + \ No newline at end of file diff --git a/live/src/main/res/layout/view_wish_list.xml b/live/src/main/res/layout/view_wish_list.xml index 5cb81637d..8ab47dfb7 100644 --- a/live/src/main/res/layout/view_wish_list.xml +++ b/live/src/main/res/layout/view_wish_list.xml @@ -7,16 +7,17 @@ + android:layout_width="12dp" + android:layout_height="12dp" />