Commit b13b8fba authored by jyx's avatar jyx

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

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