心愿单修改

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,14 +585,15 @@ 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)) {
if (!isRunble) {
LiveChatBean bean = new LiveChatBean(); LiveChatBean bean = new LiveChatBean();
bean.setContent(model.getMsg()); bean.setContent(model.getMsg());
@ -601,10 +602,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
.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 (mSVGAImageView.isAnimating()) { }
new Handler().postDelayed(xydCompleteRunnable, 2000);
if (mLiveGiftAnimPresenter != null && mLiveGiftAnimPresenter.getmQueue().size() > 0) {
new Handler().postDelayed(xydCompleteRunnable, 1000);
} 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);
}else {
topBanner1.update(mTopBannerList); topBanner1.update(mTopBannerList);
}
new Handler().postDelayed(new Runnable() { new Handler().postDelayed(new Runnable() {
@Override @Override
public void run() { public void run() {

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);
} }
} }
} }