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
5cda33c3
Commit
5cda33c3
authored
Dec 05, 2023
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
e0a6ee7f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
7 deletions
+26
-7
Constant.kt
...p/src/main/java/com/duben/speedplaylet/common/Constant.kt
+1
-0
MainFragment.kt
...n/java/com/duben/speedplaylet/ui/fragment/MainFragment.kt
+25
-7
No files found.
video/app/src/main/java/com/duben/speedplaylet/common/Constant.kt
View file @
5cda33c3
...
...
@@ -28,6 +28,7 @@ object Constant {
const
val
MAIN_FIRST_RECOMMEND
=
"MAIN_FIRST_RECOMMEND"
const
val
MAIN_TWO_RECOMMEND
=
"MAIN_TWO_RECOMMEND"
const
val
VEDIO_AD_COUNT
=
"VEDIO_AD_COUNT"
const
val
VEDIO_MAIN_COUNT
=
"VEDIO_MAIN_COUNT"
const
val
CARRIERTYPE_CSJ_VEDIO
=
"1"
...
...
video/app/src/main/java/com/duben/speedplaylet/ui/fragment/MainFragment.kt
View file @
5cda33c3
...
...
@@ -87,14 +87,20 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
* 跳转到主页面
*/
private
fun
goToMainActivity
()
{
if
(
UserManager
.
getInstance
().
newFlag
&&
!
UserManager
.
getInstance
().
vipFlag
)
{
homePresenter
.
getRecommendVedio
()
// if (UserManager.getInstance().newFlag && !UserManager.getInstance().vipFlag) {
// homePresenter.getRecommendVedio()
//
// val bundle = Bundle()
// bundle.putBoolean(VipActivity.IS_MAIN, true)
// readyGo(VipActivity::class.java, bundle)
// } else {
// homePresenter.getSoltVedio()
// }
if
(
UserManager
.
getInstance
().
newFlag
&&
!
UserManager
.
getInstance
().
vipFlag
)
{
val
bundle
=
Bundle
()
bundle
.
putBoolean
(
VipActivity
.
IS_MAIN
,
true
)
readyGo
(
VipActivity
::
class
.
java
,
bundle
)
}
else
{
homePresenter
.
getSoltVedio
()
}
}
...
...
@@ -126,7 +132,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
homePresenter
.
topTabs
()
homePresenter
.
orders
()
TrackManager
.
getInstance
().
getMyInfo
()
showRecommendAct
(
recommendVedioBean
)
showRecommendAct
()
}
}
}
...
...
@@ -381,8 +387,8 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
/**
* 展示推荐弹窗
*/
private
fun
showRecommendAct
(
data
:
RecoBean
?
)
{
if
(
data
==
null
||
data
.
vedio3
==
null
)
return
private
fun
showRecommendAct
()
{
//
if (data == null || data.vedio3 == null) return
if
(
AppConfig
.
enterVipAct
)
{
AppConfig
.
enterVipAct
=
false
...
...
@@ -395,11 +401,22 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
AppPreferencesManager
.
get
().
put
(
Constant
.
MAIN_FIRST_RECOMMEND
,
true
)
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
AppPreferencesManager
.
get
().
put
(
Constant
.
VEDIO_MAIN_COUNT
,
0
)
readyGo
(
RecommendBannerActivity
::
class
.
java
)
},
300
)
return
}
// 2、每3次弹出推荐剧
val
adCount
=
AppPreferencesManager
.
get
().
getInt
(
Constant
.
VEDIO_MAIN_COUNT
,
0
)
AppPreferencesManager
.
get
().
put
(
Constant
.
VEDIO_MAIN_COUNT
,
adCount
+
1
)
if
(
mainFirstRecommend
&&
adCount
>=
3
)
{
AppPreferencesManager
.
get
().
put
(
Constant
.
VEDIO_MAIN_COUNT
,
0
)
readyGo
(
RecommendBannerActivity
::
class
.
java
)
}
// // 2、用户第一次打开app未签约付费,而是看了十次广告以上的,则在下一次打开app时关闭启动付费页面后弹出推荐弹框一次
// val mainTwoRecommend =
// AppPreferencesManager.get().getBoolean(Constant.MAIN_TWO_RECOMMEND, false)
...
...
@@ -412,6 +429,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
// readyGo(RecommendActivity::class.java, bundle)
// }, 300)
// }
}
}
}
...
...
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