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
8e8ef62c
Commit
8e8ef62c
authored
Feb 01, 2024
by
mengcuiguang2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
6754791a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
19 deletions
+23
-19
RecommendFragment.kt
...java/com/duben/shortplay/ui/fragment/RecommendFragment.kt
+9
-9
ForegroundOrBackground.java
...ava/com/duben/shortplay/utils/ForegroundOrBackground.java
+1
-1
TxVideoAdapter.kt
...va/com/duben/shortplay/video/tx/adapter/TxVideoAdapter.kt
+13
-9
No files found.
video/app/src/main/java/com/duben/shortplay/ui/fragment/RecommendFragment.kt
View file @
8e8ef62c
...
...
@@ -26,7 +26,7 @@ import kotlinx.android.synthetic.main.fragment_recommend.*
*/
class
RecommendFragment
:
BaseFragment
(),
View
.
OnClickListener
{
private
var
mCurrentNewFlag
=
fals
e
private
var
mCurrentNewFlag
=
tru
e
private
var
mSelectTabIndex
=
0
private
val
tabsData
=
mutableListOf
<
String
>()
...
...
@@ -43,7 +43,7 @@ class RecommendFragment : BaseFragment(), View.OnClickListener {
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
fragment_recommend
private
fun
initVp2
()
{
mCurrentNewFlag
=
UserManager
.
getInstance
().
newFlag
//
mCurrentNewFlag = UserManager.getInstance().newFlag
fragments
.
clear
()
tabsData
.
add
(
"追剧"
)
tabsData
.
add
(
"推荐"
)
...
...
@@ -141,13 +141,13 @@ class RecommendFragment : BaseFragment(), View.OnClickListener {
override
fun
onResume
()
{
super
.
onResume
()
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_TWO
)
{
if
(
mCurrentNewFlag
!=
UserManager
.
getInstance
().
newFlag
)
{
mCurrentNewFlag
=
UserManager
.
getInstance
().
newFlag
// 重置状态
initVp2
()
}
}
//
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_TWO) {
//
if (mCurrentNewFlag != UserManager.getInstance().newFlag) {
//
mCurrentNewFlag = UserManager.getInstance().newFlag
//
// 重置状态
//
initVp2()
//
}
//
}
}
override
fun
onClick
(
v
:
View
?)
{
...
...
video/app/src/main/java/com/duben/shortplay/utils/ForegroundOrBackground.java
View file @
8e8ef62c
...
...
@@ -88,7 +88,7 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
long
diff
=
currentTimeMillis
-
activityStoppedTime
;
long
diffInSeconds
=
diff
/
1000
;
System
.
out
.
println
(
"mcg -->>>>>:: diffInSeconds="
+
diffInSeconds
+
" adSuccessStatus="
+
SplashManager
.
INSTANCE
.
isSuccessStatus
());
if
(
diffInSeconds
>=
1
0
&&
SplashManager
.
INSTANCE
.
isSuccessStatus
())
{
if
(
diffInSeconds
>=
6
0
&&
SplashManager
.
INSTANCE
.
isSuccessStatus
())
{
activity
.
startActivity
(
new
Intent
(
activity
,
SplashForeAdActivity
.
class
));
}
}
...
...
video/app/src/main/java/com/duben/shortplay/video/tx/adapter/TxVideoAdapter.kt
View file @
8e8ef62c
...
...
@@ -71,15 +71,19 @@ class TxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity, BaseViewH
Glide
.
with
(
context
).
load
(
vedioBean
?.
coverImage
)
.
into
(
holder
.
getView
(
R
.
id
.
iv_bg
))
val
vipBtn
=
holder
.
getView
<
View
>(
R
.
id
.
vip
)
if
(
UserManager
.
getInstance
().
newFlag
)
{
// 匹配
vipBtn
.
visibility
=
View
.
VISIBLE
vipBtn
.
setOnClickListener
{
mOnCustomChildClickListener
?.
onCustomChildClick
(
it
,
holder
.
adapterPosition
)
}
}
else
{
// 未匹配
vipBtn
.
visibility
=
View
.
GONE
// if (UserManager.getInstance().newFlag) {
// // 匹配
// vipBtn.visibility = View.VISIBLE
// vipBtn.setOnClickListener {
// mOnCustomChildClickListener?.onCustomChildClick(it, holder.adapterPosition)
// }
// } else {
// // 未匹配
// vipBtn.visibility = View.GONE
// }
vipBtn
.
visibility
=
View
.
VISIBLE
vipBtn
.
setOnClickListener
{
mOnCustomChildClickListener
?.
onCustomChildClick
(
it
,
holder
.
adapterPosition
)
}
val
adBtn
=
holder
.
getView
<
View
>(
R
.
id
.
unlock
)
...
...
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