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
2a95ecdd
Commit
2a95ecdd
authored
Oct 09, 2023
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
b087bc27
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
31 deletions
+30
-31
MainFragment.kt
...in/java/com/duben/miniplaylet/ui/fragment/MainFragment.kt
+22
-22
NewcomerDialog.kt
...n/java/com/duben/miniplaylet/ui/widgets/NewcomerDialog.kt
+8
-8
dialog_newcomer.xml
video/app/src/main/res/layout/dialog_newcomer.xml
+0
-1
No files found.
video/app/src/main/java/com/duben/miniplaylet/ui/fragment/MainFragment.kt
View file @
2a95ecdd
...
@@ -348,19 +348,19 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
...
@@ -348,19 +348,19 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
isShowNewuserFlag
=
true
isShowNewuserFlag
=
true
showNewcomerDialog
(
user
.
userMsg
.
rewardCoin
)
showNewcomerDialog
(
user
.
userMsg
.
rewardCoin
)
}
else
{
}
else
{
iv_main_newcomer
.
visibility
=
View
.
VISIBLE
//
iv_main_newcomer.visibility = View.VISIBLE
//
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
//
Handler(Looper.getMainLooper()).postDelayed({
if
(!
isAdded
)
return
@postDelayed
//
if (!isAdded) return@postDelayed
//
rope
?.
stop
()
//
rope?.stop()
rope
=
null
//
rope = null
rope
=
YoYo
.
with
(
Techniques
.
Pulse
).
duration
(
500
).
repeat
(-
1
)
//
rope = YoYo.with(Techniques.Pulse).duration(500).repeat(-1)
.
playOn
(
iv_main_newcomer
)
//
.playOn(iv_main_newcomer)
},
300
)
//
}, 300)
}
}
}
else
{
}
else
{
iv_main_newcomer
.
visibility
=
View
.
GONE
//
iv_main_newcomer.visibility = View.GONE
}
}
...
@@ -453,17 +453,17 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
...
@@ -453,17 +453,17 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
when
(
v
.
id
)
{
when
(
v
.
id
)
{
R
.
id
.
tv_newcomer_time
->
{
R
.
id
.
tv_newcomer_time
->
{
newcomerDialog
?.
dismiss
()
//
newcomerDialog?.dismiss()
iv_main_newcomer
.
visibility
=
View
.
VISIBLE
//
iv_main_newcomer.visibility = View.VISIBLE
//
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
//
Handler(Looper.getMainLooper()).postDelayed({
if
(!
isAdded
)
return
@postDelayed
//
if (!isAdded) return@postDelayed
//
rope
?.
stop
()
//
rope?.stop()
rope
=
null
//
rope = null
rope
=
YoYo
.
with
(
Techniques
.
Pulse
).
duration
(
500
).
repeat
(-
1
)
//
rope = YoYo.with(Techniques.Pulse).duration(500).repeat(-1)
.
playOn
(
iv_main_newcomer
)
//
.playOn(iv_main_newcomer)
},
300
)
//
}, 300)
}
}
}
}
}
}
...
...
video/app/src/main/java/com/duben/miniplaylet/ui/widgets/NewcomerDialog.kt
View file @
2a95ecdd
...
@@ -59,7 +59,7 @@ class NewcomerDialog(private val context: Context, private val rewardCoin: Int,
...
@@ -59,7 +59,7 @@ class NewcomerDialog(private val context: Context, private val rewardCoin: Int,
isClickBtn
=
true
isClickBtn
=
true
adListener
?.
showAd
()
adListener
?.
showAd
()
}
}
tv_newcomer_time
.
setOnClickListener
(
listener
)
//
tv_newcomer_time.setOnClickListener(listener)
val
sumCoin
=
rewardCoin
.
toString
()
val
sumCoin
=
rewardCoin
.
toString
()
val
allcoinBig
=
BigDecimal
(
sumCoin
)
val
allcoinBig
=
BigDecimal
(
sumCoin
)
...
@@ -72,18 +72,18 @@ class NewcomerDialog(private val context: Context, private val rewardCoin: Int,
...
@@ -72,18 +72,18 @@ class NewcomerDialog(private val context: Context, private val rewardCoin: Int,
.
append
(
"元"
)
.
append
(
"元"
)
.
create
()
.
create
()
//
Handler().postDelayed({
Handler
().
postDelayed
({
//
startTimer()
startTimer
()
//
}, 900)
},
900
)
}
}
override
fun
dismiss
()
{
override
fun
dismiss
()
{
super
.
dismiss
()
super
.
dismiss
()
//
if (timer != null) { //防止计时器重复
if
(
timer
!=
null
)
{
//防止计时器重复
//
timer!!.stop()
timer
!!
.
stop
()
//
timer = null
timer
=
null
//
}
}
}
}
fun
startTimer
()
{
fun
startTimer
()
{
...
...
video/app/src/main/res/layout/dialog_newcomer.xml
View file @
2a95ecdd
...
@@ -37,7 +37,6 @@
...
@@ -37,7 +37,6 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"10dp"
android:layout_marginTop=
"10dp"
android:background=
"@mipmap/ic_draw_quit"
android:gravity=
"center"
android:gravity=
"center"
android:textColor=
"@color/white"
android:textColor=
"@color/white"
android:textSize=
"14sp"
></TextView>
android:textSize=
"14sp"
></TextView>
...
...
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