任务幸运币UI。
This commit is contained in:
@@ -38,6 +38,7 @@ import com.xscm.modulemain.activity.user.conacts.DailyTasksConacts;
|
|||||||
import com.xscm.modulemain.activity.user.presenter.DailyTasksPresenter;
|
import com.xscm.modulemain.activity.user.presenter.DailyTasksPresenter;
|
||||||
import com.xscm.modulemain.BaseMvpActivity;
|
import com.xscm.modulemain.BaseMvpActivity;
|
||||||
import com.xscm.modulemain.activity.WebViewActivity;
|
import com.xscm.modulemain.activity.WebViewActivity;
|
||||||
|
import com.xscm.modulemain.dialog.DialogLuckyDraw;
|
||||||
import com.xscm.modulemain.dialog.SignInDialog;
|
import com.xscm.modulemain.dialog.SignInDialog;
|
||||||
import com.xscm.modulemain.manager.RoomManager;
|
import com.xscm.modulemain.manager.RoomManager;
|
||||||
import com.xscm.moduleutil.base.CommonAppContext;
|
import com.xscm.moduleutil.base.CommonAppContext;
|
||||||
@@ -205,6 +206,13 @@ public class DailyTasksActivity extends BaseMvpActivity<DailyTasksPresenter, Act
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
mBinding.davLucky.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
new DialogLuckyDraw(DailyTasksActivity.this).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -50,14 +50,40 @@ class DialogLuckyDraw(context: Context) : BaseDialog<DialogLuckyDrawLayoutBindin
|
|||||||
mBinding.ivOnOrOff.setOnClickListener {
|
mBinding.ivOnOrOff.setOnClickListener {
|
||||||
if (mBinding.ivOnOrOff.tag == 1) {
|
if (mBinding.ivOnOrOff.tag == 1) {
|
||||||
mBinding.ivOnOrOff.tag = 0
|
mBinding.ivOnOrOff.tag = 0
|
||||||
mBinding.ivOnOrOff.setImageResource(R.mipmap.icon_lucky_donghua_pre)
|
mBinding.ivOnOrOff.setImageResource(R.mipmap.icon_lucky_donghua_nor)
|
||||||
} else {
|
} else {
|
||||||
mBinding.ivOnOrOff.tag = 1
|
mBinding.ivOnOrOff.tag = 1
|
||||||
mBinding.ivOnOrOff.setImageResource(R.mipmap.icon_lucky_donghua_nor)
|
mBinding.ivOnOrOff.setImageResource(R.mipmap.icon_lucky_donghua_pre)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
mBinding.tvLeft1.setOnClickListener {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
mBinding.tvLeft2.setOnClickListener {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
mBinding.tvLeft3.setOnClickListener {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
mBinding.tvRight1.setOnClickListener {
|
||||||
|
|
||||||
|
}
|
||||||
|
mBinding.tvRight2.setOnClickListener {
|
||||||
|
|
||||||
|
}
|
||||||
|
mBinding.tvRight3.setOnClickListener {
|
||||||
|
|
||||||
|
}
|
||||||
|
mBinding.tvRight4.setOnClickListener {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//913073443 13837096053
|
|
||||||
private fun lottery(count: Int) {
|
private fun lottery(count: Int) {
|
||||||
if (isLottery) {
|
if (isLottery) {
|
||||||
ToastUtils.showShort("正在抽取中...")
|
ToastUtils.showShort("正在抽取中...")
|
||||||
|
|||||||
@@ -0,0 +1,228 @@
|
|||||||
|
package com.xscm.modulemain.widget
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.graphics.Color
|
||||||
|
import android.graphics.Typeface
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import android.view.*
|
||||||
|
import android.widget.FrameLayout
|
||||||
|
import android.widget.TextView
|
||||||
|
import androidx.core.content.res.ResourcesCompat
|
||||||
|
import androidx.core.view.ViewCompat
|
||||||
|
import com.xscm.modulemain.R
|
||||||
|
import kotlin.math.abs
|
||||||
|
import kotlin.math.max
|
||||||
|
import kotlin.math.min
|
||||||
|
|
||||||
|
class DraggableAdsorbView @JvmOverloads constructor(
|
||||||
|
context: Context,
|
||||||
|
attrs: AttributeSet? = null
|
||||||
|
) : FrameLayout(context, attrs) {
|
||||||
|
|
||||||
|
private lateinit var textView: TextView
|
||||||
|
|
||||||
|
private var lastRawX = 0f
|
||||||
|
private var lastRawY = 0f
|
||||||
|
private var isDragging = false
|
||||||
|
private val touchSlop = ViewConfiguration.get(context).scaledTouchSlop
|
||||||
|
|
||||||
|
init {
|
||||||
|
initView()
|
||||||
|
initAttrs(attrs)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initView() {
|
||||||
|
isClickable = true
|
||||||
|
isFocusable = true
|
||||||
|
|
||||||
|
textView = TextView(context)
|
||||||
|
addView(
|
||||||
|
textView,
|
||||||
|
LayoutParams(
|
||||||
|
LayoutParams.WRAP_CONTENT,
|
||||||
|
LayoutParams.WRAP_CONTENT
|
||||||
|
).apply {
|
||||||
|
gravity = Gravity.CENTER
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解析 XML 属性
|
||||||
|
*/
|
||||||
|
private fun initAttrs(attrs: AttributeSet?) {
|
||||||
|
if (attrs == null) return
|
||||||
|
|
||||||
|
val ta = context.obtainStyledAttributes(
|
||||||
|
attrs,
|
||||||
|
R.styleable.DraggableAdsorbView
|
||||||
|
)
|
||||||
|
|
||||||
|
val text = ta.getString(R.styleable.DraggableAdsorbView_dav_text)
|
||||||
|
val textFontResId = ta.getResourceId(R.styleable.DraggableAdsorbView_dav_textFont,0)
|
||||||
|
val textColor = ta.getColor(
|
||||||
|
R.styleable.DraggableAdsorbView_dav_textColor,
|
||||||
|
Color.WHITE
|
||||||
|
)
|
||||||
|
val textSize = ta.getDimension(
|
||||||
|
R.styleable.DraggableAdsorbView_dav_textSize,
|
||||||
|
sp2px(14f)
|
||||||
|
)
|
||||||
|
val textGravity = ta.getInt(
|
||||||
|
R.styleable.DraggableAdsorbView_dav_textGravity,
|
||||||
|
Gravity.CENTER
|
||||||
|
)
|
||||||
|
|
||||||
|
val padding = ta.getDimensionPixelSize(
|
||||||
|
R.styleable.DraggableAdsorbView_dav_textPadding,
|
||||||
|
0
|
||||||
|
)
|
||||||
|
|
||||||
|
val paddingLeft = ta.getDimensionPixelSize(
|
||||||
|
R.styleable.DraggableAdsorbView_dav_textPaddingLeft,
|
||||||
|
padding
|
||||||
|
)
|
||||||
|
val paddingTop = ta.getDimensionPixelSize(
|
||||||
|
R.styleable.DraggableAdsorbView_dav_textPaddingTop,
|
||||||
|
padding
|
||||||
|
)
|
||||||
|
val paddingRight = ta.getDimensionPixelSize(
|
||||||
|
R.styleable.DraggableAdsorbView_dav_textPaddingRight,
|
||||||
|
padding
|
||||||
|
)
|
||||||
|
val paddingBottom = ta.getDimensionPixelSize(
|
||||||
|
R.styleable.DraggableAdsorbView_dav_textPaddingBottom,
|
||||||
|
padding
|
||||||
|
)
|
||||||
|
|
||||||
|
ta.recycle()
|
||||||
|
|
||||||
|
// 应用属性
|
||||||
|
textView.text = text
|
||||||
|
textView.setTextColor(textColor)
|
||||||
|
textView.textSize = px2sp(textSize)
|
||||||
|
textView.setPadding(
|
||||||
|
paddingLeft,
|
||||||
|
paddingTop,
|
||||||
|
paddingRight,
|
||||||
|
paddingBottom
|
||||||
|
)
|
||||||
|
|
||||||
|
// 核心修复2:安全设置字体 - 校验ID有效性 + try-catch异常兜底
|
||||||
|
if (textFontResId != 0) { // 0为无效资源ID,跳过未设置的情况
|
||||||
|
try {
|
||||||
|
// 传入正确的Int类型资源ID,无类型不匹配问题
|
||||||
|
val typeface = ResourcesCompat.getFont(context, textFontResId)
|
||||||
|
textView.typeface = typeface
|
||||||
|
} catch (e: Exception) {
|
||||||
|
// 异常兜底:字体加载失败时使用系统默认字体,避免View崩溃
|
||||||
|
e.printStackTrace()
|
||||||
|
textView.typeface = Typeface.DEFAULT
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
(textView.layoutParams as LayoutParams).gravity = textGravity
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===================== 拖拽逻辑 =====================
|
||||||
|
|
||||||
|
override fun onTouchEvent(event: MotionEvent): Boolean {
|
||||||
|
when (event.actionMasked) {
|
||||||
|
MotionEvent.ACTION_DOWN -> {
|
||||||
|
parent.requestDisallowInterceptTouchEvent(true)
|
||||||
|
lastRawX = event.rawX
|
||||||
|
lastRawY = event.rawY
|
||||||
|
isDragging = false
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
MotionEvent.ACTION_MOVE -> {
|
||||||
|
val dx = event.rawX - lastRawX
|
||||||
|
val dy = event.rawY - lastRawY
|
||||||
|
|
||||||
|
if (!isDragging) {
|
||||||
|
if (abs(dx) > touchSlop || abs(dy) > touchSlop) {
|
||||||
|
isDragging = true
|
||||||
|
} else return true
|
||||||
|
}
|
||||||
|
|
||||||
|
val parentView = parent as? View ?: return true
|
||||||
|
|
||||||
|
var newX = x + dx
|
||||||
|
var newY = y + dy
|
||||||
|
|
||||||
|
newX = min(
|
||||||
|
max(0f, newX),
|
||||||
|
parentView.width - width.toFloat()
|
||||||
|
)
|
||||||
|
newY = min(
|
||||||
|
max(0f, newY),
|
||||||
|
parentView.height - height.toFloat()
|
||||||
|
)
|
||||||
|
|
||||||
|
x = newX
|
||||||
|
y = newY
|
||||||
|
|
||||||
|
lastRawX = event.rawX
|
||||||
|
lastRawY = event.rawY
|
||||||
|
}
|
||||||
|
|
||||||
|
MotionEvent.ACTION_UP,
|
||||||
|
MotionEvent.ACTION_CANCEL -> {
|
||||||
|
parent.requestDisallowInterceptTouchEvent(false)
|
||||||
|
if (isDragging) {
|
||||||
|
adsorbToEdge()
|
||||||
|
} else {
|
||||||
|
performClick()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun performClick(): Boolean {
|
||||||
|
return super.performClick()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 吸附左右边
|
||||||
|
*/
|
||||||
|
private fun adsorbToEdge() {
|
||||||
|
val parentView = parent as? View ?: return
|
||||||
|
val parentWidth = parentView.width
|
||||||
|
val centerX = x + width / 2
|
||||||
|
|
||||||
|
val targetX = if (centerX < parentWidth / 2) {
|
||||||
|
0f
|
||||||
|
} else {
|
||||||
|
parentWidth - width.toFloat()
|
||||||
|
}
|
||||||
|
|
||||||
|
ViewCompat.animate(this)
|
||||||
|
.x(targetX)
|
||||||
|
.setDuration(250)
|
||||||
|
.start()
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===================== 对外 API =====================
|
||||||
|
|
||||||
|
fun setText(text: CharSequence) {
|
||||||
|
textView.text = text
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setTextGravity(gravity: Int) {
|
||||||
|
(textView.layoutParams as LayoutParams).gravity = gravity
|
||||||
|
textView.requestLayout()
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===================== 工具 =====================
|
||||||
|
|
||||||
|
private fun sp2px(sp: Float): Float {
|
||||||
|
return sp * resources.displayMetrics.scaledDensity
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun px2sp(px: Float): Float {
|
||||||
|
return px / resources.displayMetrics.scaledDensity
|
||||||
|
}
|
||||||
|
}
|
||||||
9
MainModule/src/main/res/drawable/bg_left_50.xml
Normal file
9
MainModule/src/main/res/drawable/bg_left_50.xml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<solid android:color="@android:color/white" />
|
||||||
|
<stroke
|
||||||
|
android:width="1dp"
|
||||||
|
android:color="#E0E0E0" />
|
||||||
|
<corners android:topLeftRadius="@dimen/dp_50" android:bottomLeftRadius="@dimen/dp_50" />
|
||||||
|
</shape>
|
||||||
9
MainModule/src/main/res/drawable/bg_right_50.xml
Normal file
9
MainModule/src/main/res/drawable/bg_right_50.xml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<solid android:color="@android:color/white" />
|
||||||
|
<stroke
|
||||||
|
android:width="1dp"
|
||||||
|
android:color="#E0E0E0" />
|
||||||
|
<corners android:topRightRadius="@dimen/dp_50" android:bottomRightRadius="@dimen/dp_50" />
|
||||||
|
</shape>
|
||||||
@@ -20,9 +20,9 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_marginTop="@dimen/dp_80"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="@dimen/dp_80"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:layout_constraintTop_toBottomOf="@id/top_bar">
|
app:layout_constraintTop_toBottomOf="@id/top_bar">
|
||||||
|
|
||||||
@@ -80,9 +80,9 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginHorizontal="@dimen/dp_12"
|
android:layout_marginHorizontal="@dimen/dp_12"
|
||||||
|
android:layout_marginBottom="@dimen/dp_10"
|
||||||
android:background="@drawable/bg_r16_fff"
|
android:background="@drawable/bg_r16_fff"
|
||||||
android:backgroundTint="@color/transparent"
|
android:backgroundTint="@color/transparent"
|
||||||
android:layout_marginBottom="@dimen/dp_10"
|
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.google.android.material.tabs.TabLayout
|
<com.google.android.material.tabs.TabLayout
|
||||||
@@ -92,15 +92,15 @@
|
|||||||
android:layout_marginLeft="@dimen/dp_16"
|
android:layout_marginLeft="@dimen/dp_16"
|
||||||
android:layout_marginTop="@dimen/dp_12"
|
android:layout_marginTop="@dimen/dp_12"
|
||||||
android:layout_marginRight="@dimen/dp_16"
|
android:layout_marginRight="@dimen/dp_16"
|
||||||
|
android:background="@color/transparent"
|
||||||
android:textSize="@dimen/sp_16"
|
android:textSize="@dimen/sp_16"
|
||||||
app:tabIndicatorColor="@color/transparent"
|
app:tabIndicatorColor="@color/transparent"
|
||||||
app:tabIndicatorFullWidth="false"
|
app:tabIndicatorFullWidth="false"
|
||||||
app:tabIndicatorGravity="bottom"
|
app:tabIndicatorGravity="bottom"
|
||||||
android:background="@color/transparent"
|
|
||||||
app:tabRippleColor="@color/transparent"
|
|
||||||
app:tabIndicatorHeight="0dp"
|
app:tabIndicatorHeight="0dp"
|
||||||
app:tabMinWidth="@dimen/dp_20"
|
app:tabMinWidth="@dimen/dp_20"
|
||||||
app:tabMode="scrollable"
|
app:tabMode="scrollable"
|
||||||
|
app:tabRippleColor="@color/transparent"
|
||||||
app:tabSelectedTextColor="@color/white"
|
app:tabSelectedTextColor="@color/white"
|
||||||
app:tabTextColor="@color/colorWhite45" />
|
app:tabTextColor="@color/colorWhite45" />
|
||||||
|
|
||||||
@@ -141,6 +141,22 @@
|
|||||||
app:loading_renderer="CoolWaitLoadingRenderer" />
|
app:loading_renderer="CoolWaitLoadingRenderer" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<com.xscm.modulemain.widget.DraggableAdsorbView
|
||||||
|
android:id="@+id/dav_lucky"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@mipmap/icon_shuijing"
|
||||||
|
app:dav_text="许愿卡x0"
|
||||||
|
app:dav_textColor="#FFFFEA00"
|
||||||
|
app:dav_textFont="@font/youshebiaotihei"
|
||||||
|
app:dav_textGravity="bottom|center_horizontal"
|
||||||
|
app:dav_textPaddingBottom="@dimen/dp_18"
|
||||||
|
app:dav_textSize="@dimen/sp_10"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</layout>
|
</layout>
|
||||||
43
MainModule/src/main/res/layout/dialog_list_item_layout.xml
Normal file
43
MainModule/src/main/res/layout/dialog_list_item_layout.xml
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<?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">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/view_line"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/iv_title"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/iv_title"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_1"/>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recycle_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:paddingTop="@dimen/dp_20"
|
||||||
|
android:background="@drawable/bg_r8_top_aeedff"
|
||||||
|
android:backgroundTint="#FF1E083D"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/view_line"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:spanCount="3"
|
||||||
|
tools:listitem="@layout/item_lottery_gift_layout" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_title"
|
||||||
|
android:src="@mipmap/song_bj"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</layout>
|
||||||
@@ -6,9 +6,23 @@
|
|||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/bg_r8_top_aeedff"
|
|
||||||
android:backgroundTint="@color/color_A2B0FF"
|
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:scaleType="fitXY"
|
||||||
|
android:src="@mipmap/icon_lucky_biaoti"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:background="#FF1E083D"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/ll_btn"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/iv_title" />
|
||||||
<!-- 标题栏 -->
|
<!-- 标题栏 -->
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/rl_title"
|
android:id="@+id/rl_title"
|
||||||
@@ -17,15 +31,6 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_title"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_centerInParent="true"
|
|
||||||
android:text="逗你玩"
|
|
||||||
android:textColor="@color/color_FF333333"
|
|
||||||
android:textSize="@dimen/sp_16" />
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_close"
|
android:id="@+id/iv_close"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -65,23 +70,177 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
app:autoPlay="false"
|
app:autoPlay="false"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/iv_svga_bg"
|
||||||
app:layout_constraintEnd_toEndOf="@id/iv_svga_bg"
|
app:layout_constraintEnd_toEndOf="@id/iv_svga_bg"
|
||||||
app:layout_constraintStart_toStartOf="@id/iv_svga_bg"
|
app:layout_constraintStart_toStartOf="@id/iv_svga_bg"
|
||||||
app:layout_constraintTop_toTopOf="@id/iv_svga_bg"
|
app:layout_constraintTop_toTopOf="@id/iv_svga_bg"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/iv_svga_bg"
|
|
||||||
app:loopCount="1"
|
app:loopCount="1"
|
||||||
app:source="room_wish_crystal_animation.svga" />
|
app:source="room_wish_crystal_animation.svga" />
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_on_or_off"
|
android:id="@+id/iv_on_or_off"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_margin="@dimen/dp_20"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/guide_line_2"
|
android:layout_marginHorizontal="@dimen/dp_20"
|
||||||
|
android:layout_marginBottom="@dimen/dp_40"
|
||||||
android:src="@mipmap/icon_lucky_donghua_pre"
|
android:src="@mipmap/icon_lucky_donghua_pre"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/guide_line_2"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/iv_on_or_off"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/iv_on_or_off"
|
||||||
|
android:text="礼物动画"
|
||||||
|
android:layout_marginTop="@dimen/dp_2"
|
||||||
|
android:textColor="#FF948BA0"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"/>
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_count"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="@dimen/dp_30"
|
||||||
|
android:drawableLeft="@mipmap/icon_xuyuanka"
|
||||||
|
android:text="0"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_12"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/guide_line_2"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="end"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/ll_btn"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_right_1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/bg_left_50"
|
||||||
|
android:backgroundTint="#FF2D1B41"
|
||||||
|
android:drawableLeft="@mipmap/icon_xuyuanka"
|
||||||
|
android:drawablePadding="@dimen/dp_5"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingHorizontal="@dimen/dp_5"
|
||||||
|
android:paddingVertical="@dimen/dp_5"
|
||||||
|
android:text="排行"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_12" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_right_2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_12"
|
||||||
|
android:background="@drawable/bg_left_50"
|
||||||
|
android:backgroundTint="#FF2D1B41"
|
||||||
|
android:drawableLeft="@mipmap/icon_xuyuanka"
|
||||||
|
android:drawablePadding="@dimen/dp_5"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingHorizontal="@dimen/dp_5"
|
||||||
|
android:paddingVertical="@dimen/dp_5"
|
||||||
|
android:text="记录"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_12" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_right_3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_12"
|
||||||
|
android:background="@drawable/bg_left_50"
|
||||||
|
android:backgroundTint="#FF2D1B41"
|
||||||
|
android:drawableLeft="@mipmap/icon_xuyuanka"
|
||||||
|
android:drawablePadding="@dimen/dp_5"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingHorizontal="@dimen/dp_5"
|
||||||
|
android:paddingVertical="@dimen/dp_5"
|
||||||
|
android:text="礼品"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_12" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_right_4"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_12"
|
||||||
|
android:background="@drawable/bg_left_50"
|
||||||
|
android:backgroundTint="#FF2D1B41"
|
||||||
|
android:drawableLeft="@mipmap/icon_heart_help"
|
||||||
|
android:drawablePadding="@dimen/dp_5"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingHorizontal="@dimen/dp_5"
|
||||||
|
android:paddingVertical="@dimen/dp_5"
|
||||||
|
android:text="规则"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_12" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/ll_btn"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_left_1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/bg_right_50"
|
||||||
|
android:backgroundTint="#FF2D1B41"
|
||||||
|
android:drawableRight="@mipmap/icon_xuyuanka"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingHorizontal="@dimen/dp_5"
|
||||||
|
android:paddingVertical="@dimen/dp_5"
|
||||||
|
android:text="获得记录"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_12" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_left_2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_12"
|
||||||
|
android:background="@drawable/bg_right_50"
|
||||||
|
android:backgroundTint="#FF2D1B41"
|
||||||
|
android:drawableRight="@mipmap/icon_xuyuanka"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingHorizontal="@dimen/dp_5"
|
||||||
|
android:paddingVertical="@dimen/dp_5"
|
||||||
|
android:text="消耗记录"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_12" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_left_3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_12"
|
||||||
|
android:background="@drawable/bg_right_50"
|
||||||
|
android:backgroundTint="#FF2D1B41"
|
||||||
|
android:drawableRight="@mipmap/icon_xuyuanka"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingHorizontal="@dimen/dp_5"
|
||||||
|
android:paddingVertical="@dimen/dp_5"
|
||||||
|
android:text="中奖记录"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_12" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/ll_btn"
|
android:id="@+id/ll_btn"
|
||||||
@@ -118,14 +277,14 @@
|
|||||||
|
|
||||||
<!-- 按钮区域 -->
|
<!-- 按钮区域 -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingStart="@dimen/dp_20"
|
android:paddingStart="@dimen/dp_20"
|
||||||
|
android:paddingTop="@dimen/dp_10"
|
||||||
android:paddingEnd="@dimen/dp_20"
|
android:paddingEnd="@dimen/dp_20"
|
||||||
android:paddingBottom="@dimen/dp_20"
|
android:paddingBottom="@dimen/dp_20"
|
||||||
android:paddingTop="@dimen/dp_10"
|
android:visibility="gone"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/ll_btn">
|
app:layout_constraintTop_toBottomOf="@id/ll_btn">
|
||||||
|
|
||||||
@@ -158,18 +317,18 @@
|
|||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/recycle_view"
|
android:id="@+id/recycle_view"
|
||||||
android:visibility="gone"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
android:background="@drawable/bg_r8_top_aeedff"
|
android:background="@drawable/bg_r8_top_aeedff"
|
||||||
android:backgroundTint="@color/colorBlack45"
|
android:backgroundTint="@color/colorBlack45"
|
||||||
app:layout_constraintTop_toTopOf="@id/guide_line_1"
|
android:visibility="gone"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintBottom_toTopOf="@id/ll_btn"
|
|
||||||
app:spanCount="3"
|
|
||||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||||
tools:listitem="@layout/item_lottery_gift_layout"
|
app:layout_constraintBottom_toTopOf="@id/ll_btn"
|
||||||
android:layout_width="match_parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:layout_height="0dp"/>
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/guide_line_1"
|
||||||
|
app:spanCount="3"
|
||||||
|
tools:listitem="@layout/item_lottery_gift_layout" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</layout>
|
</layout>
|
||||||
|
|||||||
@@ -31,7 +31,6 @@
|
|||||||
android:textSize="@dimen/sp_14"
|
android:textSize="@dimen/sp_14"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
app:layout_constraintTop_toBottomOf="@id/iv_glod" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
BIN
MainModule/src/main/res/mipmap-hdpi/icon_shuijing.png
Normal file
BIN
MainModule/src/main/res/mipmap-hdpi/icon_shuijing.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 49 KiB |
BIN
MainModule/src/main/res/mipmap-hdpi/icon_xuyuanka.png
Normal file
BIN
MainModule/src/main/res/mipmap-hdpi/icon_xuyuanka.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
BIN
MainModule/src/main/res/mipmap-xhdpi/icon_shuijing.png
Normal file
BIN
MainModule/src/main/res/mipmap-xhdpi/icon_shuijing.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 83 KiB |
BIN
MainModule/src/main/res/mipmap-xhdpi/icon_xuyuanka.png
Normal file
BIN
MainModule/src/main/res/mipmap-xhdpi/icon_xuyuanka.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
BIN
MainModule/src/main/res/mipmap-xxhdpi/icon_shuijing.png
Normal file
BIN
MainModule/src/main/res/mipmap-xxhdpi/icon_shuijing.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 169 KiB |
BIN
MainModule/src/main/res/mipmap-xxhdpi/icon_xuyuanka.png
Normal file
BIN
MainModule/src/main/res/mipmap-xxhdpi/icon_xuyuanka.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.6 KiB |
@@ -1,4 +1,38 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
|
<declare-styleable name="DraggableAdsorbView">
|
||||||
|
|
||||||
|
<!-- 文本内容 -->
|
||||||
|
<attr name="dav_text" format="string" />
|
||||||
|
|
||||||
|
<!-- 文本颜色 -->
|
||||||
|
<attr name="dav_textColor" format="color" />
|
||||||
|
|
||||||
|
<!-- 文本大小 -->
|
||||||
|
<attr name="dav_textSize" format="dimension" />
|
||||||
|
|
||||||
|
<!-- 文本字体 -->
|
||||||
|
<attr name="dav_textFont" format="reference" />
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 文本位置(gravity) -->
|
||||||
|
<attr name="dav_textGravity">
|
||||||
|
<flag name="center" value="0x11" />
|
||||||
|
<flag name="left" value="0x03" />
|
||||||
|
<flag name="right" value="0x05" />
|
||||||
|
<flag name="top" value="0x30" />
|
||||||
|
<flag name="bottom" value="0x50" />
|
||||||
|
<flag name="center_horizontal" value="0x01" />
|
||||||
|
<flag name="center_vertical" value="0x10" />
|
||||||
|
</attr>
|
||||||
|
|
||||||
|
<!-- 文本内边距 -->
|
||||||
|
<attr name="dav_textPadding" format="dimension" />
|
||||||
|
<attr name="dav_textPaddingLeft" format="dimension" />
|
||||||
|
<attr name="dav_textPaddingTop" format="dimension" />
|
||||||
|
<attr name="dav_textPaddingRight" format="dimension" />
|
||||||
|
<attr name="dav_textPaddingBottom" format="dimension" />
|
||||||
|
|
||||||
|
</declare-styleable>
|
||||||
</resources>
|
</resources>
|
||||||
Reference in New Issue
Block a user