心愿单修改

This commit is contained in:
18401019693 2023-04-08 15:10:16 +08:00
parent a8178c51a0
commit 9c3fbe0506
13 changed files with 70 additions and 28 deletions

View File

@ -1,9 +1,11 @@
package com.yunbao.common.views; package com.yunbao.common.views;
import android.graphics.Color; import android.graphics.Color;
import android.text.TextUtils;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
@ -14,7 +16,6 @@ import androidx.viewpager2.widget.ViewPager2;
import com.google.android.material.tabs.TabLayout; import com.google.android.material.tabs.TabLayout;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.lxj.xpopup.XPopup; import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.core.BottomPopupView; import com.lxj.xpopup.core.BottomPopupView;
import com.yunbao.common.R; 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.Subscribe;
import org.greenrobot.eventbus.ThreadMode; import org.greenrobot.eventbus.ThreadMode;
import java.lang.reflect.Modifier;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Locale;
/** /**
* 新版心愿单 * 新版心愿单
@ -54,12 +55,16 @@ public class LiveNewWishListPopup extends BottomPopupView {
private boolean zhouXin; private boolean zhouXin;
private boolean lunarWish; private boolean lunarWish;
private boolean seasonalWish; private boolean seasonalWish;
private String ct;
private LiveNewWishListFragment dayWishFragment, zhouXinFragment, lunarWishFragment, seasonalWishFragment; private LiveNewWishListFragment dayWishFragment, zhouXinFragment, lunarWishFragment, seasonalWishFragment;
private ImageView wishListTop;
public LiveNewWishListPopup(@NonNull FragmentActivity context) { public LiveNewWishListPopup(@NonNull FragmentActivity context) {
super(context); super(context);
mContext = context; mContext = context;
ct = Locale.getDefault().getLanguage();
} }
// 返回自定义弹窗的布局 // 返回自定义弹窗的布局
@ -180,6 +185,7 @@ public class LiveNewWishListPopup extends BottomPopupView {
private void initView() { private void initView() {
fragmentViewpager = findViewById(R.id.context_layout); fragmentViewpager = findViewById(R.id.context_layout);
wishTab = findViewById(R.id.wish_tab); wishTab = findViewById(R.id.wish_tab);
wishListTop = findViewById(R.id.wish_list_top);
replacementWish = findViewById(R.id.replacement_wish); replacementWish = findViewById(R.id.replacement_wish);
wishTab.setSelectedTabIndicatorColor(Color.TRANSPARENT); wishTab.setSelectedTabIndicatorColor(Color.TRANSPARENT);
wishTab.setFocusableInTouchMode(false); wishTab.setFocusableInTouchMode(false);
@ -191,7 +197,11 @@ public class LiveNewWishListPopup extends BottomPopupView {
ViewList.add(zhouXinFragment); ViewList.add(zhouXinFragment);
ViewList.add(lunarWishFragment); ViewList.add(lunarWishFragment);
ViewList.add(seasonalWishFragment); 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); LiveNewWishListAdapter liveNewWishListAdapter = new LiveNewWishListAdapter(mContext, ViewList);
fragmentViewpager.setAdapter(liveNewWishListAdapter); fragmentViewpager.setAdapter(liveNewWishListAdapter);
@ -239,15 +249,35 @@ public class LiveNewWishListPopup extends BottomPopupView {
type = tab.getId() + 1; type = tab.getId() + 1;
switch (type) { switch (type) {
case 1: 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); replacementWish.setText(R.string.replacement_wish_day);
break; break;
case 2: 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); replacementWish.setText(R.string.replacement_wish_zhou);
break; break;
case 3: 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); replacementWish.setText(R.string.replacement_wish_lunar);
break; break;
case 4: 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); replacementWish.setText(R.string.replacement_wish_seasonal);
break; break;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 889 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 911 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 911 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 895 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 912 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 894 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 911 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 895 KiB

View File

@ -6,6 +6,13 @@
android:background="@drawable/bg_xyd" android:background="@drawable/bg_xyd"
android:orientation="vertical"> android:orientation="vertical">
<ImageView
android:id="@+id/wish_list_top"
android:layout_width="match_parent"
android:layout_height="160dp"
android:background="@drawable/wish_list_day_zh"
android:scaleType="fitCenter" />
<com.google.android.material.tabs.TabLayout <com.google.android.material.tabs.TabLayout
android:id="@+id/wish_tab" android:id="@+id/wish_tab"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -286,6 +286,9 @@ public class LiveGiftAnimPresenter {
mAnimator.setInterpolator(new LinearInterpolator()); mAnimator.setInterpolator(new LinearInterpolator());
} }
public ConcurrentLinkedQueue<LiveReceiveGiftBean> getmQueue() {
return mQueue;
}
private void downLoadIconGifCallback() { private void downLoadIconGifCallback() {
mDownloadIconCallback = new CommonCallback<File>() { mDownloadIconCallback = new CommonCallback<File>() {

View File

@ -585,26 +585,28 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
public void run() { public void run() {
xydSvg.setVisibility(View.GONE); xydSvg.setVisibility(View.GONE);
if (xydCompleteModels.size() > 0) if (xydCompleteModels.size() > 0)
showXydComplete(xydCompleteModels.get(0)); showXydComplete(xydCompleteModels.get(0), true);
} }
}; };
List<XydCompleteModel> xydCompleteModels = new ArrayList<>(); List<XydCompleteModel> xydCompleteModels = new ArrayList<>();
public void showXydComplete(XydCompleteModel model) { public synchronized void showXydComplete(XydCompleteModel model, boolean isRunble) {
if (model.getLiveId().equals(mLiveUid)) { if (model.getLiveId().equals(mLiveUid)) {
LiveChatBean bean = new LiveChatBean(); if (!isRunble) {
LiveChatBean bean = new LiveChatBean();
bean.setContent(model.getMsg()); bean.setContent(model.getMsg());
bean.setUserNiceName(model.getUserName()); bean.setUserNiceName(model.getUserName());
bean.setAtUserName(model.getGiftname()) bean.setAtUserName(model.getGiftname())
.setLevel(model.getLevel()); .setLevel(model.getLevel());
bean.setType(LiveChatBean.XYD_COMPLETE); bean.setType(LiveChatBean.XYD_COMPLETE);
mLiveChatAdapter.insertItem(bean); mLiveChatAdapter.insertItem(bean);
xydCompleteModels.add(model);
}
xydCompleteModels.add(model); if (mLiveGiftAnimPresenter != null && mLiveGiftAnimPresenter.getmQueue().size() > 0) {
if (mSVGAImageView.isAnimating()) { new Handler().postDelayed(xydCompleteRunnable, 1000);
new Handler().postDelayed(xydCompleteRunnable, 2000);
} else { } else {
try { try {
xydSvg.setLoops(1); xydSvg.setLoops(1);
@ -630,7 +632,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
if (xydCompleteModels.size() > 0) { if (xydCompleteModels.size() > 0) {
xydCompleteModels.remove(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) { public void wishListProgress(WishModel wishModel, String userNiceName, int level) {
if (mTopBannerList == null) {
mTopBannerList = new ArrayList<>();
}
wishListProgress = null; wishListProgress = null;
WishModel model = wishModel; WishModel model = wishModel;
if (!TextUtils.isEmpty(model.getWishlistName()) || !TextUtils.isEmpty(model.getWishlistProgress())) { if (!TextUtils.isEmpty(model.getWishlistName()) || !TextUtils.isEmpty(model.getWishlistProgress())) {
@ -4241,11 +4246,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
mTopBannerList.remove(bannerBean); mTopBannerList.remove(bannerBean);
} }
} }
if (mTopBannerList.size()==0){
topBanner1.setVisibility(View.GONE); topBanner1.update(mTopBannerList);
}else {
topBanner1.update(mTopBannerList);
}
new Handler().postDelayed(new Runnable() { new Handler().postDelayed(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -4265,9 +4267,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
bean.setType(LiveChatBean.WISH_LIST_PROGRESS); bean.setType(LiveChatBean.WISH_LIST_PROGRESS);
bean.setLevel(level); bean.setLevel(level);
mLiveChatAdapter.insertItem(bean); mLiveChatAdapter.insertItem(bean);
if (mTopBannerList.size()==0){ if (mTopBannerList.size() == 0) {
topBanner1.setVisibility(View.GONE); topBanner1.setVisibility(View.GONE);
}else { } else {
topBanner1.update(mTopBannerList); topBanner1.update(mTopBannerList);
} }
} }
@ -4285,9 +4287,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
// bean.setAtUserName(model.getWishlistName()); // bean.setAtUserName(model.getWishlistName());
// bean.setType(LiveChatBean.WISH_LIST_PROGRESS); // bean.setType(LiveChatBean.WISH_LIST_PROGRESS);
// mLiveChatAdapter.insertItem(bean); // mLiveChatAdapter.insertItem(bean);
if (mTopBannerList.size()==0){ if (mTopBannerList.size() == 0) {
topBanner1.setVisibility(View.GONE); topBanner1.setVisibility(View.GONE);
}else { } else {
topBanner1.update(mTopBannerList); topBanner1.update(mTopBannerList);
} }
@ -4762,7 +4764,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
.setOnBannerClickListener(new OnBannerClickListener() { .setOnBannerClickListener(new OnBannerClickListener() {
@Override @Override
public void onBannerClick(List datas, int position) { public void onBannerClick(List datas, int position) {
if (datas.size()>0){ if (datas.size() > 0) {
if (mTopBannerList.get(position).getType() == TopBannerCustomViewHolder.TYPE_CALL_ANCHOR) { if (mTopBannerList.get(position).getType() == TopBannerCustomViewHolder.TYPE_CALL_ANCHOR) {
Dialog loading = DialogUitl.loadingDialog(mContext); Dialog loading = DialogUitl.loadingDialog(mContext);
loading.show(); loading.show();

View File

@ -1958,7 +1958,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
public void showXydComplete(XydCompleteModel model) { public void showXydComplete(XydCompleteModel model) {
if (mLiveRoomViewHolder != null) { if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.showXydComplete(model); mLiveRoomViewHolder.showXydComplete(model, false);
} }
} }
} }