diff --git a/common/src/main/java/com/yunbao/common/adapter/GiftWallMainTab1List2Adapter.java b/common/src/main/java/com/yunbao/common/adapter/GiftWallMainTab1List2Adapter.java index 459f9d9f7..d066c650c 100644 --- a/common/src/main/java/com/yunbao/common/adapter/GiftWallMainTab1List2Adapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/GiftWallMainTab1List2Adapter.java @@ -114,6 +114,15 @@ public class GiftWallMainTab1List2Adapter extends RecyclerView.Adapter gifts) { + if (list == null) { + list = new ArrayList<>(); + } + int index=list.size()-1; + list.addAll(gifts); + notifyItemRangeChanged(index, gifts.size()); + } + public class VH extends RecyclerView.ViewHolder { SVGAImageView giftBg; ImageView gift_soles; @@ -135,7 +144,7 @@ public class GiftWallMainTab1List2Adapter extends RecyclerView.Adapter gifts) { + if (list == null) { + list = new ArrayList<>(); + } + int index = list.size() - 1; + list.addAll(gifts); + notifyItemRangeChanged(index, gifts.size()); + } + public void setStar(boolean star) { isStar = star; @@ -105,6 +128,11 @@ public class GiftWallMainTab2ListAdapter extends RecyclerView.Adapter { - if (isNowRank) { - new GiftWallGiftInfoDialog(mContext, giftData.getGiftId() + "", toUid, isAnchor) - .setFullWindows(!isLiveRoom) - .setLiveRoom(isLiveRoom) - .setStar(isStar) - .showDialog(); - } else { - new GiftWallMainTab2ClassicInfoDialog(mContext, giftData, isAnchor).setFullWindows(!isLiveRoom).showDialog(); - } - }); } else { user1Avatar.setVisibility(View.GONE); user2Avatar.setVisibility(View.GONE); @@ -167,6 +184,58 @@ public class GiftWallMainTab2ListAdapter extends RecyclerView.Adapter { + if (isStar) { + if (isNowRank) { + if (StringUtil.isEmpty(giftData.getNamingLiveNicename(), giftData.getNamingUserNicename())&&isLiveRoom) { + Bus.get().post(new JsWishBean(giftData.getGiftId() + "")); + Bus.get().post(new ClosePopupDialogEvent()); + } else { + new GiftWallGiftInfoDialog(mContext, giftData.getGiftId() + "", toUid, isAnchor) + .setFullWindows(!isLiveRoom) + .setLiveRoom(isLiveRoom) + .setStar(isStar) + .showDialog(); + } + } else { + new GiftWallMainTab2ClassicInfoDialog(mContext, giftData, isAnchor).setFullWindows(!isLiveRoom).showDialog(); + } + } else { + new GiftWallTab2List2Dialog(mContext).setGift(giftData).showDialog(); + } + }); + } + + void display(Context context, String url, ImageView imageView, int width, int height) { + imageView.post(new Runnable() { + @Override + public void run() { + RequestBuilder builder = Glide.with(context) + .load(url); + + if (width != -1 && height != -1) { + builder = builder.override(width, height); + } + builder + .thumbnail(1.0f) + .format(DecodeFormat.PREFER_RGB_565) + .skipMemoryCache(true) + .addListener(new RequestListener() { + @Override + public boolean onLoadFailed(@Nullable GlideException e, Object model, Target target, boolean isFirstResource) { + imageView.setImageDrawable(null); + return false; + } + + @Override + public boolean onResourceReady(Drawable resource, Object model, Target target, DataSource dataSource, boolean isFirstResource) { + return false; + } + }) + .diskCacheStrategy(DiskCacheStrategy.ALL) + .into(imageView); + } + }); } } diff --git a/common/src/main/java/com/yunbao/common/adapter/GiftWallTab2GiftInfoListItemAdapter.java b/common/src/main/java/com/yunbao/common/adapter/GiftWallTab2GiftInfoListItemAdapter.java index f7c083718..9923669b9 100644 --- a/common/src/main/java/com/yunbao/common/adapter/GiftWallTab2GiftInfoListItemAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/GiftWallTab2GiftInfoListItemAdapter.java @@ -39,13 +39,12 @@ public class GiftWallTab2GiftInfoListItemAdapter extends RecyclerView.Adapter() { @Override diff --git a/common/src/main/res/layout/dialog_gift_wall_tab2_list2.xml b/common/src/main/res/layout/dialog_gift_wall_tab2_list2.xml new file mode 100644 index 000000000..5931cdb57 --- /dev/null +++ b/common/src/main/res/layout/dialog_gift_wall_tab2_list2.xml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/fragment_gift_wall_man_tab_1.xml b/common/src/main/res/layout/fragment_gift_wall_man_tab_1.xml index 59106a9e8..c14015e31 100644 --- a/common/src/main/res/layout/fragment_gift_wall_man_tab_1.xml +++ b/common/src/main/res/layout/fragment_gift_wall_man_tab_1.xml @@ -1,260 +1,266 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + app:srcCompat="@mipmap/gift_wall_main_list_bottom" /> + + + + + android:layout_marginStart="25dp" + android:layout_marginTop="20dp" + android:text="@string/dialog_gift_wall_list2_title" + android:textColor="@color/white" + android:textSize="15sp" + android:textStyle="bold" + app:layout_constraintStart_toStartOf="@+id/imageView4" + app:layout_constraintTop_toTopOf="parent" /> - - - - - - + android:layout_marginStart="5dp" + android:text="TextView" + android:textColor="#A6A0E9FF" + android:textSize="10sp" + app:layout_constraintBottom_toBottomOf="@+id/classic_gifts_title" + app:layout_constraintStart_toEndOf="@+id/classic_gifts_title" + app:layout_constraintTop_toTopOf="@+id/classic_gifts_title" /> + android:id="@+id/classic_gift_spinner" + android:layout_width="wrap_content" + android:layout_height="20dp" + android:layout_marginEnd="30dp" + android:gravity="center" + android:orientation="horizontal" + app:layout_constraintBottom_toBottomOf="@+id/classic_gifts_title" + app:layout_constraintEnd_toEndOf="@+id/imageView4" + app:layout_constraintTop_toTopOf="@+id/classic_gifts_title"> - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - \ No newline at end of file + + \ No newline at end of file diff --git a/common/src/main/res/layout/fragment_gift_wall_man_tab_2.xml b/common/src/main/res/layout/fragment_gift_wall_man_tab_2.xml index 2777ed51f..e1854d0d8 100644 --- a/common/src/main/res/layout/fragment_gift_wall_man_tab_2.xml +++ b/common/src/main/res/layout/fragment_gift_wall_man_tab_2.xml @@ -1,206 +1,215 @@ - - + - + app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed" + app:toolbarId="@+id/toolbar"> - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + app:layout_behavior="@string/appbar_scrolling_view_behavior"> - + app:layout_constraintVertical_bias="0.0" + app:spanCount="3" + tools:itemCount="10" + tools:layoutManager="GridLayoutManager" + tools:listitem="@layout/item_gift_wall_man_tab2_list_2" /> - + android:layout_marginStart="25dp" + android:layout_marginTop="20dp" + android:text="@string/dialog_gift_wall_list2_title" + android:textColor="@color/white" + android:textSize="15sp" + android:textStyle="bold" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> - + android:layout_height="20dp" + android:layout_marginEnd="30dp" + android:gravity="center" + android:orientation="horizontal" + app:layout_constraintBottom_toBottomOf="@+id/classic_gifts_title" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="@+id/classic_gifts_title"> + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/common/src/main/res/layout/item_dialog_gift_wall_tab2_gift_info.xml b/common/src/main/res/layout/item_dialog_gift_wall_tab2_gift_info.xml index fbfcdfd4f..b195c3b2f 100644 --- a/common/src/main/res/layout/item_dialog_gift_wall_tab2_gift_info.xml +++ b/common/src/main/res/layout/item_dialog_gift_wall_tab2_gift_info.xml @@ -19,13 +19,13 @@ + android:layout_marginStart="36dp" + app:layout_constraintBottom_toBottomOf="@+id/tv_rank" + app:layout_constraintStart_toEndOf="@+id/tv_rank" + app:layout_constraintTop_toTopOf="@+id/tv_rank"> +