Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_goodmoney
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_goodmoney
Commits
8b5dd9be
Commit
8b5dd9be
authored
Dec 18, 2020
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
福袋计时器监听优化
parent
4e345302
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
HorizonChannelFragment.kt
...com/mints/goodmoney/ui/fragment/HorizonChannelFragment.kt
+3
-1
MainFragment.kt
...main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
+4
-2
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/HorizonChannelFragment.kt
View file @
8b5dd9be
...
@@ -295,6 +295,7 @@ class HorizonChannelFragment : BaseFragment(), HorizChannelView, View.OnClickLis
...
@@ -295,6 +295,7 @@ class HorizonChannelFragment : BaseFragment(), HorizChannelView, View.OnClickLis
fun
stopRedbox
()
{
fun
stopRedbox
()
{
if
(
rope
!=
null
&&
rope
!!
.
isRunning
)
{
if
(
rope
!=
null
&&
rope
!!
.
isRunning
)
{
rope
?.
stop
()
rope
?.
stop
()
rope
=
null
}
}
}
}
...
@@ -317,6 +318,7 @@ class HorizonChannelFragment : BaseFragment(), HorizChannelView, View.OnClickLis
...
@@ -317,6 +318,7 @@ class HorizonChannelFragment : BaseFragment(), HorizChannelView, View.OnClickLis
mRedBoxTimer
?.
setOnCountDownTimerListener
(
object
:
OnCountDownTimerListener
{
mRedBoxTimer
?.
setOnCountDownTimerListener
(
object
:
OnCountDownTimerListener
{
override
fun
onTick
(
millisUntilFinished
:
Long
)
{
override
fun
onTick
(
millisUntilFinished
:
Long
)
{
if
(!
requireActivity
().
isFinishing
)
{
if
(!
requireActivity
().
isFinishing
)
{
stopRedbox
()
tv_fragment_main_redbox
.
text
=
TimeRender
.
ms2MS
(
millisUntilFinished
.
toInt
())
tv_fragment_main_redbox
.
text
=
TimeRender
.
ms2MS
(
millisUntilFinished
.
toInt
())
}
}
}
}
...
@@ -383,7 +385,7 @@ class HorizonChannelFragment : BaseFragment(), HorizChannelView, View.OnClickLis
...
@@ -383,7 +385,7 @@ class HorizonChannelFragment : BaseFragment(), HorizChannelView, View.OnClickLis
})
})
}
}
private
fun
destoryTimerRedbox
(){
private
fun
destoryTimerRedbox
()
{
mRedBoxTimer
?.
stop
()
mRedBoxTimer
?.
stop
()
mRedBoxTimer
=
null
mRedBoxTimer
=
null
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
View file @
8b5dd9be
...
@@ -364,7 +364,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
...
@@ -364,7 +364,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
cdvvYilanTime
.
layoutParams
=
params
cdvvYilanTime
.
layoutParams
=
params
val
paramsRedBox
=
FrameLayout
.
LayoutParams
(
FrameLayout
.
LayoutParams
.
WRAP_CONTENT
,
FrameLayout
.
LayoutParams
.
WRAP_CONTENT
)
val
paramsRedBox
=
FrameLayout
.
LayoutParams
(
FrameLayout
.
LayoutParams
.
WRAP_CONTENT
,
FrameLayout
.
LayoutParams
.
WRAP_CONTENT
)
paramsRedBox
.
setMargins
(
0
,
BubbleUtils
.
dp2px
(
6
0
),
0
,
0
)
paramsRedBox
.
setMargins
(
0
,
BubbleUtils
.
dp2px
(
4
0
),
0
,
0
)
paramsRedBox
.
gravity
=
Gravity
.
END
paramsRedBox
.
gravity
=
Gravity
.
END
rl_fragment_main_redbox
.
layoutParams
=
paramsRedBox
rl_fragment_main_redbox
.
layoutParams
=
paramsRedBox
cdvvYilanTime
.
setOnClickListener
(
this
)
cdvvYilanTime
.
setOnClickListener
(
this
)
...
@@ -589,6 +589,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
...
@@ -589,6 +589,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
fun
stopRedbox
()
{
fun
stopRedbox
()
{
if
(
rope
!=
null
&&
rope
!!
.
isRunning
)
{
if
(
rope
!=
null
&&
rope
!!
.
isRunning
)
{
rope
?.
stop
()
rope
?.
stop
()
rope
=
null
}
}
}
}
...
@@ -609,6 +610,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
...
@@ -609,6 +610,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
mRedBoxTimer
?.
setOnCountDownTimerListener
(
object
:
OnCountDownTimerListener
{
mRedBoxTimer
?.
setOnCountDownTimerListener
(
object
:
OnCountDownTimerListener
{
override
fun
onTick
(
millisUntilFinished
:
Long
)
{
override
fun
onTick
(
millisUntilFinished
:
Long
)
{
if
(!
requireActivity
().
isFinishing
)
{
if
(!
requireActivity
().
isFinishing
)
{
stopRedbox
()
tv_fragment_main_redbox
.
text
=
TimeRender
.
ms2MS
(
millisUntilFinished
.
toInt
())
tv_fragment_main_redbox
.
text
=
TimeRender
.
ms2MS
(
millisUntilFinished
.
toInt
())
}
}
}
}
...
@@ -629,7 +631,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
...
@@ -629,7 +631,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
}
}
}
private
fun
destoryTimerRedbox
(){
private
fun
destoryTimerRedbox
()
{
mRedBoxTimer
?.
stop
()
mRedBoxTimer
?.
stop
()
mRedBoxTimer
=
null
mRedBoxTimer
=
null
}
}
...
...
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