Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_goodmoney
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_goodmoney
Commits
b3015b1b
Commit
b3015b1b
authored
Feb 23, 2021
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
来电秀滑动功能
parent
715ac981
Changes
23
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
1202 additions
and
33 deletions
+1202
-33
build.gradle
GoodMoney/app/build.gradle
+3
-0
LayoutManagerGroup.aar
GoodMoney/app/libs/LayoutManagerGroup.aar
+0
-0
AndroidManifest.xml
GoodMoney/app/src/main/AndroidManifest.xml
+3
-0
CsjDrawAdManager.kt
...main/java/com/mints/goodmoney/ad/draw/CsjDrawAdManager.kt
+94
-0
DownloadApkManager.kt
...in/java/com/mints/goodmoney/manager/DownloadApkManager.kt
+4
-2
TtCsjAdManager.java
...main/java/com/mints/goodmoney/manager/TtCsjAdManager.java
+3
-3
DrawVideoBean.java
...ain/java/com/mints/goodmoney/mvp/model/DrawVideoBean.java
+56
-0
KylVideoPresenter.kt
...a/com/mints/goodmoney/mvp/presenters/KylVideoPresenter.kt
+31
-0
KylVideoView.kt
...c/main/java/com/mints/goodmoney/mvp/views/KylVideoView.kt
+4
-1
AwardActivity.kt
...in/java/com/mints/goodmoney/ui/activitys/AwardActivity.kt
+8
-8
DrawNativeVideoActivity.kt
...m/mints/goodmoney/ui/activitys/DrawNativeVideoActivity.kt
+457
-0
KylVideoActivity.kt
...java/com/mints/goodmoney/ui/activitys/KylVideoActivity.kt
+10
-4
DrawVideoAdapter.kt
...n/java/com/mints/goodmoney/ui/adapter/DrawVideoAdapter.kt
+94
-0
KylPageAdapter.kt
...ain/java/com/mints/goodmoney/ui/adapter/KylPageAdapter.kt
+9
-8
KuYinYuePageFragment.kt
...a/com/mints/goodmoney/ui/fragment/KuYinYuePageFragment.kt
+23
-5
MyFragment.kt
...c/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
+2
-1
FullScreenVideoView.java
...a/com/mints/goodmoney/ui/widgets/FullScreenVideoView.java
+26
-0
DownloadProgressDialog.kt
...nts/goodmoney/ui/widgets/dialog/DownloadProgressDialog.kt
+0
-1
UIUtils.java
.../app/src/main/java/com/mints/goodmoney/utils/UIUtils.java
+281
-0
Utils.java
...ey/app/src/main/java/com/mints/goodmoney/utils/Utils.java
+2
-0
play_arrow.xml
GoodMoney/app/src/main/res/drawable/play_arrow.xml
+5
-0
activity_draw_native_video.xml
...ey/app/src/main/res/layout/activity_draw_native_video.xml
+54
-0
item_view_pager.xml
GoodMoney/app/src/main/res/layout/item_view_pager.xml
+33
-0
No files found.
GoodMoney/app/build.gradle
View file @
b3015b1b
...
@@ -268,6 +268,9 @@ dependencies {
...
@@ -268,6 +268,9 @@ dependencies {
// 快手
// 快手
implementation
(
name:
'kssdk-ad-3.3.6-publishRelease'
,
ext:
'aar'
)
implementation
(
name:
'kssdk-ad-3.3.6-publishRelease'
,
ext:
'aar'
)
// draw视频
implementation
(
name:
'LayoutManagerGroup'
,
ext:
'aar'
)
// testImplementation 'junit:junit:4.13'
// testImplementation 'junit:junit:4.13'
// androidTestImplementation 'androidx.test.ext:junit:1.1.2'
// androidTestImplementation 'androidx.test.ext:junit:1.1.2'
// androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
// androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
...
...
GoodMoney/app/libs/LayoutManagerGroup.aar
0 → 100644
View file @
b3015b1b
File added
GoodMoney/app/src/main/AndroidManifest.xml
View file @
b3015b1b
...
@@ -222,6 +222,9 @@
...
@@ -222,6 +222,9 @@
<activity
<activity
android:name=
".ui.activitys.TaskCpdActivity"
android:name=
".ui.activitys.TaskCpdActivity"
android:screenOrientation=
"portrait"
/>
android:screenOrientation=
"portrait"
/>
<activity
android:name=
".ui.activitys.DrawNativeVideoActivity"
android:screenOrientation=
"portrait"
/>
<activity
<activity
android:name=
".ui.activitys.KylVideoActivity"
android:name=
".ui.activitys.KylVideoActivity"
android:configChanges=
"orientation|screenSize|keyboardHidden"
android:configChanges=
"orientation|screenSize|keyboardHidden"
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/draw/CsjDrawAdManager.kt
0 → 100644
View file @
b3015b1b
package
com.mints.goodmoney.ad.draw
import
android.app.Activity
import
com.bytedance.sdk.openadsdk.AdSlot
import
com.bytedance.sdk.openadsdk.TTAdNative
import
com.bytedance.sdk.openadsdk.TTNativeExpressAd
import
com.bytedance.sdk.openadsdk.TTRewardVideoAd
import
com.mints.goodmoney.ad.video.BaseVideoAd
import
com.mints.goodmoney.manager.TTNativeExpressManager
import
com.mints.goodmoney.manager.TtCsjAdManager
import
com.mints.goodmoney.utils.LogUtil
import
com.mints.goodmoney.utils.ToastUtil
import
com.mints.goodmoney.utils.UIUtils
import
com.mints.goodmoney.utils.Utils
class
CsjDrawAdManager
private
constructor
(
activity
:
Activity
)
:
BaseVideoAd
(
activity
)
{
companion
object
{
private
var
_inst
:
CsjDrawAdManager
?
=
null
fun
getInstance
(
activity
:
Activity
):
CsjDrawAdManager
?
{
return
if
(
_inst
!=
null
)
{
_inst
}
else
{
_inst
=
CsjDrawAdManager
(
activity
)
_inst
}
}
}
private
var
ttAdNative
:
TTAdNative
?
=
null
private
var
mttRewardVideoAd
:
TTRewardVideoAd
?
=
null
private
var
csjDrawAdListener
:
CsjDrawAdListener
?
=
null
init
{
val
ttNativeExpressManager
=
TTNativeExpressManager
()
ttAdNative
=
ttNativeExpressManager
.
initTTAd
(
false
)
}
fun
loadDrawNativeAd
()
{
//step3:创建广告请求参数AdSlot,具体参数含义参考文档
//step3:创建广告请求参数AdSlot,具体参数含义参考文档
val
expressViewWidth
:
Float
=
UIUtils
.
getScreenWidthDp
(
activity
)
val
expressViewHeight
:
Float
=
UIUtils
.
getHeight
(
activity
)
val
adSlot
=
AdSlot
.
Builder
()
.
setCodeId
(
TtCsjAdManager
.
TT_AD_EXPRESS_DRAW
)
.
setExpressViewAcceptedSize
(
expressViewWidth
,
expressViewHeight
)
.
setAdCount
(
1
)
//请求广告数量为1到3条
.
build
()
mttRewardVideoAd
?.
setRewardAdInteractionListener
(
null
)
//step4:请求广告,对请求回调的广告作渲染处理
ttAdNative
?.
loadExpressDrawFeedAd
(
adSlot
,
object
:
TTAdNative
.
NativeExpressAdListener
{
override
fun
onError
(
p0
:
Int
,
p1
:
String
?)
{
ToastUtil
.
show
(
activity
,
p1
)
LogUtil
.
d
(
p1
)
this
@CsjDrawAdManager
.
csjDrawAdListener
?.
csjDrawAdFail
()
}
override
fun
onNativeExpressAdLoad
(
p0
:
MutableList
<
TTNativeExpressAd
>?)
{
if
(
p0
==
null
||
p0
.
isEmpty
())
{
ToastUtil
.
show
(
activity
,
"未请求到广告"
)
LogUtil
.
d
(
"未请求到广告"
)
return
}
this
@CsjDrawAdManager
.
csjDrawAdListener
?.
csjDrawAdSuccess
(
p0
)
}
})
}
fun
setCsjDrawAdListener
(
csjDrawAdListener
:
CsjDrawAdListener
)
{
this
.
csjDrawAdListener
=
csjDrawAdListener
}
interface
CsjDrawAdListener
{
fun
csjDrawAdFail
()
fun
csjDrawAdSuccess
(
data
:
MutableList
<
TTNativeExpressAd
>?)
}
override
fun
onDestroy
()
{
super
.
onDestroy
()
mttRewardVideoAd
?.
setRewardAdInteractionListener
(
null
)
activity
=
null
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/DownloadApkManager.kt
View file @
b3015b1b
...
@@ -108,7 +108,9 @@ object DownloadApkManager {
...
@@ -108,7 +108,9 @@ object DownloadApkManager {
.
build
()
.
build
()
.
setOnProgressListener
{
progress
->
.
setOnProgressListener
{
progress
->
if
(
activity
!=
null
&&
!
activity
!!
.
isFinishing
)
{
if
(
activity
!=
null
&&
!
activity
!!
.
isFinishing
)
{
downloadProgressDialog
?.
setProgress
(
progress
)
activity
!!
.
runOnUiThread
{
downloadProgressDialog
?.
setProgress
(
progress
)
}
}
}
}
}
.
start
(
object
:
OnDownloadListener
{
.
start
(
object
:
OnDownloadListener
{
...
@@ -126,7 +128,7 @@ object DownloadApkManager {
...
@@ -126,7 +128,7 @@ object DownloadApkManager {
}
}
override
fun
onError
(
error
:
Error
)
{
override
fun
onError
(
error
:
Error
)
{
if
(
activity
!=
null
&&
!
activity
!!
.
isFinishing
()
)
{
if
(
activity
!=
null
&&
!
activity
!!
.
isFinishing
)
{
downloadProgressDialog
?.
dismiss
()
downloadProgressDialog
?.
dismiss
()
CacheUtil
.
clearAllCache
()
CacheUtil
.
clearAllCache
()
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/TtCsjAdManager.java
View file @
b3015b1b
package
com
.
mints
.
goodmoney
.
manager
;
package
com
.
mints
.
goodmoney
.
manager
;
import
android.content.Context
;
import
android.content.Context
;
import
android.text.TextUtils
;
import
com.bytedance.sdk.openadsdk.TTAdConfig
;
import
com.bytedance.sdk.openadsdk.TTAdConfig
;
import
com.bytedance.sdk.openadsdk.TTAdConstant
;
import
com.bytedance.sdk.openadsdk.TTAdConstant
;
import
com.bytedance.sdk.openadsdk.TTAdSdk
;
import
com.bytedance.sdk.openadsdk.TTAdSdk
;
import
com.mints.goodmoney.BuildConfig
;
import
com.mints.goodmoney.BuildConfig
;
import
com.mints.goodmoney.MintsApplication
;
import
com.mints.goodmoney.MintsApplication
;
import
com.mints.goodmoney.common.AppConfig
;
import
com.mints.goodmoney.common.Constant
;
import
com.mints.goodmoney.common.Constant
;
import
com.mints.goodmoney.mvp.model.AdcodeBean
;
import
com.mints.goodmoney.mvp.model.AdcodeBean
;
import
com.mints.goodmoney.mvp.model.UserMsgBean
;
import
com.mints.library.utils.CommonUtils
;
import
com.mints.library.utils.CommonUtils
;
/**
/**
...
@@ -59,6 +56,9 @@ public class TtCsjAdManager {
...
@@ -59,6 +56,9 @@ public class TtCsjAdManager {
public
static
String
TT_AD_INSERT_LOADING_ID_LIEBAO
=
"945608874"
;
//猎豹游戏加载时
public
static
String
TT_AD_INSERT_LOADING_ID_LIEBAO
=
"945608874"
;
//猎豹游戏加载时
public
static
String
TT_AD_INSERT_LOADING_ID_JULEYUN
=
"945675533"
;
//聚乐云
public
static
String
TT_AD_INSERT_LOADING_ID_JULEYUN
=
"945675533"
;
//聚乐云
/*全屏Draw信息流*/
public
static
String
TT_AD_EXPRESS_DRAW
=
"945858858"
;
//讯飞信息流
private
static
boolean
sInit
;
private
static
boolean
sInit
;
public
static
com
.
bytedance
.
sdk
.
openadsdk
.
TTAdManager
get
()
{
public
static
com
.
bytedance
.
sdk
.
openadsdk
.
TTAdManager
get
()
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/DrawVideoBean.java
0 → 100644
View file @
b3015b1b
package
com
.
mints
.
goodmoney
.
mvp
.
model
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
import
com.bytedance.sdk.openadsdk.TTNativeExpressAd
;
public
class
DrawVideoBean
implements
Parcelable
{
public
int
type
=
0
;
public
TTNativeExpressAd
ad
;
public
String
videoId
;
public
String
videoUrl
;
public
String
ImgId
;
public
DrawVideoBean
(
int
type
,
TTNativeExpressAd
ad
,
String
videoId
,
String
videoUrl
,
String
imgId
)
{
this
.
type
=
type
;
this
.
ad
=
ad
;
this
.
videoId
=
videoId
;
this
.
videoUrl
=
videoUrl
;
ImgId
=
imgId
;
}
protected
DrawVideoBean
(
Parcel
in
)
{
type
=
in
.
readInt
();
videoId
=
in
.
readString
();
videoUrl
=
in
.
readString
();
ImgId
=
in
.
readString
();
}
@Override
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
dest
.
writeInt
(
type
);
dest
.
writeString
(
videoId
);
dest
.
writeString
(
videoUrl
);
dest
.
writeString
(
ImgId
);
}
@Override
public
int
describeContents
()
{
return
0
;
}
public
static
final
Creator
<
DrawVideoBean
>
CREATOR
=
new
Creator
<
DrawVideoBean
>()
{
@Override
public
DrawVideoBean
createFromParcel
(
Parcel
in
)
{
return
new
DrawVideoBean
(
in
);
}
@Override
public
DrawVideoBean
[]
newArray
(
int
size
)
{
return
new
DrawVideoBean
[
size
];
}
};
}
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/KylVideoPresenter.kt
View file @
b3015b1b
...
@@ -3,6 +3,7 @@ package com.mints.goodmoney.mvp.presenters
...
@@ -3,6 +3,7 @@ package com.mints.goodmoney.mvp.presenters
import
com.google.gson.JsonObject
import
com.google.gson.JsonObject
import
com.mints.goodmoney.manager.AppHttpManager
import
com.mints.goodmoney.manager.AppHttpManager
import
com.mints.goodmoney.mvp.model.BaseResponse
import
com.mints.goodmoney.mvp.model.BaseResponse
import
com.mints.goodmoney.mvp.model.KylBean
import
com.mints.goodmoney.mvp.views.KylVideoView
import
com.mints.goodmoney.mvp.views.KylVideoView
import
com.mints.library.net.neterror.BaseSubscriber
import
com.mints.library.net.neterror.BaseSubscriber
import
com.mints.library.net.neterror.Throwable
import
com.mints.library.net.neterror.Throwable
...
@@ -10,6 +11,36 @@ import java.util.*
...
@@ -10,6 +11,36 @@ import java.util.*
class
KylVideoPresenter
:
BasePresenter
<
KylVideoView
>()
{
class
KylVideoPresenter
:
BasePresenter
<
KylVideoView
>()
{
fun
getXfPageMsg
(
targetid
:
String
,
page
:
Int
,
pageCount
:
Int
)
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"targetid"
]
=
targetid
vo
[
"page"
]
=
page
vo
[
"size"
]
=
pageCount
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
getXfPageMsg
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
KylBean
>>()
{
override
fun
onCompleted
()
{
}
override
fun
onError
(
e
:
Throwable
)
{
if
(
isLinkView
)
return
view
.
getXfPageMsgFail
()
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
KylBean
>)
{
if
(
isLinkView
)
return
val
code
=
baseResponse
.
getStatus
()
when
(
code
)
{
200
->
{
view
.
getXfPageMsgSuc
(
baseResponse
.
data
)
}
else
->
view
.
showToast
(
baseResponse
.
getMessage
())
}
}
})
}
fun
addReadSeconds
(
seconds
:
Int
)
{
fun
addReadSeconds
(
seconds
:
Int
)
{
val
vo
=
HashMap
<
String
,
Any
>()
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"seconds"
]
=
seconds
vo
[
"seconds"
]
=
seconds
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/views/KylVideoView.kt
View file @
b3015b1b
package
com.mints.goodmoney.mvp.views
package
com.mints.goodmoney.mvp.views
import
com.mints.goodmoney.mvp.model.KylBean
interface
KylVideoView
:
BaseView
{
interface
KylVideoView
:
BaseView
{
fun
getXfPageMsgSuc
(
data
:
KylBean
)
fun
getXfPageMsgFail
()
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/AwardActivity.kt
View file @
b3015b1b
...
@@ -365,9 +365,14 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
...
@@ -365,9 +365,14 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
}
}
override
fun
onDestroy
()
{
override
fun
onDestroy
()
{
super
.
onDestroy
()
AppConfig
.
isSuperTask
=
false
AppConfig
.
isSuperTask
=
false
if
(
mReceiverBroadcastReceiver
!=
null
)
{
mContext
.
stopService
(
Intent
(
context
,
AppInstallService
::
class
.
java
))
mContext
.
unregisterReceiver
(
mReceiverBroadcastReceiver
)
mReceiverBroadcastReceiver
=
null
}
awardPresenter
.
setHighTaskType
(
"0"
)
awardPresenter
.
setHighTaskType
(
"0"
)
mTimer
?.
stop
()
mTimer
?.
stop
()
...
@@ -386,14 +391,9 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
...
@@ -386,14 +391,9 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
videoAdingManager
.
setVideoAdingListener
(
null
)
videoAdingManager
.
setVideoAdingListener
(
null
)
videoAdingManager
.
onDestory
()
videoAdingManager
.
onDestory
()
if
(
mReceiverBroadcastReceiver
!=
null
)
{
mContext
.
stopService
(
Intent
(
context
,
AppInstallService
::
class
.
java
))
mContext
.
unregisterReceiver
(
mReceiverBroadcastReceiver
)
mReceiverBroadcastReceiver
=
null
}
awardPresenter
.
detachView
()
awardPresenter
.
detachView
()
super
.
onDestroy
()
}
}
override
fun
onKeyDown
(
keyCode
:
Int
,
event
:
KeyEvent
):
Boolean
{
override
fun
onKeyDown
(
keyCode
:
Int
,
event
:
KeyEvent
):
Boolean
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/DrawNativeVideoActivity.kt
0 → 100644
View file @
b3015b1b
This diff is collapsed.
Click to expand it.
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/KylVideoActivity.kt
View file @
b3015b1b
...
@@ -16,6 +16,7 @@ import com.mints.goodmoney.call.permission.PermissionActivity
...
@@ -16,6 +16,7 @@ import com.mints.goodmoney.call.permission.PermissionActivity
import
com.mints.goodmoney.call.permission.PermissionManager
import
com.mints.goodmoney.call.permission.PermissionManager
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.UserManager
import
com.mints.goodmoney.manager.UserManager
import
com.mints.goodmoney.mvp.model.KylBean
import
com.mints.goodmoney.mvp.model.VideoAdingBean
import
com.mints.goodmoney.mvp.model.VideoAdingBean
import
com.mints.goodmoney.mvp.presenters.KylVideoPresenter
import
com.mints.goodmoney.mvp.presenters.KylVideoPresenter
import
com.mints.goodmoney.mvp.views.KylVideoView
import
com.mints.goodmoney.mvp.views.KylVideoView
...
@@ -133,11 +134,10 @@ class KylVideoActivity : BaseActivity(), View.OnClickListener, KylVideoView {
...
@@ -133,11 +134,10 @@ class KylVideoActivity : BaseActivity(), View.OnClickListener, KylVideoView {
private
fun
downloadVedioToCacheFile
()
{
private
fun
downloadVedioToCacheFile
()
{
downloadVedioSucFlag
=
false
downloadVedioSucFlag
=
false
var
vedioPath
=
""
var
vedioPath
:
String
=
try
{
try
{
getExternalFilesDir
(
null
)
!!
.
absolutePath
+
"/video/"
vedioPath
=
getExternalFilesDir
(
null
)
!!
.
absolutePath
+
"/video/"
}
catch
(
e
:
java
.
lang
.
Exception
)
{
}
catch
(
e
:
java
.
lang
.
Exception
)
{
vedioPath
=
filesDir
.
absolutePath
+
"/video/"
filesDir
.
absolutePath
+
"/video/"
}
}
val
vedioName
=
MD5
.
GetMD5Code
(
System
.
currentTimeMillis
().
toString
()
+
UserManager
.
getInstance
().
userID
+
videoUrl
)
+
".mp4"
val
vedioName
=
MD5
.
GetMD5Code
(
System
.
currentTimeMillis
().
toString
()
+
UserManager
.
getInstance
().
userID
+
videoUrl
)
+
".mp4"
vedioPathName
=
vedioPath
+
vedioName
vedioPathName
=
vedioPath
+
vedioName
...
@@ -225,4 +225,10 @@ class KylVideoActivity : BaseActivity(), View.OnClickListener, KylVideoView {
...
@@ -225,4 +225,10 @@ class KylVideoActivity : BaseActivity(), View.OnClickListener, KylVideoView {
PermissionActivity
.
startSelf
(
this
)
PermissionActivity
.
startSelf
(
this
)
}
}
}
}
override
fun
getXfPageMsgSuc
(
data
:
KylBean
)
{
}
override
fun
getXfPageMsgFail
()
{
}
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/adapter/DrawVideoAdapter.kt
0 → 100644
View file @
b3015b1b
package
com.mints.goodmoney.ui.adapter
import
android.content.Context
import
android.net.Uri
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.widget.*
import
androidx.recyclerview.widget.RecyclerView
import
com.mints.goodmoney.R
import
com.mints.goodmoney.mvp.model.DrawVideoBean
import
com.mints.goodmoney.ui.activitys.DrawNativeVideoActivity
import
com.mints.goodmoney.ui.adapter.listener.OnItemClickListener
import
com.mints.goodmoney.ui.widgets.FullScreenVideoView
import
com.mints.goodmoney.utils.LogUtil
import
com.mints.library.utils.GlideUtils
class
DrawVideoAdapter
(
context
:
Context
,
datas
:
List
<
DrawVideoBean
>)
:
RecyclerView
.
Adapter
<
RecyclerView
.
ViewHolder
>()
{
private
var
mContext
:
Context
=
context
private
var
mDrawVideoData
:
List
<
DrawVideoBean
>
=
datas
private
var
mOnItemClickListener
:
OnItemClickListener
?
=
null
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
RecyclerView
.
ViewHolder
{
val
view
=
LayoutInflater
.
from
(
mContext
).
inflate
(
R
.
layout
.
item_view_pager
,
parent
,
false
)
return
ViewHolder
(
view
)
}
override
fun
getItemViewType
(
position
:
Int
):
Int
{
return
mDrawVideoData
[
position
].
type
}
override
fun
onBindViewHolder
(
viewHolder
:
RecyclerView
.
ViewHolder
,
position
:
Int
)
{
val
holder
=
viewHolder
as
ViewHolder
var
view
:
View
?
=
View
(
mContext
)
val
item
:
DrawVideoBean
?
=
mDrawVideoData
[
position
]
if
(
item
?.
type
==
DrawNativeVideoActivity
.
TYPE_COMMON_ITEM
)
{
GlideUtils
.
loadImageView
(
mContext
,
item
.
ImgId
,
holder
.
img_thumb
)
view
=
getView
()
LogUtil
.
d
(
DrawNativeVideoActivity
.
WEB_VIDEO_URL
+
mDrawVideoData
[
position
].
videoId
)
(
view
as
VideoView
).
setVideoURI
(
Uri
.
parse
(
mDrawVideoData
[
position
].
videoUrl
))
}
else
if
(
item
?.
type
==
DrawNativeVideoActivity
.
TYPE_AD_ITEM
&&
item
.
ad
!=
null
)
{
view
=
item
.
ad
.
expressAdView
// if (item.ad.icon != null && item.ad.icon.imageUrl != null) {
// GlideUtils.loadImageView(mContext,)
// } else{
// holder.img_head_icon.setImageBitmap(item.ad.adLogo)
// }
}
holder
.
videoLayout
.
removeAllViews
()
if
(
view
?.
parent
!=
null
)
{
(
view
.
parent
as
ViewGroup
).
removeView
(
view
)
}
holder
.
videoLayout
.
addView
(
view
)
if
(
item
!=
null
)
{
changeUIVisibility
(
holder
,
item
.
type
)
}
}
private
fun
changeUIVisibility
(
holder
:
ViewHolder
,
type
:
Int
)
{
var
visibilable
=
true
if
(
type
==
DrawNativeVideoActivity
.
TYPE_AD_ITEM
)
{
visibilable
=
false
}
holder
.
img_play
.
visibility
=
if
(
visibilable
)
View
.
VISIBLE
else
View
.
GONE
holder
.
img_thumb
.
visibility
=
if
(
visibilable
)
View
.
VISIBLE
else
View
.
GONE
}
private
fun
getView
():
View
{
val
videoView
=
FullScreenVideoView
(
mContext
)
val
layoutParams
=
FrameLayout
.
LayoutParams
(
FrameLayout
.
LayoutParams
.
MATCH_PARENT
,
FrameLayout
.
LayoutParams
.
MATCH_PARENT
)
videoView
.
layoutParams
=
layoutParams
return
videoView
}
override
fun
getItemCount
():
Int
{
return
mDrawVideoData
.
size
}
inner
class
ViewHolder
(
itemView
:
View
)
:
RecyclerView
.
ViewHolder
(
itemView
)
{
val
img_thumb
:
ImageView
=
itemView
.
findViewById
(
R
.
id
.
img_thumb
)
val
img_play
:
ImageView
=
itemView
.
findViewById
(
R
.
id
.
img_play
)
val
rootView
:
RelativeLayout
=
itemView
.
findViewById
(
R
.
id
.
root_view
)
val
videoLayout
:
FrameLayout
=
itemView
.
findViewById
(
R
.
id
.
video_layout
)
}
fun
setOnItemClickListener
(
listener
:
OnItemClickListener
)
{
mOnItemClickListener
=
listener
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/adapter/KylPageAdapter.kt
View file @
b3015b1b
...
@@ -168,14 +168,15 @@ class KylPageAdapter(val kylPageList: MutableList<KylBean.Data>) :
...
@@ -168,14 +168,15 @@ class KylPageAdapter(val kylPageList: MutableList<KylBean.Data>) :
private
fun
bindDislikeCustom
(
dislike
:
View
,
ad
:
TTFeedAd
)
{
private
fun
bindDislikeCustom
(
dislike
:
View
,
ad
:
TTFeedAd
)
{
val
ttAdDislike
=
ad
.
getDislikeDialog
(
context
as
Activity
?)
val
ttAdDislike
=
ad
.
getDislikeDialog
(
context
as
Activity
?)
if
(
ttAdDislike
!=
null
)
{
// if (ttAdDislike != null) {
ad
.
getDislikeDialog
(
context
as
Activity
?).
setDislikeInteractionCallback
(
object
:
DislikeInteractionCallback
{
// ad.getDislikeDialog(context as Activity?).setDislikeInteractionCallback(object : DislikeInteractionCallback {
override
fun
onSelected
(
position
:
Int
,
value
:
String
)
{
// override fun onSelected(position: Int, value: String) {
}
// }
override
fun
onCancel
()
{}
// override fun onCancel() {}
override
fun
onRefuse
()
{}
// override fun onRefuse() {}
})
}
// })
// }
dislike
.
setOnClickListener
{
ttAdDislike
!!
.
showDislikeDialog
()
}
dislike
.
setOnClickListener
{
ttAdDislike
!!
.
showDislikeDialog
()
}
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/KuYinYuePageFragment.kt
View file @
b3015b1b
...
@@ -5,10 +5,11 @@ import androidx.recyclerview.widget.GridLayoutManager
...
@@ -5,10 +5,11 @@ import androidx.recyclerview.widget.GridLayoutManager
import
com.bytedance.sdk.openadsdk.*
import
com.bytedance.sdk.openadsdk.*
import
com.mints.goodmoney.R
import
com.mints.goodmoney.R
import
com.mints.goodmoney.manager.TtCsjAdManager
import
com.mints.goodmoney.manager.TtCsjAdManager
import
com.mints.goodmoney.mvp.model.DrawVideoBean
import
com.mints.goodmoney.mvp.model.KylBean
import
com.mints.goodmoney.mvp.model.KylBean
import
com.mints.goodmoney.mvp.presenters.KuYinYuePagePresenter
import
com.mints.goodmoney.mvp.presenters.KuYinYuePagePresenter
import
com.mints.goodmoney.mvp.views.KuYinYuePageView
import
com.mints.goodmoney.mvp.views.KuYinYuePageView
import
com.mints.goodmoney.ui.activitys.
Kyl
VideoActivity
import
com.mints.goodmoney.ui.activitys.
DrawNative
VideoActivity
import
com.mints.goodmoney.ui.adapter.KylPageAdapter
import
com.mints.goodmoney.ui.adapter.KylPageAdapter
import
com.mints.goodmoney.ui.fragment.base.LazyLoadBaseFragment
import
com.mints.goodmoney.ui.fragment.base.LazyLoadBaseFragment
import
com.mints.goodmoney.utils.LogUtil
import
com.mints.goodmoney.utils.LogUtil
...
@@ -62,11 +63,28 @@ class KuYinYuePageFragment(private val targetid: String) : LazyLoadBaseFragment(
...
@@ -62,11 +63,28 @@ class KuYinYuePageFragment(private val targetid: String) : LazyLoadBaseFragment(
}
}
override
fun
onItemClick
(
position
:
Int
)
{
override
fun
onItemClick
(
position
:
Int
)
{
if
(
kylData
!=
null
&&
kylData
.
size
>
0
)
{
if
(
kylData
.
size
>
0
)
{
// val bundle = Bundle()
// bundle.putString(KylVideoActivity.VIDEO_URL, kylData[position].url)
// bundle.putString(KylVideoActivity.VIDEO_ID, kylData[position].vedioId)
// readyGo(KylVideoActivity::class.java, bundle)
val
dataList
=
arrayListOf
<
DrawVideoBean
>()
val
index
=
position
%
PAGE_SIZE
// 余数
for
(
i
in
position
until
PAGE_SIZE
*
curPage
)
{
dataList
.
add
(
DrawVideoBean
(
DrawNativeVideoActivity
.
TYPE_COMMON_ITEM
,
null
,
kylData
[
index
/
PAGE_SIZE
+
i
].
vedioId
,
kylData
[
index
/
PAGE_SIZE
+
i
].
url
,
kylData
[
index
/
PAGE_SIZE
+
i
].
pvurl
))
}
val
bundle
=
Bundle
()
val
bundle
=
Bundle
()
bundle
.
putString
(
KylVideoActivity
.
VIDEO_URL
,
kylData
[
position
].
url
)
bundle
.
putParcelableArrayList
(
DrawNativeVideoActivity
.
VIDEO_DATA
,
dataList
)
bundle
.
putString
(
KylVideoActivity
.
VIDEO_ID
,
kylData
[
position
].
vedioId
)
bundle
.
putInt
(
DrawNativeVideoActivity
.
PLAY_INDEX
,
index
)
readyGo
(
KylVideoActivity
::
class
.
java
,
bundle
)
bundle
.
putInt
(
DrawNativeVideoActivity
.
CURRENT_PAGE
,
curPage
)
bundle
.
putString
(
DrawNativeVideoActivity
.
TARGET_ID
,
targetid
)
readyGo
(
DrawNativeVideoActivity
::
class
.
java
,
bundle
)
}
}
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
View file @
b3015b1b
...
@@ -762,7 +762,8 @@ class MyFragment : BaseFragment(),
...
@@ -762,7 +762,8 @@ class MyFragment : BaseFragment(),
}
}
R
.
id
.
iv_right_icon2
->
{
R
.
id
.
iv_right_icon2
->
{
// 跳转QQ客服
// 跳转QQ客服
jumpQQGroup
()
// jumpQQGroup()
readyGo
(
DrawNativeVideoActivity
::
class
.
java
)
}
}
R
.
id
.
item_customer_service
->
{
R
.
id
.
item_customer_service
->
{
// 跳转加入QQ群
// 跳转加入QQ群
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/widgets/FullScreenVideoView.java
0 → 100644
View file @
b3015b1b
package
com
.
mints
.
goodmoney
.
ui
.
widgets
;
import
android.content.Context
;
import
android.util.AttributeSet
;
import
android.widget.VideoView
;
public
class
FullScreenVideoView
extends
VideoView
{
public
FullScreenVideoView
(
Context
context
)
{
super
(
context
);
}
public
FullScreenVideoView
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
}
public
FullScreenVideoView
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
)
{
super
(
context
,
attrs
,
defStyleAttr
);
}
@Override
protected
void
onMeasure
(
int
widthMeasureSpec
,
int
heightMeasureSpec
)
{
int
width
=
getDefaultSize
(
0
,
widthMeasureSpec
);
int
height
=
getDefaultSize
(
0
,
heightMeasureSpec
);
setMeasuredDimension
(
width
,
height
);
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/widgets/dialog/DownloadProgressDialog.kt
View file @
b3015b1b
...
@@ -10,7 +10,6 @@ import android.widget.ImageView
...
@@ -10,7 +10,6 @@ import android.widget.ImageView
import
android.widget.TextView
import
android.widget.TextView
import
com.downloader.PRDownloader
import
com.downloader.PRDownloader
import
com.downloader.Progress
import
com.downloader.Progress
import
com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.R
import
com.mints.goodmoney.R
import
com.mints.goodmoney.utils.CacheUtil
import
com.mints.goodmoney.utils.CacheUtil
import
com.mints.goodmoney.utils.Utils
import
com.mints.goodmoney.utils.Utils
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/utils/UIUtils.java
0 → 100644
View file @
b3015b1b
This diff is collapsed.
Click to expand it.
GoodMoney/app/src/main/java/com/mints/goodmoney/utils/Utils.java
View file @
b3015b1b
...
@@ -26,9 +26,11 @@ import androidx.core.content.ContextCompat;
...
@@ -26,9 +26,11 @@ import androidx.core.content.ContextCompat;
import
android.provider.Settings
;
import
android.provider.Settings
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.view.DisplayCutout
;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.view.Window
;
import
android.view.Window
;
import
android.view.WindowInsets
;
import
android.view.WindowManager
;
import
android.view.WindowManager
;
import
android.view.accessibility.AccessibilityManager
;
import
android.view.accessibility.AccessibilityManager
;
...
...
GoodMoney/app/src/main/res/drawable/play_arrow.xml
0 → 100644
View file @
b3015b1b
<vector
android:alpha=
"0.61"
android:height=
"24dp"
android:viewportHeight=
"24.0"
android:viewportWidth=
"24.0"
android:width=
"24dp"
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<path
android:fillColor=
"#99ffffff"
android:pathData=
"M8,5v14l11,-7z"
/>
</vector>
GoodMoney/app/src/main/res/layout/activity_draw_native_video.xml
0 → 100644
View file @
b3015b1b
<?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"
android:background=
"@color/black"
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/recy_draw_native"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<ImageView
android:id=
"@+id/ivBack"
android:layout_width=
"60dp"
android:layout_height=
"60dp"
android:layout_marginStart=
"5dp"
android:layout_marginTop=
"15dp"
android:padding=
"16dp"
android:src=
"@mipmap/ic_left_arrow"
/>
<TextView
android:id=
"@+id/ivVedio"
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
android:layout_alignParentBottom=
"true"
android:layout_marginLeft=
"50dp"
android:layout_marginRight=
"50dp"
android:layout_marginBottom=
"100dp"
android:background=
"@drawable/shape_tv_gold"
android:gravity=
"center"
android:text=
"设置视频彩铃"
android:textColor=
"@color/white"
/>
<TextView
android:id=
"@+id/ivSetting"
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
android:layout_alignParentBottom=
"true"
android:layout_marginLeft=
"50dp"
android:layout_marginRight=
"50dp"
android:layout_marginBottom=
"40dp"
android:background=
"@drawable/shape_tv_gold"
android:gravity=
"center"
android:text=
"看广告设置来电秀"
android:textColor=
"@color/white"
/>
</RelativeLayout>
</RelativeLayout>
GoodMoney/app/src/main/res/layout/item_view_pager.xml
0 → 100644
View file @
b3015b1b
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/root_view"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/black"
>
<FrameLayout
android:id=
"@+id/video_layout"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:clickable=
"false"
android:focusable=
"false"
/>
<ImageView
android:id=
"@+id/img_thumb"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:clickable=
"false"
android:focusable=
"false"
android:scaleType=
"centerCrop"
/>
<ImageView
android:id=
"@+id/img_play"
android:layout_width=
"100dp"
android:layout_height=
"100dp"
android:layout_centerInParent=
"true"
android:alpha=
"0"
android:clickable=
"true"
android:focusable=
"true"
android:src=
"@drawable/play_arrow"
/>
</RelativeLayout>
\ No newline at end of file
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