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
f848b5b4
Commit
f848b5b4
authored
Jul 13, 2023
by
mengcuiguang2
Browse files
Options
Browse Files
Download
Plain Diff
代码优化
parents
bc5199fc
71af70a4
Changes
77
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
77 changed files
with
1448 additions
and
487 deletions
+1448
-487
misc.xml
video/.idea/misc.xml
+10
-0
mints_wisdomclean.jks
video/app/mints_wisdomclean.jks
+0
-0
AndroidManifest.xml
video/app/src/main/AndroidManifest.xml
+6
-6
GlideUtils.kt
...o/app/src/main/java/com/mints/library/utils/GlideUtils.kt
+1
-1
AdManager.kt
...o/app/src/main/java/com/mints/wisdomclean/ad/AdManager.kt
+4
-21
TTGroMoreAdManagerHolder.java
...va/com/mints/wisdomclean/ad/TTGroMoreAdManagerHolder.java
+1
-3
InMoneyVideo.java
...ain/java/com/mints/wisdomclean/ad/video/InMoneyVideo.java
+0
-10
InMoneyVideoNoPre.java
...ava/com/mints/wisdomclean/ad/video/InMoneyVideoNoPre.java
+5
-11
Constant.kt
...pp/src/main/java/com/mints/wisdomclean/common/Constant.kt
+3
-0
LocalVedioManager.kt
...n/java/com/mints/wisdomclean/manager/LocalVedioManager.kt
+46
-5
TrackManager.java
...main/java/com/mints/wisdomclean/manager/TrackManager.java
+6
-0
VedioBean.java
.../main/java/com/mints/wisdomclean/mvp/model/VedioBean.java
+71
-3
WatchRecordBean.kt
...n/java/com/mints/wisdomclean/mvp/model/WatchRecordBean.kt
+0
-11
FollowPresenter.kt
...a/com/mints/wisdomclean/mvp/presenters/FollowPresenter.kt
+4
-6
RecommendPresenter.kt
...om/mints/wisdomclean/mvp/presenters/RecommendPresenter.kt
+38
-0
VideoPresenter.kt
...va/com/mints/wisdomclean/mvp/presenters/VideoPresenter.kt
+6
-2
WatchRecordPresenter.kt
.../mints/wisdomclean/mvp/presenters/WatchRecordPresenter.kt
+2
-2
RecommendView.kt
...ain/java/com/mints/wisdomclean/mvp/views/RecommendView.kt
+6
-0
LoanService.java
.../src/main/java/com/mints/wisdomclean/net/LoanService.java
+9
-3
MainActivity.kt
...n/java/com/mints/wisdomclean/ui/activitys/MainActivity.kt
+12
-2
MobileLoginActivity.kt
...com/mints/wisdomclean/ui/activitys/MobileLoginActivity.kt
+4
-3
SettingsActivity.kt
...va/com/mints/wisdomclean/ui/activitys/SettingsActivity.kt
+3
-2
SplashActivity.kt
...java/com/mints/wisdomclean/ui/activitys/SplashActivity.kt
+8
-7
SplashAdActivity.kt
...va/com/mints/wisdomclean/ui/activitys/SplashAdActivity.kt
+4
-2
VipActivity.kt
...in/java/com/mints/wisdomclean/ui/activitys/VipActivity.kt
+8
-3
WatchRecordActivity.kt
...com/mints/wisdomclean/ui/activitys/WatchRecordActivity.kt
+36
-16
FollowAdapter.kt
...in/java/com/mints/wisdomclean/ui/adapter/FollowAdapter.kt
+12
-3
HotStyleAdapter.kt
.../java/com/mints/wisdomclean/ui/adapter/HotStyleAdapter.kt
+1
-1
TopAdapter.kt
.../main/java/com/mints/wisdomclean/ui/adapter/TopAdapter.kt
+1
-1
VideoEpisodeAdapter.kt
...a/com/mints/wisdomclean/ui/adapter/VideoEpisodeAdapter.kt
+4
-3
WatchRecordAdapter.kt
...va/com/mints/wisdomclean/ui/adapter/WatchRecordAdapter.kt
+37
-9
FollowVideoFragment.kt
.../com/mints/wisdomclean/ui/fragment/FollowVideoFragment.kt
+35
-6
MainFragment.kt
...in/java/com/mints/wisdomclean/ui/fragment/MainFragment.kt
+26
-9
MovieFragment.kt
...n/java/com/mints/wisdomclean/ui/fragment/MovieFragment.kt
+7
-16
MyFragment.kt
...main/java/com/mints/wisdomclean/ui/fragment/MyFragment.kt
+0
-1
RecommendFragment.kt
...va/com/mints/wisdomclean/ui/fragment/RecommendFragment.kt
+35
-6
WatchVideoFragment.kt
...a/com/mints/wisdomclean/ui/fragment/WatchVideoFragment.kt
+50
-123
CycleProgress.java
.../java/com/mints/wisdomclean/ui/widgets/CycleProgress.java
+1
-1
NestedScrollableHost.kt
.../com/mints/wisdomclean/ui/widgets/NestedScrollableHost.kt
+98
-0
StickHeaderDecoration.java
...m/mints/wisdomclean/ui/widgets/StickHeaderDecoration.java
+2
-2
VideoEpisodeDialog.kt
...va/com/mints/wisdomclean/ui/widgets/VideoEpisodeDialog.kt
+15
-9
VipCountDialog.kt
...n/java/com/mints/wisdomclean/ui/widgets/VipCountDialog.kt
+82
-0
TimeHelp.java
...p/src/main/java/com/mints/wisdomclean/utils/TimeHelp.java
+78
-0
DramaApiDetailActivity.kt
...ava/com/mints/wisdomclean/video/DramaApiDetailActivity.kt
+233
-47
DramaTabFragment.kt
...main/java/com/mints/wisdomclean/video/DramaTabFragment.kt
+51
-13
DrawDramaFragment.kt
...ain/java/com/mints/wisdomclean/video/DrawDramaFragment.kt
+0
-2
RecommendVideoAdapter.kt
...java/com/mints/wisdomclean/video/RecommendVideoAdapter.kt
+18
-7
VideoActivity.kt
...rc/main/java/com/mints/wisdomclean/video/VideoActivity.kt
+75
-19
VideoAdapter.kt
...src/main/java/com/mints/wisdomclean/video/VideoAdapter.kt
+4
-1
btn_index_submit.xml
video/app/src/main/res/drawable/btn_index_submit.xml
+1
-1
btn_index_submit_unchecked.xml
.../app/src/main/res/drawable/btn_index_submit_unchecked.xml
+1
-1
rb_opinion_selected.xml
video/app/src/main/res/drawable/rb_opinion_selected.xml
+1
-1
activity_aboutus.xml
video/app/src/main/res/layout/activity_aboutus.xml
+2
-2
activity_mobile_login.xml
video/app/src/main/res/layout/activity_mobile_login.xml
+1
-1
activity_video.xml
video/app/src/main/res/layout/activity_video.xml
+2
-2
activity_watch_record.xml
video/app/src/main/res/layout/activity_watch_record.xml
+15
-15
dialog_vip_count.xml
video/app/src/main/res/layout/dialog_vip_count.xml
+42
-0
drama_activity_api_detail.xml
video/app/src/main/res/layout/drama_activity_api_detail.xml
+126
-13
fragment_follow_video.xml
video/app/src/main/res/layout/fragment_follow_video.xml
+6
-8
fragment_main.xml
video/app/src/main/res/layout/fragment_main.xml
+13
-14
fragment_main_my.xml
video/app/src/main/res/layout/fragment_main_my.xml
+5
-5
fragment_watch_video.xml
video/app/src/main/res/layout/fragment_watch_video.xml
+9
-4
item_block_view.xml
video/app/src/main/res/layout/item_block_view.xml
+3
-2
item_empty_history.xml
video/app/src/main/res/layout/item_empty_history.xml
+16
-0
item_empty_video.xml
video/app/src/main/res/layout/item_empty_video.xml
+4
-0
item_follow.xml
video/app/src/main/res/layout/item_follow.xml
+18
-10
item_hot_style.xml
video/app/src/main/res/layout/item_hot_style.xml
+1
-1
item_rv_top.xml
video/app/src/main/res/layout/item_rv_top.xml
+1
-1
item_video.xml
video/app/src/main/res/layout/item_video.xml
+3
-1
item_watch_record.xml
video/app/src/main/res/layout/item_watch_record.xml
+4
-2
web_header_layout.xml
video/app/src/main/res/layout/web_header_layout.xml
+2
-1
bg_detail_bottom.png
video/app/src/main/res/mipmap-xhdpi/bg_detail_bottom.png
+0
-0
bg_detail_top.png
video/app/src/main/res/mipmap-xhdpi/bg_detail_top.png
+0
-0
bg_vip_count.png
video/app/src/main/res/mipmap-xhdpi/bg_vip_count.png
+0
-0
bg_vip_count_circle.png
video/app/src/main/res/mipmap-xhdpi/bg_vip_count_circle.png
+0
-0
styles.xml
video/app/src/main/res/values/styles.xml
+5
-0
gradle.properties
video/gradle.properties
+9
-4
No files found.
video/.idea/misc.xml
0 → 100644
View file @
f848b5b4
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ExternalStorageConfigurationManager"
enabled=
"true"
/>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_11"
default=
"true"
project-jdk-name=
"Android Studio default JDK"
project-jdk-type=
"JavaSDK"
>
<output
url=
"file://$PROJECT_DIR$/build/classes"
/>
</component>
<component
name=
"ProjectType"
>
<option
name=
"id"
value=
"Android"
/>
</component>
</project>
\ No newline at end of file
video/app/mints_wisdomclean.jks
0 → 100644
View file @
f848b5b4
File added
video/app/src/main/AndroidManifest.xml
View file @
f848b5b4
...
...
@@ -20,7 +20,7 @@
<application
android:name=
".MintsApplication"
android:allowBackup=
"
fals
e"
android:allowBackup=
"
tru
e"
android:icon=
"@mipmap/ic_launcher_main"
android:label=
"@string/app_name"
android:largeHeap=
"true"
...
...
@@ -69,7 +69,11 @@
android:configChanges=
"orientation|screenSize|keyboardHidden"
android:exported=
"true"
android:theme=
"@style/AppTheme.TranslucentSplish"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<activity
android:name=
".ui.activitys.SplashAdActivity"
...
...
@@ -85,15 +89,11 @@
<activity
android:name=
".ui.activitys.MainActivity"
android:configChanges=
"orientation|keyboardHidden|screenSize"
android:exported=
"
tru
e"
android:exported=
"
fals
e"
android:launchMode=
"singleTask"
android:screenOrientation=
"portrait"
android:theme=
"@style/AppTheme.NoneTranslucent"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<activity
android:name=
".ui.activitys.WebActivity"
...
...
video/app/src/main/java/com/mints/library/utils/GlideUtils.kt
View file @
f848b5b4
...
...
@@ -74,7 +74,7 @@ object GlideUtils {
Glide
.
with
(
mContext
!!
).
load
(
path
).
apply
(
RequestOptions
().
transform
(
CenterCrop
(),
RoundedCorners
(
BubbleUtils
.
dp2px
(
2
0
))
RoundedCorners
(
BubbleUtils
.
dp2px
(
1
0
))
)
).
dontAnimate
().
into
(
mImageView
!!
)
}
...
...
video/app/src/main/java/com/mints/wisdomclean/ad/AdManager.kt
View file @
f848b5b4
package
com.mints.wisdomclean.ad
import
android.app.Activity
import
com.mints.wisdomclean.ad.splash.SplashManager
import
com.mints.wisdomclean.ad.video.InMoneyVideo
/**
...
...
@@ -8,8 +9,6 @@ import com.mints.wisdomclean.ad.video.InMoneyVideo
*/
class
AdManager
{
private
val
TAG
=
AdManager
::
class
.
java
.
simpleName
companion
object
{
const
val
AD_NO_SHOWTIME_OUT
=
50
// 广告请示成功但在规定时间内未展示
...
...
@@ -26,8 +25,7 @@ class AdManager {
* isPreLoad:是否是预加载调用,需要躲避监听
*/
fun
preLoadAd
(
activity
:
Activity
,
isPreLoad
:
Boolean
=
false
)
{
// 加载激励视频广告
this
.
loadRewardVideo
(
activity
,
isPreLoad
)
InMoneyVideo
.
getInstance
().
preLoadAd
(
activity
,
isPreLoad
)
}
/**
...
...
@@ -37,21 +35,6 @@ class AdManager {
activity
:
Activity
,
carrierType
:
String
,
AdStatusListener
:
AdStatusListener
?,
)
{
// 加载激励视频广告
showRewardVideo
(
activity
,
AdStatusListener
,
carrierType
)
}
// 预加载激励视频广告
private
fun
loadRewardVideo
(
activity
:
Activity
,
isPreLoad
:
Boolean
=
false
)
{
InMoneyVideo
.
getInstance
().
preLoadAd
(
activity
,
isPreLoad
)
}
// 展示激励视频广告
private
fun
showRewardVideo
(
activity
:
Activity
,
AdStatusListener
:
AdStatusListener
?,
carrierType
:
String
,
)
{
InMoneyVideo
.
getInstance
()
.
showRewardAd
(
...
...
@@ -61,12 +44,12 @@ class AdManager {
)
}
/**
* 开屏页使用-预加载广告
*/
fun
splashPreLoadAll
(
activity
:
Activity
)
{
this
.
loadRewardVideo
(
activity
)
SplashManager
.
preLoadAd
(
activity
)
this
.
preLoadAd
(
activity
)
}
}
\ No newline at end of file
video/app/src/main/java/com/mints/wisdomclean/ad/TTGroMoreAdManagerHolder.java
View file @
f848b5b4
...
...
@@ -19,6 +19,7 @@ import com.mints.wisdomclean.video.DPHolderManager;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.logging.Handler
;
/**
* 穿山甲广告
...
...
@@ -46,9 +47,6 @@ public class TTGroMoreAdManagerHolder {
if
(!
sInit
)
{
GMMediationAdSdk
.
initialize
(
context
,
buildV2Config
(
context
));
sInit
=
true
;
// 初始化短剧SDK
DPHolderManager
.
INSTANCE
.
initDpSdk
(
context
);
}
}
...
...
video/app/src/main/java/com/mints/wisdomclean/ad/video/InMoneyVideo.java
View file @
f848b5b4
...
...
@@ -226,14 +226,11 @@ public class InMoneyVideo {
public
void
onRewardedAdShow
()
{
if
(
mttRewardAd
!=
null
)
{
if
(
mttRewardAd
.
getShowEcpm
()
!=
null
)
{
nowAdcode
=
mttRewardAd
.
getShowEcpm
().
getAdNetworkRitId
();
nowEcpm
=
mttRewardAd
.
getShowEcpm
().
getPreEcpm
();
nowAdSource
=
mttRewardAd
.
getShowEcpm
().
getAdNetworkPlatformName
();
}
}
LogUtil
.
d
(
TAG
,
"gromore应用内激励视频广告-->onRewardedAdShow"
);
...
...
@@ -310,13 +307,6 @@ public class InMoneyVideo {
* 激励视频播放完毕,验证是否有效发放奖励的回调
*/
public
void
onRewardVerify
(
RewardItem
rewardItem
)
{
// Map<String, Object> customData = rewardItem.getCustomData();
// if (customData != null) {
// String adnName = (String) customData.get(RewardItem.KEY_ADN_NAME);
// if (RewardItem.KEY_GDT.equals(adnName)) {
// LogUtil.d(TAG, "rewardItem gdt: " + customData.get(RewardItem.KEY_GDT_TRANS_ID));
// }
// }
}
/**
...
...
video/app/src/main/java/com/mints/wisdomclean/ad/video/InMoneyVideoNoPre.java
View file @
f848b5b4
...
...
@@ -14,6 +14,7 @@ import com.bytedance.msdk.api.v2.slot.GMAdOptionUtil;
import
com.bytedance.msdk.api.v2.slot.GMAdSlotRewardVideo
;
import
com.mints.library.utils.json.JsonUtil
;
import
com.mints.wisdomclean.BuildConfig
;
import
com.mints.wisdomclean.ad.AdManager
;
import
com.mints.wisdomclean.ad.AdStatusListener
;
import
com.mints.wisdomclean.manager.UserManager
;
import
com.mints.wisdomclean.utils.LogUtil
;
...
...
@@ -166,10 +167,10 @@ public class InMoneyVideoNoPre {
LogUtil
.
d
(
TAG
,
"InMoneyVideoNoPre应用内激励视频广告-->onRewardedAdShow"
);
// 预加载
//
if (weakActivity.get() != null) {
//
LogUtil.d(TAG, "InMoneyVideoNoPre应用内激励视频广告->onFullVideoAdShow 触发预加载下次广告");
//
AdManager.Companion.getInstance().preLoadAd(weakActivity.get(),true);
//
}
if
(
weakActivity
.
get
()
!=
null
)
{
LogUtil
.
d
(
TAG
,
"InMoneyVideoNoPre应用内激励视频广告->onFullVideoAdShow 触发预加载下次广告"
);
AdManager
.
Companion
.
getInstance
().
preLoadAd
(
weakActivity
.
get
(),
true
);
}
}
@Override
...
...
@@ -231,13 +232,6 @@ public class InMoneyVideoNoPre {
* 激励视频播放完毕,验证是否有效发放奖励的回调
*/
public
void
onRewardVerify
(
RewardItem
rewardItem
)
{
// Map<String, Object> customData = rewardItem.getCustomData();
// if (customData != null) {
// String adnName = (String) customData.get(RewardItem.KEY_ADN_NAME);
// if (RewardItem.KEY_GDT.equals(adnName)) {
// LogUtil.d(TAG, "rewardItem gdt: " + customData.get(RewardItem.KEY_GDT_TRANS_ID));
// }
// }
}
/**
...
...
video/app/src/main/java/com/mints/wisdomclean/common/Constant.kt
View file @
f848b5b4
...
...
@@ -5,6 +5,8 @@ object Constant {
const
val
PAGE_SIZE
=
12
const
val
LOCAL_VEDIO
=
"LOCAL_VEDIO"
const
val
VEDIO_BEAN
=
"VEDIO_BEAN"
const
val
VEDIO_NEXT
=
"VEDIO_NEXT"
const
val
VEDIO_THIRD
=
"VEDIO_THIRD"
/**
* 首次弹出权限声明
...
...
@@ -12,6 +14,7 @@ object Constant {
const
val
LOAN_PERMISSION_FLAG
=
"loan_permission_flag"
const
val
FIRST_SPLASH
=
"first_splash"
const
val
IS_FIRST_AGREE_BTN
=
"is_first_agree_btn"
const
val
IS_FIRST_VIP_BTN
=
"is_first_agree_btn"
const
val
TAG_NAME
=
"SUN"
const
val
MINTS_APP_NAME
=
"河狸短视频"
const
val
MINTS_PKG_NAME
=
"com.mints.wisdomclean"
...
...
video/app/src/main/java/com/mints/wisdomclean/manager/LocalVedioManager.kt
View file @
f848b5b4
...
...
@@ -4,10 +4,14 @@ import android.app.Activity
import
android.content.Intent
import
android.os.Bundle
import
android.text.TextUtils
import
com.bytedance.sdk.dp.DPDrama
import
com.bytedance.sdk.dp.DPSdk
import
com.bytedance.sdk.dp.IDPWidgetFactory
import
com.mints.library.utils.json.JsonUtil
import
com.mints.wisdomclean.common.Constant
import
com.mints.wisdomclean.mvp.model.VedioBean
import
com.mints.wisdomclean.utils.AppPreferencesManager
import
com.mints.wisdomclean.utils.ToastUtil
import
com.mints.wisdomclean.video.DramaApiDetailActivity
import
com.mints.wisdomclean.video.VideoActivity
...
...
@@ -78,16 +82,53 @@ object LocalVedioManager {
/**
* 根据类型跳转对应视频详情页 [自有或穿山甲]
*/
fun
startVedioDetailActivityForType
(
activity
:
Activity
,
data
:
VedioBean
?)
{
val
bundle
=
Bundle
()
bundle
.
putString
(
Constant
.
VEDIO_BEAN
,
JsonUtil
.
toJson
(
data
))
fun
startVedioDetailActivityForType
(
activity
:
Activity
,
data
:
VedioBean
?,
isPlayNext
:
Boolean
=
false
,
isThirdId
:
Boolean
=
false
)
{
if
(
data
?.
createType
==
1
)
{
//自有短剧
val
bundle
=
Bundle
()
bundle
.
putString
(
Constant
.
VEDIO_BEAN
,
JsonUtil
.
toJson
(
data
))
bundle
.
putBoolean
(
Constant
.
VEDIO_NEXT
,
isPlayNext
)
bundle
.
putBoolean
(
Constant
.
VEDIO_THIRD
,
isThirdId
)
readyGo
(
activity
,
VideoActivity
::
class
.
java
,
bundle
)
}
else
{
requestDrama
(
activity
,
data
)
}
}
// 请求穿山甲数据
private
fun
requestDrama
(
activity
:
Activity
,
data
:
VedioBean
?)
{
if
(
DPSdk
.
isStartSuccess
()
&&
data
!=
null
)
{
DPSdk
.
factory
().
requestDrama
(
arrayListOf
(
data
.
thirdId
.
toLong
()),
object
:
IDPWidgetFactory
.
DramaCallback
{
override
fun
onError
(
p0
:
Int
,
p1
:
String
?)
{
ToastUtil
.
show
(
activity
,
"网络错误!"
)
}
override
fun
onSuccess
(
dataList
:
MutableList
<
out
DPDrama
>?,
info
:
MutableMap
<
String
,
Any
>?
)
{
dataList
?.
takeIf
{
it
.
isNotEmpty
()
}
?.
first
()
?.
let
{
DramaApiDetailActivity
.
outerDrama
=
it
//穿山甲短剧
val
bundle
=
Bundle
()
bundle
.
putString
(
Constant
.
VEDIO_BEAN
,
JsonUtil
.
toJson
(
data
))
readyGo
(
activity
,
DramaApiDetailActivity
::
class
.
java
,
bundle
)
}
}
}
)
}
else
{
ToastUtil
.
show
(
activity
,
"网络错误!"
)
}
}
fun
readyGo
(
activity
:
Activity
,
clazz
:
Class
<
*
>,
bundle
:
Bundle
)
{
...
...
video/app/src/main/java/com/mints/wisdomclean/manager/TrackManager.java
View file @
f848b5b4
...
...
@@ -49,8 +49,14 @@ public class TrackManager {
HashMap
<
String
,
Object
>
vo
=
new
HashMap
<>();
vo
.
put
(
"vedioIndex"
,
data
.
getSeeIndex
());
vo
.
put
(
"vedioId"
,
data
.
getVedioId
());
vo
.
put
(
"thirdId"
,
data
.
getThirdId
());
trackPresenter
.
commitVedio
(
vo
);
}
}
public
void
getMyInfo
()
{
if
(
trackPresenter
!=
null
)
{
trackPresenter
.
getMyInfo
();
}
}
}
video/app/src/main/java/com/mints/wisdomclean/mvp/model/VedioBean.java
View file @
f848b5b4
...
...
@@ -21,7 +21,75 @@ public class VedioBean implements Serializable {
private
String
scriptName
;
private
String
scriptAuthor
;
private
int
vedioId
;
// 视频id,服务器标识
private
int
hot
;
// 播放量
private
String
hot
;
// 收藏量
private
String
showNum
;
// 播放量
private
int
adGiveVedioNum
;
// 广告解锁数量
private
String
recommendUrl
;
// 推荐视频地址
private
int
recommendIndex
;
// 推荐视频第几集
private
long
seeUpdateTime
;
// 时间戳
private
boolean
checked
;
// 选中
private
int
tipMaxIndex
;
// 倒计时弹框
public
String
getShowNum
()
{
return
showNum
;
}
public
void
setShowNum
(
String
showNum
)
{
this
.
showNum
=
showNum
;
}
public
int
getTipMaxIndex
()
{
return
tipMaxIndex
;
}
public
void
setTipMaxIndex
(
int
tipMaxIndex
)
{
this
.
tipMaxIndex
=
tipMaxIndex
;
}
public
boolean
isChecked
()
{
return
checked
;
}
public
void
setChecked
(
boolean
checked
)
{
this
.
checked
=
checked
;
}
public
long
getSeeUpdateTime
()
{
return
seeUpdateTime
;
}
public
void
setSeeUpdateTime
(
long
seeUpdateTime
)
{
this
.
seeUpdateTime
=
seeUpdateTime
;
}
public
String
getRecommendUrl
()
{
return
recommendUrl
;
}
public
void
setRecommendUrl
(
String
recommendUrl
)
{
this
.
recommendUrl
=
recommendUrl
;
}
public
int
getRecommendIndex
()
{
return
recommendIndex
;
}
public
void
setRecommendIndex
(
int
recommendIndex
)
{
this
.
recommendIndex
=
recommendIndex
;
}
public
int
getAdGiveVedioNum
()
{
return
adGiveVedioNum
;
}
public
void
setAdGiveVedioNum
(
int
adGiveVedioNum
)
{
this
.
adGiveVedioNum
=
adGiveVedioNum
;
}
public
void
setHot
(
String
hot
)
{
this
.
hot
=
hot
;
}
public
String
getThirdId
()
{
return
thirdId
;
}
...
...
@@ -150,11 +218,11 @@ public class VedioBean implements Serializable {
this
.
collect
=
collect
;
}
public
int
getHot
()
{
public
String
getHot
()
{
return
hot
;
}
public
void
setHot
(
int
hot
)
{
public
void
String
(
String
hot
)
{
this
.
hot
=
hot
;
}
}
video/app/src/main/java/com/mints/wisdomclean/mvp/model/WatchRecordBean.kt
deleted
100644 → 0
View file @
bc5199fc
package
com.mints.wisdomclean.mvp.model
import
android.os.Parcelable
import
kotlinx.android.parcel.Parcelize
@Parcelize
data class
WatchRecordBean
(
var
name
:
String
=
""
,
var
group
:
String
=
""
,
var
collect
:
Boolean
=
false
,
)
:
Parcelable
,
java
.
io
.
Serializable
\ No newline at end of file
video/app/src/main/java/com/mints/wisdomclean/mvp/presenters/FollowPresenter.kt
View file @
f848b5b4
...
...
@@ -11,11 +11,9 @@ import java.util.HashMap
class
FollowPresenter
:
BasePresenter
<
FollowView
>()
{
fun
getCollectList
(
videoId
:
String
)
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"videoId"
]
=
videoId
fun
getCollectList
()
{
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
collectList
(
vo
),
.
call
(
loanService
.
collectList
(),
object
:
BaseSubscriber
<
BaseResponse
<
BannerList
>>()
{
override
fun
onCompleted
()
{
if
(
isLinkView
)
return
...
...
@@ -50,9 +48,9 @@ class FollowPresenter : BasePresenter<FollowView>() {
}
fun
cancelCollect
(
videoId
:
String
)
{
fun
cancelCollect
(
videoId
:
List
<
String
>
)
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"
videoId
"
]
=
videoId
vo
[
"
list
"
]
=
videoId
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
cancelCollect
(
vo
),
...
...
video/app/src/main/java/com/mints/wisdomclean/mvp/presenters/RecommendPresenter.kt
View file @
f848b5b4
...
...
@@ -4,12 +4,50 @@ import com.google.gson.JsonObject
import
com.mints.library.net.neterror.BaseSubscriber
import
com.mints.library.net.neterror.Throwable
import
com.mints.wisdomclean.manager.AppHttpManager
import
com.mints.wisdomclean.mvp.model.BannerList
import
com.mints.wisdomclean.mvp.model.BaseResponse
import
com.mints.wisdomclean.mvp.views.RecommendView
import
java.util.HashMap
class
RecommendPresenter
:
BasePresenter
<
RecommendView
>()
{
fun
autoList
()
{
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
autoList
(),
object
:
BaseSubscriber
<
BaseResponse
<
BannerList
>>()
{
override
fun
onCompleted
()
{
if
(
isLinkView
)
return
view
.
hideLoading
()
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
BannerList
>)
{
if
(
isLinkView
)
return
view
.
hideLoading
()
val
code
=
baseResponse
.
status
val
message
=
baseResponse
.
message
when
(
code
)
{
200
->
view
.
autoListSuc
(
baseResponse
.
data
)
else
->
{
view
.
autoListFail
()
view
.
showToast
(
message
)
}
}
}
override
fun
onError
(
e
:
Throwable
?)
{
if
(
isLinkView
)
return
view
.
hideLoading
()
view
.
showToast
(
e
?.
message
)
view
.
autoListFail
()
}
})
}
fun
collect
(
videoId
:
String
)
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"videoId"
]
=
videoId
...
...
video/app/src/main/java/com/mints/wisdomclean/mvp/presenters/VideoPresenter.kt
View file @
f848b5b4
...
...
@@ -11,9 +11,13 @@ import java.util.HashMap
class
VideoPresenter
:
BasePresenter
<
VideoView
>()
{
fun
getIndexList
(
videoId
:
String
)
{
fun
getIndexList
(
thirdId
:
String
,
csj
:
Boolean
=
false
)
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"vedioId"
]
=
videoId
if
(
csj
)
{
vo
[
"thirdId"
]
=
thirdId
}
else
{
vo
[
"vedioId"
]
=
thirdId
}
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
getIndexList
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
IndexList
>>()
{
...
...
video/app/src/main/java/com/mints/wisdomclean/mvp/presenters/WatchRecordPresenter.kt
View file @
f848b5b4
...
...
@@ -49,7 +49,7 @@ class WatchRecordPresenter : BasePresenter<WatchRecordView>() {
fun
collect
(
videoId
:
String
)
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"v
ide
oId"
]
=
videoId
vo
[
"v
edi
oId"
]
=
videoId
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
collect
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
JsonObject
>>()
{
override
fun
onCompleted
()
{
...
...
@@ -87,7 +87,7 @@ class WatchRecordPresenter : BasePresenter<WatchRecordView>() {
fun
cancelCollect
(
videoId
:
String
)
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"v
ide
oId"
]
=
videoId
vo
[
"v
edi
oId"
]
=
videoId
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
cancelCollect
(
vo
),
...
...
video/app/src/main/java/com/mints/wisdomclean/mvp/views/RecommendView.kt
View file @
f848b5b4
package
com.mints.wisdomclean.mvp.views
import
com.mints.wisdomclean.mvp.model.BannerList
interface
RecommendView
:
BaseView
{
...
...
@@ -9,4 +11,8 @@ interface RecommendView : BaseView {
fun
cancelCollectSuc
()
fun
cancelCollectFail
()
fun
autoListSuc
(
list
:
BannerList
)
fun
autoListFail
()
}
\ No newline at end of file
video/app/src/main/java/com/mints/wisdomclean/net/LoanService.java
View file @
f848b5b4
...
...
@@ -174,7 +174,7 @@ public interface LoanService {
*
* @return
*/
@POST
(
"api/feedback"
)
@POST
(
"api/
vedio/
feedback"
)
Observable
<
BaseResponse
<
Object
>>
feedback
(
@Body
Map
<
String
,
Object
>
vo
);
/**
...
...
@@ -232,7 +232,7 @@ public interface LoanService {
* @return
*/
@POST
(
"api/vedio/collectList"
)
Observable
<
BaseResponse
<
BannerList
>>
collectList
(
@Body
Map
<
String
,
Object
>
vo
);
Observable
<
BaseResponse
<
BannerList
>>
collectList
();
/**
* 最新一条记录
...
...
@@ -248,7 +248,7 @@ public interface LoanService {
* @return
*/
@POST
(
"api/vedio/history"
)
Observable
<
BaseResponse
<
Objec
t
>>
history
();
Observable
<
BaseResponse
<
BannerLis
t
>>
history
();
/**
* 提交视频信息
...
...
@@ -256,6 +256,12 @@ public interface LoanService {
@POST
(
"api/vedio/reportIndex"
)
Observable
<
BaseResponse
<
Object
>>
reportIndex
(
@Body
Map
<
String
,
Object
>
vo
);
/**
* 推荐
*/
@POST
(
"api/vedio/autoList"
)
Observable
<
BaseResponse
<
BannerList
>>
autoList
();
/**
* 默认http工厂
*/
...
...
video/app/src/main/java/com/mints/wisdomclean/ui/activitys/MainActivity.kt
View file @
f848b5b4
...
...
@@ -27,6 +27,7 @@ import com.mints.wisdomclean.ui.fragment.MyFragment
import
com.mints.wisdomclean.ui.fragment.RecommendFragment
import
com.mints.wisdomclean.ui.widgets.DialogListener
import
com.mints.wisdomclean.ui.widgets.PhoneDialog
import
com.mints.wisdomclean.video.DPHolderManager
import
kotlinx.android.synthetic.main.activity_main.*
/**
...
...
@@ -65,7 +66,7 @@ class MainActivity : BaseActivity(), View.OnClickListener {
tabIvRecommend
=
findViewById
(
R
.
id
.
tab_iv_recommend
)
tabIvMy
=
findViewById
(
R
.
id
.
tab_iv_my
)
findViewById
<
View
>(
R
.
id
.
tab_rl_loan
).
setOnClickListener
(
this
)
findViewById
<
View
>(
R
.
id
.
tab_
iv
_recommend
).
setOnClickListener
(
this
)
findViewById
<
View
>(
R
.
id
.
tab_
rl
_recommend
).
setOnClickListener
(
this
)
findViewById
<
View
>(
R
.
id
.
tab_rl_my
).
setOnClickListener
(
this
)
AppConfig
.
fragmentClickFlag
=
Constant
.
FRAGMENT_CLICK_ONE
if
(
mainFragment
==
null
)
{
...
...
@@ -86,6 +87,9 @@ class MainActivity : BaseActivity(), View.OnClickListener {
AdManager
.
instance
.
preLoadAd
(
this
)
initEditView
()
// 初始化短剧SDK
DPHolderManager
.
initDpSdk
(
context
);
// initEasyFloat()
}
...
...
@@ -189,7 +193,7 @@ class MainActivity : BaseActivity(), View.OnClickListener {
override
fun
onClick
(
view
:
View
)
{
when
(
view
.
id
)
{
R
.
id
.
tab_rl_loan
->
clickTab1Layout
()
R
.
id
.
tab_
iv
_recommend
->
clickTab2Layout
()
R
.
id
.
tab_
rl
_recommend
->
clickTab2Layout
()
R
.
id
.
tab_rl_my
->
clickTab3Layout
()
}
}
...
...
@@ -297,6 +301,12 @@ class MainActivity : BaseActivity(), View.OnClickListener {
}
}
fun
showEditView
(
show
:
Boolean
)
{
recommendFragment
?.
let
{
(
it
as
RecommendFragment
).
showEditView
(
show
)
}
}
fun
showEdit
(
isEdit
:
Boolean
)
{
if
(
isEdit
)
{
ll_edit
.
visibility
=
View
.
VISIBLE
...
...
video/app/src/main/java/com/mints/wisdomclean/ui/activitys/MobileLoginActivity.kt
View file @
f848b5b4
...
...
@@ -186,7 +186,7 @@ class MobileLoginActivity : BaseActivity(), LoginView, View.OnClickListener {
}
override
fun
updateDrawState
(
ds
:
TextPaint
)
{
ds
.
color
=
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
color_FF9837
)
ds
.
color
=
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
tv_message_recente_money
)
ds
.
isUnderlineText
=
false
}
})
...
...
@@ -200,7 +200,7 @@ class MobileLoginActivity : BaseActivity(), LoginView, View.OnClickListener {
}
override
fun
updateDrawState
(
ds
:
TextPaint
)
{
ds
.
color
=
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
color_FF9837
)
ds
.
color
=
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
tv_message_recente_money
)
ds
.
isUnderlineText
=
false
}
})
...
...
@@ -251,7 +251,8 @@ class MobileLoginActivity : BaseActivity(), LoginView, View.OnClickListener {
when
(
v
?.
id
)
{
R
.
id
.
dialog_btn_left
->
{
readyGo
(
MainActivity
::
class
.
java
)
val
activity
=
ActivityPageManager
.
getInstance
().
getActivity
(
MainActivity
::
class
.
java
)
val
activity
=
ActivityPageManager
.
getInstance
().
getActivity
(
MainActivity
::
class
.
java
)
if
(
activity
!=
null
&&
activity
is
MainActivity
)
{
activity
.
clickTab3Layout
()
}
...
...
video/app/src/main/java/com/mints/wisdomclean/ui/activitys/SettingsActivity.kt
View file @
f848b5b4
...
...
@@ -6,6 +6,7 @@ import android.content.Intent
import
android.net.Uri
import
android.os.Bundle
import
android.os.Handler
import
android.os.Looper
import
android.text.TextUtils
import
android.view.View
import
android.widget.ImageView
...
...
@@ -194,7 +195,7 @@ class SettingsActivity : BaseActivity(), View.OnClickListener {
this
,
SpanUtils
()
.
append
(
"确认注销账户?"
)
.
setForegroundColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
color_FF9837
))
.
setForegroundColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
tv_message_recente_money
))
.
create
(),
"提示"
,
"确定"
,
...
...
@@ -204,7 +205,7 @@ class SettingsActivity : BaseActivity(), View.OnClickListener {
ToastUtil
.
show
(
this
@SettingsActivity
,
"注销账户申请已发起!"
)
Handler
().
postDelayed
({
Handler
(
Looper
.
getMainLooper
()
).
postDelayed
({
finish
()
},
200
)
...
...
video/app/src/main/java/com/mints/wisdomclean/ui/activitys/SplashActivity.kt
View file @
f848b5b4
...
...
@@ -5,15 +5,13 @@ import android.os.Bundle
import
android.view.KeyEvent
import
android.view.View
import
com.mints.wisdomclean.R
import
com.mints.wisdomclean.ad.AdManager
import
com.mints.wisdomclean.ad.splash.SplashManager
import
com.mints.wisdomclean.common.AppConfig
import
com.mints.wisdomclean.common.Constant
import
com.mints.wisdomclean.common.Constant.PRIVACY_URL
import
com.mints.wisdomclean.common.Constant.REGISTER_URL
import
com.mints.wisdomclean.common.DeviceInfo.Companion.instance
import
com.mints.wisdomclean.manager.TrackManager
import
com.mints.wisdomclean.manager.UserManager
import
com.mints.wisdomclean.ui.activitys.WebActivity
import
com.mints.wisdomclean.ui.activitys.base.BaseActivity
import
com.mints.wisdomclean.ui.widgets.CycleProgress
import
com.mints.wisdomclean.ui.widgets.DialogListener
...
...
@@ -21,6 +19,7 @@ import com.mints.wisdomclean.ui.widgets.PowerDialog
import
com.mints.wisdomclean.ui.widgets.PowerDialog2
import
com.mints.wisdomclean.ui.widgets.countdowntimer.CountDownTimerSupport
import
com.mints.wisdomclean.ui.widgets.countdowntimer.OnCountDownTimerListener
import
com.mints.wisdomclean.utils.AppPreferencesManager
import
com.mints.wisdomclean.utils.AppPreferencesManager.get
import
com.mints.wisdomclean.utils.LogUtil
import
java.util.*
...
...
@@ -71,7 +70,7 @@ class SplashActivity : BaseActivity() {
private
fun
initData
()
{
val
firstSplash
=
get
().
getBoolean
(
Constant
.
FIRST_SPLASH
,
true
)
if
(!
firstSplash
)
{
SplashManager
.
preLoadAd
(
this
)
AdManager
.
instance
.
splashPreLoadAll
(
this
)
}
mProgressBar
!!
.
startOneAnim
()
try
{
...
...
@@ -92,7 +91,7 @@ class SplashActivity : BaseActivity() {
// 第一次安装时,延迟加载开屏广告,因为广告sdk还未初始化完成
val
firstSplash
=
get
().
getBoolean
(
Constant
.
FIRST_SPLASH
,
true
)
if
(
firstSplash
&&
millisUntilFinished
==
(
AD_TIME_OUT
-
2000
).
toLong
())
{
SplashManager
.
preLoadAd
(
this
@SplashActivity
)
AdManager
.
instance
.
splashPreLoadAll
(
this
@SplashActivity
)
get
().
put
(
Constant
.
FIRST_SPLASH
,
false
)
}
...
...
@@ -143,8 +142,10 @@ class SplashActivity : BaseActivity() {
* 跳转到主页面
*/
private
fun
goToMainActivity
()
{
// if (UserManager.getInstance().newFlag && !UserManager.getInstance().vipFlag) {
if
(!
UserManager
.
getInstance
().
vipFlag
)
{
// val vipEnter = AppPreferencesManager.get().getBoolean(Constant.IS_FIRST_VIP_BTN, false)
// if ((UserManager.getInstance().newFlag && !UserManager.getInstance().vipFlag) || !vipEnter) {
if
(
UserManager
.
getInstance
().
newFlag
&&
!
UserManager
.
getInstance
().
vipFlag
)
{
// AppPreferencesManager.get().put(Constant.IS_FIRST_VIP_BTN, true)
// 匹配用户 且 不是vip
val
bundle
=
Bundle
()
bundle
.
putBoolean
(
VipActivity
.
IS_GUIDE
,
true
)
...
...
video/app/src/main/java/com/mints/wisdomclean/ui/activitys/SplashAdActivity.kt
View file @
f848b5b4
...
...
@@ -95,8 +95,10 @@ class SplashAdActivity : BaseActivity() {
* 跳转到主页面
*/
private
fun
goToMainActivity
()
{
// if (UserManager.getInstance().newFlag&&!UserManager.getInstance().vipFlag) {
if
(!
UserManager
.
getInstance
().
vipFlag
)
{
// val vipEnter = AppPreferencesManager.get().getBoolean(Constant.IS_FIRST_VIP_BTN, false)
// if ((UserManager.getInstance().newFlag && !UserManager.getInstance().vipFlag) || !vipEnter) {
if
(
UserManager
.
getInstance
().
newFlag
&&
!
UserManager
.
getInstance
().
vipFlag
)
{
// AppPreferencesManager.get().put(Constant.IS_FIRST_VIP_BTN, true)
// 匹配用户 且 不是vip
val
bundle
=
Bundle
()
bundle
.
putBoolean
(
VipActivity
.
IS_GUIDE
,
true
)
...
...
video/app/src/main/java/com/mints/wisdomclean/ui/activitys/VipActivity.kt
View file @
f848b5b4
...
...
@@ -32,6 +32,7 @@ import com.mints.wisdomclean.ui.activitys.base.BaseActivity
import
com.mints.wisdomclean.ui.adapter.VipAdapter
import
com.mints.wisdomclean.ui.widgets.*
import
com.mints.library.utils.nodoubleclick.AntiShake
import
com.mints.wisdomclean.utils.AppPreferencesManager
import
kotlinx.android.synthetic.main.activity_vip.*
import
kotlinx.android.synthetic.main.header_layout.*
...
...
@@ -129,7 +130,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, VipAdapter.On
ll_vip_alipay
.
visibility
=
View
.
GONE
ll_vip_wx
.
visibility
=
View
.
VISIBLE
payType
=
WEIXIN_PAY
iv_vip_wx
.
setImageResource
(
R
.
mipmap
.
ic_vip_enable
)
iv_vip_wx
.
setImageResource
(
R
.
mipmap
.
ic_vip_enable
_blue
)
iv_vip_alipay
.
setImageResource
(
R
.
mipmap
.
ic_vip_none
)
}
...
...
@@ -188,7 +189,9 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, VipAdapter.On
override
fun
onKeyDown
(
keyCode
:
Int
,
event
:
KeyEvent
?):
Boolean
{
when
(
keyCode
)
{
KeyEvent
.
KEYCODE_BACK
->
{
if
(!
UserManager
.
getInstance
().
vipFlag
&&
vipList
!=
null
&&
vipList
!!
.
size
>
0
)
{
if
(!
UserManager
.
getInstance
().
vipFlag
&&
UserManager
.
getInstance
().
newFlag
&&
vipList
!=
null
&&
vipList
!!
.
size
>
0
)
{
vipAdapter
.
setPosition
(
0
)
vipAdapter
.
notifyDataSetChanged
()
...
...
@@ -219,7 +222,9 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, VipAdapter.On
when
(
v
?.
id
)
{
R
.
id
.
ic_vip_quit
->
{
if
(!
UserManager
.
getInstance
().
vipFlag
&&
vipList
!=
null
&&
vipList
!!
.
size
>
0
)
{
if
(!
UserManager
.
getInstance
().
vipFlag
&&
UserManager
.
getInstance
().
newFlag
&&
vipList
!=
null
&&
vipList
!!
.
size
>
0
)
{
vipAdapter
.
setPosition
(
0
)
vipAdapter
.
notifyDataSetChanged
()
val
vipBean
=
vipList
!!
[
0
]
...
...
video/app/src/main/java/com/mints/wisdomclean/ui/activitys/WatchRecordActivity.kt
View file @
f848b5b4
package
com.mints.wisdomclean.ui.activitys
import
android.view.LayoutInflater
import
android.view.View
import
androidx.recyclerview.widget.LinearLayoutManager
import
com.mints.wisdomclean.R
import
com.mints.wisdomclean.manager.LocalVedioManager
import
com.mints.wisdomclean.mvp.model.BannerList
import
com.mints.wisdomclean.mvp.model.
WatchRecord
Bean
import
com.mints.wisdomclean.mvp.model.
Vedio
Bean
import
com.mints.wisdomclean.mvp.presenters.WatchRecordPresenter
import
com.mints.wisdomclean.mvp.views.WatchRecordView
import
com.mints.wisdomclean.ui.activitys.base.BaseActivity
import
com.mints.wisdomclean.ui.adapter.WatchRecordAdapter
import
com.mints.wisdomclean.ui.widgets.StickHeaderDecoration
import
com.mints.wisdomclean.utils.TimeHelp
import
kotlinx.android.synthetic.main.activity_watch_record.*
import
kotlinx.android.synthetic.main.header_layout.*
...
...
@@ -23,6 +26,7 @@ class WatchRecordActivity : BaseActivity(), WatchRecordView {
private
val
watchRecordPresenter
by
lazy
{
WatchRecordPresenter
()
}
private
var
mWatchRecordAdapter
:
WatchRecordAdapter
?
=
null
private
var
datas
=
mutableListOf
<
VedioBean
>()
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_watch_record
...
...
@@ -34,22 +38,31 @@ class WatchRecordActivity : BaseActivity(), WatchRecordView {
iv_left_icon
.
setImageResource
(
R
.
mipmap
.
ic_arrow_back
)
iv_left_icon
.
setOnClickListener
{
finish
()
}
val
beanList
:
MutableList
<
WatchRecordBean
>
=
ArrayList
()
for
(
i
in
0
..
5
)
{
beanList
.
add
(
WatchRecordBean
(
String
.
format
(
"第一组%d号"
,
i
+
1
),
"第一组"
))
}
for
(
i
in
0
..
5
)
{
beanList
.
add
(
WatchRecordBean
(
String
.
format
(
"第二组%d号"
,
i
+
1
),
"第二组"
))
watchRecordPresenter
.
getHistory
()
mWatchRecordAdapter
=
WatchRecordAdapter
()
val
emptyView
=
LayoutInflater
.
from
(
this
).
inflate
(
R
.
layout
.
item_empty_history
,
null
)
mWatchRecordAdapter
?.
setEmptyView
(
emptyView
)
mWatchRecordAdapter
?.
setNewInstance
(
datas
)
mWatchRecordAdapter
?.
setOnItemClickListener
{
adapter
,
view
,
position
->
LocalVedioManager
.
startVedioDetailActivityForType
(
this
@WatchRecordActivity
,
datas
[
position
]
)
}
for
(
i
in
0
..
5
)
{
beanList
.
add
(
WatchRecordBean
(
String
.
format
(
"第三组%d号"
,
i
+
1
),
"第三组"
))
mWatchRecordAdapter
?.
setOnItemCollectClickListener
(
object
:
WatchRecordAdapter
.
OnItemCollectClickListener
{
override
fun
onItemCollectClick
(
position
:
Int
)
{
if
(
datas
[
position
].
collect
==
0
)
{
datas
[
position
].
collect
=
1
watchRecordPresenter
.
collect
(
""
+
datas
[
position
].
vedioId
)
}
else
{
datas
[
position
].
collect
=
0
watchRecordPresenter
.
cancelCollect
(
""
+
datas
[
position
].
vedioId
)
}
for
(
i
in
0
..
9
)
{
beanList
.
add
(
WatchRecordBean
(
String
.
format
(
"第四组%d号"
,
i
+
1
),
"第四组"
))
mWatchRecordAdapter
?.
notifyItemChanged
(
position
)
}
mWatchRecordAdapter
=
WatchRecordAdapter
()
mWatchRecordAdapter
?.
setNewInstance
(
beanList
)
})
rv_watch_record
.
layoutManager
=
LinearLayoutManager
(
this
)
rv_watch_record
.
addItemDecoration
(
StickHeaderDecoration
(
this
))
rv_watch_record
.
adapter
=
mWatchRecordAdapter
...
...
@@ -63,7 +76,14 @@ class WatchRecordActivity : BaseActivity(), WatchRecordView {
}
override
fun
getHistorySuc
(
historyBean
:
BannerList
)
{
datas
.
clear
()
val
data
=
historyBean
.
list
for
(
datum
in
data
)
{
datum
.
topTabsReamrk
=
TimeHelp
.
format
(
datum
.
seeUpdateTime
*
1000
)
datas
.
add
(
datum
)
}
mWatchRecordAdapter
?.
setNewInstance
(
datas
)
mWatchRecordAdapter
?.
notifyDataSetChanged
()
}
override
fun
getHistoryFail
()
{
...
...
video/app/src/main/java/com/mints/wisdomclean/ui/adapter/FollowAdapter.kt
View file @
f848b5b4
...
...
@@ -2,12 +2,14 @@ package com.mints.wisdomclean.ui.adapter
import
android.app.Activity
import
android.view.View
import
android.widget.CheckBox
import
android.widget.TextView
import
com.chad.library.adapter.base.BaseQuickAdapter
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
import
com.mints.library.utils.GlideUtils
import
com.mints.wisdomclean.R
import
com.mints.wisdomclean.mvp.model.VedioBean
import
kotlinx.android.synthetic.main.fragment_main.*
/**
* @author Assen
...
...
@@ -20,12 +22,16 @@ class FollowAdapter(var activity: Activity) :
private
var
showEdit
=
false
override
fun
convert
(
holder
:
BaseViewHolder
,
item
:
VedioBean
)
{
holder
.
getView
<
CheckBox
>(
R
.
id
.
cb
).
isChecked
=
item
.
isChecked
holder
.
getView
<
CheckBox
>(
R
.
id
.
cb
).
setOnCheckedChangeListener
{
buttonView
,
isChecked
->
item
.
isChecked
=
isChecked
}
holder
.
getView
<
View
>(
R
.
id
.
fm_mask
).
visibility
=
if
(
showEdit
)
View
.
VISIBLE
else
View
.
GONE
holder
.
getView
<
TextView
>(
R
.
id
.
title_tv
).
text
=
item
.
title
holder
.
getView
<
TextView
>(
R
.
id
.
info_tv
).
text
=
item
.
scriptName
holder
.
getView
<
TextView
>(
R
.
id
.
info_tv
).
text
=
"观看至第${item.seeIndex}集"
holder
.
getView
<
TextView
>(
R
.
id
.
complete_tv
).
text
=
if
(
item
.
completeStatus
==
0
)
"已完结"
else
"更新中"
GlideUtils
.
loadImageViewNoAnim
(
context
,
item
.
coverImage
,
holder
.
getView
(
R
.
id
.
image_iv
))
GlideUtils
.
loadImageViewNoAnim
2
(
context
,
item
.
coverImage
,
holder
.
getView
(
R
.
id
.
image_iv
))
}
// 设置编辑状态
...
...
@@ -36,6 +42,9 @@ class FollowAdapter(var activity: Activity) :
// 全选
fun
fullChoice
()
{
for
(
datum
in
data
)
{
datum
.
isChecked
=
true
}
notifyDataSetChanged
()
}
}
\ No newline at end of file
video/app/src/main/java/com/mints/wisdomclean/ui/adapter/HotStyleAdapter.kt
View file @
f848b5b4
...
...
@@ -36,7 +36,7 @@ class HotStyleAdapter(val context: Context, val dataList: ArrayList<VedioBean>)
val
topBean
=
dataList
?.
get
(
position
)
if
(
topBean
!=
null
)
{
holder
.
tvVedioItemCount
.
text
=
"${if (topBean.completeStatus == 0) "
已完结
" else "
更新至$
{
topBean
.
vedioTotal
}
"}"
"${if (topBean.completeStatus == 0) "
已完结
" else "
更新至$
{
topBean
.
vedioTotal
}
集
"}"
holder
.
tvVedioItemTitle
.
text
=
"${topBean.title}"
holder
.
tvVedioItemText
.
text
=
"${topBean.vedioDesc}"
GlideUtils
.
loadImageViewGifForFitCenter
(
...
...
video/app/src/main/java/com/mints/wisdomclean/ui/adapter/TopAdapter.kt
View file @
f848b5b4
...
...
@@ -39,7 +39,7 @@ class TopAdapter(val topList: MutableList<VedioBean>?) :
val
topBean
=
topList
?.
get
(
position
)
if
(
topBean
!=
null
)
{
holder
.
tvTopItemLable
.
text
=
"${position + 1}"
holder
.
tvTopItemCount
.
text
=
"${topBean.hot}万"
holder
.
tvTopItemCount
.
text
=
topBean
.
showNum
holder
.
tvTopItemTitle
.
text
=
"${topBean.title}"
if
(
topBean
.
orderTags
!=
null
&&
topBean
.
orderTags
.
size
>
0
)
{
val
sb
=
StringBuilder
()
...
...
video/app/src/main/java/com/mints/wisdomclean/ui/adapter/VideoEpisodeAdapter.kt
View file @
f848b5b4
...
...
@@ -6,7 +6,6 @@ import com.chad.library.adapter.base.BaseQuickAdapter
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
import
com.mints.wisdomclean.R
import
com.mints.wisdomclean.mvp.model.EpisodeBean
import
com.mints.wisdomclean.utils.ToastUtil
/**
* @author Assen
...
...
@@ -23,8 +22,10 @@ class VideoEpisodeAdapter :
rv
.
adapter
=
itemVideoEpisodeAdapter
val
list
=
mutableListOf
<
EpisodeBean
>()
itemVideoEpisodeAdapter
.
addChildClickViewIds
(
R
.
id
.
item_tv
)
itemVideoEpisodeAdapter
.
setOnItemChildClickListener
{
adapter
,
view
,
position
->
mOnEpisodeClickListener
?.
onEpisodeClick
(
position
)
itemVideoEpisodeAdapter
.
setOnItemClickListener
{
adapter
,
view
,
position
->
mOnEpisodeClickListener
?.
onEpisodeClick
(
position
)
}
list
.
addAll
(
item
)
itemVideoEpisodeAdapter
.
setNewInstance
(
list
)
...
...
video/app/src/main/java/com/mints/wisdomclean/ui/adapter/WatchRecordAdapter.kt
View file @
f848b5b4
package
com.mints.wisdomclean.ui.adapter
import
android.view.View
import
android.widget.TextView
import
com.airbnb.lottie.LottieAnimationView
import
com.airbnb.lottie.LottieComposition
import
com.airbnb.lottie.LottieCompositionFactory
import
com.airbnb.lottie.LottieDrawable
import
com.chad.library.adapter.base.BaseQuickAdapter
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
import
com.mints.library.utils.GlideUtils
import
com.mints.wisdomclean.R
import
com.mints.wisdomclean.mvp.model.
WatchRecord
Bean
import
com.mints.wisdomclean.mvp.model.
Vedio
Bean
/**
* @author Assen
...
...
@@ -16,16 +18,29 @@ import com.mints.wisdomclean.mvp.model.WatchRecordBean
* @desc
*/
class
WatchRecordAdapter
:
BaseQuickAdapter
<
WatchRecord
Bean
,
BaseViewHolder
>(
R
.
layout
.
item_watch_record
)
{
BaseQuickAdapter
<
Vedio
Bean
,
BaseViewHolder
>(
R
.
layout
.
item_watch_record
)
{
override
fun
convert
(
holder
:
BaseViewHolder
,
item
:
WatchRecordBean
)
{
override
fun
convert
(
holder
:
BaseViewHolder
,
item
:
VedioBean
)
{
GlideUtils
.
loadImageViewNoAnim2
(
context
,
item
.
coverImage
,
holder
.
getView
(
R
.
id
.
image_iv
))
holder
.
getView
<
TextView
>(
R
.
id
.
title_tv
).
text
=
item
.
title
holder
.
getView
<
TextView
>(
R
.
id
.
info_tv
).
text
=
"观看至第${item.seeIndex}集"
if
(
item
.
collect
==
0
)
{
// 未收藏
holder
.
getView
<
LottieAnimationView
>(
R
.
id
.
iv_collect
)
.
setImageResource
(
R
.
mipmap
.
home_collect_img_0
)
}
else
{
// 已收藏
holder
.
getView
<
LottieAnimationView
>(
R
.
id
.
iv_collect
)
.
setImageResource
(
R
.
mipmap
.
home_collect_img_1
)
}
holder
.
getView
<
View
>(
R
.
id
.
ll_collect
).
setOnClickListener
{
if
(
!
item
.
collect
)
{
// data[holder.layoutPosition].collect = true
if
(
item
.
collect
==
0
)
{
mOnItemCollectClickListener
?.
onItemCollectClick
(
holder
.
adapterPosition
)
playCollectAnim
(
holder
.
getView
(
R
.
id
.
iv_collect
))
}
else
{
// data[holder.layoutPosition].collect = false
mOnItemCollectClickListener
?.
onItemCollectClick
(
holder
.
adapterPosition
)
playCancelCollectAnim
(
holder
.
getView
(
R
.
id
.
iv_collect
))
}
}
...
...
@@ -38,11 +53,12 @@ class WatchRecordAdapter :
* @return
*/
fun
isItemHeader
(
position
:
Int
):
Boolean
{
if
(
data
.
size
==
0
)
return
false
return
if
(
position
==
0
)
{
true
}
else
{
val
lastGroupName
:
String
=
data
[
position
-
1
].
group
val
currentGroupName
:
String
=
data
[
position
].
group
val
lastGroupName
:
String
=
data
[
position
-
1
].
topTabsReamrk
val
currentGroupName
:
String
=
data
[
position
].
topTabsReamrk
//判断上一个数据的组别和下一个数据的组别是否一致,如果不一致则是不同组,也就是为第一项(头部)
lastGroupName
!=
currentGroupName
}
...
...
@@ -55,7 +71,8 @@ class WatchRecordAdapter :
* @return
*/
fun
getGroupName
(
position
:
Int
):
String
{
return
data
[
position
].
group
if
(
data
.
size
==
0
)
return
""
return
data
[
position
].
topTabsReamrk
}
private
fun
playCollectAnim
(
view
:
LottieAnimationView
)
{
...
...
@@ -82,4 +99,15 @@ class WatchRecordAdapter :
view
.
setImageDrawable
(
lottieDrawable
)
}
private
var
mOnItemCollectClickListener
:
OnItemCollectClickListener
?
=
null
fun
setOnItemCollectClickListener
(
onItemCollectClickListener
:
OnItemCollectClickListener
)
{
this
.
mOnItemCollectClickListener
=
onItemCollectClickListener
}
interface
OnItemCollectClickListener
{
fun
onItemCollectClick
(
position
:
Int
)
}
}
\ No newline at end of file
video/app/src/main/java/com/mints/wisdomclean/ui/fragment/FollowVideoFragment.kt
View file @
f848b5b4
...
...
@@ -6,6 +6,7 @@ import android.view.View
import
androidx.fragment.app.Fragment
import
androidx.recyclerview.widget.GridLayoutManager
import
com.mints.wisdomclean.R
import
com.mints.wisdomclean.manager.LocalVedioManager
import
com.mints.wisdomclean.mvp.model.BannerList
import
com.mints.wisdomclean.mvp.model.VedioBean
import
com.mints.wisdomclean.mvp.presenters.FollowPresenter
...
...
@@ -25,7 +26,7 @@ class FollowVideoFragment : BaseFragment(), FollowView {
private
val
followPresenter
by
lazy
{
FollowPresenter
()
}
private
val
datas
=
arrayListOf
<
VedioBean
>()
lateinit
var
followAdapter
:
FollowAdapter
private
var
followAdapter
:
FollowAdapter
?
=
null
companion
object
{
fun
newInstance
():
Fragment
{
...
...
@@ -38,6 +39,7 @@ class FollowVideoFragment : BaseFragment(), FollowView {
override
fun
onResume
()
{
super
.
onResume
()
followPresenter
.
getCollectList
()
}
override
fun
initViewsAndEvents
()
{
...
...
@@ -57,12 +59,18 @@ class FollowVideoFragment : BaseFragment(), FollowView {
}
rv_follow
.
layoutManager
=
GridLayoutManager
(
requireContext
(),
3
)
followAdapter
=
FollowAdapter
(
requireActivity
())
followAdapter
.
setEmptyView
(
emptyView
)
followAdapter
.
setNewInstance
(
datas
)
followAdapter
?.
setEmptyView
(
emptyView
)
followAdapter
?.
setNewInstance
(
datas
)
followAdapter
?.
setOnItemClickListener
{
adapter
,
view
,
position
->
LocalVedioManager
.
startVedioDetailActivityForType
(
requireActivity
(),
datas
[
position
]
)
}
rv_follow
.
adapter
=
followAdapter
}
fun
getAdapter
():
FollowAdapter
{
fun
getAdapter
():
FollowAdapter
?
{
return
followAdapter
}
...
...
@@ -75,23 +83,44 @@ class FollowVideoFragment : BaseFragment(), FollowView {
return
datas
.
isEmpty
()
}
private
fun
showEditView
(
show
:
Boolean
)
{
(
requireActivity
()
as
MainActivity
).
showEditView
(
show
)
}
override
fun
getCollectListSuc
(
bannerList
:
BannerList
)
{
datas
.
clear
()
if
(
bannerList
.
list
.
isNotEmpty
())
{
datas
.
addAll
(
bannerList
.
list
)
followAdapter
.
setNewInstance
(
datas
)
followAdapter
?
.
setNewInstance
(
datas
)
}
showEditView
(
true
)
followAdapter
?.
setEditStyle
(
false
)
followAdapter
?.
notifyDataSetChanged
()
}
override
fun
getCollectListFail
()
{
showEditView
(
false
)
}
override
fun
cancelCollectSuc
()
{
followPresenter
.
getCollectList
()
(
requireActivity
()
as
MainActivity
).
showEdit
(
false
)
}
override
fun
cancelCollectFail
()
{
}
fun
delete
()
{
followAdapter
?.
let
{
val
strArr
=
arrayListOf
<
String
>()
for
(
datum
in
it
.
data
)
{
if
(
datum
.
isChecked
)
{
strArr
.
add
(
""
+
datum
.
vedioId
)
}
}
followPresenter
.
cancelCollect
(
strArr
)
}
}
}
\ No newline at end of file
video/app/src/main/java/com/mints/wisdomclean/ui/fragment/MainFragment.kt
View file @
f848b5b4
...
...
@@ -16,6 +16,7 @@ import com.mints.wisdomclean.R
import
com.mints.wisdomclean.common.AppConfig
import
com.mints.wisdomclean.common.Constant
import
com.mints.wisdomclean.manager.LocalVedioManager
import
com.mints.wisdomclean.manager.TrackManager
import
com.mints.wisdomclean.manager.UserManager
import
com.mints.wisdomclean.mvp.model.*
import
com.mints.wisdomclean.mvp.presenters.HomePresenter
...
...
@@ -43,7 +44,10 @@ import kotlin.concurrent.schedule
*/
class
MainFragment
:
LazyLoadBaseFragment
(),
HomeView
,
View
.
OnClickListener
,
OnRefreshListener
{
private
var
mSelectTabIndex
=
-
1
companion
object
{
var
mSelectTabIndex
=
-
1
}
private
val
tabsData
=
mutableListOf
<
HotStyleTypesBean
>()
private
val
bannerList
=
mutableListOf
<
BannerBean
>()
private
val
topList
=
mutableListOf
<
VedioBean
>()
...
...
@@ -80,6 +84,15 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
}
banner
?.
start
()
setWatchingStatus
()
if
(
TextUtils
.
isEmpty
(
userManager
?.
userID
))
{
//获取游客登录数据
homePresenter
.
userLogin
()
}
else
{
homePresenter
.
topTabs
()
homePresenter
.
orders
()
TrackManager
.
getInstance
().
getMyInfo
()
}
}
}
...
...
@@ -116,12 +129,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
requireActivity
().
runOnUiThread
{
if
(
AntiShake
.
check
(
rv_main_list
?.
id
))
return
@runOnUiThread
if
(
TextUtils
.
isEmpty
(
userManager
?.
userID
))
{
//获取游客登录数据
homePresenter
.
userLogin
()
}
else
{
homePresenter
.
topTabs
()
homePresenter
.
orders
()
if
(!
TextUtils
.
isEmpty
(
userManager
?.
userID
))
{
homePresenter
.
getHomeV1Types
()
}
}
...
...
@@ -211,7 +219,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
iv_main_watching_pic
)
tv_main_watching_name
.
text
=
cacheVedio
.
title
tv_main_watching_text1
.
text
=
"上次观看至第${cacheVedio.
completeStatus
}集"
tv_main_watching_text1
.
text
=
"上次观看至第${cacheVedio.
seeIndex
}集"
if
(
cacheVedio
.
orderTags
!=
null
&&
cacheVedio
.
orderTags
.
size
>
0
)
{
val
sb
=
StringBuilder
()
for
(
i
in
0
until
cacheVedio
.
orderTags
.
size
)
{
...
...
@@ -239,7 +247,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
bannerList
.
clear
()
for
(
i
in
0
until
data
.
list
.
size
)
{
val
bean
=
BannerBean
()
bean
.
title
=
data
.
list
.
get
(
i
).
t
itle
bean
.
title
=
data
.
list
.
get
(
i
).
t
opTabsReamrk
bean
.
imageRes
=
data
.
list
.
get
(
i
).
coverImage
bannerList
.
add
(
bean
)
}
...
...
@@ -262,4 +270,13 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
}
topAdapter
?.
notifyDataSetChanged
()
}
override
fun
onHiddenChanged
(
hidden
:
Boolean
)
{
super
.
onHiddenChanged
(
hidden
)
if
(
isHidden
)
{
vpAdapter
?.
getFragments
()
?.
get
(
mSelectTabIndex
)
?.
onPause
()
}
else
{
vpAdapter
?.
getFragments
()
?.
get
(
mSelectTabIndex
)
?.
onResume
()
}
}
}
\ No newline at end of file
video/app/src/main/java/com/mints/wisdomclean/ui/fragment/MovieFragment.kt
View file @
f848b5b4
...
...
@@ -47,29 +47,20 @@ class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnLoadMoreListener
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
fragment_movie
override
fun
initViewsAndEvents
()
{
arguments
?.
let
{
mType
=
it
.
getInt
(
VIDEO_TYPE
,
mType
)
mPosition
=
it
.
getInt
(
VIDEO_POSITION
,
mPosition
)
}
}
override
fun
onFragmentFirstVisible
()
{
super
.
onFragmentFirstVisible
()
picContentPresenter
.
attachView
(
this
)
initView
()
initListener
()
onRefresh
()
arguments
?.
let
{
mType
=
it
.
getInt
(
VIDEO_TYPE
,
mType
)
mPosition
=
it
.
getInt
(
VIDEO_POSITION
,
mPosition
)
}
override
fun
onHiddenChanged
(
hidden
:
Boolean
)
{
if
(
hidden
)
{
// 不在最前端界面显示
onPause
()
}
else
{
// 重新显示到最前端中
onResume
()
}
super
.
onHiddenChanged
(
hidden
)
override
fun
onResume
()
{
super
.
onResume
()
onRefresh
()
}
override
fun
onDestroy
()
{
...
...
video/app/src/main/java/com/mints/wisdomclean/ui/fragment/MyFragment.kt
View file @
f848b5b4
...
...
@@ -14,7 +14,6 @@ import com.mints.wisdomclean.ui.activitys.*
import
com.mints.wisdomclean.ui.fragment.base.BaseFragment
import
com.mints.wisdomclean.utils.SpanUtils
import
com.mints.wisdomclean.utils.TimeRender
import
com.mints.wisdomclean.video.DPHolderManager
import
kotlinx.android.synthetic.main.fragment_main_my.*
/**
...
...
video/app/src/main/java/com/mints/wisdomclean/ui/fragment/RecommendFragment.kt
View file @
f848b5b4
...
...
@@ -10,9 +10,11 @@ import com.google.android.material.tabs.TabLayoutMediator
import
com.mints.wisdomclean.R
import
com.mints.wisdomclean.common.AppConfig
import
com.mints.wisdomclean.common.Constant
import
com.mints.wisdomclean.manager.UserManager
import
com.mints.wisdomclean.ui.activitys.MainActivity
import
com.mints.wisdomclean.ui.adapter.RecommendPageAdapter
import
com.mints.wisdomclean.ui.fragment.base.BaseFragment
import
com.mints.wisdomclean.video.DramaTabFragment
import
kotlinx.android.synthetic.main.fragment_recommend.*
/**
...
...
@@ -22,6 +24,8 @@ import kotlinx.android.synthetic.main.fragment_recommend.*
*/
class
RecommendFragment
:
BaseFragment
(),
View
.
OnClickListener
{
private
var
mCurrentNewFlag
=
false
private
var
mSelectTabIndex
=
-
1
private
val
tabsData
=
mutableListOf
<
String
>()
private
val
fragments
=
mutableListOf
<
Fragment
>()
...
...
@@ -37,11 +41,19 @@ class RecommendFragment : BaseFragment(), View.OnClickListener {
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
fragment_recommend
private
fun
initVp2
()
{
mCurrentNewFlag
=
UserManager
.
getInstance
().
newFlag
fragments
.
clear
()
tabsData
.
add
(
"追剧"
)
tabsData
.
add
(
"推荐"
)
fragments
.
clear
()
if
(
mCurrentNewFlag
)
{
fragments
.
add
(
FollowVideoFragment
.
newInstance
())
fragments
.
add
(
WatchVideoFragment
.
newInstance
())
}
else
{
fragments
.
add
(
FollowVideoFragment
.
newInstance
())
fragments
.
add
(
DramaTabFragment
())
}
vpAdapter
=
RecommendPageAdapter
(
fragments
,
this
)
vp2_recommend
.
adapter
=
vpAdapter
...
...
@@ -132,6 +144,11 @@ class RecommendFragment : BaseFragment(), View.OnClickListener {
super
.
onResume
()
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_TWO
)
{
if
(
mCurrentNewFlag
!=
UserManager
.
getInstance
().
newFlag
)
{
mCurrentNewFlag
=
UserManager
.
getInstance
().
newFlag
// 重置状态
initVp2
()
}
}
}
...
...
@@ -147,7 +164,7 @@ class RecommendFragment : BaseFragment(), View.OnClickListener {
}
}
private
fun
handleEditStyle
(
isEdit
:
Boolean
)
{
fun
handleEditStyle
(
isEdit
:
Boolean
)
{
if
(
isEdit
)
{
// 禁止滑动
vp2_recommend
.
isUserInputEnabled
=
false
...
...
@@ -164,15 +181,26 @@ class RecommendFragment : BaseFragment(), View.OnClickListener {
tv_edit_text
.
visibility
=
View
.
GONE
}
(
requireActivity
()
as
MainActivity
).
showEdit
(
isEdit
)
(
fragments
[
0
]
as
FollowVideoFragment
).
getAdapter
().
setEditStyle
(
isEdit
)
(
fragments
[
0
]
as
FollowVideoFragment
).
getAdapter
()
?
.
setEditStyle
(
isEdit
)
}
private
fun
changeBottomTabColor
(
showBlack
:
Boolean
)
{
(
requireActivity
()
as
MainActivity
).
showBlack
(
showBlack
)
}
fun
showEditView
(
show
:
Boolean
)
{
handleEditStyle
(!
show
)
// if (show) {
// iv_edit_close.visibility = View.GONE
// iv_edit.visibility = View.VISIBLE
// } else {
// iv_edit_close.visibility = View.VISIBLE
// iv_edit.visibility = View.GONE
// }
}
fun
fullChoice
()
{
(
fragments
[
0
]
as
FollowVideoFragment
).
getAdapter
().
fullChoice
()
(
fragments
[
0
]
as
FollowVideoFragment
).
getAdapter
()
?
.
fullChoice
()
}
fun
changeTab
(
index
:
Int
)
{
...
...
@@ -180,11 +208,12 @@ class RecommendFragment : BaseFragment(), View.OnClickListener {
}
fun
delete
()
{
(
fragments
[
0
]
as
FollowVideoFragment
).
delete
()
}
override
fun
onHiddenChanged
(
hidden
:
Boolean
)
{
super
.
onHiddenChanged
(
hidden
)
fragments
[
1
].
onHiddenChanged
(
hidden
)
// 传递生命周期
if
(
hidden
)
{
fragments
[
1
].
onPause
()
...
...
video/app/src/main/java/com/mints/wisdomclean/ui/fragment/WatchVideoFragment.kt
View file @
f848b5b4
This diff is collapsed.
Click to expand it.
video/app/src/main/java/com/mints/wisdomclean/ui/widgets/CycleProgress.java
View file @
f848b5b4
...
...
@@ -104,7 +104,7 @@ public class CycleProgress extends View {
pathMeasure
.
getSegment
(
0
,
pathMeasure
.
getLength
()
*
mAnimatorValue
,
dstPath
,
true
);
//渐变
Shader
mShader
=
new
LinearGradient
(
mStrokeWidth
/
2
,
mStrokeWidth
/
2
,
mProgressWidth
,
mHeight
-
mStrokeWidth
/
2
,
Color
.
parseColor
(
"#
08DA9B"
),
Color
.
parseColor
(
"#3ADAFA
"
),
Shader
.
TileMode
.
REPEAT
);
Color
.
parseColor
(
"#
F96856"
),
Color
.
parseColor
(
"#EC325C
"
),
Shader
.
TileMode
.
REPEAT
);
//遮罩
mProgressPaint
.
setXfermode
(
new
PorterDuffXfermode
(
PorterDuff
.
Mode
.
SRC_IN
));
mProgressPaint
.
setShader
(
mShader
);
...
...
video/app/src/main/java/com/mints/wisdomclean/ui/widgets/NestedScrollableHost.kt
0 → 100644
View file @
f848b5b4
package
com.mints.wisdomclean.ui.widgets
import
android.content.Context
import
android.util.AttributeSet
import
android.view.MotionEvent
import
android.view.View
import
android.view.ViewConfiguration
import
android.widget.FrameLayout
import
androidx.viewpager2.widget.ViewPager2
import
androidx.viewpager2.widget.ViewPager2.ORIENTATION_HORIZONTAL
import
kotlin.math.absoluteValue
import
kotlin.math.sign
class
NestedScrollableHost
:
FrameLayout
{
constructor
(
context
:
Context
)
:
super
(
context
)
constructor
(
context
:
Context
,
attrs
:
AttributeSet
?)
:
super
(
context
,
attrs
)
private
var
touchSlop
=
0
private
var
initialX
=
0f
private
var
initialY
=
0f
//循环遍历找到viewPager2
private
val
parentViewPager
:
ViewPager2
?
get
()
{
var
v
:
View
?
=
parent
as
?
View
while
(
v
!=
null
&&
v
!
is
ViewPager2
)
{
v
=
v
.
parent
as
?
View
}
return
v
as
?
ViewPager2
}
//找到子RecyclerView
private
val
child
:
View
?
get
()
=
if
(
childCount
>
0
)
getChildAt
(
0
)
else
null
init
{
//最小滑动距离
touchSlop
=
ViewConfiguration
.
get
(
context
).
scaledTouchSlop
}
private
fun
canChildScroll
(
orientation
:
Int
,
delta
:
Float
):
Boolean
{
val
direction
=
-
delta
.
sign
.
toInt
()
return
when
(
orientation
)
{
//判断子RecyclerView在水平方向是否可以滑动deltaX
0
->
child
?.
canScrollHorizontally
(
direction
)
?:
false
//判断子RecyclerView在竖直方向是否可以滑动deltaY
1
->
child
?.
canScrollVertically
(
direction
)
?:
false
else
->
throw
IllegalArgumentException
()
}
}
override
fun
onInterceptTouchEvent
(
e
:
MotionEvent
):
Boolean
{
handleInterceptTouchEvent
(
e
)
return
super
.
onInterceptTouchEvent
(
e
)
}
private
fun
handleInterceptTouchEvent
(
e
:
MotionEvent
)
{
val
orientation
=
parentViewPager
?.
orientation
?:
return
//如果子RecyclerView在viewPager2的滑动方向上不能滑动直接返回
if
(!
canChildScroll
(
orientation
,
-
1f
)
&&
!
canChildScroll
(
orientation
,
1f
))
{
return
}
if
(
e
.
action
==
MotionEvent
.
ACTION_DOWN
)
{
initialX
=
e
.
x
initialY
=
e
.
y
//down事件直接强制禁止父view拦截事件,后续事件先交给子RecyclerView先判断是否能够消费
//如果这一块不强制禁止父view会导致后续事件可能直接没到子RecyclerView就被父view拦截了
//默认RecyclerView onTouchEvent返回true但是viewPager2会在onInterceptTouchEvent拦截住
parent
.
requestDisallowInterceptTouchEvent
(
true
)
}
else
if
(
e
.
action
==
MotionEvent
.
ACTION_MOVE
)
{
//计算手指滑动距离
val
dx
=
e
.
x
-
initialX
val
dy
=
e
.
y
-
initialY
val
isVpHorizontal
=
orientation
==
ORIENTATION_HORIZONTAL
val
scaledDx
=
dx
.
absoluteValue
*
if
(
isVpHorizontal
)
.
5f
else
1f
val
scaledDy
=
dy
.
absoluteValue
*
if
(
isVpHorizontal
)
1f
else
.
5f
//滑动距离超过最小滑动值
if
(
scaledDx
>
touchSlop
||
scaledDy
>
touchSlop
)
{
if
(
isVpHorizontal
==
(
scaledDy
>
scaledDx
))
{
//如果viewPager2是横向滑动但手势是竖直方向滑动,则允许所有父类拦截
parent
.
requestDisallowInterceptTouchEvent
(
false
)
}
else
{
//手势滑动方向和viewPage2是同方向的,需要询问子RecyclerView是否在同方向能滑动
if
(
canChildScroll
(
orientation
,
if
(
isVpHorizontal
)
dx
else
dy
))
{
//子RecyclerView能滑动直接禁止父view拦截事件
parent
.
requestDisallowInterceptTouchEvent
(
true
)
}
else
{
//子RecyclerView不能滑动(划到第一个Item还往右滑或者划到最后面一个Item还往左划的时候)允许父view拦截
parent
.
requestDisallowInterceptTouchEvent
(
false
)
}
}
}
}
}
}
video/app/src/main/java/com/mints/wisdomclean/ui/widgets/StickHeaderDecoration.java
View file @
f848b5b4
...
...
@@ -35,7 +35,7 @@ public class StickHeaderDecoration extends RecyclerView.ItemDecoration {
public
StickHeaderDecoration
(
Context
context
)
{
mItemHeaderHeight
=
dp2px
(
context
,
40
);
mTextPaddingLeft
=
dp2px
(
context
,
6
);
mTextPaddingLeft
=
dp2px
(
context
,
10
);
mTextRect
=
new
Rect
();
...
...
@@ -74,7 +74,7 @@ public class StickHeaderDecoration extends RecyclerView.ItemDecoration {
mTextPaint
.
getTextBounds
(
adapter
.
getGroupName
(
position
),
0
,
adapter
.
getGroupName
(
position
).
length
(),
mTextRect
);
c
.
drawText
(
adapter
.
getGroupName
(
position
),
left
+
mTextPaddingLeft
,
(
view
.
getTop
()
-
mItemHeaderHeight
)
+
mItemHeaderHeight
/
2
+
mTextRect
.
height
()
/
2
,
mTextPaint
);
}
else
{
c
.
drawRect
(
left
,
view
.
getTop
()
-
1
,
right
,
view
.
getTop
(),
mLinePaint
);
//
c.drawRect(left, view.getTop() - 1, right, view.getTop(), mLinePaint);
}
}
}
...
...
video/app/src/main/java/com/mints/wisdomclean/ui/widgets/VideoEpisodeDialog.kt
View file @
f848b5b4
...
...
@@ -11,7 +11,7 @@ import com.google.android.material.tabs.TabLayout
import
com.google.android.material.tabs.TabLayoutMediator
import
com.mints.wisdomclean.R
import
com.mints.wisdomclean.mvp.model.EpisodeBean
import
com.mints.wisdomclean.mvp.model.
IndexList
import
com.mints.wisdomclean.mvp.model.
VedioBean
import
com.mints.wisdomclean.ui.adapter.VideoEpisodeAdapter
import
com.mints.wisdomclean.utils.CommonUtils
...
...
@@ -22,7 +22,7 @@ import com.mints.wisdomclean.utils.CommonUtils
*/
class
VideoEpisodeDialog
(
context
:
Context
,
val
indexList
:
IndexList
?,
val
vedioBean
:
VedioBean
?,
private
val
listener
:
DialogListener
)
:
Dialog
(
context
,
R
.
style
.
dialog
)
{
...
...
@@ -61,22 +61,21 @@ class VideoEpisodeDialog(
ivClose
=
findViewById
(
R
.
id
.
close_iv
)
ivClose
.
setOnClickListener
(
listener
)
findViewById
<
TextView
>(
R
.
id
.
title_tv
).
text
=
indexList
?.
vedioMsg
?.
title
findViewById
<
TextView
>(
R
.
id
.
title_tv
).
text
=
vedioBean
?.
title
findViewById
<
TextView
>(
R
.
id
.
label_tv
).
text
=
if
(
indexList
?.
vedioMsg
?.
completeStatus
==
0
)
"已完结"
else
"未完结
"
if
(
vedioBean
?.
completeStatus
==
0
)
"已完结"
else
"更新中
"
initVp
()
}
private
fun
initVp
()
{
for
(
i
in
0
until
indexList
!!
.
vedioMsg
.
vedioTotal
)
{
if
(
i
<
indexList
.
list
.
size
)
{
val
index
=
indexList
.
list
[
i
]
for
(
i
in
0
until
vedioBean
!!
.
vedioTotal
)
{
if
(
i
<
vedioBean
.
unlockIndex
)
{
var
playing
=
false
if
(
indexList
.
vedioMsg
.
seeIndex
==
i
)
{
if
(
vedioBean
.
seeIndex
==
i
)
{
playing
=
true
}
mData
.
add
(
EpisodeBean
(
index
.
isLock
,
playing
,
""
+
(
i
+
1
)))
mData
.
add
(
EpisodeBean
(
false
,
playing
,
""
+
(
i
+
1
)))
}
else
{
mData
.
add
(
EpisodeBean
(
lock
=
true
,
playing
=
false
,
title
=
""
+
(
i
+
1
)))
}
...
...
@@ -130,6 +129,13 @@ class VideoEpisodeDialog(
}
}
fun
changeLockStatus
(
unlockIndex
:
Int
)
{
for
(
i
in
0
until
mData
.
size
)
{
mData
[
i
].
lock
=
i
>
unlockIndex
}
adapter
?.
notifyDataSetChanged
()
}
fun
setCurrentIndex
(
position
:
Int
)
{
for
(
mDatum
in
mData
)
{
mDatum
.
playing
=
false
...
...
video/app/src/main/java/com/mints/wisdomclean/ui/widgets/VipCountDialog.kt
0 → 100644
View file @
f848b5b4
package
com.mints.wisdomclean.ui.widgets
import
android.app.Activity
import
android.app.Dialog
import
android.content.Intent
import
android.view.Gravity
import
android.view.KeyEvent
import
android.view.View
import
android.view.WindowManager
import
android.widget.TextView
import
com.mints.wisdomclean.R
import
com.mints.wisdomclean.ui.activitys.VipActivity
import
com.mints.wisdomclean.ui.widgets.countdowntimer.CountDownTimerSupport
import
com.mints.wisdomclean.ui.widgets.countdowntimer.OnCountDownTimerListener
class
VipCountDialog
(
activity
:
Activity
)
:
Dialog
(
activity
,
R
.
style
.
dialog
)
{
private
val
lp
:
WindowManager
.
LayoutParams
var
timer
:
CountDownTimerSupport
?
=
null
init
{
setContentView
(
R
.
layout
.
dialog_vip_count
)
// 设置window属性
lp
=
window
!!
.
attributes
lp
.
gravity
=
Gravity
.
CENTER
lp
.
width
=
WindowManager
.
LayoutParams
.
MATCH_PARENT
lp
.
windowAnimations
=
R
.
style
.
DialogAnimFade
window
!!
.
attributes
=
lp
// 设置外部不可关闭
setCancelable
(
false
)
setCanceledOnTouchOutside
(
false
)
setOnKeyListener
{
dialogInterface
,
i
,
keyEvent
->
i
==
KeyEvent
.
KEYCODE_BACK
}
val
fm
=
findViewById
<
View
>(
R
.
id
.
fm
)
val
text_count
=
findViewById
<
TextView
>(
R
.
id
.
text_count
)
timer
=
CountDownTimerSupport
(
3000L
,
1000
)
timer
?.
setOnCountDownTimerListener
(
object
:
OnCountDownTimerListener
{
override
fun
onTick
(
millisUntilFinished
:
Long
)
{
text_count
.
text
=
(
millisUntilFinished
/
1000L
).
toString
()
}
override
fun
onFinish
()
{
dismiss
()
}
})
timer
?.
start
()
fm
.
setOnClickListener
{
activity
.
startActivity
(
Intent
(
activity
,
VipActivity
::
class
.
java
))
dismiss
()
}
}
override
fun
dismiss
()
{
super
.
dismiss
()
this
.
mOnDialogDismiss
?.
onDialogDismiss
()
}
override
fun
onDetachedFromWindow
()
{
super
.
onDetachedFromWindow
()
timer
?.
stop
()
timer
=
null
}
private
var
mOnDialogDismiss
:
OnDialogDismiss
?
=
null
fun
setOnDialogDismiss
(
onDialogDismiss
:
OnDialogDismiss
):
Dialog
{
this
.
mOnDialogDismiss
=
onDialogDismiss
return
this
}
interface
OnDialogDismiss
{
fun
onDialogDismiss
()
}
}
\ No newline at end of file
video/app/src/main/java/com/mints/wisdomclean/utils/TimeHelp.java
0 → 100644
View file @
f848b5b4
package
com
.
mints
.
wisdomclean
.
utils
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.Locale
;
public
class
TimeHelp
{
public
static
String
format
(
long
timeMillis
)
{
return
format
(
new
Date
(
timeMillis
));
}
private
static
String
format
(
Date
date
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
//当前年
int
currYear
=
calendar
.
get
(
Calendar
.
YEAR
);
//当前日
int
currDay
=
calendar
.
get
(
Calendar
.
DAY_OF_YEAR
);
//当前时
int
currHour
=
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
);
//当前分
int
currMinute
=
calendar
.
get
(
Calendar
.
MINUTE
);
//当前秒
int
currSecond
=
calendar
.
get
(
Calendar
.
SECOND
);
calendar
.
setTime
(
date
);
int
msgYear
=
calendar
.
get
(
Calendar
.
YEAR
);
//说明不是同一年
if
(
currYear
!=
msgYear
)
{
return
new
SimpleDateFormat
(
"yyyy年MM月dd日"
,
Locale
.
getDefault
()).
format
(
date
);
}
int
msgDay
=
calendar
.
get
(
Calendar
.
DAY_OF_YEAR
);
//超过7天,直接显示xx月xx日
if
(
currDay
-
msgDay
>
7
)
{
return
new
SimpleDateFormat
(
"MM月dd日"
,
Locale
.
getDefault
()).
format
(
date
);
}
//不是当天
if
(
currDay
-
msgDay
>
0
)
{
if
(
currDay
-
msgDay
==
1
)
{
return
"昨天"
;
}
else
{
return
currDay
-
msgDay
+
"天前"
;
}
}
int
msgHour
=
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
);
int
msgMinute
=
calendar
.
get
(
Calendar
.
MINUTE
);
//不是当前小时内
if
(
currHour
-
msgHour
>
0
)
{
//如果当前分钟小,说明最后一个不满一小时
if
(
currMinute
<
msgMinute
)
{
if
(
currHour
-
msgHour
==
1
)
{
//当前只大一个小时值,说明不够一小时
return
60
-
msgMinute
+
currMinute
+
"分钟前"
;
}
else
{
return
currHour
-
msgHour
-
1
+
"小时前"
;
}
}
//如果当前分钟数大,够了一个周期
return
currHour
-
msgHour
+
"小时前"
;
}
int
msgSecond
=
calendar
.
get
(
Calendar
.
SECOND
);
//不是当前分钟内
if
(
currMinute
-
msgMinute
>
0
)
{
//如果当前秒数小,说明最后一个不满一分钟
if
(
currSecond
<
msgSecond
)
{
if
(
currMinute
-
msgMinute
==
1
)
{
//当前只大一个分钟值,说明不够一分钟
return
"刚刚"
;
}
else
{
return
currMinute
-
msgMinute
-
1
+
"分钟前"
;
}
}
//如果当前秒数大,够了一个周期
return
currMinute
-
msgMinute
+
"分钟前"
;
}
//x秒前
return
"刚刚"
;
}
}
\ No newline at end of file
video/app/src/main/java/com/mints/wisdomclean/video/DramaApiDetailActivity.kt
View file @
f848b5b4
This diff is collapsed.
Click to expand it.
video/app/src/main/java/com/mints/wisdomclean/video/DramaTabFragment.kt
View file @
f848b5b4
package
com.mints.wisdomclean.video
import
android.os.Bundle
import
android.util.Log
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
com.bytedance.sdk.dp.DPDramaDetailConfig
import
com.bytedance.sdk.dp.DPSdk
...
...
@@ -14,19 +10,22 @@ import com.bytedance.sdk.dp.IDPDramaListener
import
com.bytedance.sdk.dp.IDPDrawListener
import
com.bytedance.sdk.dp.IDPWidget
import
com.mints.wisdomclean.R
import
com.mints.wisdomclean.manager.LocalVedioManager
import
com.mints.wisdomclean.mvp.model.IndexList
import
com.mints.wisdomclean.mvp.presenters.VideoPresenter
import
com.mints.wisdomclean.mvp.views.VideoView
import
com.mints.wisdomclean.ui.fragment.base.BaseFragment
/**
* Created by limingqi on 2023/1/17
*/
class
DramaTabFragment
:
BaseFragment
()
{
class
DramaTabFragment
:
BaseFragment
()
,
VideoView
{
companion
object
{
private
val
videoPresenter
by
lazy
{
VideoPresenter
()
}
private
const
val
TAG
=
"DramaTabFragment"
private
const
val
FREE_SET
=
-
1
private
const
val
LOCK_SET
=
-
1
companion
object
{
private
const
val
TAG
=
"DramaTabFragment"
}
private
var
dpWidget
:
IDPWidget
?
=
null
...
...
@@ -42,6 +41,8 @@ class DramaTabFragment : BaseFragment() {
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
drama_home_frag_wrapper
private
fun
init
()
{
videoPresenter
.
attachView
(
this
)
if
(
isInited
)
{
return
}
...
...
@@ -57,15 +58,16 @@ class DramaTabFragment : BaseFragment() {
return
}
val
dramaDetailConfig
=
DPDramaDetailConfig
.
obtain
(
DPDramaDetailConfig
.
COMMON_DETAIL
)
.
freeSet
(
FREE_SET
)
.
lockSet
(
LOCK_SET
)
val
dramaDetailConfig
=
DPDramaDetailConfig
.
obtain
(
DPDramaDetailConfig
.
SPECIFIC_DETAIL
)
.
setEnterDelegate
{
context
,
drama
,
current
->
DramaApiDetailActivity
.
outerDrama
=
drama
videoPresenter
.
getIndexList
(
""
+
drama
.
id
,
true
)
}
.
hideMore
(
false
)
.
hideLeftTopTips
(
false
,
null
)
.
listener
(
dramaListener
)
// 短剧详情页视频播放回调
.
adListener
(
dramaAdListener
)
// 短剧详情页激励视频回调
dpWidget
=
DPSdk
.
factory
().
createDraw
(
DPWidgetDrawParams
.
obtain
()
.
adOffset
(
0
)
//单位 dp,为 0 时可以不设置
...
...
@@ -338,5 +340,41 @@ class DramaTabFragment : BaseFragment() {
}
}
override
fun
onDestroy
()
{
super
.
onDestroy
()
videoPresenter
.
detachView
()
}
override
fun
getIndexListSuc
(
indexList
:
IndexList
)
{
LocalVedioManager
.
startVedioDetailActivityForType
(
requireActivity
(),
indexList
.
vedioMsg
,
true
,
isThirdId
=
true
)
}
override
fun
getIndexListFail
()
{
showToast
(
"网络错误!"
)
}
override
fun
collectSuc
()
{
}
override
fun
collectFail
()
{
}
override
fun
cancelCollectSuc
()
{
}
override
fun
cancelCollectFail
()
{
}
override
fun
unlockSuc
(
indexList
:
IndexList
)
{
}
override
fun
unlockFail
()
{
}
}
\ No newline at end of file
video/app/src/main/java/com/mints/wisdomclean/video/DrawDramaFragment.kt
View file @
f848b5b4
...
...
@@ -13,7 +13,6 @@ import com.bytedance.sdk.dp.IDPDrawListener
import
com.bytedance.sdk.dp.IDPWidget
import
com.mints.wisdomclean.R
import
com.mints.wisdomclean.ui.fragment.base.BaseFragment
import
com.mints.wisdomclean.video.DramaApiDetailActivity.Companion.KEY_DRAMA_UNLOCK_INDEX
/**
* Created by limingqi on 2023/5/10
...
...
@@ -93,7 +92,6 @@ class DrawDramaFragment : BaseFragment() {
val
intent
=
Intent
(
context
,
DramaApiDetailActivity
::
class
.
java
)
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
)
DramaApiDetailActivity
.
outerDrama
=
drama
intent
.
putExtra
(
KEY_DRAMA_UNLOCK_INDEX
,
100
)
context
.
startActivity
(
intent
)
}
.
freeSet
(
FREE_SET
)
...
...
video/app/src/main/java/com/mints/wisdomclean/video/RecommendVideoAdapter.kt
View file @
f848b5b4
...
...
@@ -14,6 +14,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
import
com.mints.wisdomclean.MintsApplication
import
com.mints.wisdomclean.R
import
com.mints.wisdomclean.mvp.model.VedioBean
/**
* author : ChenWenJie
...
...
@@ -22,17 +23,27 @@ import com.mints.wisdomclean.R
* desc : 适配器
*/
class
RecommendVideoAdapter
(
var
activity
:
Activity
)
:
BaseQuickAdapter
<
V
ide
oBean
,
BaseViewHolder
>(
R
.
layout
.
item_video_recommend
)
{
BaseQuickAdapter
<
V
edi
oBean
,
BaseViewHolder
>(
R
.
layout
.
item_video_recommend
)
{
override
fun
convert
(
holder
:
BaseViewHolder
,
item
:
V
ide
oBean
)
{
override
fun
convert
(
holder
:
BaseViewHolder
,
item
:
V
edi
oBean
)
{
//用户名
holder
.
setText
(
R
.
id
.
username_tv
,
item
.
user_nam
e
)
holder
.
setText
(
R
.
id
.
username_tv
,
item
.
titl
e
)
//标题
holder
.
setText
(
R
.
id
.
usertitle_tv
,
item
.
video_title
)
holder
.
setText
(
R
.
id
.
usertitle_tv
,
"第"
+
item
.
recommendIndex
+
"集"
)
//缩略图
Glide
.
with
(
activity
).
load
(
item
.
video_i
mage
)
Glide
.
with
(
activity
).
load
(
item
.
coverI
mage
)
.
into
(
holder
.
getView
<
JzvdStdTikTok
>(
R
.
id
.
jz_video
).
posterImageView
)
if
(
item
.
collect
==
0
)
{
// 未收藏
holder
.
getView
<
LottieAnimationView
>(
R
.
id
.
iv_collect
)
.
setImageResource
(
R
.
mipmap
.
home_collect_img_0
)
}
else
{
// 已收藏
holder
.
getView
<
LottieAnimationView
>(
R
.
id
.
iv_collect
)
.
setImageResource
(
R
.
mipmap
.
home_collect_img_1
)
}
var
isPlay
=
false
holder
.
getView
<
View
>(
R
.
id
.
ll_collect
).
setOnClickListener
{
isPlay
=
!
isPlay
...
...
@@ -49,11 +60,11 @@ class RecommendVideoAdapter(var activity: Activity) :
if
(
holder
.
layoutPosition
+
1
<
itemCount
)
{
val
item1
=
getItem
(
holder
.
layoutPosition
+
1
)
//缓存下一个 10秒
proxy
!!
.
preLoad
(
item1
.
video_path
,
10
)
proxy
!!
.
preLoad
(
item1
.
recommendUrl
,
10
)
}
//缓存当前,播放当前
val
proxyUrl
=
proxy
?.
getProxyUrl
(
item
.
video_path
).
toString
()
//设置视
val
proxyUrl
=
proxy
?.
getProxyUrl
(
item
.
recommendUrl
).
toString
()
//设置视
setPlay
(
holder
.
getView
(
R
.
id
.
jz_video
),
proxyUrl
)
}
...
...
video/app/src/main/java/com/mints/wisdomclean/video/VideoActivity.kt
View file @
f848b5b4
...
...
@@ -14,6 +14,7 @@ import com.google.gson.Gson
import
com.mints.wisdomclean.R
import
com.mints.wisdomclean.ad.AdManager
import
com.mints.wisdomclean.ad.AdStatusListener
import
com.mints.wisdomclean.ad.NoPreAdManager
import
com.mints.wisdomclean.common.Constant
import
com.mints.wisdomclean.manager.LocalVedioManager
import
com.mints.wisdomclean.mvp.model.IndexList
...
...
@@ -27,6 +28,7 @@ import com.mints.wisdomclean.ui.activitys.base.BaseActivity
import
com.mints.wisdomclean.ui.adapter.VideoEpisodeAdapter
import
com.mints.wisdomclean.ui.widgets.DialogListener
import
com.mints.wisdomclean.ui.widgets.VideoEpisodeDialog
import
com.mints.wisdomclean.ui.widgets.VipCountDialog
import
kotlinx.android.synthetic.main.activity_video.*
import
java.util.HashMap
...
...
@@ -44,18 +46,24 @@ class VideoActivity : BaseActivity(), View.OnClickListener, VideoView,
private
var
mVedioBean
:
VedioBean
?
=
null
private
var
indexBean
:
IndexList
?
=
null
private
var
isPlayNext
=
false
private
var
playIndex
=
1
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_video
override
fun
initViewsAndEvents
()
{
videoPresenter
.
attachView
(
this
)
mVedioBean
?.
let
{
videoPresenter
.
getIndexList
(
""
+
it
.
vedioId
)
}
if
(
isPlayNext
)
{
playIndex
=
mVedioBean
!!
.
recommendIndex
}
initView
()
}
override
fun
getBundleExtras
(
extras
:
Bundle
?)
{
val
json
=
extras
?.
getString
(
Constant
.
VEDIO_BEAN
)
isPlayNext
=
extras
?.
getBoolean
(
Constant
.
VEDIO_NEXT
,
false
)
==
true
mVedioBean
=
Gson
().
fromJson
(
json
,
VedioBean
::
class
.
java
)
super
.
getBundleExtras
(
extras
)
...
...
@@ -83,10 +91,11 @@ class VideoActivity : BaseActivity(), View.OnClickListener, VideoView,
fun
initView
()
{
mVedioBean
?.
let
{
episode_tv
.
text
=
"共"
+
it
.
vedioTotal
+
"集"
+
if
(
it
.
completeStatus
==
0
)
"已完结"
else
"更新中"
+
" >"
"共"
+
it
.
vedioTotal
+
"集"
+
if
(
it
.
completeStatus
==
0
)
"已完结"
else
"更新中"
}
fm_bottom
.
setOnClickListener
(
this
)
close_iv
.
setOnClickListener
(
this
)
val
recyViewLayoutManager
=
RecyViewLayoutManager
(
this
,
OrientationHelper
.
VERTICAL
)
recy
.
layoutManager
=
recyViewLayoutManager
...
...
@@ -96,8 +105,6 @@ class VideoActivity : BaseActivity(), View.OnClickListener, VideoView,
adapter
.
setNewInstance
(
getAdapterData
())
val
emptyView
=
LayoutInflater
.
from
(
this
).
inflate
(
R
.
layout
.
item_empty_video
,
null
)
adapter
.
setEmptyView
(
emptyView
)
//指定位置其他页面跳转过来。直接定位指定posion 这里不需要。
// recy.scrollToPosition(postion);
adapter
.
setOnCustomChildClickListener
(
this
)
adapter
.
setOnVideoCompletion
(
object
:
JzvdStdTikTok
.
OnVideoCompletion
{
...
...
@@ -109,7 +116,8 @@ class VideoActivity : BaseActivity(), View.OnClickListener, VideoView,
override
fun
onInitComplete
()
{
dialog
?.
setCurrentIndex
(
mCurrentPosition
)
//初始化 自动播放
autoPlayVideo
()
// autoPlayVideo()
showVipCountDialog
(
mCurrentPosition
)
}
override
fun
onPageRelease
(
isNext
:
Boolean
,
position
:
Int
)
{
...
...
@@ -129,8 +137,10 @@ class VideoActivity : BaseActivity(), View.OnClickListener, VideoView,
//是最底部,执行加载更多数据
// loadData()
}
autoPlayVideo
()
mCurrentPosition
=
position
// autoPlayVideo()
showVipCountDialog
(
mCurrentPosition
)
dialog
?.
setCurrentIndex
(
mCurrentPosition
)
}
...
...
@@ -171,8 +181,10 @@ class VideoActivity : BaseActivity(), View.OnClickListener, VideoView,
player
.
startVideoAfterPreloading
()
// VIdeoindex -> seeIndex
mVedioBean
!!
.
seeIndex
=
mCurrentPosition
if
(
videos
.
size
>
mCurrentPosition
)
{
mVedioBean
!!
.
seeIndex
=
videos
[
mCurrentPosition
].
vedioIndex
LocalVedioManager
.
commitVedio
(
mVedioBean
!!
)
}
//播放开始,进行倒计时
}
...
...
@@ -202,8 +214,7 @@ class VideoActivity : BaseActivity(), View.OnClickListener, VideoView,
dialog
?.
setCurrentIndex
(
mCurrentPosition
)
dialog
!!
.
show
()
}
else
{
dialog
=
VideoEpisodeDialog
(
this
,
indexBean
!!
,
object
:
DialogListener
()
{
dialog
=
VideoEpisodeDialog
(
this
,
mVedioBean
,
object
:
DialogListener
()
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
?)
{
super
.
onClick
(
dialog
,
v
)
dialog
?.
dismiss
()
...
...
@@ -216,12 +227,19 @@ class VideoActivity : BaseActivity(), View.OnClickListener, VideoView,
}
override
fun
getIndexListSuc
(
indexList
:
IndexList
)
{
indexBean
=
indexList
mVedioBean
=
indexList
.
vedioMsg
indexBean
=
indexList
videos
.
clear
()
videos
.
addAll
(
indexList
.
list
)
adapter
.
setNewInstance
(
getAdapterData
())
adapter
.
notifyDataSetChanged
()
// 处理推荐页跳转自动播放下一集逻辑
if
(!
isPlayNext
)
{
playIndex
=
mVedioBean
!!
.
seeIndex
-
1
}
mCurrentPosition
=
playIndex
recy
.
scrollToPosition
(
playIndex
)
}
override
fun
getIndexListFail
()
{
...
...
@@ -244,6 +262,7 @@ class VideoActivity : BaseActivity(), View.OnClickListener, VideoView,
}
override
fun
unlockSuc
(
indexList
:
IndexList
)
{
dialog
?.
changeLockStatus
(
videos
.
size
)
videos
.
addAll
(
indexList
.
list
)
adapter
.
setNewInstance
(
getAdapterData
())
adapter
.
notifyDataSetChanged
()
...
...
@@ -260,7 +279,8 @@ class VideoActivity : BaseActivity(), View.OnClickListener, VideoView,
mCurrentPosition
=
position
recy
.
scrollToPosition
(
position
)
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
autoPlayVideo
()
showVipCountDialog
(
mCurrentPosition
)
// autoPlayVideo()
},
300
)
}
...
...
@@ -299,12 +319,33 @@ class VideoActivity : BaseActivity(), View.OnClickListener, VideoView,
// 看广告解锁
AdManager
.
instance
.
showAd
(
this
,
""
,
object
:
AdStatusListener
{
override
fun
adSuccess
()
{}
var
canFail
=
false
override
fun
adSuccess
()
{
canFail
=
true
}
override
fun
adFail
()
{
if
(
canFail
)
return
NoPreAdManager
.
loadVideoAd
(
this
@VideoActivity
,
""
,
object
:
AdStatusListener
{
override
fun
adFail
()
{
showToast
(
"广告太火爆了,请稍候再试"
)
}
override
fun
adSuccess
()
{
}
override
fun
adClose
(
vo
:
HashMap
<
String
,
Any
>?)
{
vo
?.
let
{
vo
[
"vedioId"
]
=
mVedioBean
!!
.
vedioId
videoPresenter
.
unlock
(
vo
)
}
}
})
}
override
fun
adClose
(
vo
:
HashMap
<
String
,
Any
>?)
{
vo
?.
let
{
vo
[
"vedioId"
]
=
mVedioBean
!!
.
vedioId
...
...
@@ -322,5 +363,20 @@ class VideoActivity : BaseActivity(), View.OnClickListener, VideoView,
}
}
private
fun
showVipCountDialog
(
position
:
Int
)
{
if
(
isFinishing
)
return
if
(
mVedioBean
!!
.
tipMaxIndex
==
0
||
mVedioBean
!!
.
tipMaxIndex
-
1
<
position
)
{
autoPlayVideo
()
return
}
VipCountDialog
(
this
)
.
setOnDialogDismiss
(
object
:
VipCountDialog
.
OnDialogDismiss
{
override
fun
onDialogDismiss
()
{
autoPlayVideo
()
}
})
.
show
()
}
}
\ No newline at end of file
video/app/src/main/java/com/mints/wisdomclean/video/VideoAdapter.kt
View file @
f848b5b4
...
...
@@ -4,6 +4,7 @@ import android.util.Log
import
android.view.View
import
android.widget.Button
import
android.widget.LinearLayout
import
android.widget.TextView
import
cn.jzvd.Jzvd
import
cn.jzvd.JzvdStd
import
com.airbnb.lottie.LottieAnimationView
...
...
@@ -46,6 +47,7 @@ class VideoAdapter(private var vedioBean: VedioBean) :
holder
.
getView
<
View
>(
R
.
id
.
vip
).
setOnClickListener
{
mOnCustomChildClickListener
?.
onCustomChildClick
(
it
,
holder
.
adapterPosition
)
}
holder
.
getView
<
TextView
>(
R
.
id
.
unlock
).
text
=
"看广告解锁"
+
vedioBean
!!
.
adGiveVedioNum
+
"集"
holder
.
getView
<
View
>(
R
.
id
.
leave
).
visibility
=
View
.
GONE
holder
.
getView
<
View
>(
R
.
id
.
leave
).
setOnClickListener
{
mOnCustomChildClickListener
?.
onCustomChildClick
(
it
,
holder
.
adapterPosition
)
...
...
@@ -57,7 +59,7 @@ class VideoAdapter(private var vedioBean: VedioBean) :
private
fun
initVideoHolder
(
holder
:
BaseViewHolder
,
item
:
VideoMultiItemEntity
)
{
//标题
holder
.
setText
(
R
.
id
.
title_tv
,
item
.
video
.
title
)
holder
.
setText
(
R
.
id
.
title_tv
,
vedioBean
.
title
)
//介绍
holder
.
setText
(
R
.
id
.
info_tv
,
"第"
+
item
.
video
.
vedioIndex
+
"集"
)
//收藏数量
...
...
@@ -100,6 +102,7 @@ class VideoAdapter(private var vedioBean: VedioBean) :
val
proxyUrl
=
proxy
?.
getProxyUrl
(
item
.
video
.
vedioUrl
).
toString
()
//设置视
setPlay
(
holder
.
getView
(
R
.
id
.
jz_video
),
proxyUrl
)
// setPlay(holder.getView(R.id.jz_video), item.video.vedioUrl)
}
fun
setPlay
(
jzvdStdTikTok
:
JzvdStdTikTok
,
path
:
String
)
{
...
...
video/app/src/main/res/drawable/btn_index_submit.xml
View file @
f848b5b4
...
...
@@ -2,7 +2,7 @@
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:width=
"345dp"
android:height=
"44dp"
>
<shape
android:shape=
"rectangle"
>
<solid
android:color=
"
#fffeb63d
"
/>
<solid
android:color=
"
@color/tv_message_recente_money
"
/>
<corners
android:radius=
"50dp"
/>
</shape>
</item>
...
...
video/app/src/main/res/drawable/btn_index_submit_unchecked.xml
View file @
f848b5b4
...
...
@@ -2,7 +2,7 @@
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:width=
"345dp"
android:height=
"44dp"
>
<shape
android:shape=
"rectangle"
>
<stroke
android:width=
"1dp"
android:color=
"
#fffeb63d
"
/>
<stroke
android:width=
"1dp"
android:color=
"
@color/tv_message_recente_money
"
/>
<solid
android:color=
"#ffffff"
/>
<corners
android:radius=
"50dp"
/>
</shape>
...
...
video/app/src/main/res/drawable/rb_opinion_selected.xml
View file @
f848b5b4
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:color=
"@android:color/white"
android:drawable=
"@drawable/btn_index_submit"
android:state_checked=
"true"
></item>
<item
android:color=
"
#FEB63D
"
android:drawable=
"@drawable/btn_index_submit_unchecked"
android:state_checked=
"false"
></item>
<item
android:color=
"
@color/tv_message_recente_money
"
android:drawable=
"@drawable/btn_index_submit_unchecked"
android:state_checked=
"false"
></item>
</selector>
\ No newline at end of file
video/app/src/main/res/layout/activity_aboutus.xml
View file @
f848b5b4
...
...
@@ -85,7 +85,7 @@
android:layout_marginRight=
"2dp"
android:padding=
"5dp"
android:text=
"@string/register_name"
android:textColor=
"@color/
color_FF9837
"
android:textColor=
"@color/
tv_message_recente_money
"
android:textSize=
"14sp"
/>
<View
...
...
@@ -102,7 +102,7 @@
android:layout_marginLeft=
"2dp"
android:padding=
"5dp"
android:text=
"隐私政策"
android:textColor=
"@color/
color_FF9837
"
android:textColor=
"@color/
tv_message_recente_money
"
android:textSize=
"14sp"
/>
</LinearLayout>
...
...
video/app/src/main/res/layout/activity_mobile_login.xml
View file @
f848b5b4
...
...
@@ -131,7 +131,7 @@
android:layout_centerVertical=
"true"
android:gravity=
"center"
android:text=
"获取验证码"
android:textColor=
"@color/
color_FF9837
"
android:textColor=
"@color/
tv_message_recente_money
"
android:textSize=
"12sp"
/>
</RelativeLayout>
...
...
video/app/src/main/res/layout/activity_video.xml
View file @
f848b5b4
...
...
@@ -5,7 +5,7 @@
android:layout_height=
"match_parent"
android:background=
"@color/black"
android:orientation=
"vertical"
tools:context=
".video.VideoActivity"
>
r
tools:context=
".video.VideoActivity"
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/recy"
...
...
@@ -50,7 +50,7 @@
android:layout_height=
"wrap_content"
android:layout_marginStart=
"10dp"
android:layout_weight=
"1"
android:text=
"共100集 已完结
>
"
android:text=
"共100集 已完结"
android:textColor=
"@color/white"
/>
<ImageView
...
...
video/app/src/main/res/layout/activity_watch_record.xml
View file @
f848b5b4
...
...
@@ -8,28 +8,28 @@
<include
layout=
"@layout/header_layout"
/>
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id=
"@+id/srlMainPage"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
app:srlAccentColor=
"@color/black"
>
<!-- <com.scwang.smartrefresh.layout.SmartRefreshLayout-->
<!-- android:id="@+id/srlMainPage"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="0dp"-->
<!-- android:layout_weight="1"-->
<!-- app:srlAccentColor="@color/black">--
>
<com.scwang.smartrefresh.header.MaterialHeader
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/
>
<!-- <com.scwang.smartrefresh.header.MaterialHeader-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content" />--
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_watch_record"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
<com.scwang.smartrefresh.layout.footer.ClassicsFooter
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:srlAccentColor=
"@color/black"
app:srlPrimaryColor=
"@color/color_FDFDFD"
/
>
</com.scwang.smartrefresh.layout.SmartRefreshLayout
>
<!-- <com.scwang.smartrefresh.layout.footer.ClassicsFooter-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- app:srlAccentColor="@color/black"-->
<!-- app:srlPrimaryColor="@color/color_FDFDFD" />--
>
<!-- </com.scwang.smartrefresh.layout.SmartRefreshLayout>--
>
</LinearLayout>
video/app/src/main/res/layout/dialog_vip_count.xml
0 → 100644
View file @
f848b5b4
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<FrameLayout
android:id=
"@+id/fm"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_centerInParent=
"true"
android:layout_margin=
"50dp"
android:background=
"@drawable/shape_banner_write"
>
<ImageView
android:layout_width=
"match_parent"
android:layout_height=
"200dp"
android:scaleType=
"centerCrop"
android:src=
"@mipmap/bg_vip_count"
/>
<TextView
android:id=
"@+id/text_count"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginBottom=
"20dp"
android:background=
"@mipmap/bg_vip_count_circle"
android:gravity=
"center"
android:text=
"3"
android:textColor=
"@color/tv_message_recente_money"
android:textSize=
"30sp"
android:textStyle=
"bold"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal|bottom"
android:layout_marginBottom=
"30dp"
android:text=
"一分钱签约会员解锁全部剧集"
android:textColor=
"@color/black"
/>
</FrameLayout>
</RelativeLayout>
video/app/src/main/res/layout/drama_activity_api_detail.xml
View file @
f848b5b4
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
android:background=
"#77090909"
>
<FrameLayout
android:id=
"@+id/fl_container"
...
...
@@ -9,6 +11,81 @@
android:layout_height=
"match_parent"
android:layout_marginBottom=
"50dp"
/>
<View
android:id=
"@+id/view"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<LinearLayout
android:id=
"@+id/ll"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"15dp"
android:layout_marginBottom=
"100dp"
android:orientation=
"vertical"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
>
<TextView
android:id=
"@+id/title_tv"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:ellipsize=
"end"
android:gravity=
"center"
android:maxEms=
"9"
android:maxLines=
"1"
android:text=
"-"
android:textColor=
"#fff"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/info_tv"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:ellipsize=
"end"
android:maxEms=
"14"
android:maxLines=
"3"
android:text=
"-"
android:textColor=
"#fff"
android:textSize=
"14sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_collect"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"15dp"
android:gravity=
"center"
android:orientation=
"vertical"
app:layout_constraintBottom_toTopOf=
"@id/ll"
app:layout_constraintRight_toRightOf=
"parent"
>
<com.airbnb.lottie.LottieAnimationView
android:id=
"@+id/zan_iv"
android:layout_width=
"35dp"
android:layout_height=
"35dp"
android:layout_marginTop=
"10dp"
android:src=
"@mipmap/home_collect_img_0"
/>
<TextView
android:id=
"@+id/zan_num_tv"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:text=
"-"
android:textColor=
"#fff"
android:textSize=
"14sp"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<FrameLayout
android:id=
"@+id/fm_bottom"
android:layout_width=
"match_parent"
...
...
@@ -51,22 +128,58 @@
</FrameLayout>
<FrameLayout
android:id=
"@+id/block_view"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginBottom=
"50dp"
android:background=
"#99000000"
>
<ImageView
android:id=
"@+id/iv_bg"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#10ffffff"
android:gravity=
"center"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/tv_info"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal
"
android:layout_marginTop=
"10dp
"
android:textColor=
"#FFFFFFFF
"
android:layout_marginBottom=
"30dp
"
android:text=
"试看已结束
"
android:textColor=
"@color/white
"
android:textSize=
"16sp"
/>
<Button
android:id=
"@+id/unlock"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"20dp"
android:background=
"@mipmap/bg_detail_top"
android:text=
"看广告解锁1集"
android:textColor=
"@color/white"
/>
<Button
android:id=
"@+id/vip"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@mipmap/bg_detail_bottom"
android:textColor=
"@color/white"
/>
</LinearLayout>
<
include
layout=
"@layout/item_block_view"
/
>
<
/FrameLayout
>
<ImageView
android:id=
"@+id/leave"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"20dp"
android:padding=
"10dp"
android:src=
"@mipmap/ic_arrow_white"
/>
</FrameLayout>
\ No newline at end of file
video/app/src/main/res/layout/fragment_follow_video.xml
View file @
f848b5b4
...
...
@@ -2,16 +2,14 @@
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:paddingTop=
"68dp"
android:background=
"@color/white"
>
android:paddingTop=
"68dp"
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_follow"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:background=
"@color/full_transparent"
android:overScrollMode=
"never"
/>
</FrameLayout>
\ No newline at end of file
video/app/src/main/res/layout/fragment_main.xml
View file @
f848b5b4
...
...
@@ -153,8 +153,8 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_marginLeft=
"1
5
dp"
android:layout_marginRight=
"1
5
dp"
android:layout_marginLeft=
"1
0
dp"
android:layout_marginRight=
"1
0
dp"
android:layout_marginBottom=
"10dp"
android:background=
"@drawable/shape_bg_black"
>
...
...
@@ -173,10 +173,11 @@
<TextView
android:id=
"@+id/tv_main_watching_name"
android:layout_width=
"
match_par
ent"
android:layout_width=
"
wrap_cont
ent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"8dp"
android:text=
"我去平行时空"
android:text=
"我去平行时空我去平行时空"
android:singleLine=
"true"
android:textColor=
"@color/white"
android:textSize=
"14sp"
/>
...
...
@@ -186,6 +187,8 @@
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:text=
"重生 虐恋"
android:singleLine=
"true"
android:layout_marginBottom=
"2dp"
android:textColor=
"@color/white"
android:textSize=
"10sp"
/>
...
...
@@ -194,35 +197,33 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"重生 虐恋"
android:singleLine=
"true"
android:textColor=
"@color/graya"
android:textSize=
"10sp"
/>
</LinearLayout>
<RelativeLayout
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
>
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
>
<ImageView
android:id=
"@+id/iv_main_watching_close"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:padding=
"
10
dp"
android:padding=
"
6
dp"
android:layout_alignParentRight=
"true"
android:src=
"@mipmap/ic_quit_white"
></ImageView>
<TextView
android:id=
"@+id/tv_main_watching_goto"
android:layout_width=
"
wrap_content
"
android:layout_width=
"
100dp
"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"30dp"
android:background=
"@drawable/shape_red"
android:layout_marginRight=
"15dp"
android:gravity=
"center"
android:paddingLeft=
"30dp"
android:paddingTop=
"8dp"
android:paddingRight=
"30dp"
android:paddingBottom=
"10dp"
android:text=
"继续观看"
android:textColor=
"@color/white"
...
...
@@ -230,6 +231,4 @@
android:textStyle=
"bold"
/>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
video/app/src/main/res/layout/fragment_main_my.xml
View file @
f848b5b4
...
...
@@ -112,7 +112,7 @@
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:paddingStart=
"20dp"
android:paddingEnd=
"
20
dp"
>
android:paddingEnd=
"
15
dp"
>
<TextView
android:layout_width=
"0dp"
...
...
@@ -143,7 +143,7 @@
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:paddingStart=
"20dp"
android:paddingEnd=
"
20
dp"
>
android:paddingEnd=
"
15
dp"
>
<TextView
android:layout_width=
"0dp"
...
...
@@ -173,7 +173,7 @@
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:paddingStart=
"20dp"
android:paddingEnd=
"
20
dp"
>
android:paddingEnd=
"
15
dp"
>
<TextView
android:layout_width=
"0dp"
...
...
@@ -204,7 +204,7 @@
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:paddingStart=
"20dp"
android:paddingEnd=
"
20
dp"
>
android:paddingEnd=
"
15
dp"
>
<TextView
android:id=
"@+id/tv_contact"
...
...
@@ -235,7 +235,7 @@
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:paddingStart=
"20dp"
android:paddingEnd=
"
20
dp"
>
android:paddingEnd=
"
15
dp"
>
<TextView
android:layout_width=
"0dp"
...
...
video/app/src/main/res/layout/fragment_watch_video.xml
View file @
f848b5b4
...
...
@@ -4,10 +4,15 @@
android:layout_height=
"match_parent"
android:background=
"@color/black"
>
<com.mints.wisdomclean.ui.widgets.NestedScrollableHost
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/recy"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginTop=
"30dp"
/>
</com.mints.wisdomclean.ui.widgets.NestedScrollableHost>
</FrameLayout>
\ No newline at end of file
video/app/src/main/res/layout/item_block_view.xml
View file @
f848b5b4
...
...
@@ -11,9 +11,10 @@
android:layout_height=
"match_parent"
/>
<LinearLayout
android:layout_width=
"
match_par
ent"
android:layout_height=
"
match_par
ent"
android:layout_width=
"
wrap_cont
ent"
android:layout_height=
"
wrap_cont
ent"
android:gravity=
"center"
android:layout_gravity=
"center"
android:orientation=
"vertical"
>
<TextView
...
...
video/app/src/main/res/layout/item_empty_history.xml
0 → 100644
View file @
f848b5b4
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<View
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerInParent=
"true"
android:text=
"还没有历史记录"
android:textSize=
"18sp"
/>
</RelativeLayout>
\ No newline at end of file
video/app/src/main/res/layout/item_empty_video.xml
View file @
f848b5b4
...
...
@@ -4,6 +4,10 @@
android:layout_height=
"match_parent"
android:background=
"#99000000"
>
<View
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
video/app/src/main/res/layout/item_follow.xml
View file @
f848b5b4
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"180dp"
>
android:layout_width=
"wrap_content"
android:layout_marginBottom=
"10dp"
android:layout_marginLeft=
"3dp"
android:layout_marginRight=
"3dp"
android:layout_height=
"wrap_content"
>
<ImageView
android:id=
"@+id/image_iv"
android:layout_width=
"100dp"
android:layout_height=
"120dp"
android:layout_width=
"110dp"
android:layout_height=
"150dp"
android:scaleType=
"fitXY"
android:src=
"@mipmap/ic_launcher_main"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
...
...
@@ -18,7 +22,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"6dp"
android:layout_marginBottom=
"
10
dp"
android:layout_marginBottom=
"
4
dp"
android:text=
"已完结"
android:textColor=
"@color/white"
app:layout_constraintBottom_toBottomOf=
"@id/image_iv"
...
...
@@ -26,9 +30,11 @@
<TextView
android:id=
"@+id/title_tv"
android:layout_width=
"
wrap_content
"
android:layout_width=
"
106dp
"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:ellipsize=
"end"
android:maxLines=
"1"
android:text=
"重回80年代"
android:textColor=
"@color/black"
app:layout_constraintStart_toStartOf=
"@id/image_iv"
...
...
@@ -36,9 +42,11 @@
<TextView
android:id=
"@+id/info_tv"
android:layout_width=
"
wrap_content
"
android:layout_width=
"
106dp
"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:ellipsize=
"end"
android:maxLines=
"1"
android:text=
"重回80年代"
android:textColor=
"@color/gray"
android:textSize=
"12sp"
...
...
@@ -47,8 +55,8 @@
<FrameLayout
android:id=
"@+id/fm_mask"
android:layout_width=
"1
0
0dp"
android:layout_height=
"
180dp
"
android:layout_width=
"1
1
0dp"
android:layout_height=
"
wrap_content
"
android:background=
"@drawable/shape_half_trans2"
app:layout_constraintEnd_toEndOf=
"@id/image_iv"
app:layout_constraintStart_toStartOf=
"@id/image_iv"
...
...
@@ -63,7 +71,7 @@
android:button=
"@null"
android:drawableEnd=
"@drawable/selector_cb"
android:paddingEnd=
"6dp"
android:paddingBottom=
"1
4
0dp"
/>
android:paddingBottom=
"1
9
0dp"
/>
</FrameLayout>
...
...
video/app/src/main/res/layout/item_hot_style.xml
View file @
f848b5b4
...
...
@@ -51,7 +51,7 @@
android:layout_height=
"wrap_content"
android:singleLine=
"true"
android:text=
"重生 虐恋"
android:textColor=
"@color/
color_939AA3
"
android:textColor=
"@color/
gray
"
android:textSize=
"12sp"
/>
</LinearLayout>
\ No newline at end of file
video/app/src/main/res/layout/item_rv_top.xml
View file @
f848b5b4
...
...
@@ -65,7 +65,7 @@
android:layout_height=
"wrap_content"
android:singleLine=
"true"
android:text=
"重生 虐恋"
android:textColor=
"@color/
color_939AA3
"
android:textColor=
"@color/
gray
"
android:textSize=
"12sp"
/>
</LinearLayout>
\ No newline at end of file
video/app/src/main/res/layout/item_video.xml
View file @
f848b5b4
...
...
@@ -21,6 +21,7 @@
android:layout_height=
"wrap_content"
android:layout_marginStart=
"15dp"
android:orientation=
"horizontal"
android:layout_marginBottom=
"10dp"
app:layout_constraintBottom_toTopOf=
"@id/info_tv"
app:layout_constraintLeft_toLeftOf=
"parent"
>
...
...
@@ -40,7 +41,8 @@
<TextView
android:id=
"@+id/info_tv"
android:layout_width=
"wrap_content"
android:layout_height=
"50dp"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"24dp"
android:layout_marginStart=
"15dp"
android:ellipsize=
"end"
android:gravity=
"center|left"
...
...
video/app/src/main/res/layout/item_watch_record.xml
View file @
f848b5b4
...
...
@@ -3,8 +3,7 @@
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:paddingStart=
"15dp"
android:paddingEnd=
"15dp"
>
android:padding=
"10dp"
>
<ImageView
android:id=
"@+id/image_iv"
...
...
@@ -35,6 +34,9 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"6dp"
android:ellipsize=
"end"
android:maxWidth=
"140dp"
android:maxLines=
"2"
android:text=
"重回80年代"
android:textColor=
"@color/gray"
android:textSize=
"12sp"
/>
...
...
video/app/src/main/res/layout/web_header_layout.xml
View file @
f848b5b4
...
...
@@ -34,5 +34,6 @@
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:layout_alignParentBottom=
"true"
android:background=
"#E6E6E6"
/>
android:background=
"#E6E6E6"
android:visibility=
"gone"
/>
</RelativeLayout>
\ No newline at end of file
video/app/src/main/res/mipmap-xhdpi/bg_detail_bottom.png
0 → 100644
View file @
f848b5b4
9.63 KB
video/app/src/main/res/mipmap-xhdpi/bg_detail_top.png
0 → 100644
View file @
f848b5b4
13.5 KB
video/app/src/main/res/mipmap-xhdpi/bg_vip_count.png
0 → 100644
View file @
f848b5b4
63.1 KB
video/app/src/main/res/mipmap-xhdpi/bg_vip_count_circle.png
0 → 100644
View file @
f848b5b4
4.18 KB
video/app/src/main/res/values/styles.xml
View file @
f848b5b4
...
...
@@ -78,6 +78,11 @@
<item
name=
"android:windowExitAnimation"
>
@anim/dialog_bottom_out
</item>
</style>
<style
name=
"DialogAnimFade"
parent=
"@android:style/Animation"
>
<item
name=
"android:windowEnterAnimation"
>
@anim/fade_in
</item>
<item
name=
"android:windowExitAnimation"
>
@anim/fade_out
</item>
</style>
<style
name=
"CustomCheckboxTheme"
parent=
"@android:style/Widget.CompoundButton.CheckBox"
>
<item
name=
"android:button"
>
@drawable/checkbox_style
</item>
</style>
...
...
video/gradle.properties
View file @
f848b5b4
...
...
@@ -25,10 +25,15 @@ android.nonTransitiveRClass=true
DEBUG_URL
=
"https://api.mints-tech.cn/camera-api/"
RELEASE_URL="https://api.mints-tech.cn/camera-api/"
RELEASE_KEY_PASSWORD
=
mintshelivideo
RELEASE_KEY_ALIAS
=
mints_helivideo
RELEASE_STORE_PASSWORD
=
mintshelivideo
RELEASE_STORE_FILE
=
mints_helivideo.jks
#RELEASE_KEY_PASSWORD=mintshelivideo
#RELEASE_KEY_ALIAS=mints_helivideo
#RELEASE_STORE_PASSWORD=mintshelivideo
#RELEASE_STORE_FILE=mints_helivideo.jks
RELEASE_KEY_PASSWORD
=
mintswisdomclean
RELEASE_KEY_ALIAS
=
mints_wisdomclean
RELEASE_STORE_PASSWORD
=
mintswisdomclean
RELEASE_STORE_FILE
=
mints_wisdomclean.jks
#ShareSDK
RELEASE_SHARESDK_KEY
=
381ca97ef616d
...
...
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