心愿单修改

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

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: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
android:id="@+id/wish_tab"
android:layout_width="match_parent"

View File

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

View File

@ -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<XydCompleteModel> 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();

View File

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