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
8bdfa54c
Commit
8bdfa54c
authored
Oct 18, 2024
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
446cfee7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
160 additions
and
32 deletions
+160
-32
build.gradle
video/app/build.gradle
+2
-2
VipActivity.kt
...java/com/duben/miaoquplayletu/ui/activitys/VipActivity.kt
+8
-0
MainFragment.kt
...java/com/duben/miaoquplayletu/ui/fragment/MainFragment.kt
+139
-30
fragment_main.xml
video/app/src/main/res/layout/fragment_main.xml
+11
-0
No files found.
video/app/build.gradle
View file @
8bdfa54c
...
@@ -10,8 +10,8 @@ android {
...
@@ -10,8 +10,8 @@ android {
applicationId
"com.duben.miaoquplayletu"
applicationId
"com.duben.miaoquplayletu"
minSdkVersion
rootProject
.
ext
.
androidMinSdkVersion
minSdkVersion
rootProject
.
ext
.
androidMinSdkVersion
targetSdkVersion
rootProject
.
ext
.
androidTargetSdkVersion
targetSdkVersion
rootProject
.
ext
.
androidTargetSdkVersion
versionCode
72
1
versionCode
72
2
versionName
"7.2.
1
"
versionName
"7.2.
2
"
flavorDimensions
"default"
flavorDimensions
"default"
// dex突破65535的限制
// dex突破65535的限制
...
...
video/app/src/main/java/com/duben/miaoquplayletu/ui/activitys/VipActivity.kt
View file @
8bdfa54c
...
@@ -3,6 +3,7 @@ package com.duben.miaoquplayletu.ui.activitys
...
@@ -3,6 +3,7 @@ package com.duben.miaoquplayletu.ui.activitys
import
android.animation.ValueAnimator
import
android.animation.ValueAnimator
import
android.app.Dialog
import
android.app.Dialog
import
android.content.Intent
import
android.content.Intent
import
android.graphics.Color
import
android.net.Uri
import
android.net.Uri
import
android.os.Bundle
import
android.os.Bundle
import
android.os.Handler
import
android.os.Handler
...
@@ -207,6 +208,13 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
...
@@ -207,6 +208,13 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
if
(!
TextUtils
.
isEmpty
(
bean
.
remarks
))
{
if
(!
TextUtils
.
isEmpty
(
bean
.
remarks
))
{
tv_vip_hint
.
text
=
bean
.
remarks
tv_vip_hint
.
text
=
bean
.
remarks
tv_vip_hint
.
visibility
=
View
.
VISIBLE
tv_vip_hint
.
visibility
=
View
.
VISIBLE
if
(
bean
.
isShowCycTips
)
{
tv_vip_hint
.
setTextColor
(
Color
.
parseColor
(
"#FFAC5E"
))
tv_vip_hint
.
textSize
=
12f
}
else
{
tv_vip_hint
.
setTextColor
(
Color
.
parseColor
(
"#97ffffff"
))
tv_vip_hint
.
textSize
=
10f
}
}
else
{
}
else
{
tv_vip_hint
.
visibility
=
View
.
INVISIBLE
tv_vip_hint
.
visibility
=
View
.
INVISIBLE
}
}
...
...
video/app/src/main/java/com/duben/miaoquplayletu/ui/fragment/MainFragment.kt
View file @
8bdfa54c
package
com.duben.miaoquplayletu.ui.fragment
package
com.duben.miaoquplayletu.ui.fragment
import
android.app.Dialog
import
android.content.Intent
import
android.net.Uri
import
android.os.Bundle
import
android.os.Bundle
import
android.os.Handler
import
android.os.Handler
import
android.os.Looper
import
android.os.Looper
...
@@ -11,6 +14,8 @@ import androidx.core.content.ContextCompat
...
@@ -11,6 +14,8 @@ import androidx.core.content.ContextCompat
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
androidx.recyclerview.widget.RecyclerView
import
androidx.viewpager2.widget.ViewPager2
import
androidx.viewpager2.widget.ViewPager2
import
com.duben.library.net.neterror.BaseSubscriber
import
com.duben.library.net.neterror.Throwable
import
com.google.android.material.tabs.TabLayout
import
com.google.android.material.tabs.TabLayout
import
com.google.android.material.tabs.TabLayoutMediator
import
com.google.android.material.tabs.TabLayoutMediator
import
com.scwang.smartrefresh.layout.api.RefreshLayout
import
com.scwang.smartrefresh.layout.api.RefreshLayout
...
@@ -35,8 +40,16 @@ import com.duben.miaoquplayletu.utils.SpanUtils
...
@@ -35,8 +40,16 @@ import com.duben.miaoquplayletu.utils.SpanUtils
import
com.duben.library.utils.GlideUtils
import
com.duben.library.utils.GlideUtils
import
com.duben.library.utils.json.JsonUtil
import
com.duben.library.utils.json.JsonUtil
import
com.duben.library.utils.nodoubleclick.AntiShake
import
com.duben.library.utils.nodoubleclick.AntiShake
import
com.duben.miaoquplayletu.MintsApplication
import
com.duben.miaoquplayletu.manager.AppHttpManager
import
com.duben.miaoquplayletu.ui.activitys.*
import
com.duben.miaoquplayletu.ui.activitys.*
import
com.duben.miaoquplayletu.ui.widgets.DialogListener
import
com.duben.miaoquplayletu.ui.widgets.DialogUtils
import
com.duben.miaoquplayletu.utils.ToastUtil
import
com.google.gson.JsonObject
import
kotlinx.android.synthetic.main.activity_order_record.*
import
kotlinx.android.synthetic.main.fragment_main.*
import
kotlinx.android.synthetic.main.fragment_main.*
import
kotlinx.android.synthetic.main.header_layout.*
import
java.lang.reflect.Field
import
java.lang.reflect.Field
import
java.util.*
import
java.util.*
import
kotlin.concurrent.schedule
import
kotlin.concurrent.schedule
...
@@ -58,6 +71,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
...
@@ -58,6 +71,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
private
var
vpAdapter
:
HomeVideoPageAdapter
?
=
null
private
var
vpAdapter
:
HomeVideoPageAdapter
?
=
null
private
var
topAdapter
:
TopAdapter
?
=
null
private
var
topAdapter
:
TopAdapter
?
=
null
private
var
recommendVedioBean
:
RecoBean
?
=
null
private
var
recommendVedioBean
:
RecoBean
?
=
null
private
var
mAgreementDTO
:
OrderRecordBean
.
AgreementDTO
?
=
null
private
val
homePresenter
by
lazy
{
HomePresenter
()
}
private
val
homePresenter
by
lazy
{
HomePresenter
()
}
...
@@ -135,13 +149,30 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
...
@@ -135,13 +149,30 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
homePresenter
.
topTabs
()
homePresenter
.
topTabs
()
homePresenter
.
orders
()
homePresenter
.
orders
()
TrackManager
.
getInstance
().
getMyInfo
()
TrackManager
.
getInstance
().
getMyInfo
()
getData
()
// showRecommendAct()
// showRecommendAct()
}
}
AppConfig
.
showVipAdDialog
=
false
AppConfig
.
showVipAdDialog
=
false
}
}
}
}
private
fun
getData
()
{
AppHttpManager
.
getInstance
(
baseApplication
)
.
call
(
baseApplication
.
loanService
.
cashOutRecords
,
object
:
BaseSubscriber
<
BaseResponse
<
OrderRecordBean
>>()
{
override
fun
onError
(
e
:
Throwable
)
{
}
override
fun
onNext
(
t
:
BaseResponse
<
OrderRecordBean
>)
{
if
(
t
.
status
==
200
)
{
mAgreementDTO
=
t
.
data
.
agreement
}
}
})
}
override
fun
onFragmentPause
()
{
override
fun
onFragmentPause
()
{
banner
?.
stop
()
banner
?.
stop
()
}
}
...
@@ -152,6 +183,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
...
@@ -152,6 +183,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
tv_main_watching_goto
.
setOnClickListener
(
this
)
tv_main_watching_goto
.
setOnClickListener
(
this
)
ll_lucky
.
setOnClickListener
(
this
)
ll_lucky
.
setOnClickListener
(
this
)
iv_kefu_main
.
setOnClickListener
(
this
)
iv_kefu_main
.
setOnClickListener
(
this
)
iv_sign_main
.
setOnClickListener
(
this
)
}
}
override
fun
onClick
(
v
:
View
?)
{
override
fun
onClick
(
v
:
View
?)
{
...
@@ -174,9 +206,80 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
...
@@ -174,9 +206,80 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
R
.
id
.
iv_kefu_main
->
{
R
.
id
.
iv_kefu_main
->
{
(
requireActivity
()
as
MainActivity
).
backPhoneDialog
()
(
requireActivity
()
as
MainActivity
).
backPhoneDialog
()
}
}
R
.
id
.
iv_sign_main
->
{
if
(
mAgreementDTO
==
null
)
{
showToast
(
"暂未开通自动续费"
)
}
else
{
signDialog
()
}
}
}
}
}
}
private
fun
signDialog
()
{
DialogUtils
.
showDialog
(
requireActivity
(),
SpanUtils
()
.
append
(
"是否要取消签约?"
)
.
setForegroundColor
(
ContextCompat
.
getColor
(
requireContext
(),
R
.
color
.
tv_message_recente_money
)
)
.
create
(),
"提示"
,
"确定"
,
object
:
DialogListener
()
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
?)
{
dialog
?.
dismiss
()
unSign
()
}
},
"返回"
,
object
:
DialogListener
()
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
?)
{
dialog
?.
dismiss
()
}
})
}
private
fun
unSign
()
{
AppHttpManager
.
getInstance
(
baseApplication
)
.
call
(
baseApplication
.
loanService
.
unSign
(),
object
:
BaseSubscriber
<
BaseResponse
<
JsonObject
>>()
{
override
fun
onError
(
e
:
Throwable
)
{}
override
fun
onNext
(
t
:
BaseResponse
<
JsonObject
>)
{
if
(
t
.
status
==
200
)
{
kefuAccount
()
}
}
})
}
private
fun
kefuAccount
()
{
DialogUtils
.
showDialog
(
requireActivity
(),
SpanUtils
()
.
append
(
"如有问题请联系客服\n"
+
"4000969950"
)
.
setForegroundColor
(
ContextCompat
.
getColor
(
requireContext
(),
R
.
color
.
tv_message_recente_money
))
.
create
(),
"提示"
,
"确定"
,
object
:
DialogListener
()
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
?)
{
dialog
?.
dismiss
()
val
intent
=
Intent
(
Intent
.
ACTION_DIAL
)
intent
.
data
=
Uri
.
parse
(
"tel:"
+
"4000969950"
)
requireContext
().
startActivity
(
intent
)
}
})
}
private
fun
loadData
()
{
private
fun
loadData
()
{
Timer
().
schedule
(
200
)
{
Timer
().
schedule
(
200
)
{
...
@@ -195,6 +298,12 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
...
@@ -195,6 +298,12 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
iv_kefu_main
,
iv_kefu_main
,
1
1
)
)
GlideUtils
.
loadImageViewGifForCenterCrop
(
it
,
"https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/ic_main_nosign.png"
,
iv_sign_main
,
1
)
}
}
}
}
...
@@ -208,8 +317,8 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
...
@@ -208,8 +317,8 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
override
fun
onItemClick
(
position
:
Int
)
{
override
fun
onItemClick
(
position
:
Int
)
{
if
(
topList
.
size
>
0
)
{
if
(
topList
.
size
>
0
)
{
LocalVedioManager
.
startVedioDetailActivityForType
(
LocalVedioManager
.
startVedioDetailActivityForType
(
requireActivity
(),
requireActivity
(),
topList
[
position
]
topList
[
position
]
)
)
}
}
}
}
...
@@ -278,9 +387,9 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
...
@@ -278,9 +387,9 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
val
cacheVedio
=
LocalVedioManager
.
getCacheVedio
()
val
cacheVedio
=
LocalVedioManager
.
getCacheVedio
()
if
(
cacheVedio
!=
null
)
{
if
(
cacheVedio
!=
null
)
{
GlideUtils
.
loadImageViewGifForCenterCrop
(
GlideUtils
.
loadImageViewGifForCenterCrop
(
requireContext
(),
requireContext
(),
cacheVedio
.
coverImage
,
cacheVedio
.
coverImage
,
iv_main_watching_pic
iv_main_watching_pic
)
)
tv_main_watching_name
.
text
=
cacheVedio
.
title
tv_main_watching_name
.
text
=
cacheVedio
.
title
tv_main_watching_text1
.
text
=
"上次观看至第${cacheVedio.seeIndex}集"
tv_main_watching_text1
.
text
=
"上次观看至第${cacheVedio.seeIndex}集"
...
@@ -317,22 +426,22 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
...
@@ -317,22 +426,22 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
}
}
banner
.
addBannerLifecycleObserver
(
this
)
banner
.
addBannerLifecycleObserver
(
this
)
.
setAdapter
(
ImageTitleAdapter
(
bannerList
))
.
setAdapter
(
ImageTitleAdapter
(
bannerList
))
.
setOnBannerListener
{
data2
,
position
->
.
setOnBannerListener
{
data2
,
position
->
val
banner
=
data
.
list
.
get
(
position
)
val
banner
=
data
.
list
.
get
(
position
)
if
(
banner
.
createType
==
4
)
{
if
(
banner
.
createType
==
4
)
{
// 九宫格
// 九宫格
val
bundle
=
Bundle
()
val
bundle
=
Bundle
()
bundle
.
putBoolean
(
NineActivity
.
IS_AD_SHOW
,
true
)
bundle
.
putBoolean
(
NineActivity
.
IS_AD_SHOW
,
true
)
readyGo
(
NineActivity
::
class
.
java
,
bundle
)
readyGo
(
NineActivity
::
class
.
java
,
bundle
)
}
else
{
}
else
{
LocalVedioManager
.
startVedioDetailActivityForType
(
LocalVedioManager
.
startVedioDetailActivityForType
(
requireActivity
(),
requireActivity
(),
banner
banner
)
)
}
}
}
}
}
}
}
}
...
@@ -380,16 +489,16 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
...
@@ -380,16 +489,16 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
val
need
=
data
.
need
val
need
=
data
.
need
if
(
complete
>=
need
)
{
if
(
complete
>=
need
)
{
tv_lucky_status
.
text
=
SpanUtils
()
tv_lucky_status
.
text
=
SpanUtils
()
.
append
(
"可领取"
)
.
append
(
"可领取"
)
.
setForegroundColor
(
resources
.
getColor
(
R
.
color
.
apk_uninstalled
))
.
setForegroundColor
(
resources
.
getColor
(
R
.
color
.
apk_uninstalled
))
.
create
()
.
create
()
}
else
{
}
else
{
tv_lucky_status
.
text
=
SpanUtils
()
tv_lucky_status
.
text
=
SpanUtils
()
.
append
(
complete
.
toString
())
.
append
(
complete
.
toString
())
.
setForegroundColor
(
resources
.
getColor
(
R
.
color
.
red
))
.
setForegroundColor
(
resources
.
getColor
(
R
.
color
.
red
))
.
append
(
"/"
)
.
append
(
"/"
)
.
append
(
need
.
toString
())
.
append
(
need
.
toString
())
.
create
()
.
create
()
}
}
}
}
...
@@ -423,7 +532,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
...
@@ -423,7 +532,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
if
(
UserManager
.
getInstance
().
newFlag
&&
!
UserManager
.
getInstance
().
vipFlag
)
{
if
(
UserManager
.
getInstance
().
newFlag
&&
!
UserManager
.
getInstance
().
vipFlag
)
{
// 1、第一次打开app并关闭付费页进首页时出现一次
// 1、第一次打开app并关闭付费页进首页时出现一次
val
mainFirstRecommend
=
val
mainFirstRecommend
=
AppPreferencesManager
.
get
().
getBoolean
(
Constant
.
MAIN_FIRST_RECOMMEND
,
false
)
AppPreferencesManager
.
get
().
getBoolean
(
Constant
.
MAIN_FIRST_RECOMMEND
,
false
)
if
(!
mainFirstRecommend
)
{
if
(!
mainFirstRecommend
)
{
if
(
AppConfig
.
enterVipAct
)
{
if
(
AppConfig
.
enterVipAct
)
{
AppConfig
.
enterVipAct
=
false
AppConfig
.
enterVipAct
=
false
...
...
video/app/src/main/res/layout/fragment_main.xml
View file @
8bdfa54c
...
@@ -254,6 +254,17 @@
...
@@ -254,6 +254,17 @@
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
/>
app:layout_constraintEnd_toEndOf=
"parent"
/>
<ImageView
android:id=
"@+id/iv_sign_main"
android:layout_width=
"80dp"
android:layout_height=
"88dp"
android:layout_marginEnd=
"5dp"
android:layout_marginBottom=
"170dp"
android:gravity=
"center"
android:orientation=
"vertical"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
/>
<LinearLayout
<LinearLayout
android:id=
"@+id/ll_lucky"
android:id=
"@+id/ll_lucky"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
...
...
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