增加航海代码(未修改UI版)

This commit is contained in:
huangjian
2022-08-11 18:27:13 +08:00
parent 509d99c0b9
commit 8163a7790b
72 changed files with 1707 additions and 1596 deletions

Binary file not shown.

View File

@@ -873,7 +873,10 @@ public class MessageView extends FrameLayout {
}
} else if (first == CustomAttachment.CUSTOM_MSG_BOX) {
setBoxMeMsg(chatRoomMessage, tvContent);
} else if (first == CustomAttachment.CUSTOM_MSG_KTV) {
}
else if (first == CustomAttachment.CUSTOM_MSG_RADISH) {
setRadishMeMsg(chatRoomMessage, tvContent);
}else if (first == CustomAttachment.CUSTOM_MSG_KTV) {
setKtvMsg(chatRoomMessage, tvContent);
} else if (first == CustomAttachment.CUSTOM_MSG_QUEUING_MIC) {
switch (second) {
@@ -1700,6 +1703,20 @@ public class MessageView extends FrameLayout {
tvContent.setText(text.build());
}
private void setRadishMeMsg(ChatRoomMessage chatRoomMessage, TextView tvContent) {
RoomBoxPrizeAttachment attachment = (RoomBoxPrizeAttachment) chatRoomMessage.getAttachment();
// 内容
SpannableBuilder text = new SpannableBuilder(tvContent)
.append("厉害了 ", new ForegroundColorSpan(greyColor))
.append(attachment.getNick() + " ", new ForegroundColorSpan(roomTipColor))
.append(attachment.getBoxTypeStr() + " 获得", new ForegroundColorSpan(greyColor))
.append(attachment.getPrizeName(), new ForegroundColorSpan(Color.WHITE));
if (attachment.getPrizeNum() > 1) {
text.append(" x" + attachment.getPrizeNum() + " ", new ForegroundColorSpan(roomTipColor));
}
tvContent.setText(text.build());
}
private void setUpdateAudioMsg(TextView tvContent) {
SpannableBuilder text = new SpannableBuilder(tvContent)
.append("消息: ", new ForegroundColorSpan(roomTipColor))

View File

@@ -109,6 +109,13 @@ class RoomEffectView @JvmOverloads constructor(
private var disposableGiftCompound: Disposable? = null
private val messagesGiftCompound: MutableList<ChatRoomMessage> by lazy { ArrayList() }
private var animationRadish: Animation? = null
private val messagesRadish: MutableList<ChatRoomMessage> by lazy { java.util.ArrayList() }
private var radishDisposable: Disposable? = null
private val messagesRadishSVGA: MutableList<ChatRoomMessage> by lazy { java.util.ArrayList() }
private var radishSVGADisposable: Disposable? = null
private var isSvgaPlaying = false
private var isHideCarEffect = false
@@ -139,6 +146,8 @@ class RoomEffectView @JvmOverloads constructor(
RoomEvent.BOX_NOTIFY -> addBoxNotify(roomEvent.chatRoomMessage)
RoomEvent.DATING_ALL_NOTIFY -> addDatingAllNotify(roomEvent.chatRoomMessage)
RoomEvent.BOX_NOTIFY_SVGA -> addBoxNotifyBySVGA(roomEvent.chatRoomMessage)
RoomEvent.RADISH_NOTIFY -> addRadishNotify(roomEvent.chatRoomMessage)
RoomEvent.RADISH_NOTIFY_SVGA -> addRadishNotifyBySVGA(roomEvent.chatRoomMessage)
RoomEvent.ROOM_GIFT_COMPOUND -> addGiftCompoundNotify(roomEvent.chatRoomMessage)
RoomEvent.RECEIVE_ROOM_LUCKY_BAG_NOTICE, RoomEvent.RECEIVE_SERVICE_LUCKY_BAG_NOTICE -> //全服福袋
//厅内福袋
@@ -482,6 +491,136 @@ class RoomEffectView @JvmOverloads constructor(
}, null)
}
/**
* 幸运池飘屏
*
* @param chatRoomMessage
*/
private fun addRadishNotify(chatRoomMessage: ChatRoomMessage) {
if (binding.clNotify.visibility == GONE) {
binding.clNotify.visibility = VISIBLE
}
messagesRadish.add(chatRoomMessage)
if (radishDisposable == null || messagesRadish.size == 1) {
radishDisposable = Observable.interval(0, PERIOD.toLong(), TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
.takeWhile { messagesRadish.size > 0 }
.subscribe {
showRadishNotify(messagesRadish.removeAt(0))
}
}
}
private fun showRadishNotify(chatRoomMessage: ChatRoomMessage?) {
val attachment = chatRoomMessage?.attachment as? RoomBoxPrizeAttachment ?: return
val textView =
LayoutInflater.from(mContext)
.inflate(R.layout.layout_room_radish_notify, null) as TextView
textView.setBackgroundResource(R.drawable.bg_radish_notice)
val text = SpannableBuilder()
.append("厉害了! ", ForegroundColorSpan(Color.WHITE))
.append(
attachment.nick + " ",
ForegroundColorSpan(resources.getColor(R.color.notice_nick))
)
.append(attachment.boxTypeStr + " 获得", ForegroundColorSpan(Color.WHITE))
.append(
attachment.prizeName,
ForegroundColorSpan(resources.getColor(R.color.notice_gift))
)
if (attachment.prizeNum > 1) {
text.append("x" + attachment.prizeNum, ForegroundColorSpan(Color.WHITE))
}
textView.text = text.build()
animationRadish = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify)
binding.flRadishNotify.addView(textView)
textView.startAnimation(animationRadish)
binding.flRadishNotify.postDelayed(
{ binding.flRadishNotify.removeView(textView) },
SHOW_TIME.toLong()
)
}
/**
* 幸运池飘屏 五级 SVGA背景的
*
* @param chatRoomMessage
*/
private fun addRadishNotifyBySVGA(chatRoomMessage: ChatRoomMessage) {
if (binding.clNotify.visibility == GONE) {
binding.clNotify.visibility = VISIBLE
}
messagesRadishSVGA.add(chatRoomMessage)
if (radishSVGADisposable == null || messagesRadishSVGA.size == 1) {
radishSVGADisposable = Observable.interval(0, PERIOD.toLong(), TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
.takeWhile { messagesRadishSVGA.size > 0 }
.subscribe {
showRadishNotifyBySVGA(messagesRadishSVGA.removeAt(0))
}
}
}
private fun showRadishNotifyBySVGA(chatRoomMessage: ChatRoomMessage?) {
val attachment = chatRoomMessage?.attachment as? RoomBoxPrizeAttachment ?: return
val text = SpannableBuilder()
.append("厉害了! ", ForegroundColorSpan(Color.WHITE))
.append(
attachment.nick + " ",
ForegroundColorSpan(resources.getColor(R.color.notice_nick))
)
.append(attachment.boxTypeStr + " 获得", ForegroundColorSpan(Color.WHITE))
.append(
attachment.prizeName,
ForegroundColorSpan(resources.getColor(R.color.notice_gift))
)
if (attachment.prizeNum > 1) {
text.append("x" + attachment.prizeNum, ForegroundColorSpan(Color.WHITE))
}
val svgaImageView = SVGAImageView(mContext)
svgaImageView.loops = 1
svgaImageView.clearsAfterStop = true
val params = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)
svgaImageView.layoutParams = params
svgaImageView.callback = object : SimpleSvgaCallback() {
override fun onFinished() {
binding.flSvgaRadishNotify.post {
binding.flSvgaRadishNotify.removeView(svgaImageView)
}
}
}
binding.flSvgaRadishNotify.addView(svgaImageView)
shareParser().decodeFromAssets(
"svga/radish_notify.svga",
object : SVGAParser.ParseCompletion {
override fun onComplete(videoItem: SVGAVideoEntity) {
val dynamicEntity = SVGADynamicEntity()
val textPaint = TextPaint()
textPaint.color = Color.WHITE //字体颜色
textPaint.textSize = 24f //字体大小
dynamicEntity.setDynamicText(
StaticLayout(
text.build(),
0,
text.build().length,
textPaint,
0,
Layout.Alignment.ALIGN_CENTER,
1.0f,
0.0f,
false
), "blb_copywriting"
)
val drawable = SVGADrawable(videoItem, dynamicEntity)
svgaImageView.setImageDrawable(drawable)
svgaImageView.stepToFrame(0, true)
}
override fun onError() {}
})
}
/**
* 礼物合成,带SVGA背景的消息
*
@@ -508,7 +647,7 @@ class RoomEffectView @JvmOverloads constructor(
val msgBean = (chatRoomMessage.attachment as GiftCompoundAttachment).msgBean
val text = SpannableBuilder()
.append(
msgBean.nick + " ",
msgBean.nick.subAndReplaceDot(7) + " ",
ForegroundColorSpan(resources.getColor(R.color.notice_nick))
)
.append(msgBean.msg + " ", ForegroundColorSpan(Color.WHITE))

View File

@@ -2,6 +2,7 @@ package com.yizhuan.erban.ui.webview;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.Gravity;
@@ -36,7 +37,11 @@ public class DialogWebViewActivity extends CommonWebViewActivity {
getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, ScreenUtil.screenHeight / 3 * 2);
getWindow().setGravity(Gravity.BOTTOM);
showTitleBar = getIntent().getBooleanExtra("showTitleBar", true);
if (!showTitleBar) layoutTitleBar.setVisibility(View.GONE);
if (!showTitleBar) {
layoutTitleBar.setVisibility(View.GONE);
webView.setBackgroundColor(Color.TRANSPARENT);
webView.getBackground().setAlpha(0);
}
}
@Override

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View File

@@ -1,93 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="click"
type="android.view.View.OnClickListener" />
</data>
<androidx.cardview.widget.CardView
android:layout_width="250dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:cardCornerRadius="@dimen/dp_3">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:background="@color/color_f5f5f5"
android:background="@color/white">
<TextView
android:id="@+id/tv_hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="36dp"
android:text="提示"
android:textColor="@color/color_333333"
android:textSize="18sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="41dp"
android:layout_marginRight="41dp"
android:layout_marginTop="@dimen/dp_25"
android:text="haha"
android:textColor="@color/color_666666"
android:textSize="15sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_hint" />
<com.coorchice.library.SuperTextView
android:id="@+id/stv_close"
android:layout_width="75dp"
android:layout_height="30dp"
android:layout_marginRight="@dimen/dp_15"
android:layout_marginTop="19dp"
android:clickable="true"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:onClick="@{click}"
android:text="关闭"
android:textColor="@color/color_333333"
android:textSize="15sp"
app:corner="@dimen/dp_15"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/stv_buy"
app:layout_constraintTop_toBottomOf="@id/tv_content"
app:stroke_color="@color/color_CCCCCC"
app:stroke_width="1px" />
<com.coorchice.library.SuperTextView
android:id="@+id/stv_buy"
android:layout_width="75dp"
android:layout_height="30dp"
android:layout_marginBottom="30dp"
android:layout_marginTop="19dp"
android:clickable="true"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:onClick="@{click}"
android:text="购买"
android:textColor="@color/white"
android:textSize="15sp"
app:corner="@dimen/dp_15"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/stv_close"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_content"
app:solid="@color/appColor" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</layout>

View File

@@ -52,6 +52,13 @@
app:layout_constraintDimensionRatio="75:11"
app:layout_constraintTop_toTopOf="parent" />
<FrameLayout
android:id="@+id/fl_radish_notify"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintDimensionRatio="75:11"
app:layout_constraintTop_toTopOf="parent" />
<FrameLayout
android:id="@+id/fl_box_notify"
android:layout_width="match_parent"
@@ -59,6 +66,13 @@
app:layout_constraintDimensionRatio="75:11"
app:layout_constraintTop_toTopOf="parent" />
<FrameLayout
android:id="@+id/fl_svga_radish_notify"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintDimensionRatio="75:11"
app:layout_constraintTop_toTopOf="parent" />
<FrameLayout
android:id="@+id/fl_gift_compound_notify"
android:layout_width="match_parent"

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<com.coorchice.library.SuperTextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:background="@drawable/bg_radish_notice"
android:ellipsize="end"
android:gravity="center"
android:paddingStart="80dp"
android:paddingEnd="80dp"
android:lines="2"
android:textSize="12sp"
tools:layout_height="wrap_content"
tools:text="hahhahahaahahhahahaahahhahahaahahhahahaahahahaahah" />

View File

@@ -0,0 +1,16 @@
package com.yizhuan.erban.shipantics;
import com.yizhuan.xchat_android_core.room.treasure_box.bean.BoxRankingInfo;
import com.yizhuan.xchat_android_library.base.IMvpBaseView;
public interface IRadishRankingView extends IMvpBaseView {
void getBoxRankingSuccess(BoxRankingInfo list);
void getBoxRankingFails(String error);
void getBoxRankingLoadMoreSuccess(BoxRankingInfo list);
void getBoxRankingLoadMoreFails(String error);
}

View File

@@ -0,0 +1,355 @@
package com.yizhuan.erban.shipantics;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.netease.nim.uikit.StatusBarUtil;
import com.netease.nim.uikit.common.util.sys.ScreenUtil;
import com.yizhuan.erban.R;
import com.yizhuan.erban.base.BaseBindingActivity;
import com.yizhuan.erban.common.svga.SimpleSvgaCallback;
import com.yizhuan.erban.databinding.ActivityPullRadishBinding;
import com.yizhuan.erban.ui.pay.ChargeActivity;
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
import com.yizhuan.erban.ui.webview.DialogWebViewActivity;
import com.yizhuan.treasure_box.bean.PrizeInfo;
import com.yizhuan.treasure_box.model.IBoxModel;
import com.yizhuan.treasure_box.model.RadishModel;
import com.yizhuan.xchat_android_core.UriProvider;
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
import com.yizhuan.xchat_android_core.manager.RoomEvent;
import com.yizhuan.xchat_android_core.pay.PayModel;
import com.yizhuan.xchat_android_core.pay.bean.WalletInfo;
import com.yizhuan.xchat_android_core.utils.StringUtils;
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes;
import com.yizhuan.xchat_android_library.utils.FormatUtils;
import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
import com.yizhuan.xchat_android_library.utils.TextWatcherWrapper;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
@ActLayoutRes(R.layout.activity_pull_radish)
public class PullRadishActivity extends BaseBindingActivity<ActivityPullRadishBinding> implements View.OnClickListener {
private volatile int keyNum = -1;
private ArrayList<PrizeInfo> cacheList = new ArrayList<>();
private ArrayList<PrizeInfo> hintPrizeCacheList = new ArrayList<>();
private ObjectAnimator translationXAnimator;
private ObjectAnimator translationYAnimator;
private AnimatorSet animatorSet;
private int boxType = IBoxModel.BOX_TYPE_NORMAL;
private int height;
public static void start(Context context) {
Intent starter = new Intent(context, PullRadishActivity.class);
context.startActivity(starter);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//这里的height用MATCH_PARENT状态栏会被顶上去,不知道什么鬼
height = ScreenUtil.screenHeight - ScreenUtil.getStatusBarHeight(context);
getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, height);
getWindow().setGravity(Gravity.BOTTOM);
subscribeEvent();
}
@Override
protected void init() {
mBinding.setClick(this);
ObjectAnimator openXAnimator = ObjectAnimator.ofFloat(mBinding.ivOpen, "scaleX", 1, 0.9f, 1)
.setDuration(200);
ObjectAnimator openYAnimator = ObjectAnimator.ofFloat(mBinding.ivOpen, "scaleY", 1, 0.9f, 1)
.setDuration(200);
animatorSet = new AnimatorSet()
.setDuration(200);
animatorSet.play(openYAnimator).with(openXAnimator);
translationXAnimator = ObjectAnimator.ofFloat(mBinding.ivGiftAnim, "translationX", 0,
ScreenUtil.screenWidth / 2f - ScreenUtil.dip2px(15 + 19)).setDuration(100);
translationXAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
translationXAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mBinding.ivGiftAnim.setVisibility(View.GONE);
}
});
mBinding.ivBox.post(() -> {
translationYAnimator = ObjectAnimator.ofFloat(mBinding.ivGiftAnim, "translationY", 0,
height - (mBinding.ivBox.getBottom() + mBinding.ivBox.getTop()) / 2f - ScreenUtil.dip2px(10 + 19)).setDuration(100);
translationYAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
});
WalletInfo walletInfo = PayModel.get().getCurrentWalletInfo();
if (walletInfo != null) {
mBinding.tvDiamondNum.setText(FormatUtils.formatBigInteger(walletInfo.getDiamondNum()));
}
mBinding.editNum.addTextChangedListener(new TextWatcherWrapper() {
@Override
public void afterTextChanged(Editable editable) {
int num = StringUtils.toInt(mBinding.editNum.getText().toString(), 0);
if (num > 200) {
mBinding.editNum.setText("200");
mBinding.editNum.setSelection(3);
SingleToastUtil.showToast("一次性最多只能拔200次");
}
}
});
mBinding.ivBox.setCallback(new SimpleSvgaCallback() {
@Override
public void onFinished() {
mBinding.ivBox.stepToFrame(0, false);
}
});
looperPrize();
looperHintPrize();
}
@Override
protected void onResume() {
super.onResume();
loadKeyInfo();
}
@SuppressLint("CheckResult")
private void loadKeyInfo() {
RadishModel.get()
.getKeyInfo(boxType)
.compose(bindToLifecycle())
.subscribe(keyInfo -> {
changeKeyNum(keyInfo.getKeyNum());
});
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.root_view:
finish();
break;
case R.id.iv_more:
new RadishMoreDialog(context).openDialog();
break;
case R.id.tv_rank:
RadishRankingActivity.start(this);
break;
case R.id.iv_get_diamond:
ChargeActivity.start(this);
break;
case R.id.iv_get_key:
DialogWebViewActivity.start(context, UriProvider.getRadishKey());
break;
case R.id.iv_open:
openBox(StringUtils.toInt(mBinding.editNum.getText().toString(), 0));
break;
case R.id.iv_sub:
mBinding.editNum.setText(String.valueOf(Math.max(StringUtils.toInt(mBinding.editNum.getText().toString(), 0) - 1, 1)));
mBinding.editNum.setSelection(mBinding.editNum.length());
break;
case R.id.iv_add:
mBinding.editNum.setText(String.valueOf(Math.min((StringUtils.toInt(mBinding.editNum.getText().toString(), 0) + 1), 9999)));
mBinding.editNum.setSelection(mBinding.editNum.length());
break;
case R.id.view_bg:
//do nothing
break;
default:
break;
}
}
/**
* 检查钥匙(锤子)数量
*
* @param count 想要使用的数量
* @return true 表示数量不足,无法进行下一步操作
* false 表示数量没问题,可以继续操作
*/
private boolean checkKeyNum(int count) {
if (count == 0) {
SingleToastUtil.showToast("拔萝卜次数不能为0!");
return true;
}
if (keyNum == -1) {
SingleToastUtil.showToast("数据加载中,请稍后...");
return true;
}
if (keyNum < count) {
getDialogManager().showOkCancelDialog("参与活动获得萝卜铲", "去参与",
() -> DialogWebViewActivity.start(context, UriProvider.getRadishKey()));
return true;
}
return false;
}
@SuppressLint("CheckResult")
private void openBox(int count) {
if (checkKeyNum(count)) {
return;
}
mBinding.ivOpen.setEnabled(false);
mBinding.ivFirstBox.setVisibility(View.GONE);
mBinding.ivBox.startAnimation();
mBinding.ivOpen.setPivotY(mBinding.ivOpen.getHeight());
animatorSet.start();
long startTime = System.currentTimeMillis();
RadishModel.get().openBox(boxType, count, true)
.compose(bindToLifecycle())
.doOnError(throwable -> {
mBinding.ivOpen.setEnabled(true);
SingleToastUtil.showToast(throwable.getMessage());
})
.toObservable()
.delay(startTime - System.currentTimeMillis() + 500, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
.flatMap(openBoxResult -> {
mBinding.ivOpen.setEnabled(true);
changeKeyNum(openBoxResult.getRemainKeyNum());
cacheList.addAll(openBoxResult.getPrizeItemList());
return Observable.fromIterable(openBoxResult.getPrizeItemList());
})
.filter(prizeInfo -> prizeInfo.getPrizeLevel() > 2)
.subscribe(prizeInfo -> hintPrizeCacheList.add(prizeInfo));
}
@SuppressLint("CheckResult")
private void looperPrize() {
Observable.interval(0, 100, TimeUnit.MILLISECONDS)
.compose(bindToLifecycle())
.observeOn(AndroidSchedulers.mainThread())
.filter(aLong -> cacheList.size() > 0)
.subscribe(aLong -> {
PrizeInfo prizeInfo = cacheList.get(0);
String url = prizeInfo.getPrizeImgUrl();
if (cacheList.size() > 0) cacheList.remove(0);
if (!TextUtils.isEmpty(url)) {
if (translationXAnimator != null) translationXAnimator.start();
if (translationYAnimator != null) translationYAnimator.start();
mBinding.ivGiftAnim.setVisibility(View.VISIBLE);
mBinding.svgaGiftBg.startAnimation();
ImageLoadUtils.loadImage(context, url, mBinding.ivGiftAnim);
}
}
, e -> looperPrize());//出错了继续looper......
}
private final Runnable removeRunnable = () -> mBinding.llPrizeHint.removeAllViews();
@SuppressLint("CheckResult")
private void looperHintPrize() {
Observable.interval(0, 250, TimeUnit.MILLISECONDS)
.compose(bindToLifecycle())
.observeOn(AndroidSchedulers.mainThread())
.filter(aLong -> hintPrizeCacheList.size() > 0)
.subscribe(aLong -> addPrizeHintView(hintPrizeCacheList.remove(0))
, e -> looperHintPrize());//出错了继续looper......
}
private void addPrizeHintView(PrizeInfo prizeInfo) {
mBinding.llPrizeHint.removeCallbacks(removeRunnable);
mBinding.llPrizeHint.postDelayed(removeRunnable, 3000);
LinearLayout linearLayout = (LinearLayout) LayoutInflater.from(this).inflate(R.layout.item_box_prize_hint, null);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ScreenUtil.dip2px(21));
layoutParams.setMargins(0, 0, 0, ScreenUtil.dip2px(5));
linearLayout.setLayoutParams(layoutParams);
switch (prizeInfo.getPrizeLevel()) {
case 3:
default:
linearLayout.setBackgroundResource(R.drawable.bg_box_prize_hint_v3);
break;
case 4:
linearLayout.setBackgroundResource(R.drawable.bg_box_prize_hint_v4);
break;
case 5:
linearLayout.setBackgroundResource(R.drawable.bg_box_prize_hint_v5);
break;
}
mBinding.llPrizeHint.addView(linearLayout);
if (mBinding.llPrizeHint.getChildCount() > 6) {
mBinding.llPrizeHint.removeViewAt(0);
}
for (int i = 0; i < mBinding.llPrizeHint.getChildCount(); i++) {
ObjectAnimator.ofFloat(mBinding.llPrizeHint.getChildAt(i), "translationY", ScreenUtil.dip2px(21), 0)
.setDuration(200)
.start();
}
((TextView) linearLayout.findViewById(R.id.tv_prize_name)).setText(prizeInfo.getPrizeName());
((TextView) linearLayout.findViewById(R.id.tv_prize_num)).setText("x" + prizeInfo.getPrizeNum());
}
/**
* 更新钥匙(锤子)数量
*
* @param num
*/
private void changeKeyNum(int num) {
keyNum = num;
mBinding.tvKeyNum.setText(keyNum + "");
}
/**
* 更新钱包
*
* @param g
*/
private void setGold(double g) {
mBinding.tvDiamondNum.setText(FormatUtils.formatBigInteger(g));
PayModel.get().getCurrentWalletInfo().setDiamondNum(g);
}
@SuppressLint("CheckResult")
private void subscribeEvent() {
//更新钻石数量和被踢出房间退出
IMNetEaseManager.get().getChatRoomEventObservable()
.compose(bindToLifecycle())
.subscribe(roomEvent -> {
switch (roomEvent.getEvent()) {
case RoomEvent.WALLET_UPDATE:
setGold(roomEvent.getWalletInfo().getDiamondNum());
break;
case RoomEvent.KICK_OUT_ROOM:
finish();
break;
}
});
}
@Override
protected boolean needSteepStateBar() {
return true;
}
@Override
protected void setStatusBar() {
super.setStatusBar();
StatusBarUtil.transparencyBar(this);
StatusBarUtil.StatusBarLightMode(this);
}
}

View File

@@ -0,0 +1,51 @@
package com.yizhuan.erban.shipantics;
import android.content.Context;
import android.view.Gravity;
import android.view.Window;
import android.view.WindowManager;
import com.yizhuan.erban.R;
import com.yizhuan.erban.databinding.DialogRadishMoreBinding;
import com.yizhuan.erban.treasure_box.widget.dialog.BaseBindingDialog;
import com.yizhuan.erban.ui.webview.DialogWebViewActivity;
import com.yizhuan.xchat_android_core.UriProvider;
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes;
@ActLayoutRes(R.layout.dialog_radish_more)
public class RadishMoreDialog extends BaseBindingDialog<DialogRadishMoreBinding> {
public RadishMoreDialog(Context context) {
super(context);
width = WindowManager.LayoutParams.MATCH_PARENT;
height = WindowManager.LayoutParams.WRAP_CONTENT;
}
@Override
protected void onStart() {
super.onStart();
Window window = getWindow();
if (window != null) {
WindowManager.LayoutParams windowParams = window.getAttributes();
windowParams.gravity = Gravity.BOTTOM;
window.setAttributes(windowParams);
}
}
@Override
protected void init() {
binding.tvHistory.setOnClickListener(v -> {
DialogWebViewActivity.start(context, UriProvider.getRadishHistory(),false);
closeDialog();
});
binding.tvBoxRule.setOnClickListener(v -> {
DialogWebViewActivity.start(context, UriProvider.getRadishHelp(),false);
closeDialog();
});
binding.tvGetKey.setOnClickListener(v -> {
DialogWebViewActivity.start(context,UriProvider.getRadishKey());
closeDialog();
});
}
}

View File

@@ -0,0 +1,113 @@
package com.yizhuan.erban.shipantics;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;
import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;
import com.flyco.tablayout.SlidingTabLayout;
import com.yizhuan.erban.R;
import com.yizhuan.erban.base.BaseActivity;
import com.yizhuan.erban.common.ViewPagerAdapter;
import com.yizhuan.erban.decoration.view.widgets.CarMagicIndicator;
import com.yizhuan.tutu.room_chat.event.ClickRootViewEvent;
import com.yizhuan.xchat_android_core.home.bean.TabInfo;
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
import com.yizhuan.xchat_android_core.manager.RoomEvent;
import com.yizhuan.xchat_android_core.room.treasure_box.event.RefreshBoxRankingEvent;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class RadishRankingActivity extends BaseActivity implements CarMagicIndicator.OnItemSelectListener {
@BindView(R.id.view_indicator)
SlidingTabLayout viewIndicator;
@BindView(R.id.viewpager)
ViewPager viewpager;
@BindView(R.id.iv_refresh)
ImageView ivRefresh;
private String[] titles = {"今日榜单", "昨日榜单"};
public static final int TYPE_TODAY = 1;//今日
public static final int TYPE_YESTERDAY = 2;//今日
public static void start(Context context) {
Intent starter = new Intent(context, RadishRankingActivity.class);
//starter.putExtra();
context.startActivity(starter);
}
@SuppressLint("CheckResult")
public void init() {
List<TabInfo> tabInfoList = new ArrayList<>(2);
for (int i = 0; i < titles.length; i++) {
tabInfoList.add(new TabInfo(i, titles[i]));
}
viewpager.setOffscreenPageLimit(2);
viewpager.setAdapter(new ViewPagerAdapter(getSupportFragmentManager(), getFragment(), titles));
viewIndicator.setViewPager(viewpager, titles, this, getFragment());
IMNetEaseManager.get().getChatRoomEventObservable()
.compose(bindToLifecycle())
.filter(roomEvent -> roomEvent.getEvent() == RoomEvent.KICK_OUT_ROOM)
.subscribe(roomEvent -> finish());
ivRefresh.setOnClickListener(v -> EventBus.getDefault().post(new RefreshBoxRankingEvent()));
}
@Override
protected boolean needSteepStateBar() {
return false;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_radish_ranking);
ButterKnife.bind(this);
EventBus.getDefault().register(this);
init();
}
@Override
protected void onDestroy() {
super.onDestroy();
EventBus.getDefault().unregister(this);
}
private ArrayList<Fragment> getFragment() {
ArrayList<Fragment> list = new ArrayList<>();
list.add(RadishRankingFragment.newInstance(TYPE_TODAY));
list.add(RadishRankingFragment.newInstance(TYPE_YESTERDAY));
return list;
}
@Override
public void onItemSelect(int position) {
viewpager.setCurrentItem(position);
}
@OnClick(R.id.root_view)
public void onViewClicked() {
finish();
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onRootViewClicked(ClickRootViewEvent event) {
onViewClicked();
}
}

View File

@@ -0,0 +1,171 @@
package com.yizhuan.erban.shipantics;
import android.os.Bundle;
import android.view.View;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.yizhuan.erban.R;
import com.yizhuan.erban.base.BaseMvpFragment;
import com.yizhuan.erban.treasure_box.adapter.BoxRankingListAdapter;
import com.yizhuan.xchat_android_core.room.treasure_box.bean.BoxRankingInfo;
import com.yizhuan.xchat_android_core.room.treasure_box.event.RefreshBoxRankingEvent;
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
import com.yizhuan.xchat_android_library.utils.ListUtils;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
/**
* 房间内私聊用的好友列表界面
*
* @author MadisonRong RoomNewbieListFragment
*/
@CreatePresenter(RadishRankingPresenter.class)
public class RadishRankingFragment extends BaseMvpFragment<IRadishRankingView, RadishRankingPresenter> implements IRadishRankingView, BaseQuickAdapter.RequestLoadMoreListener {
private RecyclerView recyclerView;
private SwipeRefreshLayout swipeRefresh;
private BoxRankingListAdapter mAdapter;
private int datetype;
public static RadishRankingFragment newInstance(int datetype) {
Bundle args = new Bundle();
args.putInt("datetype",datetype);
RadishRankingFragment fragment = new RadishRankingFragment();
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EventBus.getDefault().register(this);
if (getArguments() != null) {
datetype = getArguments().getInt("datetype");
}
}
@Override
public int getRootLayoutId() {
return R.layout.fragment_newbie_list;
}
@Override
public void onFindViews() {
recyclerView = mView.findViewById(R.id.recycler_view);
swipeRefresh = mView.findViewById(R.id.swipe_refresh);
}
@Override
public void onSetListener() {
swipeRefresh.setOnRefreshListener(() -> {
mAdapter.setEnableLoadMore(true);
loadData(true,datetype);
});
}
@Override
public void initiate() {
initRecyclerView();
loadData(true,datetype);
}
/**
* 刷新数据
*/
private void loadData(boolean isRefresh,int datetype) {
getMvpPresenter().loadData(isRefresh,datetype);
}
@Override
public View.OnClickListener getLoadMoreListener() {
return super.getLoadMoreListener();
}
private void initRecyclerView() {
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
recyclerView.setItemAnimator(null);
mAdapter = new BoxRankingListAdapter(mContext);
mAdapter.setOnLoadMoreListener(this, recyclerView);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
recyclerView.setLayoutManager(linearLayoutManager);
recyclerView.setAdapter(mAdapter);
}
@Override
public void getBoxRankingSuccess(BoxRankingInfo rankingInfo) {
hideStatus();
if (mAdapter != null) {
int page = getMvpPresenter().getPage();
if (page <= 1) {
swipeRefresh.setRefreshing(false);
if (rankingInfo.getRankVos() == null || rankingInfo.getRankVos().size() == 0) {
showNoData(getString(R.string.empty_newbie_list));
} else {
mAdapter.setNewData(rankingInfo.getRankVos());
}
}
}
}
@Override
public void getBoxRankingFails(String error) {
hideStatus();
int page = getMvpPresenter().getPage();
if (page <= 1) {
showNoData(getString(R.string.empty_newbie_list));
}
}
@Override
public void getBoxRankingLoadMoreSuccess(BoxRankingInfo rankingInfo) {
if (ListUtils.isListEmpty(rankingInfo.getRankVos())){
mAdapter.loadMoreEnd();
return;
}
mAdapter.addData(rankingInfo.getRankVos());
mAdapter.loadMoreComplete();
}
@Override
public void getBoxRankingLoadMoreFails(String error) {
hideStatus();
int page = getMvpPresenter().getPage();
if (page <= 1) {
showNoData(getString(R.string.empty_newbie_list));
}
}
@Override
public void onReloadData() {
super.onReloadData();
loadData(true,datetype);
}
@Override
public void onLoadMoreRequested() {
loadData(false,datetype);
}
@Override
public void onDestroy() {
super.onDestroy();
EventBus.getDefault().unregister(this);
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onRefreshRanking(RefreshBoxRankingEvent event) {
loadData(true,datetype);
}
}

View File

@@ -0,0 +1,63 @@
package com.yizhuan.erban.shipantics;
import com.yizhuan.erban.base.BaseMvpPresenter;
import com.yizhuan.treasure_box.model.RadishModel;
import com.yizhuan.xchat_android_core.Constants;
import com.yizhuan.xchat_android_core.room.treasure_box.bean.BoxRankingInfo;
import io.reactivex.SingleObserver;
import io.reactivex.disposables.Disposable;
public class RadishRankingPresenter extends BaseMvpPresenter<IRadishRankingView> {
private int page = 0;
public void loadData(boolean isRefresh, int datetype) {
if (isRefresh) {
page = 1;
} else {
page++;
}
RadishModel.get().getBoxRankingList(datetype, page, Constants.PAGE_SIZE)
.compose(bindToLifecycle()).subscribe(new SingleObserver<BoxRankingInfo>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onSuccess(BoxRankingInfo roomNewbieInfos) {
if (roomNewbieInfos != null) {
if (mMvpView != null) {
if (isRefresh) {
mMvpView.getBoxRankingSuccess(roomNewbieInfos);
} else {
mMvpView.getBoxRankingLoadMoreSuccess(roomNewbieInfos);
}
}
} else {
if (mMvpView != null) {
if (isRefresh) {
mMvpView.getBoxRankingFails("暂无数据");
} else {
mMvpView.getBoxRankingLoadMoreFails("已经到底啦");
}
}
}
}
@Override
public void onError(Throwable e) {
if (mMvpView != null) {
mMvpView.getBoxRankingFails(e.getMessage());
}
}
});
}
public int getPage() {
return page;
}
}

View File

@@ -24,7 +24,6 @@ import com.yizhuan.erban.R;
import com.yizhuan.erban.base.BaseBindingActivity;
import com.yizhuan.erban.databinding.ActivityTreasureBoxHonourBinding;
import com.yizhuan.erban.treasure_box.widget.dialog.BoxMoreDialog;
import com.yizhuan.erban.treasure_box.widget.dialog.BuyKeyDialog;
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
import com.yizhuan.erban.ui.webview.DialogWebViewActivity;
import com.yizhuan.treasure_box.bean.PrizeInfo;
@@ -32,7 +31,6 @@ import com.yizhuan.treasure_box.model.BoxModel;
import com.yizhuan.treasure_box.model.IBoxModel;
import com.yizhuan.xchat_android_core.DemoCache;
import com.yizhuan.xchat_android_core.UriProvider;
import com.yizhuan.xchat_android_core.auth.AuthModel;
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
import com.yizhuan.xchat_android_core.manager.RoomEvent;
import com.yizhuan.xchat_android_core.pay.PayModel;

View File

@@ -1,180 +0,0 @@
package com.yizhuan.erban.treasure_box.widget.dialog;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.EditText;
import com.yizhuan.erban.R;
import com.yizhuan.erban.databinding.DialogBuyKeyBinding;
import com.yizhuan.treasure_box.event.HonourBoxBuyKeyEvent;
import com.yizhuan.treasure_box.model.BoxModel;
import com.yizhuan.treasure_box.model.IBoxModel;
import com.yizhuan.xchat_android_core.auth.AuthModel;
import com.yizhuan.treasure_box.event.BoxBuyKeyEvent;
import com.yizhuan.xchat_android_core.utils.StringUtils;
import com.yizhuan.xchat_android_core.utils.net.BalanceNotEnoughExeption;
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes;
import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
import com.yizhuan.xchat_android_library.utils.config.BasicConfig;
import org.greenrobot.eventbus.EventBus;
import io.reactivex.disposables.Disposable;
@ActLayoutRes(R.layout.dialog_buy_key)
public class BuyKeyDialog extends BaseBindingDialog<DialogBuyKeyBinding> implements View.OnClickListener, TextWatcher {
private EditText edtNum;
private int price;
private int maxCount;
private volatile Disposable disposable;
private int boxType;
public BuyKeyDialog(Context context, int price) {
this(context, price, IBoxModel.BOX_TYPE_NORMAL);
}
public BuyKeyDialog(Context context, int price, int boxType) {
super(context);
this.price = price;
this.boxType = boxType;
maxCount = 99999999;
}
@Override
protected void init() {
binding.setClick(this);
edtNum = binding.edtNum;
edtNum.setCursorVisible(false);
binding.tvPrice.setText(Math.min(maxCount, 50) * price + "钻石");
edtNum.addTextChangedListener(this);
edtNum.setLongClickable(false);
if (boxType == IBoxModel.BOX_TYPE_NORMAL){
binding.tvBuyKey.setText(context.getResources().getString(R.string.tips_to_buy_a_normal_key));
Drawable drawable = context.getResources().getDrawable(R.drawable.ic_key_large);
drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumWidth());
binding.tvBuyKey.setCompoundDrawables(drawable, null , null, null);
}else if (boxType == IBoxModel.BOX_TYPE_HONOUR){
binding.tvBuyKey.setText(context.getResources().getString(R.string.tips_to_buy_a_key));
Drawable drawable = context.getResources().getDrawable(R.drawable.ic_honour_key_large);
drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumWidth());
binding.tvBuyKey.setCompoundDrawables(drawable, null , null, null);
}
}
public void onClick(View view) {
switch (view.getId()) {
case R.id.btn_sub:
int num = getNum();
num = num <= 10 ? 1 : (num - 10);
edtNum.setText(num + "");
break;
case R.id.btn_add:
num = getNum() + 10;
num = Math.min(maxCount, num);
edtNum.setText(num + "");
break;
case R.id.stv_close:
dismiss();
break;
case R.id.stv_buy:
if (getNum() == 0) {
SingleToastUtil.showToast("购买锤子数量不能为0,请重新输入!");
return;
}
if (boxType == IBoxModel.BOX_TYPE_NORMAL){
disposable = BoxModel.get()
.buyKey(getNum())
.doOnError(throwable -> {
int code = -1;
if (throwable instanceof BalanceNotEnoughExeption) {
code = BalanceNotEnoughExeption.code;
}
SingleToastUtil.showToast(BasicConfig.INSTANCE.getAppContext(), throwable.getMessage());
EventBus.getDefault().post(new BoxBuyKeyEvent()
.setSuccess(false)
.setCode(code)
.setKeyDeficiency(false));
})
.subscribe(keyInfo -> {
dismiss();
EventBus.getDefault().post(new BoxBuyKeyEvent()
.setSuccess(true)
.setKeyDeficiency(false)
.setKeyInfo(keyInfo));
});
}else if (boxType == IBoxModel.BOX_TYPE_HONOUR){
disposable = BoxModel.get()
.buyHonourKey(AuthModel.get().getCurrentUid(), getNum(),
AuthModel.get().getTicket())
.doOnError(throwable -> {
int code = -1;
if (throwable instanceof BalanceNotEnoughExeption) {
code = BalanceNotEnoughExeption.code;
}
SingleToastUtil.showToast(BasicConfig.INSTANCE.getAppContext(), throwable.getMessage());
EventBus.getDefault().post(new HonourBoxBuyKeyEvent()
.setSuccess(false)
.setCode(code)
.setKeyDeficiency(false));
})
.subscribe(keyInfo -> {
dismiss();
EventBus.getDefault().post(new HonourBoxBuyKeyEvent()
.setSuccess(true)
.setKeyDeficiency(false)
.setKeyInfo(keyInfo));
});
}
break;
case R.id.edt_num:
edtNum.setCursorVisible(true);
break;
default:
break;
}
}
private int getNum() {
int n = StringUtils.toInt(edtNum.getText().toString(), 0);
return Math.min(n, maxCount);
}
@Override
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
if (disposable != null && !disposable.isDisposed()) {
disposable.dispose();
}
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
//这里后台要求只能输入8位数。
Editable editable = (Editable) s;
if (start + count > 8){
editable.delete(8,start + count);
}
}
@Override
public void afterTextChanged(Editable s) {
String numString = getNum() + "";
//输入的数字超过int的最大值则给个默认值
if (!numString.equals(s.toString())) {
edtNum.setText(numString);
}
edtNum.setSelection(numString.length());
binding.tvPrice.setText(getNum() * price + "钻石");
}
}

View File

@@ -1,129 +0,0 @@
package com.yizhuan.erban.treasure_box.widget.dialog;
import android.content.Context;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.style.ForegroundColorSpan;
import android.view.View;
import com.yizhuan.erban.R;
import com.yizhuan.erban.databinding.DialogKeyDeficiencyBinding;
import com.yizhuan.treasure_box.event.HonourBoxBuyKeyEvent;
import com.yizhuan.treasure_box.model.BoxModel;
import com.yizhuan.treasure_box.model.IBoxModel;
import com.yizhuan.xchat_android_core.auth.AuthModel;
import com.yizhuan.treasure_box.event.BoxBuyKeyEvent;
import com.yizhuan.xchat_android_core.utils.net.BalanceNotEnoughExeption;
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes;
import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
import com.yizhuan.xchat_android_library.utils.config.BasicConfig;
import org.greenrobot.eventbus.EventBus;
import io.reactivex.disposables.Disposable;
@ActLayoutRes(R.layout.dialog_key_deficiency)
public class KeyDeficiencyDialog extends BaseBindingDialog<DialogKeyDeficiencyBinding> implements View.OnClickListener {
/**
* 开箱子次数
*/
private int count;
/**
* 欠缺的钥匙(锤子)数量
*/
private int num;
private volatile Disposable disposable;
private int boxType;
public KeyDeficiencyDialog(Context context, int count, int num) {
this(context, count, num, IBoxModel.BOX_TYPE_NORMAL);
}
public KeyDeficiencyDialog(Context context, int count, int num, int boxType) {
super(context, R.style.MyAlertDialogStyle);
this.count = count;
this.num = num;
this.boxType = boxType;
}
@Override
protected void init() {
binding.setClick(this);
String s = "您剩余锤子不足以砸开这些金蛋,是否补购其余";
String content = s + num + "个锤子并砸开金蛋?";
SpannableStringBuilder builder = new SpannableStringBuilder(content);
ForegroundColorSpan redSpan = new ForegroundColorSpan(context.getResources().getColor(R.color.roomTextNick));
builder.setSpan(redSpan, s.length(),s.length()+ String.valueOf(num).length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
binding.tvContent.setText(builder);
}
public void onClick(View view) {
switch (view.getId()) {
case R.id.stv_close:
dismiss();
break;
case R.id.stv_buy:
if (boxType == IBoxModel.BOX_TYPE_NORMAL) {
disposable = BoxModel.get()
.buyKey(num)
.doOnError(throwable -> {
int code = -1;
if (throwable instanceof BalanceNotEnoughExeption) {
code = BalanceNotEnoughExeption.code;
}
SingleToastUtil.showToast(BasicConfig.INSTANCE.getAppContext(), throwable.getMessage());
EventBus.getDefault().post(new BoxBuyKeyEvent()
.setSuccess(false)
.setCode(code)
.setKeyDeficiency(true)
.setCount(count));
})
.subscribe(keyInfo -> {
dismiss();
EventBus.getDefault().post(new BoxBuyKeyEvent()
.setSuccess(true)
.setKeyDeficiency(true)
.setCount(count)
.setKeyInfo(keyInfo));
});
} else if (boxType == IBoxModel.BOX_TYPE_HONOUR) {
disposable = BoxModel.get()
.buyHonourKey(AuthModel.get().getCurrentUid(), num,
AuthModel.get().getTicket())
.doOnError(throwable -> {
int code = -1;
if (throwable instanceof BalanceNotEnoughExeption) {
code = BalanceNotEnoughExeption.code;
}
SingleToastUtil.showToast(BasicConfig.INSTANCE.getAppContext(), throwable.getMessage());
EventBus.getDefault().post(new HonourBoxBuyKeyEvent()
.setSuccess(false)
.setCode(code)
.setKeyDeficiency(true)
.setCount(count));
})
.subscribe(keyInfo -> {
dismiss();
EventBus.getDefault().post(new HonourBoxBuyKeyEvent()
.setSuccess(true)
.setKeyDeficiency(true)
.setCount(count)
.setKeyInfo(keyInfo));
});
}
break;
}
}
@Override
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
if (disposable != null && !disposable.isDisposed()) {
disposable.dispose();
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 894 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@@ -1,25 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="true">
<item
android:drawable="@drawable/egg0"
android:duration="100" />
<item
android:drawable="@drawable/egg1"
android:duration="100" />
<item
android:drawable="@drawable/egg2"
android:duration="100" />
<item
android:drawable="@drawable/egg3"
android:duration="100" />
<item
android:drawable="@drawable/egg4"
android:duration="100" />
<item
android:drawable="@drawable/egg5"
android:duration="100" />
<item
android:drawable="@drawable/egg6"
android:duration="100" />
</animation-list>

View File

@@ -1,25 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="true">
<item
android:drawable="@drawable/honour_egg0"
android:duration="100" />
<item
android:drawable="@drawable/honour_egg1"
android:duration="100" />
<item
android:drawable="@drawable/honour_egg2"
android:duration="100" />
<item
android:drawable="@drawable/honour_egg3"
android:duration="100" />
<item
android:drawable="@drawable/honour_egg4"
android:duration="100" />
<item
android:drawable="@drawable/honour_egg5"
android:duration="100" />
<item
android:drawable="@drawable/honour_egg6"
android:duration="100" />
</animation-list>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/white" />
<corners
android:bottomLeftRadius="10dp"
android:bottomRightRadius="0dp"
android:topLeftRadius="10dp"
android:topRightRadius="0dp" />
</shape>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_pressed="true" android:drawable="@drawable/pull_radish_open_pressed"/>
<item android:state_focused="true" android:drawable="@drawable/pull_radish_open_pressed"/>
<item android:drawable="@drawable/pull_radish_open_normal"/>
</selector>

View File

@@ -1,68 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="click"
type="android.view.View.OnClickListener" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_15"
android:layout_marginEnd="@dimen/dp_15"
tools:layout_height="400dp"
android:background="@drawable/box_help_bg_normal">
<ImageButton
android:id="@+id/ib_close"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="3dp"
android:background="@null"
android:onClick="@{click}"
android:src="@drawable/icon_room_close_box"
app:layout_constraintRight_toRightOf="parent" />
<ImageView
android:id="@+id/iv_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_22"
android:layout_marginLeft="18dp"
android:src="@drawable/icon_prize_record"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_25"
android:layout_marginLeft="6dp"
android:src="@drawable/box_help_title"
app:layout_constraintLeft_toRightOf="@+id/iv_icon"
app:layout_constraintTop_toTopOf="parent" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="333dp"
android:layout_marginLeft="21dp"
android:layout_marginRight="21dp"
android:layout_marginBottom="16dp"
app:layout_constraintBottom_toBottomOf="parent">
<ImageView
android:id="@+id/iv_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/dp_20" />
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@@ -1,94 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="click"
type="android.view.View.OnClickListener" />
<variable
name="viewmodel"
type="com.yizhuan.erban.base.BaseListViewModel" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_15"
android:layout_marginEnd="@dimen/dp_15"
tools:layout_height="400dp"
android:background="@drawable/box_help_bg_normal">
<ImageButton
android:id="@+id/ib_close"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="3dp"
android:background="@null"
android:onClick="@{click}"
android:src="@drawable/icon_room_close_box"
app:layout_constraintRight_toRightOf="parent" />
<ImageView
android:id="@+id/iv_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_22"
android:layout_marginLeft="18dp"
android:src="@drawable/icon_prize_record"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_25"
android:layout_marginLeft="6dp"
android:src="@drawable/box_prize_title"
app:layout_constraintLeft_toRightOf="@+id/iv_icon"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_tips"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_26"
android:layout_marginLeft="6dp"
android:gravity="center_vertical"
android:text="@string/room_price_box_tips"
android:textColor="@color/white_transparent_50"
android:textSize="12sp"
app:layout_constraintLeft_toRightOf="@+id/iv_title"
app:layout_constraintTop_toTopOf="parent" />
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintVertical_weight="1"
app:layout_constraintTop_toBottomOf="@id/iv_title"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginTop="@dimen/dp_7"
android:layout_marginBottom="@dimen/dp_15"
android:refreshing="@{viewmodel.loading}">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
date="@{viewmodel.data}"
error="@{viewmodel.throwable}"
isLode="@{viewmodel.isLode}"
newData="@{viewmodel.loadData}"
pageSize="@{viewmodel.pageSize}"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@@ -1,100 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="click"
type="android.view.View.OnClickListener" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="400dp"
android:layout_marginEnd="@dimen/dp_15"
android:layout_marginStart="@dimen/dp_15"
android:background="@drawable/box_help_bg_normal">
<ImageButton
android:id="@+id/ib_close"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="3dp"
android:background="@null"
android:onClick="@{click}"
android:src="@drawable/icon_room_close_box"
app:layout_constraintRight_toRightOf="parent" />
<ImageView
android:id="@+id/iv_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_22"
android:layout_marginLeft="18dp"
android:src="@drawable/icon_prize_record"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_25"
android:layout_marginLeft="6dp"
android:src="@drawable/box_prize_record_title"
app:layout_constraintLeft_toRightOf="@+id/iv_icon"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_record"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginTop="@dimen/dp_26"
android:layout_marginLeft="6dp"
android:text="展示您最近300次的中奖记录"
android:textColor="@color/white_transparent_50"
android:textSize="12sp"
app:layout_constraintLeft_toRightOf="@+id/iv_title"
app:layout_constraintTop_toTopOf="parent"/>
<com.flyco.tablayout.SegmentTabLayout
android:id="@+id/seg_tab"
android:layout_width="172dp"
android:layout_height="36dp"
android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginLeft="15dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_title"
app:tl_indicator_margin_bottom="3dp"
app:tl_indicator_margin_left="3dp"
app:tl_indicator_margin_right="3dp"
app:tl_indicator_margin_top="3dp"
app:tl_bar_color="#527247ED"
app:tl_bar_stroke_color="@color/appColor"
app:tl_bar_stroke_width="0px"
app:tl_indicator_anim_enable="true"
app:tl_indicator_bounce_enable="false"
app:tl_indicator_color="#1AFFFFFF"
app:tl_tab_space_equal="true"
app:tl_textSelectColor="@color/white"
app:tl_textUnselectColor="@color/white"
app:tl_textsize="@dimen/sp_13"/>
<androidx.viewpager.widget.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintVertical_weight="1"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="15dp"
app:layout_constraintTop_toBottomOf="@id/seg_tab"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@@ -1,94 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="click"
type="android.view.View.OnClickListener" />
<variable
name="viewmodel"
type="com.yizhuan.erban.base.BaseListViewModel" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_15"
android:layout_marginEnd="@dimen/dp_15"
tools:layout_height="400dp"
android:background="@drawable/box_help_bg">
<ImageButton
android:id="@+id/ib_close"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="3dp"
android:background="@null"
android:onClick="@{click}"
android:src="@drawable/icon_room_close_box"
app:layout_constraintRight_toRightOf="parent" />
<ImageView
android:id="@+id/iv_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_22"
android:layout_marginLeft="18dp"
android:src="@drawable/icon_prize_record"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_25"
android:layout_marginLeft="6dp"
android:src="@drawable/box_prize_title"
app:layout_constraintLeft_toRightOf="@+id/iv_icon"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_tips"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_26"
android:layout_marginLeft="6dp"
android:gravity="center_vertical"
android:text="@string/room_price_box_tips"
android:textColor="@color/white_transparent_50"
android:textSize="12sp"
app:layout_constraintLeft_toRightOf="@+id/iv_title"
app:layout_constraintTop_toTopOf="parent" />
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintVertical_weight="1"
app:layout_constraintTop_toBottomOf="@id/iv_title"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginTop="@dimen/dp_7"
android:layout_marginBottom="@dimen/dp_15"
android:refreshing="@{viewmodel.loading}">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
date="@{viewmodel.data}"
error="@{viewmodel.throwable}"
isLode="@{viewmodel.isLode}"
newData="@{viewmodel.loadData}"
pageSize="@{viewmodel.pageSize}"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@@ -1,102 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="click"
type="android.view.View.OnClickListener" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="400dp"
android:layout_marginEnd="@dimen/dp_15"
android:layout_marginStart="@dimen/dp_15"
android:background="@drawable/box_help_bg">
<ImageButton
android:id="@+id/ib_close"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="3dp"
android:background="@null"
android:onClick="@{click}"
android:src="@drawable/icon_room_close_box"
app:layout_constraintRight_toRightOf="parent" />
<ImageView
android:id="@+id/iv_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_22"
android:layout_marginLeft="18dp"
android:src="@drawable/icon_prize_record"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_25"
android:layout_marginLeft="6dp"
android:src="@drawable/box_prize_record_title"
app:layout_constraintLeft_toRightOf="@+id/iv_icon"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_record"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginTop="@dimen/dp_26"
android:layout_marginLeft="6dp"
android:text="展示您最近300次的中奖记录"
android:textColor="@color/white_transparent_50"
android:textSize="12sp"
app:layout_constraintLeft_toRightOf="@+id/iv_title"
app:layout_constraintTop_toTopOf="parent"/>
<com.flyco.tablayout.SegmentTabLayout
android:id="@+id/seg_tab"
android:layout_width="172dp"
android:layout_height="36dp"
android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginLeft="15dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_title"
app:tl_indicator_margin_bottom="3dp"
app:tl_indicator_margin_left="3dp"
app:tl_indicator_margin_right="3dp"
app:tl_indicator_margin_top="3dp"
app:tl_bar_color="#527247ED"
app:tl_bar_stroke_color="@color/appColor"
app:tl_bar_stroke_width="0px"
app:tl_indicator_anim_enable="true"
app:tl_indicator_bounce_enable="false"
app:tl_indicator_color="#1AFFFFFF"
app:tl_tab_space_equal="true"
app:tl_textSelectColor="@color/white"
app:tl_textUnselectColor="@color/white"
app:tl_textsize="@dimen/sp_13"/>
<androidx.viewpager.widget.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintVertical_weight="1"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="15dp"
app:layout_constraintTop_toBottomOf="@id/seg_tab"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@@ -0,0 +1,276 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="click"
type="android.view.View.OnClickListener" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/root_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:onClick="@{click}">
<View
android:id="@+id/view_bg"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="17dp"
android:background="@drawable/pull_radish_bg"
android:onClick="@{click}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="317:387"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_percent="0.85" />
<TextView
android:id="@+id/tv_rank"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginTop="30dp"
android:drawableStart="@drawable/pull_radish_rank"
android:drawablePadding="5dp"
android:gravity="center"
android:onClick="@{click}"
android:text="排行榜"
android:textColor="@color/white"
android:textSize="13sp"
app:layout_constraintStart_toStartOf="@id/view_bg"
app:layout_constraintTop_toTopOf="@id/view_bg" />
<ImageView
android:id="@+id/iv_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginEnd="15dp"
android:gravity="center"
android:onClick="@{click}"
android:src="@drawable/pull_radish_more"
app:layout_constraintEnd_toEndOf="@id/view_bg"
app:layout_constraintTop_toTopOf="@id/view_bg" />
<ImageView
android:id="@+id/iv_diamond_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:src="@drawable/pull_radish_diamond"
app:layout_constraintEnd_toEndOf="@id/iv_more"
app:layout_constraintStart_toStartOf="@id/iv_more"
app:layout_constraintTop_toBottomOf="@id/iv_more" />
<TextView
android:id="@+id/tv_diamond_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_radish_add_diamond"
android:gravity="center"
android:paddingStart="5dp"
android:paddingEnd="10dp"
android:textColor="@color/color_333333"
android:textSize="11sp"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="@id/iv_diamond_icon"
app:layout_constraintEnd_toEndOf="@id/iv_diamond_icon"
app:layout_constraintTop_toBottomOf="@id/iv_diamond_icon"
tools:text="200" />
<ImageView
android:id="@+id/iv_get_diamond"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="@{click}"
android:src="@drawable/pull_radish_add_diamond"
app:layout_constraintBottom_toBottomOf="@id/tv_diamond_num"
app:layout_constraintEnd_toEndOf="@id/iv_diamond_icon"
app:layout_constraintStart_toEndOf="@id/iv_diamond_icon"
app:layout_constraintTop_toTopOf="@id/tv_diamond_num" />
<ImageView
android:id="@+id/iv_key_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:src="@drawable/pull_radish_meteor"
app:layout_constraintEnd_toEndOf="@id/iv_more"
app:layout_constraintStart_toStartOf="@id/iv_more"
app:layout_constraintTop_toBottomOf="@id/iv_get_diamond" />
<TextView
android:id="@+id/tv_key_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_radish_add_diamond"
android:gravity="center"
android:paddingStart="5dp"
android:paddingEnd="10dp"
android:textColor="@color/color_333333"
android:textSize="11sp"
app:layout_constraintBottom_toBottomOf="@id/iv_key_icon"
app:layout_constraintEnd_toEndOf="@id/iv_key_icon"
app:layout_constraintTop_toBottomOf="@id/iv_key_icon"
tools:text="200" />
<ImageView
android:id="@+id/iv_get_key"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="@{click}"
android:src="@drawable/pull_radish_add_diamond"
app:layout_constraintBottom_toBottomOf="@id/tv_key_num"
app:layout_constraintEnd_toEndOf="@id/iv_key_icon"
app:layout_constraintStart_toEndOf="@id/iv_key_icon"
app:layout_constraintTop_toTopOf="@id/tv_key_num" />
<ImageView
android:id="@+id/iv_first_box"
android:layout_width="0dp"
android:layout_height="0dp"
android:scaleType="fitXY"
android:src="@drawable/ic_radish_temp"
app:layout_constraintBottom_toBottomOf="@id/iv_box"
app:layout_constraintEnd_toEndOf="@id/iv_box"
app:layout_constraintStart_toStartOf="@id/iv_box"
app:layout_constraintTop_toTopOf="@id/iv_box" />
<com.opensource.svgaplayer.SVGAImageView
android:id="@+id/iv_box"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="45dp"
android:onClick="@{click}"
app:autoPlay="false"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/view_bg"
app:layout_constraintWidth_percent="0.53"
app:loopCount="1"
app:source="svga/pull_radish_bg.svga" />
<ImageView
android:id="@+id/iv_gift_anim"
android:layout_width="50dp"
android:layout_height="50dp"
app:layout_constraintBottom_toBottomOf="@id/iv_box"
app:layout_constraintEnd_toEndOf="@id/iv_box"
app:layout_constraintStart_toStartOf="@id/iv_box"
app:layout_constraintTop_toTopOf="@id/iv_box" />
<TextView
android:id="@+id/tv_continuous_open"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:gravity="center"
android:text="连续开启"
android:textColor="@color/white"
android:textSize="11sp"
app:layout_constraintBottom_toTopOf="@id/bg_add_sub"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<ImageView
android:id="@+id/bg_add_sub"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/pull_radish_add_bg"
app:layout_constraintBottom_toBottomOf="@id/iv_sub"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/iv_sub" />
<ImageView
android:id="@+id/iv_sub"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="2.5dp"
android:layout_marginBottom="5dp"
android:onClick="@{click}"
android:src="@drawable/pull_radish_sub"
app:layout_constraintBottom_toTopOf="@id/iv_open"
app:layout_constraintStart_toStartOf="@id/bg_add_sub"
app:layout_constraintTop_toBottomOf="@id/tv_continuous_open" />
<EditText
android:id="@+id/edit_num"
android:layout_width="wrap_content"
android:layout_height="23dp"
android:background="@null"
android:gravity="center"
android:inputType="number"
android:maxLength="4"
android:minWidth="40dp"
android:text="1"
android:textColor="@color/white"
android:textSize="13sp"
app:layout_constraintBottom_toBottomOf="@id/iv_sub"
app:layout_constraintEnd_toStartOf="@id/iv_add"
app:layout_constraintStart_toEndOf="@id/iv_sub"
app:layout_constraintTop_toTopOf="@id/iv_sub" />
<ImageView
android:id="@+id/iv_add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="2.5dp"
android:onClick="@{click}"
android:src="@drawable/pull_radish_add"
app:layout_constraintEnd_toEndOf="@id/bg_add_sub"
app:layout_constraintTop_toTopOf="@id/iv_sub" />
<ImageView
android:id="@+id/iv_open"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="25dp"
android:layout_marginEnd="25dp"
android:layout_marginBottom="22dp"
android:onClick="@{click}"
android:src="@drawable/click_pull_radish_selector"
app:layout_constraintBottom_toBottomOf="@id/view_bg"
app:layout_constraintEnd_toEndOf="@id/view_bg"
app:layout_constraintStart_toStartOf="@id/view_bg" />
<LinearLayout
android:id="@+id/ll_prize_hint"
android:layout_width="wrap_content"
android:layout_height="135dp"
android:layout_marginStart="7dp"
android:gravity="bottom"
android:orientation="vertical"
app:layout_constraintBottom_toTopOf="@id/tv_continuous_open"
app:layout_constraintStart_toStartOf="@id/view_bg" />
<com.opensource.svgaplayer.SVGAImageView
android:id="@+id/svga_gift_bg"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="80dp"
android:layout_marginTop="60dp"
app:autoPlay="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@id/iv_box"
app:layout_constraintTop_toTopOf="@id/iv_box"
app:loopCount="1"
app:source="svga/bubble_tran_bg.svga"
tools:background="@color/white"
tools:visibility="gone" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/root_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:background="@color/color_666666">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="360dp"
android:layout_gravity="bottom"
android:background="@drawable/shape_white_top_14dp"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<com.flyco.tablayout.SlidingTabLayout
android:id="@+id/view_indicator"
android:layout_width="match_parent"
android:layout_height="46dp"
android:background="@drawable/shape_white_top_14dp"
app:tl_indicator_color="@color/appColor"
app:tl_indicator_corner_radius="2dp"
app:tl_indicator_height="@dimen/dp_3"
app:tl_indicator_width="@dimen/dp_9"
app:tl_tab_space_equal="true"
app:tl_textSelectColor="@color/color_333333"
app:tl_textUnselectColor="@color/text_tertiary"
app:tl_textsize="@dimen/dp_16" />
<ImageView
android:id="@+id/iv_refresh"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/refresh"
android:layout_gravity="end"
android:paddingStart="@dimen/dp_15"
android:paddingEnd="@dimen/dp_15"
/>
</FrameLayout>
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="@color/color_f5f5f5" />
<androidx.viewpager.widget.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</FrameLayout>

View File

@@ -1,175 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="click"
type="android.view.View.OnClickListener" />
</data>
<androidx.cardview.widget.CardView
android:layout_width="270dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:cardElevation="0dp"
app:cardCornerRadius="@dimen/dp_8">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:background="@color/appColor_tran_10"
android:background="@color/white">
<TextView
android:id="@+id/tv_buy_key"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_marginTop="@dimen/dp_20"
android:drawablePadding="@dimen/dp_11"
android:drawableLeft="@drawable/ic_key_large"
android:text="@string/tips_to_buy_a_normal_key"
android:textColor="@color/color_333333"
android:textSize="18sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_num"
android:layout_width="wrap_content"
android:layout_height="25dp"
android:layout_marginTop="@dimen/dp_28"
android:gravity="center"
android:text="数量:"
android:textColor="@color/color_999999"
android:textSize="15sp"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/btn_sub"
app:layout_constraintTop_toBottomOf="@id/tv_buy_key" />
<com.coorchice.library.SuperTextView
android:id="@+id/btn_sub"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_marginLeft="10dp"
android:gravity="center"
android:onClick="@{click}"
android:text=""
android:background="@drawable/icon_buy_key_sub"
app:stroke_width="0px"
app:stroke_color="@color/color_CCCCCC"
app:corner="200dp"
android:textColor="@color/color_999999"
android:textStyle="bold"
app:layout_constraintTop_toTopOf="@id/tv_num"
app:layout_constraintLeft_toRightOf="@id/tv_num"
app:layout_constraintRight_toLeftOf="@+id/edt_num"
app:layout_constraintTop_toBottomOf="@id/tv_buy_key" />
<EditText
android:id="@+id/edt_num"
android:layout_width="75dp"
android:layout_height="25dp"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:gravity="center"
android:background="@drawable/shape_bg_buy_key_input"
android:hint="请输入购买数量"
android:inputType="number"
android:text="50"
android:onClick="@{click}"
android:textColor="@color/color_666666"
android:textSize="@dimen/sp_14"
app:layout_constraintTop_toTopOf="@id/tv_num"
app:layout_constraintLeft_toRightOf="@id/btn_sub"
app:layout_constraintRight_toLeftOf="@+id/btn_add"
app:layout_constraintTop_toBottomOf="@id/tv_buy_key" />
<com.coorchice.library.SuperTextView
android:id="@+id/btn_add"
android:layout_width="25dp"
android:layout_height="25dp"
android:background="@drawable/icon_buy_key_plus"
android:onClick="@{click}"
android:gravity="center"
android:text=""
android:textColor="@color/color_999999"
android:textStyle="bold"
app:stroke_width="0px"
app:stroke_color="@color/color_CCCCCC"
app:corner="200dp"
app:layout_constraintTop_toTopOf="@id/tv_num"
app:layout_constraintLeft_toRightOf="@id/edt_num"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_buy_key" />
<TextView
android:id="@+id/tv_price_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:text="价格:"
android:textColor="@color/color_999999"
android:textSize="15sp"
app:layout_constraintLeft_toLeftOf="@id/tv_num"
app:layout_constraintTop_toBottomOf="@id/tv_num" />
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:text="1000钻石"
android:textColor="#333333"
android:textSize="15sp"
app:layout_constraintLeft_toLeftOf="@id/btn_sub"
app:layout_constraintLeft_toRightOf="@id/tv_price_text"
app:layout_constraintTop_toBottomOf="@id/tv_num" />
<com.coorchice.library.SuperTextView
android:id="@+id/stv_close"
android:layout_width="105dp"
android:layout_height="38dp"
android:layout_marginTop="@dimen/dp_29"
android:gravity="center"
android:onClick="@{click}"
android:text="取消"
android:layout_marginEnd="@dimen/dp_18"
android:textColor="@color/color_333333"
android:textSize="15sp"
app:corner="100dp"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/stv_buy"
app:layout_constraintTop_toBottomOf="@id/tv_price"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginBottom="@dimen/dp_32"
app:stroke_color="@color/color_B3B3B3"
app:stroke_width="2dp" />
<com.coorchice.library.SuperTextView
android:id="@+id/stv_buy"
android:layout_width="105dp"
android:layout_height="38dp"
android:gravity="center"
android:onClick="@{click}"
android:text="购买"
android:textColor="@color/color_333333"
android:textSize="15sp"
app:corner="100dp"
app:layout_constraintTop_toTopOf="@id/stv_close"
app:layout_constraintLeft_toRightOf="@id/stv_close"
app:layout_constraintRight_toRightOf="parent"
app:solid="@color/appColor"
app:stroke_color="@color/color_333333"
app:stroke_width="2dp"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</layout>

View File

@@ -1,175 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="click"
type="android.view.View.OnClickListener" />
</data>
<androidx.cardview.widget.CardView
android:layout_width="270dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:cardElevation="0dp"
app:cardCornerRadius="@dimen/dp_8">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:background="@color/appColor_tran_10"
android:background="@color/white">
<TextView
android:id="@+id/tv_buy_key"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_marginTop="@dimen/dp_20"
android:drawablePadding="@dimen/dp_7"
android:drawableLeft="@drawable/ic_key_large"
android:text="@string/tips_to_buy_a_key"
android:textColor="@color/color_333333"
android:textSize="18sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_num"
android:layout_width="wrap_content"
android:layout_height="25dp"
android:layout_marginTop="@dimen/dp_18"
android:gravity="center"
android:text="数量:"
android:textColor="@color/color_999999"
android:textSize="15sp"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/btn_sub"
app:layout_constraintTop_toBottomOf="@id/tv_buy_key" />
<com.coorchice.library.SuperTextView
android:id="@+id/btn_sub"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_marginLeft="10dp"
android:gravity="center"
android:onClick="@{click}"
android:text=""
app:solid="@color/color_CCCCCC"
app:stroke_width="0px"
app:stroke_color="@color/color_CCCCCC"
app:corner="200dp"
android:textColor="@color/color_999999"
android:textStyle="bold"
app:layout_constraintTop_toTopOf="@id/tv_num"
app:layout_constraintLeft_toRightOf="@id/tv_num"
app:layout_constraintRight_toLeftOf="@+id/edt_num"
app:layout_constraintTop_toBottomOf="@id/tv_buy_key" />
<EditText
android:id="@+id/edt_num"
android:layout_width="75dp"
android:layout_height="25dp"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:gravity="center"
android:background="@drawable/shape_bg_buy_key_input"
android:hint="请输入购买数量"
android:inputType="number"
android:text="50"
android:onClick="@{click}"
android:textColor="@color/color_999999"
android:textSize="@dimen/sp_14"
app:layout_constraintTop_toTopOf="@id/tv_num"
app:layout_constraintLeft_toRightOf="@id/btn_sub"
app:layout_constraintRight_toLeftOf="@+id/btn_add"
app:layout_constraintTop_toBottomOf="@id/tv_buy_key" />
<com.coorchice.library.SuperTextView
android:id="@+id/btn_add"
android:layout_width="25dp"
android:layout_height="25dp"
android:background="@drawable/shape_bg_buy_key_input"
android:onClick="@{click}"
android:gravity="center"
android:text=""
android:textColor="@color/color_999999"
app:solid="@color/color_CCCCCC"
app:stroke_width="0px"
app:stroke_color="@color/color_CCCCCC"
app:corner="200dp"
app:layout_constraintTop_toTopOf="@id/tv_num"
app:layout_constraintLeft_toRightOf="@id/edt_num"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_buy_key" />
<TextView
android:id="@+id/tv_price_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:text="价格:"
android:textColor="@color/color_999999"
android:textSize="15sp"
app:layout_constraintLeft_toLeftOf="@id/tv_num"
app:layout_constraintTop_toBottomOf="@id/tv_num" />
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:text="1000钻石"
android:textColor="#333333"
android:textSize="15sp"
app:layout_constraintLeft_toLeftOf="@id/btn_sub"
app:layout_constraintLeft_toRightOf="@id/tv_price_text"
app:layout_constraintTop_toBottomOf="@id/tv_num" />
<com.coorchice.library.SuperTextView
android:id="@+id/stv_close"
android:layout_width="105dp"
android:layout_height="38dp"
android:layout_marginTop="@dimen/dp_15"
android:gravity="center"
android:onClick="@{click}"
android:text="取消"
android:layout_marginEnd="@dimen/dp_10"
android:textColor="@color/color_333333"
android:textSize="15sp"
app:corner="100dp"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/stv_buy"
app:layout_constraintTop_toBottomOf="@id/tv_price"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginBottom="@dimen/dp_32"
app:stroke_color="@color/color_B3B3B3"
app:stroke_width="2dp" />
<com.coorchice.library.SuperTextView
android:id="@+id/stv_buy"
android:layout_width="105dp"
android:layout_height="38dp"
android:gravity="center"
android:onClick="@{click}"
android:text="购买"
android:textColor="@color/color_333333"
android:textSize="15sp"
app:corner="100dp"
app:layout_constraintTop_toTopOf="@id/stv_close"
app:layout_constraintLeft_toRightOf="@id/stv_close"
app:layout_constraintRight_toRightOf="parent"
app:solid="@color/appColor"
app:stroke_color="@color/color_333333"
app:stroke_width="2dp"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</layout>

View File

@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="click"
type="android.view.View.OnClickListener" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_white_top_10dp"
android:orientation="vertical"
android:paddingStart="15dp"
android:paddingBottom="80dp"
android:paddingEnd="15dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:text="更多"
android:textColor="#ff333333"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_get_key"
android:layout_width="match_parent"
android:layout_height="43dp"
android:background="@drawable/bottom_line"
android:gravity="center_vertical"
android:text="参与活动获得萝卜铲"
android:textColor="#ff333333"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_history"
android:layout_width="match_parent"
android:layout_height="43dp"
android:background="@drawable/bottom_line"
android:gravity="center_vertical"
android:text="获奖记录"
android:textColor="#ff333333"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_box_rule"
android:layout_width="match_parent"
android:layout_height="43dp"
android:gravity="center_vertical"
android:text="玩法规则"
android:textColor="#ff333333"
android:textSize="14sp" />
</LinearLayout>
</layout>

View File

@@ -1,79 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="prizeRecord"
type="com.yizhuan.treasure_box.bean.PrizeInfo" />
</data>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="@dimen/dp_60"
app:cardBackgroundColor="@color/color_4D7247ED"
android:layout_marginBottom="14dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
app:cardCornerRadius="10dp"
app:cardElevation="0dp">
<LinearLayout
android:id="@+id/avatar"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_avatar"
circleUrl="@{prizeRecord.prizeImgUrl}"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:scaleType="fitXY" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:text="@{prizeRecord.prizeName}"
android:textColor="@color/white" />
<TextView
android:id="@+id/tv_percent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:layout_marginLeft="5dp"
android:text="@{prizeRecord.showRate}"
android:textColor="@color/white"
android:textSize="10dp"
android:background="@drawable/bg_box_prize_percent_item_round"/>
<View
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="0dp" />
<TextView
tools:text="100钻石"
android:text="@{String.valueOf(prizeRecord.platformValue) + @string/currency_unit}"
android:layout_gravity="center_vertical"
android:textSize="@dimen/sp_14"
android:textColor="@color/color_FFE823"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</androidx.cardview.widget.CardView>
</layout>

View File

@@ -1,79 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="prizeRecord"
type="com.yizhuan.treasure_box.bean.PrizeInfo" />
</data>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="@dimen/dp_60"
app:cardBackgroundColor="@color/color_4D8820E0"
android:layout_marginBottom="14dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
app:cardCornerRadius="10dp"
app:cardElevation="0dp">
<LinearLayout
android:id="@+id/avatar"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_avatar"
circleUrl="@{prizeRecord.prizeImgUrl}"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:scaleType="fitXY" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:text="@{prizeRecord.prizeName}"
android:textColor="@color/white" />
<TextView
android:id="@+id/tv_percent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="5dp"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:text="@{prizeRecord.showRate}"
android:textColor="@color/white"
android:textSize="10dp"
android:background="@drawable/bg_box_prize_percent_item_round"/>
<View
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="0dp" />
<TextView
tools:text="100钻石"
android:text="@{String.valueOf(prizeRecord.platformValue) + @string/currency_unit}"
android:layout_gravity="center_vertical"
android:textSize="@dimen/sp_14"
android:textColor="@color/color_FFE823"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</androidx.cardview.widget.CardView>
</layout>

View File

@@ -1,85 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="prizeRecord"
type="com.yizhuan.treasure_box.bean.PrizeInfo" />
<import type="android.view.View" />
</data>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="@dimen/dp_60"
app:cardBackgroundColor="@color/color_4D8820E0"
android:layout_marginBottom="14dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
app:cardCornerRadius="10dp"
app:cardElevation="0dp">
<LinearLayout
android:id="@+id/avatar"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_avatar"
circleUrl="@{prizeRecord.prizeImgUrl}"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:text="@{prizeRecord.prizeName}"
android:textColor="@color/white" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:text="@string/x"
android:textColor="@color/color_FFE823"
android:textSize="12sp"
android:visibility="@{(prizeRecord.prizeNum==0 ||prizeRecord.prizeNum==1) ? View.GONE : View.VISIBLE}" />
<TextView
android:id="@+id/tv_prize_num"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:text="@{String.valueOf(prizeRecord.prizeNum)}"
android:textColor="@color/color_FFE823"
android:textSize="14sp"
android:visibility="@{(prizeRecord.prizeNum==0 || prizeRecord.prizeNum==1) ? View.INVISIBLE : View.VISIBLE}" />
<TextView
android:id="@+id/tv_time"
drawTime="@{prizeRecord.createTime}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:textColor="#99FFFFFF" />
</LinearLayout>
</androidx.cardview.widget.CardView>
</layout>

View File

@@ -1,85 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="prizeRecord"
type="com.yizhuan.treasure_box.bean.PrizeInfo" />
<import type="android.view.View" />
</data>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="@dimen/dp_60"
app:cardBackgroundColor="@color/color_4D8820E0"
android:layout_marginBottom="14dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
app:cardCornerRadius="10dp"
app:cardElevation="0dp">
<LinearLayout
android:id="@+id/avatar"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_avatar"
circleUrl="@{prizeRecord.prizeImgUrl}"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:text="@{prizeRecord.prizeName}"
android:textColor="@color/white" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:text="@string/x"
android:textColor="@color/color_FFE823"
android:textSize="12sp"
android:visibility="@{(prizeRecord.prizeNum==0 ||prizeRecord.prizeNum==1) ? View.GONE : View.VISIBLE}" />
<TextView
android:id="@+id/tv_prize_num"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:text="@{String.valueOf(prizeRecord.prizeNum)}"
android:textColor="@color/color_FFE823"
android:textSize="14sp"
android:visibility="@{(prizeRecord.prizeNum==0 || prizeRecord.prizeNum==1) ? View.INVISIBLE : View.VISIBLE}" />
<TextView
android:id="@+id/tv_time"
android:text="@{String.valueOf(prizeRecord.platformValue) + @string/currency_unit}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:textColor="@color/color_FFE823" />
</LinearLayout>
</androidx.cardview.widget.CardView>
</layout>

View File

@@ -488,4 +488,25 @@ public class UriProvider {
return JAVA_WEB_URL.concat("/yinyou/activity/activemodel/index.html?code=ZBGG");
}
/**
* 拔萝卜帮助
*/
public static String getRadishHelp() {
return JAVA_WEB_URL.concat("/yinyou/modules/rule/radishRule.html");
}
/**
* 拔萝卜记录
*/
public static String getRadishHistory() {
return JAVA_WEB_URL.concat("/yinyou/modules/rank/index.html#/RadishRecord");
}
/**
* 获取拔萝卜钥匙
*/
public static String getRadishKey() {
return JAVA_WEB_URL.concat("/yinyou/activity/radish/index.html");
}
}

View File

@@ -928,6 +928,32 @@ public final class IMNetEaseManager {
break;
}
break;
case CUSTOM_MSG_RADISH:
RoomBoxPrizeAttachment boxPrizeAttachment = ((RoomBoxPrizeAttachment) msg.getAttachment());
UserInfo userInfo = UserModel.get().getCacheLoginUserInfo();
if (userInfo == null || boxPrizeAttachment == null) break;
boolean showRadishMsg = userInfo.getUserLevelVo() != null &&
userInfo.getUserLevelVo().getExperLevelSeq() >= boxPrizeAttachment.getUserLevelLimit();
switch (second) {
case CUSTOM_MSG_SUB_RADISH_ME:
if (AuthModel.get().getCurrentUid() == boxPrizeAttachment.getUid())
addMessages(msg);
break;
case CUSTOM_MSG_SUB_RADISH_IN_ROOM:
case CUSTOM_MSG_SUB_RADISH_ALL_ROOM:
if (showRadishMsg) {
addMessages(msg);
}
break;
case CUSTOM_MSG_SUB_RADISH_ALL_ROOM_NOTIFY:
case CUSTOM_MSG_SUB_RADISH_ALL_ROOM_NOTIFY_BY_SVGA:
if (showRadishMsg) {
addMessages(msg);
noticeRadish(msg, second);
}
break;
}
break;
case CUSTOM_MSG_DRAGON_BAR:
if (second == CUSTOM_MSG_DRAGON_BAR_START) {
noticeDragonBarStart(msg, RoomEvent.DRAGON_BAR_START);
@@ -3322,6 +3348,14 @@ public final class IMNetEaseManager {
.setChatRoomMessage(msg));
}
private void noticeRadish(ChatRoomMessage msg, int second) {
int event = second == CUSTOM_MSG_SUB_RADISH_ALL_ROOM_NOTIFY ? RoomEvent.RADISH_NOTIFY : RoomEvent.RADISH_NOTIFY_SVGA;
getChatRoomEventObservable()
.onNext(new RoomEvent()
.setEvent(event)
.setChatRoomMessage(msg));
}
private void noticeRoomLuckyBagNotice(ChatRoomMessage msg) {
getChatRoomEventObservable()
.onNext(new RoomEvent()

View File

@@ -36,6 +36,7 @@ import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUS
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_MODULE_HALL;
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_PUBLIC_CHAT_HALL;
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_QUEUING_MIC;
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_RADISH;
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_RED_PACKAGE;
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_ROOM_GIFT_VALUE;
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SHARE_FAMILY;
@@ -586,6 +587,9 @@ public class CustomAttachParser implements MsgAttachmentParser {
case CustomAttachment.CUSTOM_MSG_GIFT_COMPOUND:
attachment = new GiftCompoundAttachment(second);
break;
case CUSTOM_MSG_RADISH:
attachment = new RoomBoxPrizeAttachment(CUSTOM_MSG_RADISH, second);
break;
default:
LogUtils.e("未定义的first,请现在CustomAttachParser中解析first=" + first + " second=" + second);
break;

View File

@@ -339,6 +339,15 @@ public class CustomAttachment implements MsgAttachment {
//访客未读
public static final int CUSTOM_MSG_HEADER_TYPE_VISITOR = 78;
public static final int CUSTOM_MSG_SUB_TYPE_VISITOR_UNREAD = 781;
//房间开宝箱
public static final int CUSTOM_MSG_RADISH = 81;
public static final int CUSTOM_MSG_SUB_RADISH_ME = 811;//自己可见
public static final int CUSTOM_MSG_SUB_RADISH_IN_ROOM = 812;//当前房间可见
public static final int CUSTOM_MSG_SUB_RADISH_ALL_ROOM = 813;//所有房间可见
public static final int CUSTOM_MSG_SUB_RADISH_ALL_ROOM_NOTIFY = 814;//所有房间可见+小秘书
public static final int CUSTOM_MSG_SUB_RADISH_ALL_ROOM_NOTIFY_BY_SVGA = 815;//所有房间可见+小秘书+高大上的SVGA
//跨房PK
public static final int CUSTOM_MSG_ROOM_PK = 83;
public static final int CUSTOM_MSG_SUB_ROOM_PK_INVITE = 831;

View File

@@ -14,6 +14,7 @@ public class RoomBoxPrizeAttachment extends CustomAttachment {
private String boxTypeStr;
private long roomUid;
private int prizeNum;
private int userLevelLimit;
public RoomBoxPrizeAttachment(int first, int second) {
super(first, second);
@@ -67,14 +68,23 @@ public class RoomBoxPrizeAttachment extends CustomAttachment {
this.boxTypeStr = boxTypeStr;
}
public int getUserLevelLimit() {
return userLevelLimit;
}
public void setUserLevelLimit(int userLevelLimit) {
this.userLevelLimit = userLevelLimit;
}
@Override
protected void parseData(JSONObject jsonObject) {
uid = jsonObject.getLong("uid");
uid = jsonObject.getLongValue("uid");
prizeName = jsonObject.getString("prizeName");
nick = jsonObject.getString("nick");
boxTypeStr = jsonObject.getString("boxTypeStr");
roomUid = jsonObject.getLong("roomUid");
prizeNum = jsonObject.getInteger("prizeNum");
roomUid = jsonObject.getLongValue("roomUid");
prizeNum = jsonObject.getIntValue("prizeNum");
userLevelLimit = jsonObject.getIntValue("userLevelLimit");
}
@Override

View File

@@ -240,6 +240,11 @@ public class RoomEvent {
public static final int ROOM_CAR_EFFECT_HIDE = 94;
public static final int ROOM_CAR_EFFECT_SHOW = 95;
//开宝箱横幅
public static final int RADISH_NOTIFY = 96;
//开宝箱横幅,SVGA背景的
public static final int RADISH_NOTIFY_SVGA = 97;
private int event = NONE;
private int micPosition = Integer.MIN_VALUE;
private int posState = -1;

View File

@@ -0,0 +1,61 @@
package com.yizhuan.treasure_box.model;
import com.yizhuan.treasure_box.bean.BoxOpenStatusInfo;
import com.yizhuan.treasure_box.bean.KeyInfo;
import com.yizhuan.treasure_box.bean.OpenBoxResult;
import com.yizhuan.treasure_box.bean.PrizeInfo;
import com.yizhuan.xchat_android_core.base.IModel;
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
import com.yizhuan.xchat_android_core.room.treasure_box.bean.BoxRankingInfo;
import java.util.List;
import io.reactivex.Single;
public interface IRadishModel extends IModel {
/**
* 开箱子
*
* @param keyNum
* @param sendMessage
* @return
*/
Single<OpenBoxResult> openBox(int boxType,int keyNum, boolean sendMessage);
/**
* 获取中奖记录
*
* @param page
* @param pageSize
* @param sortType
* @param uid
* @return
*/
Single<ServiceResult<List<PrizeInfo>>> getPrizeRecord(int page,
int pageSize,
String sortType,
long uid);
/**
* 获取用户钥匙数 + 钥匙价格
*
* @return
*/
Single<KeyInfo> getKeyInfo(int boxType);
/**
* 获取奖品列表
*
* @return
*/
Single<ServiceResult<List<PrizeInfo>>> getPrizes();
/**
* 蛋开放状态
*/
Single<BoxOpenStatusInfo> getBoxOpenStatusInfo(int type);
Single<BoxRankingInfo> getBoxRankingList(int datetype, int page, int pageSize);
}

View File

@@ -0,0 +1,185 @@
package com.yizhuan.treasure_box.model;
import com.yizhuan.treasure_box.bean.BoxOpenStatusInfo;
import com.yizhuan.treasure_box.bean.KeyInfo;
import com.yizhuan.treasure_box.bean.OpenBoxResult;
import com.yizhuan.treasure_box.bean.PrizeInfo;
import com.yizhuan.xchat_android_core.auth.AuthModel;
import com.yizhuan.xchat_android_core.base.BaseModel;
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
import com.yizhuan.xchat_android_core.community.CommunityConstant;
import com.yizhuan.xchat_android_core.exception.FailReasonException;
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
import com.yizhuan.xchat_android_core.room.treasure_box.bean.BoxRankingInfo;
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
import com.yizhuan.xchat_android_library.net.rxnet.RxNet;
import java.util.List;
import io.reactivex.Single;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
public class RadishModel extends BaseModel implements IRadishModel {
/**
* 锤子数(钥匙数)不足
*/
public static final int ERROR_CODE_KEY_NUM_NOT_ENOUGH = 10000;
private Api api;
private RadishModel() {
api = RxNet.create(Api.class);
}
public static IRadishModel get() {
return BoxModelHelper.instance;
}
private static class BoxModelHelper {
private static IRadishModel instance = new RadishModel();
}
@Override
public Single<OpenBoxResult> openBox(int boxType,int keyNum, boolean sendMessage) {
if (AvRoomDataManager.get().mCurrentRoomInfo == null) {
return Single.error(new Throwable("当前房间信息为空."));
}
return api.openBox(boxType,keyNum, sendMessage, AuthModel.get().getCurrentUid(),
AvRoomDataManager.get().mCurrentRoomInfo.getUid())
.compose(RxHelper.handleSchedulers())
.flatMap(openBoxResultServiceResult -> {
if (openBoxResultServiceResult == null) {
return Single.error(new Throwable("no response"));
}
if (openBoxResultServiceResult.isSuccess()) {
if (openBoxResultServiceResult.getData() != null) {
return Single.just(openBoxResultServiceResult.getData());
} else {
return Single.error(new Throwable("data is null"));
}
}
return Single.error(new FailReasonException(openBoxResultServiceResult.getMessage(),
openBoxResultServiceResult.getCode()));
});
}
@Override
public Single<ServiceResult<List<PrizeInfo>>> getPrizeRecord(int page,
int pageSize,
String sortType,
long uid) {
return api.getPrizeRecord(page, pageSize, sortType, uid)
.compose(RxHelper.handleSchedulers());
}
@Override
public Single<KeyInfo> getKeyInfo(int boxType) {
return api.getKeyInfo(boxType,AuthModel.get().getCurrentUid())
.compose(RxHelper.handleSchedulers())
.compose(RxHelper.handleBeanData());
}
@Override
public Single<ServiceResult<List<PrizeInfo>>> getPrizes() {
return api.getPrizes()
.compose(RxHelper.handleSchedulers());
}
@Override
public Single<BoxOpenStatusInfo> getBoxOpenStatusInfo(int type) {
return api.getBoxOpenStatusInfo(type)
.compose(RxHelper.handleSchedulers())
.compose(RxHelper.handleBeanData());
}
@Override
public Single<BoxRankingInfo> getBoxRankingList(int datetype,int page,int pageSize) {
return api.apiNewbieList(String.valueOf(AuthModel.get().getCurrentUid()),
CommunityConstant.VERSION_VALID_TYPE,
AuthModel.get().getTicket(),
datetype,
page,
pageSize)
.compose(RxHelper.handleBeanData())
.compose(RxHelper.handleSchedulers());
}
private interface Api {
/**
* 中奖记录列表
*
* @param page
* @param pageSize
* @param sortType 排序类型:按时间:time,按价值:worth
* @param uid
* @return 中奖纪录列表
*/
@GET("linearlyPool/drawrecord")
Single<ServiceResult<List<PrizeInfo>>> getPrizeRecord(@Query("page") int page,
@Query("pageSize") int pageSize,
@Query("sortType") String sortType,
@Query("uid") long uid);
/**
* 开宝箱
*
* @param keyNum
* @param sendMessage
* @param uid
* @param roomUid
* @return
*/
@FormUrlEncoded
@POST("/linearlyPool/draw")
Single<ServiceResult<OpenBoxResult>> openBox(@Field("boxType") int boxType,
@Field("keyNum") int keyNum,
@Field("sendMessage") boolean sendMessage,
@Field("uid") long uid,
@Field("roomUid") long roomUid);
/**
* 获取用户钥匙数 + 钥匙价格
*
* @param uid
* @return
*/
@GET("linearlyPool/userkey")
Single<ServiceResult<KeyInfo>> getKeyInfo(@Query("boxType") int boxType,
@Query("uid") long uid);
/**
* 获取奖品列表
*
* @return
*/
@GET("linearlyPool/prizes/withRate")
Single<ServiceResult<List<PrizeInfo>>> getPrizes();
/**
* 宝箱开放状态
*/
@GET("linearlyPool/open/status")
Single<ServiceResult<BoxOpenStatusInfo>> getBoxOpenStatusInfo(@Query("type") int type);
/**
* 首页动态
*
* @return -
*/
@GET("/linearlyPool/rankings")
Single<ServiceResult<BoxRankingInfo>> apiNewbieList(
@Query("uid") String uid,
@Query("types") String types,
@Query("ticket") String ticket,
@Query("datetype") int datetype,
@Query("page") int page,
@Query("pageSize") int pageSize);
}
}