航海UI修改
@@ -1320,6 +1320,14 @@
|
||||
android:name=".avroom.newuserchargegift.NewUserChargeGiftDialog"
|
||||
android:theme="@style/dialogactivity" />
|
||||
|
||||
<activity
|
||||
android:name=".shipantics.PullRadishActivity"
|
||||
android:theme="@style/dialog_web_view_activity" />
|
||||
|
||||
<activity
|
||||
android:name=".shipantics.RadishRankingActivity"
|
||||
android:theme="@style/room_message_activity" />
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
@@ -3,6 +3,8 @@ package com.yizhuan.erban.ui.webview;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Gravity;
|
||||
@@ -39,8 +41,6 @@ public class DialogWebViewActivity extends CommonWebViewActivity {
|
||||
showTitleBar = getIntent().getBooleanExtra("showTitleBar", true);
|
||||
if (!showTitleBar) {
|
||||
layoutTitleBar.setVisibility(View.GONE);
|
||||
webView.setBackgroundColor(Color.TRANSPARENT);
|
||||
webView.getBackground().setAlpha(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,75 +1,97 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:background="@drawable/bg_radish_rank_item"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp">
|
||||
android:background="@drawable/bg_common_touch_while"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="0dp"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingEnd="@dimen/dp_15"
|
||||
>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="0.3"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:paddingStart="@dimen/dp_8"
|
||||
>
|
||||
<ImageView
|
||||
android:id="@+id/iv_position"
|
||||
android:layout_width="@dimen/dp_20"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_gravity="center"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/tv_position"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/dp_13"
|
||||
android:textColor="@color/color_666666"
|
||||
android:layout_gravity="center_vertical"
|
||||
tools:text="100"
|
||||
android:gravity="center"
|
||||
/>
|
||||
</FrameLayout>
|
||||
|
||||
<com.yizhuan.erban.ui.widget.NobleAvatarView
|
||||
android:id="@+id/noble_avatar_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="0.3"
|
||||
android:paddingStart="@dimen/dp_8">
|
||||
android:layout_gravity="center_vertical"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_position"
|
||||
android:layout_width="@dimen/dp_20"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_gravity="center" />
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_userName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="15sp"
|
||||
tools:text="我的我的我的我的我的我的"
|
||||
app:layout_flexShrink="1"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_position"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/tv_amount"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.7"
|
||||
tools:text="1236843"
|
||||
android:gravity="end"
|
||||
android:textColor="#1093F5"
|
||||
android:textSize="@dimen/dp_15"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center"
|
||||
android:textColor="#CFAD79"
|
||||
android:textSize="@dimen/dp_18"
|
||||
tools:text="100" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_avatar"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:src="@drawable/default_avatar" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_userName"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textColor="#A08161"
|
||||
android:textSize="12sp"
|
||||
tools:text="我的我的我的我的我我我我我的我的我我我我我我我我" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_amount"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_weight="0.7"
|
||||
android:drawableStart="@drawable/treasure_box_diamond"
|
||||
android:drawablePadding="5dp"
|
||||
android:gravity="center_vertical"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="#64472E"
|
||||
android:textSize="@dimen/dp_18"
|
||||
tools:text="1236843" />
|
||||
|
||||
</LinearLayout>
|
||||
android:drawableEnd="@drawable/treasure_box_diamond"
|
||||
android:drawablePadding="5dp"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/view_line"
|
||||
android:background="@color/color_F4F4F4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:layout_marginStart="90dp"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
</LinearLayout>
|
77
app/src/main/res/layout/pull_radish_ranking_list_item.xml
Normal file
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:background="@drawable/bg_radish_rank_item"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="0.3"
|
||||
android:paddingStart="@dimen/dp_8">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_position"
|
||||
android:layout_width="@dimen/dp_20"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_position"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center"
|
||||
android:textColor="#CFAD79"
|
||||
android:textSize="@dimen/dp_18"
|
||||
tools:text="100" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_avatar"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:src="@drawable/default_avatar" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_userName"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textColor="#A08161"
|
||||
android:textSize="12sp"
|
||||
tools:text="我的我的我的我的我我我我我的我的我我我我我我我我" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_amount"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_weight="0.7"
|
||||
android:drawableStart="@drawable/treasure_box_diamond"
|
||||
android:drawablePadding="5dp"
|
||||
android:gravity="center_vertical"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="#64472E"
|
||||
android:textSize="@dimen/dp_18"
|
||||
tools:text="1236843" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@@ -8,8 +8,12 @@ import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.netease.nim.uikit.StatusBarUtil;
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil;
|
||||
@@ -18,8 +22,10 @@ import com.yizhuan.erban.base.BaseBindingActivity;
|
||||
import com.yizhuan.erban.common.svga.SimpleSvgaCallback;
|
||||
import com.yizhuan.erban.databinding.ActivityPullRadishBinding;
|
||||
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.DemoCache;
|
||||
import com.yizhuan.xchat_android_core.UriProvider;
|
||||
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
|
||||
import com.yizhuan.xchat_android_core.manager.RoomEvent;
|
||||
@@ -29,16 +35,22 @@ import com.yizhuan.xchat_android_library.annatation.ActLayoutRes;
|
||||
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 final Runnable removeRunnable = () -> mBinding.llPrizeHint.removeAllViews();
|
||||
private final String[] openKeyNumbers = new String[]{"1", "10", "50", "100"};
|
||||
private int keyIndex = 0;
|
||||
private volatile int keyNum = -1;
|
||||
private AnimatorSet animatorSet;
|
||||
private int boxType = IBoxModel.BOX_TYPE_NORMAL;
|
||||
private int height;
|
||||
private ArrayList<PrizeInfo> hintPrizeCacheList = new ArrayList<>();
|
||||
|
||||
public static void start(Context context) {
|
||||
Intent starter = new Intent(context, PullRadishActivity.class);
|
||||
@@ -53,6 +65,7 @@ public class PullRadishActivity extends BaseBindingActivity<ActivityPullRadishBi
|
||||
getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, height);
|
||||
getWindow().setGravity(Gravity.BOTTOM);
|
||||
subscribeEvent();
|
||||
looperHintPrize();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -72,7 +85,6 @@ public class PullRadishActivity extends BaseBindingActivity<ActivityPullRadishBi
|
||||
int num = StringUtils.toInt(mBinding.editNum.getText().toString(), 0);
|
||||
if (num > 200) {
|
||||
mBinding.editNum.setText("200");
|
||||
mBinding.editNum.setSelection(3);
|
||||
SingleToastUtil.showToast("一次性最多只能拔200次");
|
||||
}
|
||||
}
|
||||
@@ -113,22 +125,20 @@ public class PullRadishActivity extends BaseBindingActivity<ActivityPullRadishBi
|
||||
case R.id.iv_history:
|
||||
DialogWebViewActivity.start(context, UriProvider.getRadishHistory(), false);
|
||||
break;
|
||||
case R.id.tv_rank:
|
||||
case R.id.iv_rank:
|
||||
RadishRankingActivity.start(this);
|
||||
break;
|
||||
case R.id.iv_get_key:
|
||||
DialogWebViewActivity.start(context, UriProvider.getRadishKey());
|
||||
DialogWebViewActivity.start(context, UriProvider.getRadishKey(),false);
|
||||
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());
|
||||
mBinding.editNum.setText(openKeyNumbers[keyIndex = Math.max(0, keyIndex - 1)]);
|
||||
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());
|
||||
mBinding.editNum.setText(openKeyNumbers[keyIndex = Math.min(openKeyNumbers.length - 1, keyIndex + 1)]);
|
||||
break;
|
||||
case R.id.view_bg:
|
||||
//do nothing
|
||||
@@ -167,7 +177,6 @@ public class PullRadishActivity extends BaseBindingActivity<ActivityPullRadishBi
|
||||
return;
|
||||
}
|
||||
mBinding.ivOpen.setEnabled(false);
|
||||
mBinding.ivFirstBox.setVisibility(View.GONE);
|
||||
mBinding.ivBox.startAnimation();
|
||||
mBinding.ivOpen.setPivotY(mBinding.ivOpen.getHeight());
|
||||
animatorSet.start();
|
||||
@@ -179,15 +188,62 @@ public class PullRadishActivity extends BaseBindingActivity<ActivityPullRadishBi
|
||||
SingleToastUtil.showToast(throwable.getMessage());
|
||||
})
|
||||
.delay(startTime - System.currentTimeMillis() + 500, TimeUnit.MILLISECONDS)
|
||||
.toObservable()
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.doOnSuccess(
|
||||
openBoxResult -> {
|
||||
mBinding.ivOpen.setEnabled(true);
|
||||
changeKeyNum(openBoxResult.getRemainKeyNum());
|
||||
RadishResultDialog.newInstance(openBoxResult).show(this);
|
||||
}
|
||||
)
|
||||
.subscribe();
|
||||
.flatMap(openBoxResult -> {
|
||||
mBinding.ivOpen.setEnabled(true);
|
||||
changeKeyNum(openBoxResult.getRemainKeyNum());
|
||||
if (DemoCache.readRadishTips()) {
|
||||
RadishResultDialog.newInstance(openBoxResult).show(this);
|
||||
}
|
||||
return Observable.fromIterable(openBoxResult.getPrizeItemList());
|
||||
})
|
||||
.filter(prizeInfo -> prizeInfo.getPrizeLevel() > 2)
|
||||
.subscribe(prizeInfo -> hintPrizeCacheList.add(prizeInfo));
|
||||
}
|
||||
|
||||
|
||||
@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, 15000);
|
||||
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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -30,7 +30,7 @@ import org.greenrobot.eventbus.ThreadMode;
|
||||
public class RadishRankingFragment extends BaseMvpFragment<IRadishRankingView, RadishRankingPresenter> implements IRadishRankingView, BaseQuickAdapter.RequestLoadMoreListener {
|
||||
private RecyclerView recyclerView;
|
||||
private SwipeRefreshLayout swipeRefresh;
|
||||
private BoxRankingListAdapter mAdapter;
|
||||
private RadishRankingListAdapter mAdapter;
|
||||
private int datetype;
|
||||
|
||||
public static RadishRankingFragment newInstance(int datetype) {
|
||||
@@ -93,7 +93,7 @@ public class RadishRankingFragment extends BaseMvpFragment<IRadishRankingView, R
|
||||
private void initRecyclerView() {
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
recyclerView.setItemAnimator(null);
|
||||
mAdapter = new BoxRankingListAdapter(mContext);
|
||||
mAdapter = new RadishRankingListAdapter(mContext);
|
||||
mAdapter.setOnLoadMoreListener(this, recyclerView);
|
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
|
||||
recyclerView.setLayoutManager(linearLayoutManager);
|
||||
|
@@ -0,0 +1,60 @@
|
||||
package com.yizhuan.erban.shipantics;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadKt;
|
||||
import com.yizhuan.xchat_android_core.room.treasure_box.bean.BoxRankingInfo;
|
||||
|
||||
/**
|
||||
* @author jack
|
||||
* @Description
|
||||
* @Date 2018/4/16
|
||||
*/
|
||||
|
||||
public class RadishRankingListAdapter extends BaseQuickAdapter<BoxRankingInfo.RankVosBean, BaseViewHolder> {
|
||||
|
||||
private Context mContext;
|
||||
|
||||
public RadishRankingListAdapter(Context context) {
|
||||
super(R.layout.pull_radish_ranking_list_item);
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder baseViewHolder, final BoxRankingInfo.RankVosBean rankVosBeans) {
|
||||
if (rankVosBeans == null) return;
|
||||
|
||||
baseViewHolder.setText(R.id.tv_userName, rankVosBeans.getNick()).setText(R.id.tv_amount, rankVosBeans.getAmount() + "");
|
||||
ImageLoadKt.loadAvatar(baseViewHolder.getView(R.id.iv_avatar), rankVosBeans.getAvatar());
|
||||
TextView tvPosition = baseViewHolder.getView(R.id.tv_position);
|
||||
ImageView ivPosition = baseViewHolder.getView(R.id.iv_position);
|
||||
switch (baseViewHolder.getLayoutPosition()) {
|
||||
case 0:
|
||||
tvPosition.setVisibility(View.GONE);
|
||||
ivPosition.setVisibility(View.VISIBLE);
|
||||
ivPosition.setImageDrawable(mContext.getResources().getDrawable(R.drawable.ic_box_ranking_first));
|
||||
break;
|
||||
case 1:
|
||||
tvPosition.setVisibility(View.GONE);
|
||||
ivPosition.setVisibility(View.VISIBLE);
|
||||
ivPosition.setImageDrawable(mContext.getResources().getDrawable(R.drawable.ic_box_ranking_second));
|
||||
break;
|
||||
case 2:
|
||||
tvPosition.setVisibility(View.GONE);
|
||||
ivPosition.setVisibility(View.VISIBLE);
|
||||
ivPosition.setImageDrawable(mContext.getResources().getDrawable(R.drawable.ic_box_ranking_third));
|
||||
break;
|
||||
default:
|
||||
tvPosition.setVisibility(View.VISIBLE);
|
||||
ivPosition.setVisibility(View.GONE);
|
||||
tvPosition.setText(baseViewHolder.getLayoutPosition() + 1 + "");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,6 +1,7 @@
|
||||
package com.yizhuan.erban.shipantics
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.WindowManager
|
||||
import android.widget.ImageView
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
@@ -14,6 +15,7 @@ import com.yizhuan.erban.ui.utils.RVDelegate
|
||||
import com.yizhuan.erban.ui.utils.load
|
||||
import com.yizhuan.treasure_box.bean.OpenBoxResult
|
||||
import com.yizhuan.treasure_box.bean.PrizeInfo
|
||||
import com.yizhuan.xchat_android_core.DemoCache
|
||||
|
||||
class RadishResultDialog :
|
||||
BaseDialog<DialogRadishResultBinding>() {
|
||||
@@ -29,7 +31,6 @@ class RadishResultDialog :
|
||||
return fragment
|
||||
}
|
||||
}
|
||||
|
||||
private val openBoxResult: OpenBoxResult by lazy { requireArguments().getSerializable("openBoxResult")!! as OpenBoxResult }
|
||||
private lateinit var rvDelegate: RVDelegate<PrizeInfo>
|
||||
|
||||
@@ -42,10 +43,23 @@ class RadishResultDialog :
|
||||
helper.getView<ImageView>(R.id.iv_gift).load(item.prizeImgUrl)
|
||||
}
|
||||
})
|
||||
.setLayoutManager(GridLayoutManager(context, 5, RecyclerView.VERTICAL, false))
|
||||
.setLayoutManager(
|
||||
if (openBoxResult.prizeItemList?.size == 1) {
|
||||
LinearLayoutManager(context)
|
||||
} else {
|
||||
GridLayoutManager(context, 5, RecyclerView.VERTICAL, false)
|
||||
}
|
||||
)
|
||||
.setRecyclerView(binding.recyclerView)
|
||||
.build()
|
||||
|
||||
rvDelegate.setNewData(openBoxResult.prizeItemList)
|
||||
|
||||
binding.ivClose.setOnClickListener { dismissAllowingStateLoss() }
|
||||
|
||||
binding.checkBox.setOnCheckedChangeListener { _, isChecked ->
|
||||
DemoCache.saveRadishTips(!isChecked)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -5,6 +5,7 @@ import android.content.Context;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.yizhuan.erban.shipantics.PullRadishActivity;
|
||||
import com.yizhuan.erban.treasure_box.activity.TreasureBoxActivity;
|
||||
import com.yizhuan.erban.treasure_box.activity.TreasureBoxHonourActivity;
|
||||
import com.yizhuan.erban.treasure_box.fragment.ChooseTreasureBoxDialogFragment;
|
||||
@@ -67,7 +68,8 @@ public class GoldBoxHelper {
|
||||
});
|
||||
chooseTreasureBoxDialogFragment.show(((FragmentActivity) context).getSupportFragmentManager(), "chooseTreasureBoxDialogFragment");
|
||||
} else {
|
||||
TreasureBoxActivity.start(context);
|
||||
//TreasureBoxActivity.start(context);
|
||||
PullRadishActivity.start(context);
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 731 KiB After Width: | Height: | Size: 167 KiB |
After Width: | Height: | Size: 553 B |
After Width: | Height: | Size: 343 B |
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/pull_radish_tips_checked" android:state_checked="true" />
|
||||
<item android:drawable="@drawable/pull_radish_tips_unchecked" />
|
||||
|
||||
</selector>
|
@@ -58,23 +58,12 @@
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_rank"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_get_key" />
|
||||
|
||||
<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:layout_marginTop="44dp"
|
||||
android:onClick="@{click}"
|
||||
app:autoPlay="false"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
@@ -97,6 +86,18 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintWidth_percent="0.95" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_prize_hint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="135dp"
|
||||
android:layout_marginStart="9dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:gravity="bottom"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="@id/view_bottom_bg"
|
||||
app:layout_constraintStart_toStartOf="@id/view_bottom_bg" />
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/line_1"
|
||||
android:layout_width="0dp"
|
||||
@@ -124,11 +125,11 @@
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="22dp"
|
||||
android:paddingTop="3dp"
|
||||
android:text="0"
|
||||
android:textColor="#643B29"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_more"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_more"
|
||||
tools:text="200" />
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_more" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bg_add_sub"
|
||||
@@ -152,15 +153,13 @@
|
||||
app:layout_constraintBottom_toTopOf="@id/iv_open"
|
||||
app:layout_constraintEnd_toStartOf="@id/bg_add_sub" />
|
||||
|
||||
<EditText
|
||||
<TextView
|
||||
android:id="@+id/edit_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="23dp"
|
||||
android:layout_height="wrap_content"
|
||||
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"
|
||||
|
@@ -26,7 +26,7 @@
|
||||
<com.flyco.tablayout.SlidingTabLayout
|
||||
android:id="@+id/view_indicator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="46dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="50dp"
|
||||
android:layout_marginTop="100dp"
|
||||
android:layout_marginEnd="50dp"
|
||||
|
@@ -1,13 +1,15 @@
|
||||
<?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"
|
||||
android:layout_width="283dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="100dp"
|
||||
android:background="@drawable/pull_radish_result_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_close"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
@@ -23,4 +25,20 @@
|
||||
android:layout_marginTop="75dp"
|
||||
android:layout_marginBottom="30dp" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/check_box"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:button="@null"
|
||||
android:checked="false"
|
||||
android:drawableStart="@drawable/selector_check_box_radish_tips"
|
||||
android:drawablePadding="5dp"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:text="不再提示"
|
||||
android:textColor="#ffe9c57b"
|
||||
android:textSize="10sp" />
|
||||
|
||||
</FrameLayout>
|
||||
|
@@ -19,9 +19,6 @@
|
||||
android:lines="1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="11sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="哈哈哈哈" />
|
||||
|
||||
<TextView
|
||||
@@ -33,10 +30,6 @@
|
||||
android:layout_marginStart="5dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="11sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_prize_name"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="x12" />
|
||||
|
||||
</LinearLayout>
|
@@ -21,7 +21,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:gravity="center"
|
||||
android:gravity="center_horizontal"
|
||||
android:lines="2"
|
||||
android:textColor="#ffa08161"
|
||||
android:textSize="10sp"
|
||||
tools:text="这个礼物*1" />
|
||||
|
@@ -492,21 +492,21 @@ public class UriProvider {
|
||||
* 航海帮助
|
||||
*/
|
||||
public static String getRadishHelp() {
|
||||
return JAVA_WEB_URL.concat("/yinyou/modules/rule/radishRule.html");
|
||||
return JAVA_WEB_URL.concat("/yinyou/activity/act-sail/play_explain.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* 航海记录
|
||||
*/
|
||||
public static String getRadishHistory() {
|
||||
return JAVA_WEB_URL.concat("/yinyou/modules/rank/index.html#/RadishRecord");
|
||||
return JAVA_WEB_URL.concat("/yinyou/activity/act-sail/win_record.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取航海钥匙
|
||||
*/
|
||||
public static String getRadishKey() {
|
||||
return JAVA_WEB_URL.concat("/yinyou/activity/radish/index.html");
|
||||
return JAVA_WEB_URL.concat("/yinyou/activity/act-sail/more.html");
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -54,6 +54,8 @@ public class DemoCache {
|
||||
private static final String KEY_ANCHOR_CARD_VIEW = "key_anchor_card_view";
|
||||
private static final String KEY_ANCHOR_CARD_VIEW_TIME = "key_anchor_card_view_time";
|
||||
private static final String KEY_LAUNCH_COUNT = "key_launch_count";
|
||||
private static final String KEY_RADISH_TIPS = "key_radish_tips";
|
||||
|
||||
private static StatusBarNotificationConfig notificationConfig;
|
||||
|
||||
public static Long readSpeedyMessageGoneTime() {
|
||||
@@ -293,5 +295,13 @@ public class DemoCache {
|
||||
return SettingsPref.instance().getInt(KEY_LAUNCH_COUNT, -1);
|
||||
}
|
||||
|
||||
public static void saveRadishTips(boolean value) {
|
||||
SettingsPref.instance().putBoolean(KEY_RADISH_TIPS, value);
|
||||
}
|
||||
|
||||
public static boolean readRadishTips() {
|
||||
return SettingsPref.instance().getBoolean(KEY_RADISH_TIPS, true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|