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
1968e851
Commit
1968e851
authored
Mar 25, 2021
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Banner数据为空展示广告
parent
ce9c13db
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
13 deletions
+17
-13
BannerManager.kt
.../main/java/com/mints/goodmoney/ad/banner/BannerManager.kt
+2
-2
MyFragment.kt
...c/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
+15
-11
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/banner/BannerManager.kt
View file @
1968e851
...
...
@@ -32,12 +32,12 @@ object BannerManager {
val
displayMetrics
=
MintsApplication
.
getContext
().
resources
.
displayMetrics
val
density
=
displayMetrics
.
density
// 屏幕宽度 - margin宽度
val
pxWidth
=
displayMetrics
.
widthPixels
-
(
2
0
*
density
+
0.5f
)
val
pxWidth
=
displayMetrics
.
widthPixels
-
(
1
0
*
density
+
0.5f
)
return
pxWidth
/
density
+
0.5f
}
private
fun
getViewHeight
():
Float
{
var
pxHeight
=
BubbleUtils
.
dp2px
(
1
5
0
)
var
pxHeight
=
BubbleUtils
.
dp2px
(
1
2
0
)
return
pxHeight
.
toFloat
()
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
View file @
1968e851
...
...
@@ -359,21 +359,25 @@ class MyFragment : BaseFragment(),
*/
override
fun
getMyRotationChartSuc
(
data
:
RotationChartBean
)
{
mBannerData
=
data
if
(
data
.
isShow
)
{
banner_view
.
visibility
=
View
.
VISIBLE
mAdBannerAdapter
=
AdBannerAdapter
(
activity
)
mAdBannerAdapter
?.
setOnPageClickListener
(
this
)
mAdBannerAdapter
?.
let
{
val
list
=
mBannerData
?.
list
list
?.
add
(
data
.
position
,
null
)
val
list
=
mutableListOf
<
RotationChartBean
.
ListBean
?>()
if
(
mBannerData
?.
list
!=
null
||
mBannerData
?.
list
!!
.
size
==
0
)
{
list
.
addAll
(
it
.
mDatas
)
banner_view
.
stopAutoScroll
()
}
else
{
banner_view
.
startAutoScroll
()
}
list
.
add
(
data
.
position
,
null
)
it
.
setData
(
list
)
it
.
setAdPosition
(
data
.
position
)
}
banner_view
.
setAdapter
(
mAdBannerAdapter
)
}
}
override
fun
onRefresh
(
refreshLayout
:
RefreshLayout
)
{
onDestroyBroadcastReceiver
()
...
...
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