心愿单修改
@ -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;
|
||||
}
|
||||
|
BIN
common/src/main/res/drawable/wish_list_day_en.png
Normal file
After Width: | Height: | Size: 889 KiB |
BIN
common/src/main/res/drawable/wish_list_day_zh.png
Normal file
After Width: | Height: | Size: 911 KiB |
BIN
common/src/main/res/drawable/wish_list_lunar_en.png
Normal file
After Width: | Height: | Size: 911 KiB |
BIN
common/src/main/res/drawable/wish_list_lunar_zh.png
Normal file
After Width: | Height: | Size: 895 KiB |
BIN
common/src/main/res/drawable/wish_list_seasonal_en.png
Normal file
After Width: | Height: | Size: 912 KiB |
BIN
common/src/main/res/drawable/wish_list_seasonal_zh.png
Normal file
After Width: | Height: | Size: 894 KiB |
BIN
common/src/main/res/drawable/wish_list_week_en.png
Normal file
After Width: | Height: | Size: 911 KiB |
BIN
common/src/main/res/drawable/wish_list_week_zh.png
Normal file
After Width: | Height: | Size: 895 KiB |
@ -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"
|
||||
|
@ -286,6 +286,9 @@ public class LiveGiftAnimPresenter {
|
||||
mAnimator.setInterpolator(new LinearInterpolator());
|
||||
}
|
||||
|
||||
public ConcurrentLinkedQueue<LiveReceiveGiftBean> getmQueue() {
|
||||
return mQueue;
|
||||
}
|
||||
|
||||
private void downLoadIconGifCallback() {
|
||||
mDownloadIconCallback = new CommonCallback<File>() {
|
||||
|
@ -585,14 +585,15 @@ 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)) {
|
||||
if (!isRunble) {
|
||||
LiveChatBean bean = new LiveChatBean();
|
||||
|
||||
bean.setContent(model.getMsg());
|
||||
@ -601,10 +602,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
.setLevel(model.getLevel());
|
||||
bean.setType(LiveChatBean.XYD_COMPLETE);
|
||||
mLiveChatAdapter.insertItem(bean);
|
||||
|
||||
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);
|
||||
}
|
||||
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();
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|