Commit 951df63f authored by jyx's avatar jyx

代码优化

parent 72a7a728
......@@ -365,14 +365,20 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener {
override fun onNext(t: MsgEvent) {
// if (!t.msg.equals(feedParamsForCallback["group_id"])) return
if (t.position != mPos) return
finger.pauseAnimation()
finger.visibility = View.GONE
LogUtil.d(
TAG,
"answer -> " + answer + "nextIsAd -> " + mMusicBean?.nextIsAd
)
if (t.position != mPos) return
finger.setImageDrawable(null)
val ls = finger.layoutParams as RelativeLayout.LayoutParams
val ls2 = quizLLPop.layoutParams as RelativeLayout.LayoutParams
if (answer == 0) {
ls.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option0)
ls2.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option0)
} else {
ls.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option1)
ls2.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option1)
}
mainHandler.postDelayed({
if (!isAdded) return@postDelayed
......@@ -380,23 +386,9 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener {
// 点击过后不展示
if (!rlOption0.isClickable || !rlOption1.isClickable) return@postDelayed
val ls = finger.layoutParams as RelativeLayout.LayoutParams
val ls2 = quizLLPop.layoutParams as RelativeLayout.LayoutParams
if (answer == 0) {
ls.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option0)
ls2.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option0)
} else {
ls.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option1)
ls2.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option1)
}
playFingerAnim(finger)
}, 5000)
// 重置状态
// finger.visibility = View.GONE
// quizLLPop.visibility = View.GONE
// quizTvPop.visibility = View.GONE
for (i in optionsList.indices) {
val right = answer == i
quizIvRedbox0.visibility = View.GONE
......
......@@ -44,7 +44,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:ellipsize="end"
android:maxWidth="180dp"
android:paddingBottom="5dp"
android:singleLine="true"
android:textColor="@color/color_3F2F8F"
android:textSize="16sp"
android:textStyle="bold"
......@@ -88,11 +91,14 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:ellipsize="end"
android:maxWidth="180dp"
android:paddingBottom="5dp"
android:singleLine="true"
android:textColor="@color/color_3F2F8F"
android:textSize="16sp"
android:textStyle="bold"
tools:text="伤心太平洋" />
tools:text="伤心太平洋伤心太平洋伤心太平洋" />
<ImageView
android:id="@+id/quiz_iv_redbox1"
......
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