Commit b13b8fba authored by jyx's avatar jyx

猜歌页优化RecyclerView复用问题,优化样式

parent 90f39517
......@@ -156,7 +156,7 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
return
}
RxBus.getDefault().post(MsgEvent("BUS_CHANGE_PAGE"))
RxBus.getDefault().post(MsgEvent("" + map["group_id"]))
mPos = position
LogUtil.d(TAG, "onDPPageChange: $position, map = $map")
......@@ -251,6 +251,7 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
background = R.drawable.icon_quiz_button_error_bg
background2 = R.drawable.icon_quiz_error
}
optionsList[i].setBackgroundResource(R.drawable.icon_quiz_button_bg)
val button = optionsList[i]
if (i == 0) {
option0.text = options[i]
......@@ -328,12 +329,13 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
}
override fun onNext(t: MsgEvent) {
if (!quizIvRedbox0.isClickable) return
if (!t.msg.equals(feedParamsForCallback["group_id"])) return
for (i in optionsList.indices) {
val right = answer == i
if (right) {
mMusicBean?.let {
if (it.nextIsAd) {
if (it.nextIsAd && optionsList[i].isClickable) {
if (i == 0) {
quizIvRedbox0.visibility =
View.VISIBLE
......@@ -341,6 +343,11 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
quizIvRedbox1.visibility =
View.VISIBLE
}
} else {
quizIvRedbox0.visibility =
View.GONE
quizIvRedbox0.visibility =
View.GONE
}
}
}
......@@ -655,7 +662,8 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
if (canFail) return
showLoading("正在获取视频", false)
NoPreAdManager.loadVideoAd(requireActivity(), carrierType,
NoPreAdManager.loadVideoAd(requireActivity(),
carrierType,
object : AdStatusListener {
override fun adFail() {
hideLoading()
......@@ -702,9 +710,12 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
rope?.stop()
mTimer = null
rope = null
awardVideo(Constant.CARRIERTYPE_SONG_MORE)
}
mTimer = CountDownTimerSupport(8000, 1000)
mTimer?.setOnCountDownTimerListener(object : OnCountDownTimerListener {
mTimer?.setOnCountDownTimerListener(object :
OnCountDownTimerListener {
override fun onTick(millisUntilFinished: Long) {
quizTvPop.text = String.format(
"%2ds后消失",
......@@ -870,10 +881,16 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
})
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
override fun onActivityResult(
requestCode: Int,
resultCode: Int,
data: Intent?
) {
super.onActivityResult(requestCode, resultCode, data)
val coin = data?.extras?.getInt(SongAwardActivity.SONG_REDPACKET, 0) ?: 0
val di = data?.extras?.getInt(SongAwardActivity.SONG_YUANBAO, 0) ?: 0
val coin =
data?.extras?.getInt(SongAwardActivity.SONG_REDPACKET, 0) ?: 0
val di =
data?.extras?.getInt(SongAwardActivity.SONG_YUANBAO, 0) ?: 0
showRewardAnim(coin, di)
}
......
......@@ -135,19 +135,6 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
override fun getUserSuc(data: UserBean) {
tv_my_id.text = "用户ID:${data.userMsg.idcode}"
tv_my_money.text = SpanUtils()
.append(FormatUtil.getCashFormaet(UserManager.getInstance().redpkg))
.setFontSize(40, true)
.append(" ≈ ${UserManager.getInstance().redpkg}个")
.setFontSize(14, true)
.create()
}
override fun getHallListSuc(data: TaskInfoBean) {
tasksAdapter?.taskData = data.list
recy_tasks.adapter?.notifyDataSetChanged()
if (rb_my_cash.isChecked) {
tv_my_money.text = SpanUtils()
.append(FormatUtil.getCashFormaet(UserManager.getInstance().redpkg))
......@@ -165,6 +152,11 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
}
}
override fun getHallListSuc(data: TaskInfoBean) {
tasksAdapter?.taskData = data.list
recy_tasks.adapter?.notifyDataSetChanged()
}
private fun initListener() {
btn_my_draw.setOnClickListener(this)
btn_task.setOnClickListener(this)
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 填充的颜色 -->
<solid android:color="@color/color_FDE7CF" />
<!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
<corners android:radius="20dp" />
</shape>
\ No newline at end of file
......@@ -5,6 +5,8 @@
<solid android:color="@color/color_FDE7CF" />
<!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
<corners android:radius="20dip" />
<corners
android:topLeftRadius="30dp"
android:topRightRadius="30dp" />
</shape>
\ No newline at end of file
......@@ -4,13 +4,15 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_tab_friends"
android:orientation="vertical"
android:padding="@dimen/dp_10">
android:orientation="vertical">
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_draw"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
app:tabBackground="@null"
app:tabIndicatorColor="@color/color_F61F03"
app:tabIndicatorHeight="0dp"
......
......@@ -56,7 +56,7 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginEnd="@dimen/dp_10"
android:layout_marginBottom="200dp" />
android:layout_marginBottom="260dp" />
<ImageView
android:id="@+id/iv_pause"
......
......@@ -2,7 +2,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:orientation="vertical"
android:padding="@dimen/dp_10">
<RelativeLayout
android:layout_width="match_parent"
......@@ -10,7 +11,7 @@
android:layout_marginStart="12dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="12dp"
android:background="@drawable/shape_withdraw_half"
android:background="@drawable/shape_withdraw"
android:padding="6dp">
<TextView
......@@ -93,7 +94,7 @@
android:layout_marginStart="15dp"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginEnd="15dp"
android:background="@drawable/shape_withdraw_half"
android:background="@drawable/shape_withdraw_header"
android:text="去提现"
android:textColor="@color/white"
android:textSize="@dimen/font_size_16" />
......
......@@ -34,19 +34,19 @@
android:layout_marginStart="30dp"
android:gravity="center"
android:maxWidth="66dp"
android:minWidth="50dp"
android:minWidth="55dp"
android:textColor="@color/white"
android:textSize="14sp" />
<Button
android:id="@+id/btn_draw_cash"
android:layout_width="50dp"
android:layout_width="46dp"
android:layout_height="26dp"
android:layout_marginEnd="6dp"
android:background="@drawable/shape_withdraw_header"
android:text="@string/draw_cash"
android:textColor="@color/white"
android:textSize="15sp" />
android:textSize="14sp" />
</LinearLayout>
......@@ -80,20 +80,20 @@
android:layout_marginStart="30dp"
android:gravity="center"
android:maxWidth="66dp"
android:minWidth="50dp"
android:minWidth="55dp"
android:text="-"
android:textColor="@color/white"
android:textSize="14sp" />
<Button
android:id="@+id/btn_draw_gold"
android:layout_width="50dp"
android:layout_width="46dp"
android:layout_height="26dp"
android:layout_marginEnd="6dp"
android:background="@drawable/shape_withdraw_header"
android:text="@string/draw_cash"
android:textColor="@color/white"
android:textSize="15sp" />
android:textSize="14sp" />
</LinearLayout>
......
......@@ -21,7 +21,7 @@
android:layout_centerHorizontal="true"
android:layout_marginStart="48dp"
android:layout_marginEnd="48dp"
android:layout_marginBottom="70dp"
android:layout_marginBottom="40dp"
android:background="@drawable/shape_mild_trans"
android:gravity="center"
android:padding="@dimen/dp_10"
......@@ -46,6 +46,7 @@
android:layout_centerInParent="true"
android:paddingBottom="5dp"
android:textColor="@color/color_3F2F8F"
android:textSize="16sp"
android:textStyle="bold"
tools:text="心太软" />
......@@ -89,6 +90,7 @@
android:layout_centerInParent="true"
android:paddingBottom="5dp"
android:textColor="@color/color_3F2F8F"
android:textSize="16sp"
android:textStyle="bold"
tools:text="伤心太平洋" />
......@@ -145,7 +147,7 @@
android:layout_marginEnd="30dp"
android:background="@drawable/bg_jlfb"
android:orientation="vertical"
android:visibility="visible">
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment