diff --git a/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java b/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java index 4a33c908c..e01cf045d 100644 --- a/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java +++ b/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java @@ -88,9 +88,9 @@ public class WebViewActivity extends AbsActivity { @Override public void setStatusBar() { - getWindow().setStatusBarColor(Color.parseColor("#FFFFFF")); - getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); - getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); +// getWindow().setStatusBarColor(Color.parseColor("#FFFFFF")); +// getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); +// getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); } @Override diff --git a/common/src/main/java/com/yunbao/common/adapter/GiftWallGiftInfoListItemAdapter.java b/common/src/main/java/com/yunbao/common/adapter/GiftWallGiftInfoListItemAdapter.java index 1720818ca..48b9a9584 100644 --- a/common/src/main/java/com/yunbao/common/adapter/GiftWallGiftInfoListItemAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/GiftWallGiftInfoListItemAdapter.java @@ -13,6 +13,7 @@ import com.makeramen.roundedimageview.RoundedImageView; import com.yunbao.common.R; import com.yunbao.common.bean.GiftWallInfoBean; import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.WordUtil; import java.util.ArrayList; @@ -21,11 +22,51 @@ import java.util.Locale; public class GiftWallGiftInfoListItemAdapter extends RecyclerView.Adapter { List data = new ArrayList<>(); + boolean isAnchor; + int list_type = 1; + private boolean isLiveRoom; + private boolean isStar; + int giftStatus; + private String anchorName; + private String anchorAvatar; + + public void setAnchorName(String anchorName) { + this.anchorName = anchorName; + } + + public void setAnchorAvatar(String anchorAvatar) { + this.anchorAvatar = anchorAvatar; + } + + public void setGiftStatus(int giftStatus) { + this.giftStatus = giftStatus; + } + + public void setAnchor(boolean anchor) { + isAnchor = anchor; + } + + public void setList_type(int list_type) { + this.list_type = list_type; + } + + public void setLiveRoom(boolean liveRoom) { + isLiveRoom = liveRoom; + } + + public void setStar(boolean star) { + isStar = star; + } public void setData(List data) { if (data == null) { data = new ArrayList<>(); } + if (data.isEmpty()) { + GiftWallInfoBean.Data tmp = new GiftWallInfoBean.Data(); + tmp.setId(-1); + data.add(tmp); + } this.data = data; notifyDataSetChanged(); } @@ -47,8 +88,8 @@ public class GiftWallGiftInfoListItemAdapter extends RecyclerView.Adapter999999){ + return "999999+"; + }else{ + return String.valueOf(gift_hall_send_num); + } + } public void setGift_hall_send_num(int gift_hall_send_num) { this.gift_hall_send_num = gift_hall_send_num; } diff --git a/common/src/main/java/com/yunbao/common/dialog/GiftWallDialog.java b/common/src/main/java/com/yunbao/common/dialog/GiftWallDialog.java index 86fad4d3b..530b7c440 100644 --- a/common/src/main/java/com/yunbao/common/dialog/GiftWallDialog.java +++ b/common/src/main/java/com/yunbao/common/dialog/GiftWallDialog.java @@ -18,9 +18,11 @@ import androidx.viewpager2.widget.ViewPager2; import com.lxj.xpopup.XPopup; import com.yunbao.common.R; +import com.yunbao.common.bean.GiftWallBean; import com.yunbao.common.fragment.BaseFragment; import com.yunbao.common.fragment.GiftWallMainTab1Fragment; import com.yunbao.common.fragment.GiftWallMainTab2Fragment; +import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.ScreenDimenUtil; import com.yunbao.common.utils.WordUtil; @@ -98,7 +100,16 @@ public class GiftWallDialog extends AbsDialogPopupWindow { WordUtil.isNewZh() ? "的禮物展館" : "'s Gift Hall" )); - fragments.add(new GiftWallMainTab1Fragment().setToUserId(toUserId).setAnchor(isAnchor).setLiveRoom(!isFullWindows)); + fragments.add(new GiftWallMainTab1Fragment().setToUserId(toUserId).setAnchor(isAnchor).setLiveRoom(!isFullWindows).setOnItemClickListener(new OnItemClickListener() { + @Override + public void onItemClick(GiftWallBean bean, int position) { + if (position == 1) { + mAchievement.setVisibility(View.INVISIBLE); + } else { + mAchievement.setVisibility(View.VISIBLE); + } + } + })); fragments.add(new GiftWallMainTab2Fragment().setToUserId(toUserId).setAnchor(isAnchor).setLiveRoom(!isFullWindows)); mViewPager.setAdapter(new FragmentStateAdapter((FragmentActivity) mContext) { @NonNull @@ -118,9 +129,9 @@ public class GiftWallDialog extends AbsDialogPopupWindow { public void onPageSelected(int position) { super.onPageSelected(position); fragments.get(position).updateData(); - if(position==0){ + if (position == 0) { mTvUserName.setTextColor(Color.parseColor("#6BCDFF")); - }else{ + } else { mTvUserName.setTextColor(Color.parseColor("#FFCF94")); } } @@ -179,6 +190,6 @@ public class GiftWallDialog extends AbsDialogPopupWindow { mIvBg.setScaleType(ImageView.ScaleType.FIT_XY); } mIvBack.setLayoutParams(params); - + ViewClicksAntiShake.clicksAntiShake(mIvBack, this::dismiss); } } diff --git a/common/src/main/java/com/yunbao/common/dialog/GiftWallGiftInfoDialog.java b/common/src/main/java/com/yunbao/common/dialog/GiftWallGiftInfoDialog.java index 801756145..290724b74 100644 --- a/common/src/main/java/com/yunbao/common/dialog/GiftWallGiftInfoDialog.java +++ b/common/src/main/java/com/yunbao/common/dialog/GiftWallGiftInfoDialog.java @@ -12,6 +12,7 @@ import android.widget.ProgressBar; import android.widget.TextView; import androidx.annotation.NonNull; +import androidx.constraintlayout.widget.ConstraintLayout; import androidx.recyclerview.widget.RecyclerView; import com.lxj.xpopup.XPopup; @@ -32,6 +33,7 @@ import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.Bus; +import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.ScreenDimenUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.common.views.weight.ViewClicksAntiShake; @@ -61,6 +63,7 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow { Button btn_lighten; View tab_layout; View bottom_layout; + View gift_schedule; GiftWallGiftInfoListItemAdapter adapter; RecyclerView recyclerView; @@ -148,7 +151,11 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow { recyclerView = findViewById(R.id.recyclerView); tab_layout = findViewById(R.id.tab_layout); bottom_layout = findViewById(R.id.bottom_layout); + gift_schedule = findViewById(R.id.gift_schedule); adapter = new GiftWallGiftInfoListItemAdapter(); + adapter.setAnchor(isAnchor); + adapter.setLiveRoom(isLiveRoom); + adapter.setStar(isStar); recyclerView.setAdapter(adapter); recyclerView.addItemDecoration(new ItemDecoration(mContext, 0x00000000, 0, 10)); @@ -220,10 +227,27 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow { Bus.get().post(new ClosePopupDialogEvent()); } }); + + ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) mIvBack.getLayoutParams(); + if (isFullWindows) { + params.width = DpUtil.dp2px(20); + mIvBack.setVisibility(View.VISIBLE); + mIvBg.setScaleType(ImageView.ScaleType.CENTER_CROP); + } else { + params.width = DpUtil.dp2px(1); + mIvBack.setVisibility(View.INVISIBLE); + mIvBg.setScaleType(ImageView.ScaleType.FIT_XY); + } + mIvBack.setLayoutParams(params); + ViewClicksAntiShake.clicksAntiShake(mIvBack, this::dismiss); } void initData() { + adapter.setList_type(list_type); if (isAnchor) { + if(isStar){ + gift_hall_type=2; + } LiveNetManager.get(mContext) .liveGiftHallDetail(toUserId, giftId, gift_hall_type, list_type, new HttpCallback() { @Override @@ -271,6 +295,7 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow { btn_lighten.setText(WordUtil.getNewString(R.string.dialog_gift_wall_list_spinner_down)); btn_lighten.setBackgroundResource(R.drawable.gift_wall_gift_info_un_lighten); } + adapter.setGiftStatus(giftBean.getGift_info().getIlluminate_status()); if (isAnchor) { tab_layout.setVisibility(View.VISIBLE); bottom_layout.setVisibility(View.VISIBLE); @@ -279,10 +304,15 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow { tab_layout.setVisibility(View.GONE); bottom_layout.setVisibility(View.GONE); tv_list_title.setVisibility(View.VISIBLE); - gift_btn.setVisibility(View.GONE); + if (!toUserId.equals(IMLoginManager.get(mContext).getUserInfo().getId() + "")) { + gift_btn.setVisibility(View.GONE); + gift_schedule.setVisibility(View.GONE); + gift_progress.setVisibility(View.GONE); + } } if (!isLiveRoom) { gift_btn.setEnabled(false); + gift_btn.setBackgroundResource(R.drawable.gift_wall_gift_info_btn_un); } adapter.setData(giftBean.getData()); time = (WordUtil.isNewZh() ? "榜單結算時間" : "Settlement time") + giftBean.getGift_info().getGift_hall_start() + " - " + giftBean.getGift_info().getGift_hall_end(); diff --git a/common/src/main/java/com/yunbao/common/fragment/GiftWallMainTab1Fragment.java b/common/src/main/java/com/yunbao/common/fragment/GiftWallMainTab1Fragment.java index 9ee8ae7af..ca83cedc0 100644 --- a/common/src/main/java/com/yunbao/common/fragment/GiftWallMainTab1Fragment.java +++ b/common/src/main/java/com/yunbao/common/fragment/GiftWallMainTab1Fragment.java @@ -49,6 +49,10 @@ public class GiftWallMainTab1Fragment extends BaseFragment { View classic_layout, star_layout; TextView show_time; View show_time_layout; + View hideLayout; + View appbar; + + OnItemClickListener onItemClickListener; @Override public View createView(LayoutInflater inflater, ViewGroup container) { @@ -75,6 +79,11 @@ public class GiftWallMainTab1Fragment extends BaseFragment { return this; } + public GiftWallMainTab1Fragment setOnItemClickListener(OnItemClickListener onItemClickListener) { + this.onItemClickListener = onItemClickListener; + return this; + } + @Override public void updateData() { super.updateData(); @@ -114,6 +123,17 @@ public class GiftWallMainTab1Fragment extends BaseFragment { } private void initData(GiftWallBean bean) { + onItemClickListener.onItemClick(bean, bean.getActive_rank_hide()); + if (bean.getActive_rank_hide() == 1 && !toUserId.equals(IMLoginManager.get(getContext()).getUserInfo().getId() + "")) { + hideLayout.setVisibility(View.VISIBLE); + appbar.setVisibility(View.GONE); + classic_layout.setVisibility(View.GONE); + return; + } + hideLayout.setVisibility(View.GONE); + appbar.setVisibility(View.VISIBLE); + classic_layout.setVisibility(View.VISIBLE); + list1Adapter.setDrawable(drawable); list1Adapter.setList(bean.getIlluminate_data().getWeek_star_data()); list2Adapter.setList(bean.getIlluminate_data().getGift_data()); @@ -152,6 +172,8 @@ public class GiftWallMainTab1Fragment extends BaseFragment { star_layout = contentView.findViewById(R.id.star_layout); show_time = contentView.findViewById(R.id.show_time); show_time_layout = contentView.findViewById(R.id.show_time_layout); + hideLayout = contentView.findViewById(R.id.hideLayout); + appbar = contentView.findViewById(R.id.appbar); list1Adapter = new GiftWallMainTab1List2Adapter(getContext()); list2Adapter = new GiftWallMainTab1List2Adapter(getContext()); @@ -165,8 +187,8 @@ public class GiftWallMainTab1Fragment extends BaseFragment { recyclerView1.setAdapter(list1Adapter); recyclerView2.setAdapter(list2Adapter); - recyclerView1.addItemDecoration(new ItemDecoration(getContext(), 0x00000000, DpUtil.dp2px(10), DpUtil.dp2px(11))); - recyclerView2.addItemDecoration(new ItemDecoration(getContext(), 0x00000000, DpUtil.dp2px(2), DpUtil.dp2px(11))); + recyclerView1.addItemDecoration(new ItemDecoration(getContext(), 0x00000000, DpUtil.dp2px(10), DpUtil.dp2px(11))); + recyclerView2.addItemDecoration(new ItemDecoration(getContext(), 0x00000000, DpUtil.dp2px(2), DpUtil.dp2px(11))); starGiftsTitle.getPaint().setShader(new LinearGradient(0, 0, 0, classicGiftsTitle.getPaint().getTextSize(), Color.parseColor("#FEE8C6"), Color.parseColor("#FFD5A3"), Shader.TileMode.CLAMP)); diff --git a/common/src/main/res/drawable/gift_wall_gift_info_btn_un.xml b/common/src/main/res/drawable/gift_wall_gift_info_btn_un.xml new file mode 100644 index 000000000..f4234ae23 --- /dev/null +++ b/common/src/main/res/drawable/gift_wall_gift_info_btn_un.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/dialog_gift_wall.xml b/common/src/main/res/layout/dialog_gift_wall.xml index aa15d6414..e27b0294c 100644 --- a/common/src/main/res/layout/dialog_gift_wall.xml +++ b/common/src/main/res/layout/dialog_gift_wall.xml @@ -24,6 +24,7 @@ android:layout_height="wrap_content" android:layout_marginTop="20dp" android:layout_marginEnd="10dp" + android:visibility="invisible" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent"> diff --git a/common/src/main/res/layout/dialog_gift_wall_gift_info.xml b/common/src/main/res/layout/dialog_gift_wall_gift_info.xml index 06bb03eee..0b99ba871 100644 --- a/common/src/main/res/layout/dialog_gift_wall_gift_info.xml +++ b/common/src/main/res/layout/dialog_gift_wall_gift_info.xml @@ -19,9 +19,9 @@ @@ -61,11 +61,18 @@ app:layout_constraintTop_toTopOf="parent" tools:src="@mipmap/gift_wall_gift_info_light" /> - 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 4ef716799..df7e22806 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 @@ -263,4 +263,33 @@ app:srcCompat="@mipmap/gift_wall_main_tab1_down_ic" /> + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/item_dialog_gift_wall_gift_info.xml b/common/src/main/res/layout/item_dialog_gift_wall_gift_info.xml index 65d6cd629..70e438a65 100644 --- a/common/src/main/res/layout/item_dialog_gift_wall_gift_info.xml +++ b/common/src/main/res/layout/item_dialog_gift_wall_gift_info.xml @@ -9,14 +9,27 @@ android:id="@+id/tv_rank" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="10dp" android:gravity="start" android:text="@string/dialog_gift_wall_list_info_list_header_rank" android:textColor="#FFFFFF" android:textSize="12sp" + app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> - + - + android:layout_marginEnd="70dp" + android:layout_marginBottom="10dp" + android:orientation="vertical" + > + + + + diff --git a/common/src/main/res/mipmap-xxhdpi/gift_wall_hide.png b/common/src/main/res/mipmap-xxhdpi/gift_wall_hide.png new file mode 100644 index 000000000..390df4cfd Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/gift_wall_hide.png differ diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index ee8a252e8..f6a3a7fa7 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1528,5 +1528,7 @@ 等待點亮 本期角逐 上期冠名 - + 已隐藏 + 等待冠名 + 等待助力 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 0bf67d1a2..58140c5f3 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1533,7 +1533,10 @@ Star value Star Gifts Classic Gifts - Waiting for titling + Waiting for lighting This competition Previous Title + Hidden + Waiting for titling + Waiting for assistance 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 9dfcf00d6..27504c8d0 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -3698,8 +3698,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.LIVE_WKS)); } }); - //wksAndGiftWall.addView(weekView); - //wksAndGiftWall.startFlipping(); + // wksAndGiftWall.addView(weekView); + // wksAndGiftWall.startFlipping(); new LoadDian9TuUtil().loadDian9TuAssets2(mContext, liveWksLayout, "rectangle_new.png", 1); } diff --git a/main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java b/main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java index 60ef5880a..8da5b78d7 100644 --- a/main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java @@ -79,9 +79,9 @@ public class ZhuangBanActivity extends AbsActivity { @Override public void setStatusBar() { - getWindow().setStatusBarColor(Color.parseColor("#FFFFFF")); - getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); - getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); +// getWindow().setStatusBarColor(Color.parseColor("#FFFFFF")); +// getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); +// getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); } @Override protected int getLayoutId() {