Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_vedio
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_vedio
Commits
951df63f
Commit
951df63f
authored
Oct 07, 2023
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
72a7a728
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
21 deletions
+19
-21
MusicFragment.kt
...n/java/com/duben/miniplaylet/ui/fragment/MusicFragment.kt
+12
-20
media_layout_quiz.xml
video/app/src/main/res/layout/media_layout_quiz.xml
+7
-1
No files found.
video/app/src/main/java/com/duben/miniplaylet/ui/fragment/MusicFragment.kt
View file @
951df63f
...
@@ -365,14 +365,20 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener {
...
@@ -365,14 +365,20 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener {
override
fun
onNext
(
t
:
MsgEvent
)
{
override
fun
onNext
(
t
:
MsgEvent
)
{
// if (!t.msg.equals(feedParamsForCallback["group_id"])) return
// if (!t.msg.equals(feedParamsForCallback["group_id"])) return
if
(
t
.
position
!=
mPos
)
return
finger
.
pauseAnimation
()
finger
.
visibility
=
View
.
GONE
LogUtil
.
d
(
if
(
t
.
position
!=
mPos
)
return
TAG
,
"answer -> "
+
answer
+
"nextIsAd -> "
+
mMusicBean
?.
nextIsAd
)
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
({
mainHandler
.
postDelayed
({
if
(!
isAdded
)
return
@postDelayed
if
(!
isAdded
)
return
@postDelayed
...
@@ -380,23 +386,9 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener {
...
@@ -380,23 +386,9 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener {
// 点击过后不展示
// 点击过后不展示
if
(!
rlOption0
.
isClickable
||
!
rlOption1
.
isClickable
)
return
@postDelayed
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
)
playFingerAnim
(
finger
)
},
5000
)
},
5000
)
// 重置状态
// finger.visibility = View.GONE
// quizLLPop.visibility = View.GONE
// quizTvPop.visibility = View.GONE
for
(
i
in
optionsList
.
indices
)
{
for
(
i
in
optionsList
.
indices
)
{
val
right
=
answer
==
i
val
right
=
answer
==
i
quizIvRedbox0
.
visibility
=
View
.
GONE
quizIvRedbox0
.
visibility
=
View
.
GONE
...
...
video/app/src/main/res/layout/media_layout_quiz.xml
View file @
951df63f
...
@@ -44,7 +44,10 @@
...
@@ -44,7 +44,10 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerInParent=
"true"
android:layout_centerInParent=
"true"
android:ellipsize=
"end"
android:maxWidth=
"180dp"
android:paddingBottom=
"5dp"
android:paddingBottom=
"5dp"
android:singleLine=
"true"
android:textColor=
"@color/color_3F2F8F"
android:textColor=
"@color/color_3F2F8F"
android:textSize=
"16sp"
android:textSize=
"16sp"
android:textStyle=
"bold"
android:textStyle=
"bold"
...
@@ -88,11 +91,14 @@
...
@@ -88,11 +91,14 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerInParent=
"true"
android:layout_centerInParent=
"true"
android:ellipsize=
"end"
android:maxWidth=
"180dp"
android:paddingBottom=
"5dp"
android:paddingBottom=
"5dp"
android:singleLine=
"true"
android:textColor=
"@color/color_3F2F8F"
android:textColor=
"@color/color_3F2F8F"
android:textSize=
"16sp"
android:textSize=
"16sp"
android:textStyle=
"bold"
android:textStyle=
"bold"
tools:text=
"伤心太平洋"
/>
tools:text=
"伤心太平洋
伤心太平洋伤心太平洋
"
/>
<ImageView
<ImageView
android:id=
"@+id/quiz_iv_redbox1"
android:id=
"@+id/quiz_iv_redbox1"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment