心愿单修改
@@ -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"
|
||||
|
||||