礼物面板tab UI适配优化
This commit is contained in:
@@ -23,6 +23,7 @@ import android.view.animation.RotateAnimation;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.HorizontalScrollView;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -43,11 +44,9 @@ import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargeDialog;
|
||||
import com.yizhuan.erban.base.BaseActivity;
|
||||
import com.yizhuan.erban.common.widget.CircleImageView;
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager;
|
||||
import com.yizhuan.erban.radish.task.activity.TaskCenterActivity;
|
||||
import com.yizhuan.erban.ui.gift.dialog.GiftInfoVm;
|
||||
import com.yizhuan.erban.ui.gift.dialog.PageIndicatorView;
|
||||
import com.yizhuan.erban.ui.pay.ChargeActivity;
|
||||
import com.yizhuan.erban.ui.pay.ChargeDialog;
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||
import com.yizhuan.erban.ui.webview.DialogWebViewActivity;
|
||||
@@ -70,9 +69,6 @@ import com.yizhuan.xchat_android_core.gift.bean.GiftType;
|
||||
import com.yizhuan.xchat_android_core.gift.bean.SimpleUserInfo;
|
||||
import com.yizhuan.xchat_android_core.gift.event.UpdateKnapEvent;
|
||||
import com.yizhuan.xchat_android_core.initial.InitialModel;
|
||||
import com.yizhuan.xchat_android_core.magic.MagicModel;
|
||||
import com.yizhuan.xchat_android_core.magic.bean.MagicInfo;
|
||||
import com.yizhuan.xchat_android_core.magic.exception.MagicOutOfDateException;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
|
||||
import com.yizhuan.xchat_android_core.manager.RoomEvent;
|
||||
@@ -88,8 +84,6 @@ import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
||||
import com.yizhuan.xchat_android_core.utils.StringExtensionKt;
|
||||
import com.yizhuan.xchat_android_core.utils.net.BalanceNotEnoughExeption;
|
||||
import com.yizhuan.xchat_android_core.utils.net.FreezeException;
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
||||
import com.yizhuan.xchat_android_library.bindinglist.IItem;
|
||||
import com.yizhuan.xchat_android_library.bindinglist.MultiTypeAdapter;
|
||||
@@ -106,7 +100,6 @@ import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -182,11 +175,11 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
private List<List<GiftInfoVm>> pagerList;
|
||||
private WalletInfo goldWalletInfo;
|
||||
private int itemType = ITEM_TYPE_GOLD;
|
||||
private HorizontalScrollView hsvTabs;
|
||||
private View rlGifts;
|
||||
private View llTabs;
|
||||
private View llDrawGift;
|
||||
private TextView tvDrawGiftTips;
|
||||
private TextView tvDrawGiftChange;
|
||||
private View ivDrawGiftRemoveLast;
|
||||
private View ivDrawGiftRemoveAll;
|
||||
private View ivDrawGiftClose;
|
||||
@@ -375,19 +368,17 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
reloadView = root.findViewById(R.id.tv_reload);
|
||||
reloadView.setOnClickListener(this);
|
||||
loadingView = root.findViewById(R.id.iv_loading);
|
||||
hsvTabs = root.findViewById(R.id.hsv_tabs);
|
||||
rlGifts = root.findViewById(R.id.rl_gifts);
|
||||
llTabs = root.findViewById(R.id.ll_tabs);
|
||||
llDrawGift = root.findViewById(R.id.ll_draw_gift);
|
||||
tvDrawGiftTips = root.findViewById(R.id.tv_draw_gift_tips);
|
||||
tvDrawGiftChange = root.findViewById(R.id.tv_draw_gift_change);
|
||||
setGradient(tvDrawGiftChange);
|
||||
ivDrawGiftRemoveLast = root.findViewById(R.id.iv_draw_gift_remove_last);
|
||||
ivDrawGiftRemoveAll = root.findViewById(R.id.iv_draw_gift_remove_all);
|
||||
ivDrawGiftClose = root.findViewById(R.id.iv_draw_gift_close);
|
||||
ivDrawGiftClose.setOnClickListener(this);
|
||||
ivDrawGiftRemoveLast.setOnClickListener(this);
|
||||
ivDrawGiftRemoveAll.setOnClickListener(this);
|
||||
tvDrawGiftChange.setOnClickListener(this);
|
||||
showLoadingView();
|
||||
showLoadingAnimation();
|
||||
sendGiftButton.setOnClickListener(this);
|
||||
@@ -535,18 +526,6 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
|
||||
}
|
||||
|
||||
private void setGradient(TextView textView) {
|
||||
float endX = textView.getPaint().getTextSize() * textView.getText().length();
|
||||
LinearGradient linearGradient = new LinearGradient(
|
||||
0f, 0f, endX, 0f,
|
||||
Color.parseColor("#57CF99"),
|
||||
Color.parseColor("#33ECFF"),
|
||||
Shader.TileMode.CLAMP
|
||||
);
|
||||
textView.getPaint().setShader(linearGradient);
|
||||
textView.invalidate();
|
||||
}
|
||||
|
||||
private void showLoadingAnimation() {
|
||||
Animation rotateAnimation = new RotateAnimation(0, 360,
|
||||
Animation.RELATIVE_TO_SELF, 0.5f,
|
||||
@@ -669,6 +648,13 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
updateWeekStarDesc();
|
||||
isShowDrawGiftModel = false;
|
||||
updateDrawGift();
|
||||
giftIndicator.post(() -> {
|
||||
if (position < GiftIndicator.TYPE_WEEK) {
|
||||
hsvTabs.fullScroll(View.FOCUS_LEFT);
|
||||
} else {
|
||||
hsvTabs.fullScroll(View.FOCUS_RIGHT);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void updateLuckyBagIntro() {
|
||||
@@ -803,7 +789,8 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
tvDrawGiftTips.setText(spannableBuilder.build());
|
||||
sendGiftButton.setEnabled(true);
|
||||
} else {
|
||||
sendGiftButton.setEnabled(false);
|
||||
boolean isDrawGiftTab = giftIndicator.getCurrrentType() == GiftIndicator.TYPE_DRAW_GIFT;
|
||||
sendGiftButton.setEnabled(!isDrawGiftTab);
|
||||
tvDrawGiftTips.setText("至少画10个才能送出");
|
||||
}
|
||||
}
|
||||
@@ -818,7 +805,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
totalValue = totalValue / 10000.0f;
|
||||
diamond = FormatUtils.formatBigDecimal(totalValue) + "W+";
|
||||
} else {
|
||||
diamond = String.valueOf(totalValue);
|
||||
diamond = String.valueOf((int) totalValue);
|
||||
}
|
||||
SpannableBuilder text = new SpannableBuilder()
|
||||
.append("总价值: ", new ForegroundColorSpan(Color.parseColor("#7A797A")))
|
||||
@@ -1254,13 +1241,15 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
DialogWebViewActivity.start(context, UriProvider.getWeekStarUrl(), true);
|
||||
break;
|
||||
case R.id.iv_draw_gift_close:
|
||||
case R.id.tv_draw_gift_change:
|
||||
clearDrawGift();
|
||||
isShowDrawGiftModel = false;
|
||||
updateDrawGift();
|
||||
break;
|
||||
case R.id.iv_draw_gift_remove_last:
|
||||
if (drawGiftHelper != null) drawGiftHelper.removeLastStroke();
|
||||
if (drawGiftHelper != null) {
|
||||
drawGiftHelper.removeLastStroke();
|
||||
updateDrawGiftTips();
|
||||
}
|
||||
break;
|
||||
case R.id.iv_draw_gift_remove_all:
|
||||
clearDrawGift();
|
||||
@@ -1365,8 +1354,8 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
|
||||
private void clearDrawGift() {
|
||||
if (drawGiftHelper != null) {
|
||||
tvDrawGiftTips.setText("至少画10个才能送出");
|
||||
drawGiftHelper.clearDrawGift();
|
||||
updateDrawGiftTips();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -30,25 +30,22 @@ public class GiftIndicator extends LinearLayout {
|
||||
|
||||
/**普通礼物*/
|
||||
public static final int TYPE_NORMAL = 0;
|
||||
/**魔法礼物*/
|
||||
public static final int TYPE_MAGIC = 1;
|
||||
/**贵族礼物*/
|
||||
public static final int TYPE_NOBLE = 2;
|
||||
/**背包礼物*/
|
||||
public static final int TYPE_KNAP = 3;
|
||||
/**
|
||||
* 萝卜礼物
|
||||
*/
|
||||
public static final int TYPE_RADISH = 4;
|
||||
|
||||
/**星球礼物*/
|
||||
public static final int TYPE_LUCKY = 5;
|
||||
public static final int TYPE_LUCKY = 1;
|
||||
|
||||
/**贵族礼物*/
|
||||
public static final int TYPE_NOBLE = 2;
|
||||
|
||||
|
||||
/**周星礼物*/
|
||||
public static final int TYPE_WEEK = 6;
|
||||
public static final int TYPE_WEEK = 3;
|
||||
|
||||
/**涂鸦礼物*/
|
||||
public static final int TYPE_DRAW_GIFT = 7;
|
||||
public static final int TYPE_DRAW_GIFT = 4;
|
||||
|
||||
/**背包礼物*/
|
||||
public static final int TYPE_KNAP = 5;
|
||||
|
||||
private Map<String, String> map = new HashMap<>();
|
||||
|
||||
|
@@ -14,7 +14,9 @@
|
||||
android:layout_height="55dp"
|
||||
android:background="@drawable/bg_draw_gift_operation"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_draw_gift_tips"
|
||||
@@ -30,15 +32,6 @@
|
||||
android:layout_height="1px"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_draw_gift_change"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="切换涂鸦"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_draw_gift_remove_last"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -64,9 +57,9 @@
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_avatars"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/desc_layout"
|
||||
@@ -120,34 +113,44 @@
|
||||
android:orientation="horizontal"
|
||||
tools:background="@color/blue">
|
||||
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/hsv_tabs"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:clipToPadding="false"
|
||||
android:paddingStart="9dp"
|
||||
android:requiresFadingEdge="horizontal">
|
||||
|
||||
<com.yizhuan.erban.ui.widget.magicindicator.GiftIndicator
|
||||
android:id="@+id/gift_indicator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="9dp" />
|
||||
android:layout_gravity="center_vertical" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
</HorizontalScrollView>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="15dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_open_noble"
|
||||
android:layout_width="84dp"
|
||||
android:layout_height="26dp"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/ic_vip_gift_dialog"
|
||||
android:visibility="visible" />
|
||||
android:visibility="gone"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_lucky_bag_intro"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:drawableStart="@drawable/ic_luckybag_intro"
|
||||
android:drawablePadding="@dimen/dp_5"
|
||||
android:gravity="center_vertical"
|
||||
@@ -161,13 +164,12 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:gravity="center_vertical"
|
||||
android:text="总价值0钻石"
|
||||
android:textColor="#7A7A7A"
|
||||
android:textSize="@dimen/dp_13"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
tools:visibility="gone" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_week_in"
|
||||
@@ -175,7 +177,9 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
tools:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -186,11 +190,12 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:src="@drawable/ic_week_star_arrow" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
|
@@ -182,8 +182,8 @@
|
||||
android:gravity="center"
|
||||
android:maxLength="4"
|
||||
android:text="1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="13sp"
|
||||
android:textColor="#64472E"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_sub"
|
||||
app:layout_constraintEnd_toStartOf="@id/iv_add"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_sub"
|
||||
|
Reference in New Issue
Block a user