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
d4883bee
Commit
d4883bee
authored
Nov 19, 2020
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化好兔生命周期stop监听
parent
df7344c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
HorizChannelFragment.kt
...a/com/mints/goodmoney/ui/fragment/HorizChannelFragment.kt
+1
-1
MainFragment.kt
...main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
+17
-4
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/HorizChannelFragment.kt
View file @
d4883bee
...
...
@@ -130,7 +130,7 @@ class HorizChannelFragment : BaseFragment(), HorizChannelView, View.OnClickListe
}
override
fun
onStop
(
p0
:
String
?,
p1
:
String
?,
p2
:
String
?)
{
pauseDownloadTime
()
//
pauseDownloadTime()
}
})
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
View file @
d4883bee
...
...
@@ -31,8 +31,6 @@ import kotlinx.android.synthetic.main.fragment_main_first.*
import
net.grandcentrix.tray.AppPreferences
import
kotlin.collections.ArrayList
private
val
TAG
=
MainFragment
::
class
.
java
.
simpleName
/**
* 描述:首页
* 作者:孟崔广
...
...
@@ -40,6 +38,8 @@ private val TAG = MainFragment::class.java.simpleName
*/
class
MainFragment
:
BaseFragment
(),
HomeView
,
View
.
OnClickListener
{
private
val
TAG
=
MainFragment
::
class
.
java
.
simpleName
private
val
homePresenter
by
lazy
{
HomePresenter
()
}
private
val
userManager
by
lazy
{
UserManager
.
getInstance
()
}
private
val
ps
by
lazy
{
AppPreferences
(
context
)
}
...
...
@@ -85,6 +85,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
// 广告回调
YLUIConfig
.
getInstance
().
registerAdListener
(
object
:
YLAdListener
{
override
fun
onSuccess
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{
LogUtil
.
d
(
TAG
,
"onSuccess"
)
}
override
fun
onError
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
Int
,
p4
:
String
?,
p5
:
String
?)
{
...
...
@@ -94,6 +95,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
override
fun
onShow
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
)
{
LogUtil
.
d
(
TAG
,
"onShow"
)
resumeAdTime
()
}
...
...
@@ -107,17 +109,22 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
override
fun
onAdEmpty
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{}
override
fun
onVideoStart
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
)
{}
override
fun
onVideoStart
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
)
{
LogUtil
.
d
(
TAG
,
"onVideoStart"
)
}
override
fun
onVideoPause
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{
LogUtil
.
d
(
TAG
,
"onVideoPause"
)
pauseDownloadTime
()
}
override
fun
onVideoResume
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{
LogUtil
.
d
(
TAG
,
"onVideoResume"
)
resumeAdTime
()
}
override
fun
onVideoComplete
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{
LogUtil
.
d
(
TAG
,
"onVideoComplete"
)
pauseDownloadTime
()
}
...
...
@@ -296,15 +303,18 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
isFirstLoadVedio
=
false
initTimeview
()
}
else
{
LogUtil
.
d
(
TAG
,
"registerPlayerCallBack onStart"
)
resumeDownloadTime
(
videoid
)
}
}
override
fun
onPause
(
pager
:
String
,
p1
:
String
?,
p2
:
String
?)
{
LogUtil
.
d
(
TAG
,
"registerPlayerCallBack onPause"
)
pauseDownloadTime
()
}
override
fun
onResume
(
pager
:
String
,
videoid
:
String
,
p2
:
String
?)
{
LogUtil
.
d
(
TAG
,
"registerPlayerCallBack onResume"
)
resumeDownloadTime
(
videoid
)
}
...
...
@@ -313,6 +323,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
override
fun
onLoopComplete
(
pager
:
String
?,
videoID
:
String
,
taskID
:
String
?,
num
:
Int
)
{
LogUtil
.
d
(
TAG
,
"registerPlayerCallBack onLoopComplete"
)
addVedioIdList
(
videoID
)
pauseDownloadTime
()
}
...
...
@@ -324,11 +335,13 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
override
fun
onError
(
pager
:
String
,
p1
:
String
?,
p2
:
String
?)
{
pauseDownloadTime
()
}
override
fun
onStop
(
pager
:
String
,
p1
:
String
?,
p2
:
String
?)
{
pauseDownloadTime
()
LogUtil
.
d
(
TAG
,
"registerPlayerCallBack onStop"
)
// pauseDownloadTime()
}
})
}
...
...
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