添加了盲盒转盘抽奖功能
修改交友房中开始后,不能点击头像送礼的问题
This commit is contained in:
@@ -1,55 +1,377 @@
|
||||
<?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:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="match_parent"
|
||||
android:background="@mipmap/tkzj_bj">
|
||||
<!-- 顶部抽奖按钮 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/lottery_buttons_layout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_margin="@dimen/dp_16"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_lottery_once"
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_one"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:text="抽奖一次" />
|
||||
android:layout_weight="1"
|
||||
android:background="@mipmap/chou_w"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_lottery_ten"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:text="抽奖10次" />
|
||||
<TextView
|
||||
android:id="@+id/btn_lottery_one"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_3"
|
||||
android:gravity="center"
|
||||
android:text="抽一次"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_lottery_hundred"
|
||||
android:layout_width="wrap_content"
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_2"
|
||||
android:drawableLeft="@mipmap/jinb"
|
||||
android:gravity="center"
|
||||
android:text="10币一次"
|
||||
android:textSize="@dimen/sp_10" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_ten"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:text="抽奖100次" />
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:layout_weight="1"
|
||||
android:background="@mipmap/chou_w"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_lottery_ten"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_3"
|
||||
android:gravity="center"
|
||||
android:text="抽十次"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_2"
|
||||
android:drawableLeft="@mipmap/jinb"
|
||||
android:gravity="center"
|
||||
android:text="100币一次"
|
||||
android:textSize="@dimen/sp_10" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_hundred"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@mipmap/chou_w"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_lottery_hundred"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_3"
|
||||
android:gravity="center"
|
||||
android:text="抽百次"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_2"
|
||||
android:drawableLeft="@mipmap/jinb"
|
||||
android:gravity="center"
|
||||
android:text="1000币一次"
|
||||
android:textSize="@dimen/sp_10" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 礼物网格 -->
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_gifts"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/lottery_buttons_layout"
|
||||
<TextView
|
||||
android:id="@+id/tv_jc"
|
||||
android:layout_width="@dimen/dp_48"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_60"
|
||||
android:background="@mipmap/tkzi_rigth_bj"
|
||||
android:gravity="center"
|
||||
android:text="奖池"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gz"
|
||||
android:layout_width="@dimen/dp_48"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:background="@mipmap/tkzj_left_bj"
|
||||
android:gravity="center"
|
||||
android:text="规则"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_jc" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_jl"
|
||||
android:layout_width="@dimen/dp_48"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:background="@mipmap/tkzj_left_bj"
|
||||
android:gravity="center"
|
||||
android:text="记录"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_gz" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_yx"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_60"
|
||||
android:layout_marginBottom="@dimen/dp_17"
|
||||
app:layout_constraintTop_toBottomOf="@+id/gift10"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toTopOf="@+id/lottery_buttons_layout"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_lock_yx"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="音效"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_14"
|
||||
|
||||
/>
|
||||
|
||||
<Switch
|
||||
android:id="@+id/sw_lock_yx"
|
||||
android:layout_width="@dimen/dp_37"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
android:background="@drawable/room_tuner_selector_switch"
|
||||
android:thumb="@android:color/transparent"
|
||||
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_tx"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_marginBottom="@dimen/dp_17"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintTop_toTopOf="@+id/ll_yx"
|
||||
app:layout_constraintStart_toEndOf="@+id/ll_yx">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_tx"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="特效"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_14"
|
||||
|
||||
/>
|
||||
|
||||
<Switch
|
||||
android:id="@+id/sw_tex"
|
||||
android:layout_width="@dimen/dp_37"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
android:background="@drawable/room_tuner_selector_switch"
|
||||
android:thumb="@android:color/transparent"
|
||||
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.xscm.moduleutil.widget.GiftCardView
|
||||
android:id="@+id/gift1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_93"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
app:giftCount="66666"
|
||||
app:giftIcon="@mipmap/ic_launcher"
|
||||
app:giftName="柔情似水"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_jl"
|
||||
app:layout_constraintWidth_percent="0.2"
|
||||
/>
|
||||
|
||||
<com.xscm.moduleutil.widget.GiftCardView
|
||||
android:id="@+id/gift2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_93"
|
||||
android:layout_marginStart="@dimen/dp_11"
|
||||
app:giftCount="66666"
|
||||
app:giftIcon="@mipmap/ic_launcher"
|
||||
app:giftName="柔情似水"
|
||||
app:layout_constraintStart_toEndOf="@+id/gift1"
|
||||
app:layout_constraintTop_toTopOf="@+id/gift1"
|
||||
app:layout_constraintWidth_percent="0.2"
|
||||
/>
|
||||
|
||||
<com.xscm.moduleutil.widget.GiftCardView
|
||||
android:id="@+id/gift3"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_93"
|
||||
android:layout_marginStart="@dimen/dp_11"
|
||||
app:giftCount="66666"
|
||||
app:giftIcon="@mipmap/ic_launcher"
|
||||
app:giftName="柔情似水"
|
||||
app:layout_constraintStart_toEndOf="@+id/gift2"
|
||||
app:layout_constraintTop_toTopOf="@+id/gift2"
|
||||
app:layout_constraintWidth_percent="0.2"
|
||||
/>
|
||||
|
||||
<com.xscm.moduleutil.widget.GiftCardView
|
||||
android:id="@+id/gift4"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_93"
|
||||
android:layout_marginEnd="@dimen/dp_20"
|
||||
app:giftCount="66666"
|
||||
app:giftIcon="@mipmap/ic_launcher"
|
||||
app:giftName="柔情似水"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/gift3"
|
||||
app:layout_constraintWidth_percent="0.2"
|
||||
/>
|
||||
|
||||
<com.xscm.moduleutil.widget.GiftCardView
|
||||
android:id="@+id/gift5"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_93"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:layout_marginEnd="@dimen/dp_20"
|
||||
app:giftCount="66666"
|
||||
app:giftIcon="@mipmap/ic_launcher"
|
||||
app:giftName="柔情似水"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/gift3"
|
||||
app:layout_constraintWidth_percent="0.2"
|
||||
/>
|
||||
|
||||
<com.xscm.moduleutil.widget.GiftCardView
|
||||
android:id="@+id/gift6"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_93"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:layout_marginEnd="@dimen/dp_20"
|
||||
app:giftCount="66666"
|
||||
app:giftIcon="@mipmap/ic_launcher"
|
||||
app:giftName="柔情似水"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/gift5"
|
||||
app:layout_constraintWidth_percent="0.2"
|
||||
/>
|
||||
|
||||
<com.xscm.moduleutil.widget.GiftCardView
|
||||
android:id="@+id/gift7"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_93"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:layout_marginEnd="@dimen/dp_20"
|
||||
app:giftCount="66666"
|
||||
app:giftIcon="@mipmap/ic_launcher"
|
||||
app:giftName="柔情似水"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/gift6"
|
||||
app:layout_constraintWidth_percent="0.2"
|
||||
/>
|
||||
|
||||
<com.xscm.moduleutil.widget.GiftCardView
|
||||
android:id="@+id/gift8"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_93"
|
||||
android:layout_marginStart="@dimen/dp_11"
|
||||
app:giftCount="66666"
|
||||
app:giftIcon="@mipmap/ic_launcher"
|
||||
app:giftName="柔情似水"
|
||||
app:layout_constraintStart_toEndOf="@+id/gift9"
|
||||
app:layout_constraintTop_toTopOf="@+id/gift7"
|
||||
app:layout_constraintWidth_percent="0.2"
|
||||
/>
|
||||
|
||||
<com.xscm.moduleutil.widget.GiftCardView
|
||||
android:id="@+id/gift9"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_93"
|
||||
android:layout_marginStart="@dimen/dp_11"
|
||||
app:giftCount="66666"
|
||||
app:giftIcon="@mipmap/ic_launcher"
|
||||
app:giftName="柔情似水"
|
||||
app:layout_constraintStart_toEndOf="@+id/gift10"
|
||||
app:layout_constraintTop_toTopOf="@+id/gift8"
|
||||
app:layout_constraintWidth_percent="0.2"
|
||||
/>
|
||||
|
||||
<com.xscm.moduleutil.widget.GiftCardView
|
||||
android:id="@+id/gift10"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_93"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
app:giftCount="66666"
|
||||
app:giftIcon="@mipmap/ic_launcher"
|
||||
app:giftName="柔情似水"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/gift9"
|
||||
app:layout_constraintWidth_percent="0.2"
|
||||
/>
|
||||
|
||||
<com.xscm.moduleutil.widget.GiftCardView
|
||||
android:id="@+id/gift11"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_93"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
app:giftCount="66666"
|
||||
app:giftIcon="@mipmap/ic_launcher"
|
||||
app:giftName="柔情似水"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/gift6"
|
||||
app:layout_constraintWidth_percent="0.2"
|
||||
/>
|
||||
|
||||
<com.xscm.moduleutil.widget.GiftCardView
|
||||
android:id="@+id/gift12"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_93"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
app:giftCount="66666"
|
||||
app:giftIcon="@mipmap/ic_launcher"
|
||||
app:giftName="柔情似水"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/gift5"
|
||||
app:layout_constraintWidth_percent="0.2"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
63
moduleUtil/src/main/res/layout/view_gift_card.xml
Normal file
63
moduleUtil/src/main/res/layout/view_gift_card.xml
Normal file
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_gift_icon"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:scaleType="fitCenter" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gift_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:text="礼物名称"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gift_count"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="999"
|
||||
android:drawableLeft="@mipmap/jinb"
|
||||
android:gravity="center"
|
||||
android:textColor="#C7BF62"
|
||||
android:textSize="@dimen/sp_10" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/result"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_15"
|
||||
android:gravity="center"
|
||||
tools:text="x1000"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#024AA7"
|
||||
android:textSize="18sp"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</FrameLayout>
|
||||
Reference in New Issue
Block a user