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
ce9c13db
Commit
ce9c13db
authored
Mar 25, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
907cc3f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
18 deletions
+27
-18
BannerBaseAdapter.java
...ava/com/mints/goodmoney/ui/adapter/BannerBaseAdapter.java
+7
-1
MyFragment.kt
...c/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
+20
-17
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/adapter/BannerBaseAdapter.java
View file @
ce9c13db
...
@@ -44,7 +44,7 @@ public abstract class BannerBaseAdapter<T> extends PagerAdapter {
...
@@ -44,7 +44,7 @@ public abstract class BannerBaseAdapter<T> extends PagerAdapter {
// return mDatas == null || mDatas.size() == 0 ? 0 : mDatas.size();
// return mDatas == null || mDatas.size() == 0 ? 0 : mDatas.size();
// }
// }
public
int
getCount
()
{
public
int
getCount
()
{
return
mDatas
==
null
||
mDatas
.
size
()
==
0
?
0
:
Integer
.
MAX_VALUE
;
return
mDatas
==
null
||
mDatas
.
size
()
==
0
?
0
:
Integer
.
MAX_VALUE
;
}
}
@Override
@Override
...
@@ -177,9 +177,15 @@ public abstract class BannerBaseAdapter<T> extends PagerAdapter {
...
@@ -177,9 +177,15 @@ public abstract class BannerBaseAdapter<T> extends PagerAdapter {
}
}
public
void
setBannerView
(
BannerView
bannerView
)
{
public
void
setBannerView
(
BannerView
bannerView
)
{
this
.
mBannerView
=
bannerView
;
this
.
mBannerView
=
bannerView
;
}
}
public
void
setIndex
()
{
mBannerView
.
setCurrentIndex
(
0
);
}
/**
/**
* 条目页面的触摸事件
* 条目页面的触摸事件
*/
*/
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
View file @
ce9c13db
...
@@ -34,7 +34,10 @@ import com.mints.goodmoney.mvp.presenters.MyPresenter
...
@@ -34,7 +34,10 @@ import com.mints.goodmoney.mvp.presenters.MyPresenter
import
com.mints.goodmoney.mvp.views.MyView
import
com.mints.goodmoney.mvp.views.MyView
import
com.mints.goodmoney.service.AppInstallService
import
com.mints.goodmoney.service.AppInstallService
import
com.mints.goodmoney.ui.activitys.*
import
com.mints.goodmoney.ui.activitys.*
import
com.mints.goodmoney.ui.adapter.*
import
com.mints.goodmoney.ui.adapter.AdBannerAdapter
import
com.mints.goodmoney.ui.adapter.GvMyAdapter
import
com.mints.goodmoney.ui.adapter.MainMyAdapter
import
com.mints.goodmoney.ui.adapter.ViewPagerAdapter
import
com.mints.goodmoney.ui.adapter.listener.OnItemChildClickListener
import
com.mints.goodmoney.ui.adapter.listener.OnItemChildClickListener
import
com.mints.goodmoney.ui.fragment.base.BaseFragment
import
com.mints.goodmoney.ui.fragment.base.BaseFragment
import
com.mints.goodmoney.ui.widgets.ShareDialog
import
com.mints.goodmoney.ui.widgets.ShareDialog
...
@@ -127,14 +130,8 @@ class MyFragment : BaseFragment(),
...
@@ -127,14 +130,8 @@ class MyFragment : BaseFragment(),
initManager
()
initManager
()
initView
()
initView
()
initRecy
()
initRecy
()
initBanner
()
}
}
private
fun
initBanner
()
{
mAdBannerAdapter
=
AdBannerAdapter
(
activity
)
mAdBannerAdapter
?.
setOnPageClickListener
(
this
)
banner_view
.
setAdapter
(
mAdBannerAdapter
)
}
override
fun
onHiddenChanged
(
hidden
:
Boolean
)
{
override
fun
onHiddenChanged
(
hidden
:
Boolean
)
{
if
(
hidden
)
{
// 不在最前端界面显示
if
(
hidden
)
{
// 不在最前端界面显示
...
@@ -147,6 +144,9 @@ class MyFragment : BaseFragment(),
...
@@ -147,6 +144,9 @@ class MyFragment : BaseFragment(),
override
fun
onPause
()
{
override
fun
onPause
()
{
super
.
onPause
()
super
.
onPause
()
banner_view
.
stopAutoScroll
()
item_clock_signview
.
stopRedbox
()
item_clock_signview
.
stopRedbox
()
}
}
...
@@ -166,9 +166,7 @@ class MyFragment : BaseFragment(),
...
@@ -166,9 +166,7 @@ class MyFragment : BaseFragment(),
myPresenter
.
myRotationChart
()
myPresenter
.
myRotationChart
()
// 防止banner刷新太快
banner_view
.
startAutoScroll
()
// if (AntiShake.check(fl_my_banner?.id)) return
// BannerManager.getTtBanner(TtCsjAdManager.TT_AD_BANNER_MY, fl_my_banner)
// 刷新喜马拉雅信息流
// 刷新喜马拉雅信息流
TTPreLoadExpressXmlyManager
.
getInstance
().
loadTtFrameLayout
()
TTPreLoadExpressXmlyManager
.
getInstance
().
loadTtFrameLayout
()
...
@@ -360,15 +358,20 @@ class MyFragment : BaseFragment(),
...
@@ -360,15 +358,20 @@ class MyFragment : BaseFragment(),
* 设置Banner
* 设置Banner
*/
*/
override
fun
getMyRotationChartSuc
(
data
:
RotationChartBean
)
{
override
fun
getMyRotationChartSuc
(
data
:
RotationChartBean
)
{
banner_view
.
visibility
=
View
.
VISIBLE
mBannerData
=
data
mBannerData
=
data
mAdBannerAdapter
?.
let
{
if
(
data
.
isShow
)
{
val
list
=
mBannerData
?.
list
banner_view
.
visibility
=
View
.
VISIBLE
list
?.
add
(
data
.
position
,
null
)
mAdBannerAdapter
=
AdBannerAdapter
(
activity
)
it
.
setData
(
list
)
mAdBannerAdapter
?.
setOnPageClickListener
(
this
)
it
.
setAdPosition
(
data
.
position
)
mAdBannerAdapter
?.
let
{
it
.
notifyDataSetChanged
()
val
list
=
mBannerData
?.
list
list
?.
add
(
data
.
position
,
null
)
it
.
setData
(
list
)
it
.
setAdPosition
(
data
.
position
)
}
banner_view
.
setAdapter
(
mAdBannerAdapter
)
}
}
}
}
override
fun
onRefresh
(
refreshLayout
:
RefreshLayout
)
{
override
fun
onRefresh
(
refreshLayout
:
RefreshLayout
)
{
...
...
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