diff --git a/common/src/main/java/com/yunbao/common/views/LiveNewWishListPopup.java b/common/src/main/java/com/yunbao/common/views/LiveNewWishListPopup.java index cb2c31d04..e1303d6ee 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveNewWishListPopup.java +++ b/common/src/main/java/com/yunbao/common/views/LiveNewWishListPopup.java @@ -1,9 +1,11 @@ package com.yunbao.common.views; import android.graphics.Color; +import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; @@ -14,7 +16,6 @@ import androidx.viewpager2.widget.ViewPager2; import com.google.android.material.tabs.TabLayout; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; import com.lxj.xpopup.XPopup; import com.lxj.xpopup.core.BottomPopupView; import com.yunbao.common.R; @@ -35,9 +36,9 @@ import com.yunbao.common.views.weight.ViewClicksAntiShake; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; -import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.List; +import java.util.Locale; /** * 新版心愿单 @@ -54,12 +55,16 @@ public class LiveNewWishListPopup extends BottomPopupView { private boolean zhouXin; private boolean lunarWish; private boolean seasonalWish; - + private String ct; private LiveNewWishListFragment dayWishFragment, zhouXinFragment, lunarWishFragment, seasonalWishFragment; + private ImageView wishListTop; public LiveNewWishListPopup(@NonNull FragmentActivity context) { super(context); mContext = context; + ct = Locale.getDefault().getLanguage(); + + } // 返回自定义弹窗的布局 @@ -180,6 +185,7 @@ public class LiveNewWishListPopup extends BottomPopupView { private void initView() { fragmentViewpager = findViewById(R.id.context_layout); wishTab = findViewById(R.id.wish_tab); + wishListTop = findViewById(R.id.wish_list_top); replacementWish = findViewById(R.id.replacement_wish); wishTab.setSelectedTabIndicatorColor(Color.TRANSPARENT); wishTab.setFocusableInTouchMode(false); @@ -191,7 +197,11 @@ public class LiveNewWishListPopup extends BottomPopupView { ViewList.add(zhouXinFragment); ViewList.add(lunarWishFragment); ViewList.add(seasonalWishFragment); - + if (TextUtils.equals(ct, "zh")) { + wishListTop.setBackgroundResource(R.drawable.wish_list_day_zh); + } else { + wishListTop.setBackgroundResource(R.drawable.wish_list_day_en); + } LiveNewWishListAdapter liveNewWishListAdapter = new LiveNewWishListAdapter(mContext, ViewList); fragmentViewpager.setAdapter(liveNewWishListAdapter); @@ -239,15 +249,35 @@ public class LiveNewWishListPopup extends BottomPopupView { type = tab.getId() + 1; switch (type) { case 1: + if (TextUtils.equals(ct, "zh")) { + wishListTop.setBackgroundResource(R.drawable.wish_list_day_zh); + } else { + wishListTop.setBackgroundResource(R.drawable.wish_list_day_en); + } replacementWish.setText(R.string.replacement_wish_day); break; case 2: + if (TextUtils.equals(ct, "zh")) { + wishListTop.setBackgroundResource(R.drawable.wish_list_week_zh); + } else { + wishListTop.setBackgroundResource(R.drawable.wish_list_week_en); + } replacementWish.setText(R.string.replacement_wish_zhou); break; case 3: + if (TextUtils.equals(ct, "zh")) { + wishListTop.setBackgroundResource(R.drawable.wish_list_lunar_zh); + } else { + wishListTop.setBackgroundResource(R.drawable.wish_list_lunar_en); + } replacementWish.setText(R.string.replacement_wish_lunar); break; case 4: + if (TextUtils.equals(ct, "zh")) { + wishListTop.setBackgroundResource(R.drawable.wish_list_seasonal_zh); + } else { + wishListTop.setBackgroundResource(R.drawable.wish_list_seasonal_en); + } replacementWish.setText(R.string.replacement_wish_seasonal); break; } diff --git a/common/src/main/res/drawable/wish_list_day_en.png b/common/src/main/res/drawable/wish_list_day_en.png new file mode 100644 index 000000000..fcba5660f Binary files /dev/null and b/common/src/main/res/drawable/wish_list_day_en.png differ diff --git a/common/src/main/res/drawable/wish_list_day_zh.png b/common/src/main/res/drawable/wish_list_day_zh.png new file mode 100644 index 000000000..f2cfefa71 Binary files /dev/null and b/common/src/main/res/drawable/wish_list_day_zh.png differ diff --git a/common/src/main/res/drawable/wish_list_lunar_en.png b/common/src/main/res/drawable/wish_list_lunar_en.png new file mode 100644 index 000000000..6f99a69e7 Binary files /dev/null and b/common/src/main/res/drawable/wish_list_lunar_en.png differ diff --git a/common/src/main/res/drawable/wish_list_lunar_zh.png b/common/src/main/res/drawable/wish_list_lunar_zh.png new file mode 100644 index 000000000..852850794 Binary files /dev/null and b/common/src/main/res/drawable/wish_list_lunar_zh.png differ diff --git a/common/src/main/res/drawable/wish_list_seasonal_en.png b/common/src/main/res/drawable/wish_list_seasonal_en.png new file mode 100644 index 000000000..ac0bff237 Binary files /dev/null and b/common/src/main/res/drawable/wish_list_seasonal_en.png differ diff --git a/common/src/main/res/drawable/wish_list_seasonal_zh.png b/common/src/main/res/drawable/wish_list_seasonal_zh.png new file mode 100644 index 000000000..2684339b1 Binary files /dev/null and b/common/src/main/res/drawable/wish_list_seasonal_zh.png differ diff --git a/common/src/main/res/drawable/wish_list_week_en.png b/common/src/main/res/drawable/wish_list_week_en.png new file mode 100644 index 000000000..74397cf8d Binary files /dev/null and b/common/src/main/res/drawable/wish_list_week_en.png differ diff --git a/common/src/main/res/drawable/wish_list_week_zh.png b/common/src/main/res/drawable/wish_list_week_zh.png new file mode 100644 index 000000000..8e46b3dec Binary files /dev/null and b/common/src/main/res/drawable/wish_list_week_zh.png differ diff --git a/common/src/main/res/layout/dialog_live_new_wish_list.xml b/common/src/main/res/layout/dialog_live_new_wish_list.xml index aa4dca25f..542dd57c5 100644 --- a/common/src/main/res/layout/dialog_live_new_wish_list.xml +++ b/common/src/main/res/layout/dialog_live_new_wish_list.xml @@ -6,6 +6,13 @@ android:background="@drawable/bg_xyd" android:orientation="vertical"> + + getmQueue() { + return mQueue; + } private void downLoadIconGifCallback() { mDownloadIconCallback = new CommonCallback() { 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 cc6c52fc1..438f2528d 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -585,26 +585,28 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public void run() { xydSvg.setVisibility(View.GONE); if (xydCompleteModels.size() > 0) - showXydComplete(xydCompleteModels.get(0)); + showXydComplete(xydCompleteModels.get(0), true); } }; List xydCompleteModels = new ArrayList<>(); - public void showXydComplete(XydCompleteModel model) { + public synchronized void showXydComplete(XydCompleteModel model, boolean isRunble) { if (model.getLiveId().equals(mLiveUid)) { - LiveChatBean bean = new LiveChatBean(); + if (!isRunble) { + LiveChatBean bean = new LiveChatBean(); - bean.setContent(model.getMsg()); - bean.setUserNiceName(model.getUserName()); - bean.setAtUserName(model.getGiftname()) - .setLevel(model.getLevel()); - bean.setType(LiveChatBean.XYD_COMPLETE); - mLiveChatAdapter.insertItem(bean); + bean.setContent(model.getMsg()); + bean.setUserNiceName(model.getUserName()); + bean.setAtUserName(model.getGiftname()) + .setLevel(model.getLevel()); + bean.setType(LiveChatBean.XYD_COMPLETE); + mLiveChatAdapter.insertItem(bean); + xydCompleteModels.add(model); + } - xydCompleteModels.add(model); - if (mSVGAImageView.isAnimating()) { - new Handler().postDelayed(xydCompleteRunnable, 2000); + if (mLiveGiftAnimPresenter != null && mLiveGiftAnimPresenter.getmQueue().size() > 0) { + new Handler().postDelayed(xydCompleteRunnable, 1000); } else { try { xydSvg.setLoops(1); @@ -630,7 +632,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis if (xydCompleteModels.size() > 0) { xydCompleteModels.remove(0); - new Handler().postDelayed(xydCompleteRunnable, 2000); + new Handler().postDelayed(xydCompleteRunnable, 1000); } } @@ -4233,6 +4235,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } public void wishListProgress(WishModel wishModel, String userNiceName, int level) { + if (mTopBannerList == null) { + mTopBannerList = new ArrayList<>(); + } wishListProgress = null; WishModel model = wishModel; if (!TextUtils.isEmpty(model.getWishlistName()) || !TextUtils.isEmpty(model.getWishlistProgress())) { @@ -4241,11 +4246,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis mTopBannerList.remove(bannerBean); } } - if (mTopBannerList.size()==0){ - topBanner1.setVisibility(View.GONE); - }else { - topBanner1.update(mTopBannerList); - } + + topBanner1.update(mTopBannerList); new Handler().postDelayed(new Runnable() { @Override public void run() { @@ -4265,9 +4267,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis bean.setType(LiveChatBean.WISH_LIST_PROGRESS); bean.setLevel(level); mLiveChatAdapter.insertItem(bean); - if (mTopBannerList.size()==0){ + if (mTopBannerList.size() == 0) { topBanner1.setVisibility(View.GONE); - }else { + } else { topBanner1.update(mTopBannerList); } } @@ -4285,9 +4287,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis // bean.setAtUserName(model.getWishlistName()); // bean.setType(LiveChatBean.WISH_LIST_PROGRESS); // mLiveChatAdapter.insertItem(bean); - if (mTopBannerList.size()==0){ + if (mTopBannerList.size() == 0) { topBanner1.setVisibility(View.GONE); - }else { + } else { topBanner1.update(mTopBannerList); } @@ -4762,7 +4764,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .setOnBannerClickListener(new OnBannerClickListener() { @Override public void onBannerClick(List datas, int position) { - if (datas.size()>0){ + if (datas.size() > 0) { if (mTopBannerList.get(position).getType() == TopBannerCustomViewHolder.TYPE_CALL_ANCHOR) { Dialog loading = DialogUitl.loadingDialog(mContext); loading.show(); 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 ebd5a1044..56bc0d7c7 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -1958,7 +1958,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe public void showXydComplete(XydCompleteModel model) { if (mLiveRoomViewHolder != null) { - mLiveRoomViewHolder.showXydComplete(model); + mLiveRoomViewHolder.showXydComplete(model, false); } } }