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
30c84a81
Commit
30c84a81
authored
Nov 13, 2024
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
ba0c3831
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
5 deletions
+57
-5
build.gradle
video/app/build.gradle
+2
-2
GravityEngineManager.kt
...a/com/duben/happyplayletu/manager/GravityEngineManager.kt
+34
-2
VipActivity.kt
.../java/com/duben/happyplayletu/ui/activitys/VipActivity.kt
+21
-1
No files found.
video/app/build.gradle
View file @
30c84a81
...
@@ -10,8 +10,8 @@ android {
...
@@ -10,8 +10,8 @@ android {
applicationId
"com.duben.happyplayletu"
applicationId
"com.duben.happyplayletu"
minSdkVersion
rootProject
.
ext
.
androidMinSdkVersion
minSdkVersion
rootProject
.
ext
.
androidMinSdkVersion
targetSdkVersion
rootProject
.
ext
.
androidTargetSdkVersion
targetSdkVersion
rootProject
.
ext
.
androidTargetSdkVersion
versionCode
72
2
versionCode
72
4
versionName
"7.2.
2
"
versionName
"7.2.
4
"
flavorDimensions
"default"
flavorDimensions
"default"
// dex突破65535的限制
// dex突破65535的限制
...
...
video/app/src/main/java/com/duben/happyplayletu/manager/GravityEngineManager.kt
View file @
30c84a81
package
com.duben.happyplayletu.manager
package
com.duben.happyplayletu.manager
import
android.app.Application
import
android.app.Application
import
android.text.TextUtils
import
cn.gravity.android.GEConfig
import
cn.gravity.android.GEConfig
import
cn.gravity.android.GravityEngineSDK
import
cn.gravity.android.GravityEngineSDK
import
cn.gravity.android.GravityEngineSDK.AutoTrackEventType
import
cn.gravity.android.InitializeCallback
import
cn.gravity.android.InitializeCallback
import
com.bytedance.hume.readapk.HumeSDK
import
com.duben.happyplayletu.MintsApplication
import
com.duben.happyplayletu.MintsApplication
import
com.duben.happyplayletu.utils.DeviceUuidFactory
import
com.duben.happyplayletu.utils.DeviceUuidFactory
import
com.duben.happyplayletu.utils.LogUtil
import
com.duben.happyplayletu.utils.LogUtil
...
@@ -36,12 +39,11 @@ object GravityEngineManager {
...
@@ -36,12 +39,11 @@ object GravityEngineManager {
val
config
:
GEConfig
=
GEConfig
.
getInstance
(
application
,
ACCESS_TOKEN
)
val
config
:
GEConfig
=
GEConfig
.
getInstance
(
application
,
ACCESS_TOKEN
)
// 保存此实例,后续调用方法均需要用到
// 保存此实例,后续调用方法均需要用到
val
gravityEngineSDKInstance
=
GravityEngineSDK
.
setupAndStart
(
config
)
val
gravityEngineSDKInstance
=
GravityEngineSDK
.
setupAndStart
(
config
)
val
channel
=
getAppMetaData
(
MintsApplication
.
getContext
(),
"CHANNEL_NAME"
)
gravityEngineSDKInstance
.
initialize
(
gravityEngineSDKInstance
.
initialize
(
ACCESS_TOKEN
,
ACCESS_TOKEN
,
DeviceUuidFactory
().
deviceUuid
.
toString
(),
DeviceUuidFactory
().
deviceUuid
.
toString
(),
DeviceUuidFactory
().
deviceUuid
.
toString
(),
DeviceUuidFactory
().
deviceUuid
.
toString
(),
c
hannel
,
c
reateChannel
()
,
object
:
InitializeCallback
{
object
:
InitializeCallback
{
override
fun
onFailed
(
errorMsg
:
String
,
initializeBody
:
JSONObject
?)
{
override
fun
onFailed
(
errorMsg
:
String
,
initializeBody
:
JSONObject
?)
{
LogUtil
.
d
(
"mcg --> gravityEngineSDKInstance onFailed="
+
errorMsg
)
LogUtil
.
d
(
"mcg --> gravityEngineSDKInstance onFailed="
+
errorMsg
)
...
@@ -54,6 +56,8 @@ object GravityEngineManager {
...
@@ -54,6 +56,8 @@ object GravityEngineManager {
responseJson
responseJson
)
)
)
)
enableAutoTrack
(
gravityEngineSDKInstance
)
}
}
},
},
ENABLE_SYNC_ATTRIBUTION
ENABLE_SYNC_ATTRIBUTION
...
@@ -63,4 +67,32 @@ object GravityEngineManager {
...
@@ -63,4 +67,32 @@ object GravityEngineManager {
e
.
printStackTrace
()
e
.
printStackTrace
()
}
}
}
}
/**
* 开启自动采集
*/
fun
enableAutoTrack
(
gravityEngineSDKInstance
:
GravityEngineSDK
)
{
val
typeList
:
MutableList
<
AutoTrackEventType
>
=
ArrayList
()
typeList
.
add
(
AutoTrackEventType
.
APP_INSTALL
)
typeList
.
add
(
AutoTrackEventType
.
APP_END
)
typeList
.
add
(
AutoTrackEventType
.
APP_CRASH
)
typeList
.
add
(
AutoTrackEventType
.
APP_VIEW_SCREEN
)
typeList
.
add
(
AutoTrackEventType
.
APP_CLICK
)
gravityEngineSDKInstance
.
enableAutoTrack
(
typeList
)
}
fun
createChannel
():
String
{
var
channel
=
getAppMetaData
(
MintsApplication
.
getContext
(),
"CHANNEL_NAME"
)
try
{
// 穿山甲分包渠道
val
ttChannel
=
HumeSDK
.
getChannel
(
MintsApplication
.
getContext
())
if
(!
TextUtils
.
isEmpty
(
ttChannel
))
{
// 此处方式不能修改,已和后端约定
channel
=
channel
+
"_"
+
ttChannel
}
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
return
channel
}
}
}
\ No newline at end of file
video/app/src/main/java/com/duben/happyplayletu/ui/activitys/VipActivity.kt
View file @
30c84a81
...
@@ -3,6 +3,7 @@ package com.duben.happyplayletu.ui.activitys
...
@@ -3,6 +3,7 @@ package com.duben.happyplayletu.ui.activitys
import
android.animation.ValueAnimator
import
android.animation.ValueAnimator
import
android.app.Dialog
import
android.app.Dialog
import
android.content.Intent
import
android.content.Intent
import
android.graphics.Color
import
android.net.Uri
import
android.net.Uri
import
android.os.Bundle
import
android.os.Bundle
import
android.os.Handler
import
android.os.Handler
...
@@ -32,6 +33,7 @@ import com.duben.happyplayletu.ui.adapter.VipBannerAdapter
...
@@ -32,6 +33,7 @@ import com.duben.happyplayletu.ui.adapter.VipBannerAdapter
import
com.duben.happyplayletu.ui.widgets.*
import
com.duben.happyplayletu.ui.widgets.*
import
com.duben.happyplayletu.ui.widgets.countdowntimer.CountDownTimerSupport
import
com.duben.happyplayletu.ui.widgets.countdowntimer.CountDownTimerSupport
import
com.duben.happyplayletu.ui.widgets.countdowntimer.OnCountDownTimerListener
import
com.duben.happyplayletu.ui.widgets.countdowntimer.OnCountDownTimerListener
import
com.duben.happyplayletu.utils.SpanUtils
import
com.duben.library.utils.GlideUtils
import
com.duben.library.utils.GlideUtils
import
com.duben.library.utils.nodoubleclick.AntiShake
import
com.duben.library.utils.nodoubleclick.AntiShake
import
com.jobo.alipay.AliPay
import
com.jobo.alipay.AliPay
...
@@ -207,12 +209,30 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
...
@@ -207,12 +209,30 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
if
(!
TextUtils
.
isEmpty
(
bean
.
remarks
))
{
if
(!
TextUtils
.
isEmpty
(
bean
.
remarks
))
{
tv_vip_hint
.
text
=
bean
.
remarks
tv_vip_hint
.
text
=
bean
.
remarks
tv_vip_hint
.
visibility
=
View
.
VISIBLE
tv_vip_hint
.
visibility
=
View
.
VISIBLE
if
(
bean
.
isShowCycTips
)
{
tv_vip_hint
.
setTextColor
(
Color
.
parseColor
(
"#FFAC5E"
))
tv_vip_hint
.
textSize
=
12f
}
else
{
tv_vip_hint
.
setTextColor
(
Color
.
parseColor
(
"#97ffffff"
))
tv_vip_hint
.
textSize
=
10f
}
}
else
{
}
else
{
tv_vip_hint
.
visibility
=
View
.
INVISIBLE
tv_vip_hint
.
visibility
=
View
.
INVISIBLE
}
}
if
(!
TextUtils
.
isEmpty
(
bean
.
buttonText
))
{
if
(!
TextUtils
.
isEmpty
(
bean
.
buttonText
))
{
tvVipPay
.
text
=
bean
.
buttonText
if
(
bean
.
isShowCycTips
)
{
tvVipPay
.
text
=
SpanUtils
()
.
append
(
bean
.
buttonText
+
"\n"
)
.
setFontSize
(
20
,
true
)
.
append
(
bean
.
remarks
)
.
setFontSize
(
10
,
true
)
.
setForegroundColor
(
Color
.
parseColor
(
"#A24240"
))
.
create
()
}
else
{
tvVipPay
.
text
=
bean
.
buttonText
}
tvVipAgreement
.
text
=
"点击购买即表示您同意《自动续费协议》"
tvVipAgreement
.
text
=
"点击购买即表示您同意《自动续费协议》"
}
else
{
}
else
{
tvVipPay
.
text
=
"立即开通"
tvVipPay
.
text
=
"立即开通"
...
...
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