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
6a8580b3
Commit
6a8580b3
authored
Jun 01, 2021
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GroMore信息流代码优化
parent
badca490
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
489 additions
and
16 deletions
+489
-16
GroMoreCarrierExpressManager.kt
...ints/goodmoney/ad/express/GroMoreCarrierExpressManager.kt
+475
-9
GroMoreExpressManager.kt
...a/com/mints/goodmoney/ad/express/GroMoreExpressManager.kt
+5
-3
PreLoadExpressManager.kt
...a/com/mints/goodmoney/ad/express/PreLoadExpressManager.kt
+3
-3
TaskCpdFragment.kt
...n/java/com/mints/goodmoney/ui/fragment/TaskCpdFragment.kt
+1
-1
UIUtils.java
.../app/src/main/java/com/mints/goodmoney/utils/UIUtils.java
+5
-0
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/express/GroMoreCarrierExpressManager.kt
View file @
6a8580b3
This diff is collapsed.
Click to expand it.
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/express/GroMoreExpressManager.kt
View file @
6a8580b3
...
@@ -101,7 +101,7 @@ class GroMoreExpressManager : TTSettingConfigCallback {
...
@@ -101,7 +101,7 @@ class GroMoreExpressManager : TTSettingConfigCallback {
.
setTTVideoOption
(
videoOption
)
//视频声音相关的配置
.
setTTVideoOption
(
videoOption
)
//视频声音相关的配置
.
setAdmobNativeAdOptions
(
admobNativeAdOptions
)
.
setAdmobNativeAdOptions
(
admobNativeAdOptions
)
.
setAdStyleType
(
mAdStyle
)
//必传,表示请求的模板广告还是原生广告,AdSlot.TYPE_EXPRESS_AD:模板广告 ; AdSlot.TYPE_NATIVE_AD:原生广告
.
setAdStyleType
(
mAdStyle
)
//必传,表示请求的模板广告还是原生广告,AdSlot.TYPE_EXPRESS_AD:模板广告 ; AdSlot.TYPE_NATIVE_AD:原生广告
.
setImageAdSize
(
UIUtils
.
getScreenWidthDp
(
MintsApplication
.
getContext
()).
toInt
(),
32
0
)
// 必选参数 单位dp ,详情见上面备注解释
.
setImageAdSize
(
340
,
0
)
// 必选参数 单位dp ,详情见上面备注解释
.
setAdCount
(
1
)
//请求广告数量为1到3条
.
setAdCount
(
1
)
//请求广告数量为1到3条
.
setGdtNativeAdLogoParams
(
gdtNativeAdLogUtiloParams
)
// 设置gdt logo布局参数。
.
setGdtNativeAdLogoParams
(
gdtNativeAdLogUtiloParams
)
// 设置gdt logo布局参数。
.
build
()
.
build
()
...
@@ -129,7 +129,9 @@ class GroMoreExpressManager : TTSettingConfigCallback {
...
@@ -129,7 +129,9 @@ class GroMoreExpressManager : TTSettingConfigCallback {
}
}
if
(
ads
.
size
>
0
)
{
if
(
ads
.
size
>
0
)
{
mADLoadSuccessListener
?.
onGMAdLoadSuc
(
ads
[
0
])
mADLoadSuccessListener
?.
onGMAdLoadSuc
(
createAdView
(
ads
[
0
]))
val
ttNativeAd
=
ads
[
0
]
val
ttNativeAd
=
ads
[
0
]
val
vo
=
HashMap
<
String
,
Any
>()
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"adcode"
]
=
ttNativeAd
.
getAdNetworkRitId
()
vo
[
"adcode"
]
=
ttNativeAd
.
getAdNetworkRitId
()
...
@@ -252,7 +254,7 @@ class GroMoreExpressManager : TTSettingConfigCallback {
...
@@ -252,7 +254,7 @@ class GroMoreExpressManager : TTSettingConfigCallback {
sWidth
=
FrameLayout
.
LayoutParams
.
MATCH_PARENT
sWidth
=
FrameLayout
.
LayoutParams
.
MATCH_PARENT
sHeight
=
FrameLayout
.
LayoutParams
.
WRAP_CONTENT
sHeight
=
FrameLayout
.
LayoutParams
.
WRAP_CONTENT
}
else
{
}
else
{
sWidth
=
UIUtils
.
getScreenWidth
Dp
(
MintsApplication
.
getContext
()).
toInt
()
sWidth
=
UIUtils
.
getScreenWidth
(
MintsApplication
.
getContext
()).
toInt
()
sHeight
=
(
sWidth
*
height
/
width
).
toInt
()
sHeight
=
(
sWidth
*
height
/
width
).
toInt
()
}
}
if
(
video
!=
null
)
{
if
(
video
!=
null
)
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/express/PreLoadExpressManager.kt
View file @
6a8580b3
...
@@ -152,11 +152,11 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener
...
@@ -152,11 +152,11 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener
mAdFrameLayout
?.
addView
(
view
)
mAdFrameLayout
?.
addView
(
view
)
}
}
override
fun
onGMAdLoadSuc
(
ttNativeAd
:
TTNativeAd
?)
{
override
fun
onGMAdLoadSuc
(
ttNativeAd
:
View
?)
{
// if (currentIndex == 3) {
// if (currentIndex == 3) {
// mAdFrameLayout?.addView(view)
// mAdFrameLayout?.addView(view)
// }
// }
mAdFrameLayout
?.
addView
(
ttNativeAd
?.
expressView
)
mAdFrameLayout
?.
addView
(
ttNativeAd
)
}
}
}
}
...
@@ -174,5 +174,5 @@ interface KSADLoadSuccessListener {
...
@@ -174,5 +174,5 @@ interface KSADLoadSuccessListener {
}
}
interface
GMADLoadSuccessListener
{
interface
GMADLoadSuccessListener
{
fun
onGMAdLoadSuc
(
ttNativeAd
:
TTNativeAd
?)
fun
onGMAdLoadSuc
(
ttNativeAd
:
View
?)
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/TaskCpdFragment.kt
View file @
6a8580b3
...
@@ -322,7 +322,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
...
@@ -322,7 +322,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
// cpdLoadCountTime = cpdMax
// cpdLoadCountTime = cpdMax
RxjavaUtil
.
executeRxTask
<
MutableList
<
TzTaskBean
>>
(
object
:
CommonRxTask
<
MutableList
<
TzTaskBean
>>()
{
RxjavaUtil
.
executeRxTask
(
object
:
CommonRxTask
<
MutableList
<
TzTaskBean
>>()
{
override
fun
doInIOThread
()
{
override
fun
doInIOThread
()
{
val
newPkgData
=
mutableListOf
<
TzTaskBean
>()
val
newPkgData
=
mutableListOf
<
TzTaskBean
>()
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/utils/UIUtils.java
View file @
6a8580b3
...
@@ -29,6 +29,11 @@ public class UIUtils {
...
@@ -29,6 +29,11 @@ public class UIUtils {
return
width
/
(
scale
<=
0
?
1
:
scale
)
+
0.5f
;
return
width
/
(
scale
<=
0
?
1
:
scale
)
+
0.5f
;
}
}
public
static
int
getScreenWidth
(
Context
context
)
{
DisplayMetrics
dm
=
context
.
getResources
().
getDisplayMetrics
();
return
dm
.
widthPixels
;
}
//全面屏、刘海屏适配
//全面屏、刘海屏适配
public
static
float
getHeight
(
Activity
activity
)
{
public
static
float
getHeight
(
Activity
activity
)
{
hideBottomUIMenu
(
activity
);
hideBottomUIMenu
(
activity
);
...
...
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