fixt:修复送礼面板-分类选择器与背包价值重叠问题
This commit is contained in:
@@ -162,7 +162,6 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
private ImageView ivLuckyBagIntro;
|
||||
private View flLuckyDesc;
|
||||
private RecyclerView rvLuckyMsg;
|
||||
private TextView tvGiftValue;
|
||||
private EditText etSendMessage;
|
||||
private Button sendGiftButton;
|
||||
private View layoutEmpty;
|
||||
@@ -185,7 +184,6 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
private WalletInfo goldWalletInfo = PayModel.get().getCurrentWalletInfo();
|
||||
private int itemType = ITEM_TYPE_GOLD;
|
||||
private View rlGifts;
|
||||
private View llTabs;
|
||||
private View llDrawGift;
|
||||
private TextView tvDrawGiftTips;
|
||||
private View ivDrawGiftRemoveLast;
|
||||
@@ -420,7 +418,6 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
reloadView.setOnClickListener(this);
|
||||
loadingView = findViewById(R.id.iv_loading);
|
||||
rlGifts = findViewById(R.id.rl_gifts);
|
||||
llTabs = findViewById(R.id.ll_tabs);
|
||||
llDrawGift = findViewById(R.id.ll_draw_gift);
|
||||
tvDrawGiftTips = findViewById(R.id.tv_draw_gift_tips);
|
||||
ivDrawGiftRemoveLast = findViewById(R.id.iv_draw_gift_remove_last);
|
||||
@@ -445,10 +442,10 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
if (AvRoomDataManager.get().isHasRoomPrivilegeCard()) {
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_PRIVILEGE, "特权卡", "特权卡"));
|
||||
}
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_KNAP, "背包", "背包"));
|
||||
giftIndicator = findViewById(R.id.gift_indicator);
|
||||
giftIndicator.initTab(
|
||||
tabInfoList,
|
||||
true,
|
||||
context.getResources().getColor(R.color.color_bdbfd0),
|
||||
context.getResources().getColor(R.color.color_ffe710)
|
||||
);
|
||||
@@ -508,7 +505,6 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
ivLuckyBagIntro = findViewById(R.id.iv_lucky_bag_intro);
|
||||
flLuckyDesc = findViewById(R.id.fl_lucky_desc);
|
||||
rvLuckyMsg = findViewById(R.id.rv_lucky_msg);
|
||||
tvGiftValue = findViewById(R.id.tv_gift_value);
|
||||
tvSelectAll = findViewById(R.id.tv_select_all);
|
||||
tvSelectAll.setSelected(false);
|
||||
tvSelectAll.setOnClickListener(v -> avatarListAdapter.selectAll());
|
||||
@@ -757,7 +753,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
}
|
||||
});
|
||||
} else if (isKnap) {
|
||||
tvGiftValue.setVisibility(View.VISIBLE);
|
||||
giftIndicator.getBackpackValueView().setVisibility(View.VISIBLE);
|
||||
showEmptyView();
|
||||
} else if (position == GiftIndicator.TYPE_LUCKY ||
|
||||
position == GiftIndicator.TYPE_WEEK ||
|
||||
@@ -817,7 +813,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
pagerList = beanTransformVm(context, currentGiftInfoList, isKnap, Integer.MAX_VALUE, selectGiftInfo);
|
||||
setGridViewData(pagerList);
|
||||
if (isKnap) {
|
||||
tvGiftValue.setVisibility(View.VISIBLE);
|
||||
giftIndicator.getBackpackValueView().setVisibility(View.VISIBLE);
|
||||
updateTotalPrice();
|
||||
} else {
|
||||
if (giftNumber == -1) {
|
||||
@@ -981,7 +977,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
);
|
||||
drawGiftHelper.setMaxDrawSize(MAX_DRAW_SIZE);
|
||||
rlGifts.setVisibility(View.GONE);
|
||||
llTabs.setVisibility(View.GONE);
|
||||
giftIndicator.setVisibility(View.GONE);
|
||||
llTabType.setVisibility(View.GONE);
|
||||
lineTabType.setVisibility(View.GONE);
|
||||
giftNumLayout.setVisibility(View.GONE);
|
||||
@@ -1001,7 +997,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
getWindow().setAttributes(params);
|
||||
}
|
||||
rlGifts.setVisibility(View.VISIBLE);
|
||||
llTabs.setVisibility(View.VISIBLE);
|
||||
giftIndicator.setVisibility(View.VISIBLE);
|
||||
llTabType.setVisibility(View.VISIBLE);
|
||||
lineTabType.setVisibility(View.VISIBLE);
|
||||
llDrawGift.setVisibility(View.GONE);
|
||||
@@ -1053,7 +1049,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
SpannableBuilder text = new SpannableBuilder()
|
||||
.append("总价值: ", new ForegroundColorSpan(Color.parseColor("#BABBCD")))
|
||||
.append(diamond + "", new ForegroundColorSpan(Color.parseColor("#FFE710")));
|
||||
tvGiftValue.setText(text.build());
|
||||
giftIndicator.getBackpackValueView().setText(text.build());
|
||||
}
|
||||
|
||||
private void showPrivilegeEmptyView() {
|
||||
@@ -1100,7 +1096,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
layoutLoadFiled.setVisibility(View.GONE);
|
||||
layoutEmpty.setVisibility(View.GONE);
|
||||
etSendMessage.setVisibility(View.GONE);
|
||||
tvGiftValue.setVisibility(View.GONE);
|
||||
giftIndicator.getBackpackValueView().setVisibility(View.GONE);
|
||||
llStarWeek.setVisibility(View.GONE);
|
||||
flLuckyDesc.setVisibility(View.GONE);
|
||||
|
||||
|
@@ -132,7 +132,6 @@ public class PrivateChatGiftDialog extends BottomSheetDialog implements View.OnC
|
||||
private TextView tvWeekStarFirstUsername;
|
||||
private TextView tvWeekStarEmpty;
|
||||
private DrawableCenterTextView tvWeekStarIn;
|
||||
private TextView tvGiftValue;
|
||||
private LinearLayout layoutLoading;
|
||||
private ImageView ivLoading;
|
||||
private LinearLayout layoutLoadFailed;
|
||||
@@ -251,10 +250,10 @@ public class PrivateChatGiftDialog extends BottomSheetDialog implements View.OnC
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_NORMAL, "礼物", "礼物"));
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_NOBLE, "贵族", "贵族"));
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_WEEK, "星座礼物", "星座礼物"));
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_KNAP, "背包", "背包"));
|
||||
giftIndicator = findViewById(R.id.gift_indicator);
|
||||
giftIndicator.initTab(
|
||||
tabInfoList,
|
||||
true,
|
||||
Color.parseColor("#878B9C"),
|
||||
Color.parseColor("#282828")
|
||||
);
|
||||
@@ -297,7 +296,6 @@ public class PrivateChatGiftDialog extends BottomSheetDialog implements View.OnC
|
||||
tvWeekStarFirstUsername = findViewById(R.id.tv_week_star_first_username);
|
||||
tvWeekStarEmpty = findViewById(R.id.tv_week_star_empty);
|
||||
tvWeekStarIn = findViewById(R.id.tv_week_star_in);
|
||||
tvGiftValue = findViewById(R.id.tv_gift_value);
|
||||
layoutLoading = findViewById(R.id.layout_loading);
|
||||
ivLoading = findViewById(R.id.iv_loading);
|
||||
layoutLoadFailed = findViewById(R.id.layout_load_failed);
|
||||
@@ -372,7 +370,7 @@ public class PrivateChatGiftDialog extends BottomSheetDialog implements View.OnC
|
||||
if (ListUtils.isListEmpty(currentGiftInfoList)) {
|
||||
currentGiftInfo = null;
|
||||
if (isKnap) {
|
||||
tvGiftValue.setVisibility(View.VISIBLE);
|
||||
giftIndicator.getBackpackValueView().setVisibility(View.VISIBLE);
|
||||
showEmptyView();
|
||||
} else if (position == GiftIndicator.TYPE_LUCKY ||
|
||||
position == GiftIndicator.TYPE_WEEK ||
|
||||
@@ -393,7 +391,7 @@ public class PrivateChatGiftDialog extends BottomSheetDialog implements View.OnC
|
||||
pagerList = beanTransformVm(context, currentGiftInfoList, isKnap, Integer.MAX_VALUE, selectGiftInfo);
|
||||
setGridViewData(pagerList);
|
||||
if (isKnap) {
|
||||
tvGiftValue.setVisibility(View.VISIBLE);
|
||||
giftIndicator.getBackpackValueView().setVisibility(View.VISIBLE);
|
||||
updateTotalPrice();
|
||||
} else {
|
||||
if (giftNumber == -1) {
|
||||
@@ -478,7 +476,7 @@ public class PrivateChatGiftDialog extends BottomSheetDialog implements View.OnC
|
||||
SpannableBuilder text = new SpannableBuilder()
|
||||
.append("总价值: ", new ForegroundColorSpan(Color.parseColor("#BABBCD")))
|
||||
.append(diamond + "", new ForegroundColorSpan(Color.parseColor("#FFE710")));
|
||||
tvGiftValue.setText(text.build());
|
||||
giftIndicator.getBackpackValueView().setText(text.build());
|
||||
}
|
||||
|
||||
private void showEmptyView() {
|
||||
@@ -509,7 +507,7 @@ public class PrivateChatGiftDialog extends BottomSheetDialog implements View.OnC
|
||||
layoutLoadFailed.setVisibility(View.GONE);
|
||||
layoutEmpty.setVisibility(View.GONE);
|
||||
etGiftMessage.setVisibility(View.GONE);
|
||||
tvGiftValue.setVisibility(View.GONE);
|
||||
giftIndicator.getBackpackValueView().setVisibility(View.GONE);
|
||||
llStarWeek.setVisibility(View.GONE);
|
||||
|
||||
gridView.setVisibility(View.VISIBLE);
|
||||
|
@@ -5,8 +5,11 @@ import android.content.Context;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import android.util.AttributeSet;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.HorizontalScrollView;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
@@ -92,30 +95,47 @@ public class GiftIndicator extends LinearLayout {
|
||||
private int mFalseColor;
|
||||
private int mTrueColor;
|
||||
|
||||
private LinearLayout tabLayout;
|
||||
private HorizontalScrollView scrollView;
|
||||
private TextView mTvBackpackValue;
|
||||
|
||||
public GiftIndicator(Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
LayoutInflater.from(context)
|
||||
.inflate(R.layout.gift_type_indicator, this, true);
|
||||
setOrientation(LinearLayout.HORIZONTAL);
|
||||
setGravity(Gravity.CENTER_VERTICAL);
|
||||
tabLayout = findViewById(R.id.layout_tab);
|
||||
scrollView = findViewById(R.id.scrollView);
|
||||
mTvBackpackValue = findViewById(R.id.tv_backpack_value);
|
||||
}
|
||||
|
||||
public void initTab(List<GiftTab> list, int falseColor, int trueColor) {
|
||||
public void initTab(List<GiftTab> list, boolean addBackpackTab, int falseColor, int trueColor) {
|
||||
tabList = new ArrayList<>();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
GiftTab tab = list.get(i);
|
||||
View view = inflate(GiftIndicator.this.getContext(), R.layout.layout_gift_indicator_item, null);
|
||||
tab.setItemView(view);
|
||||
addView(view, new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
UIUtil.dip2px(getContext(), 26)));
|
||||
TextView tvTitle = view.findViewById(R.id.tv_title);
|
||||
tvTitle.setText(tab.getUnSelectedTitle());
|
||||
addTab(tabLayout, tab);
|
||||
}
|
||||
tabList.addAll(list);
|
||||
if (addBackpackTab) {
|
||||
GiftTab tab = new GiftTab(GiftIndicator.TYPE_KNAP, "背包", "背包");
|
||||
addTab(this, tab);
|
||||
tabList.add(tab);
|
||||
}
|
||||
LinearLayout.LayoutParams params = new LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
params.weight = 1f;
|
||||
addView(new View(getContext()), list.size() - 1, params);
|
||||
tabList = list;
|
||||
mFalseColor = falseColor;
|
||||
mTrueColor = trueColor;
|
||||
setPosition(TYPE_NORMAL);
|
||||
}
|
||||
|
||||
private void addTab(ViewGroup group, GiftTab tab) {
|
||||
View view = inflate(GiftIndicator.this.getContext(), R.layout.layout_gift_indicator_item, null);
|
||||
tab.setItemView(view);
|
||||
group.addView(view, new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
UIUtil.dip2px(getContext(), 26)));
|
||||
TextView tvTitle = view.findViewById(R.id.tv_title);
|
||||
tvTitle.setText(tab.getUnSelectedTitle());
|
||||
}
|
||||
|
||||
public Observable<Integer> addClick() {
|
||||
return Observable.create(emitter -> {
|
||||
for (int i = 0; i < tabList.size(); i++) {
|
||||
@@ -129,6 +149,8 @@ public class GiftIndicator extends LinearLayout {
|
||||
imageView.setVisibility(GONE);
|
||||
DemoCache.saveNewGiftTypeTip(false);
|
||||
}
|
||||
} else if (index.getType() == TYPE_KNAP) {
|
||||
scrollView.postDelayed(() -> scrollView.fullScroll(View.FOCUS_RIGHT),50);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -175,4 +197,7 @@ public class GiftIndicator extends LinearLayout {
|
||||
}
|
||||
}
|
||||
|
||||
public TextView getBackpackValueView() {
|
||||
return mTvBackpackValue;
|
||||
}
|
||||
}
|
||||
|
@@ -378,43 +378,18 @@
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/ll_tabs"
|
||||
<com.nnbc123.app.ui.widget.magicindicator.GiftIndicator
|
||||
android:id="@+id/gift_indicator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="34dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/rl_avatars"
|
||||
tools:background="@color/blue">
|
||||
|
||||
<com.nnbc123.app.ui.widget.magicindicator.GiftIndicator
|
||||
android:id="@+id/gift_indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gift_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:layout_marginEnd="42dp"
|
||||
android:drawableEnd="@drawable/ic_gift_dialog_diamond"
|
||||
android:drawablePadding="2dp"
|
||||
android:fontFamily="@string/sans_serif"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:text="总价值:0"
|
||||
android:textColor="#BABBCD"
|
||||
android:textSize="@dimen/dp_10"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</FrameLayout>
|
||||
tools:background="@color/blue" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_gifts"
|
||||
@@ -423,7 +398,7 @@
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/ll_tabs">
|
||||
app:layout_constraintTop_toBottomOf="@id/gift_indicator">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_loading"
|
||||
@@ -493,9 +468,9 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:layout_marginEnd="@dimen/dp_10" />
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:visibility="gone" />
|
||||
|
||||
<com.nnbc123.app.ui.widget.RecyclerViewNoViewpagerScroll
|
||||
android:id="@+id/privilegeView"
|
||||
|
@@ -112,39 +112,14 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/ll_tabs"
|
||||
<com.nnbc123.app.ui.widget.magicindicator.GiftIndicator
|
||||
android:id="@+id/gift_indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="14dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp">
|
||||
|
||||
<com.nnbc123.app.ui.widget.magicindicator.GiftIndicator
|
||||
android:id="@+id/gift_indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="center_vertical" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gift_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:layout_marginEnd="42dp"
|
||||
android:drawableEnd="@drawable/ic_gift_dialog_diamond"
|
||||
android:drawablePadding="2dp"
|
||||
android:fontFamily="@string/sans_serif"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:text="总价值:0"
|
||||
android:textColor="@color/text_secondary_878b9c"
|
||||
android:textSize="@dimen/dp_10"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</FrameLayout>
|
||||
android:paddingEnd="8dp" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_gifts"
|
||||
|
43
app/src/main/res/layout/gift_type_indicator.xml
Normal file
43
app/src/main/res/layout/gift_type_indicator.xml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/layout_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
tools:parentTag="android.widget.LinearLayout">
|
||||
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/scrollView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_tab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</HorizontalScrollView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_backpack_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:drawableEnd="@drawable/ic_gift_dialog_diamond"
|
||||
android:drawablePadding="2dp"
|
||||
android:fontFamily="@string/sans_serif"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:text="总价值:0"
|
||||
android:textColor="#BABBCD"
|
||||
android:textSize="@dimen/dp_10"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
</merge>
|
@@ -2,7 +2,7 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="26dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="@dimen/dp_7"
|
||||
@@ -23,6 +23,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top"
|
||||
android:src="@drawable/ic_gift_dialog_new"
|
||||
android:visibility="gone" />
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</LinearLayout>
|
Reference in New Issue
Block a user