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
bb1506aa
Commit
bb1506aa
authored
Mar 25, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
1968e851
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
6 deletions
+21
-6
MyFragment.kt
...c/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
+6
-3
BannerView.java
.../main/java/com/mints/goodmoney/ui/widgets/BannerView.java
+15
-3
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
View file @
bb1506aa
...
...
@@ -164,8 +164,6 @@ class MyFragment : BaseFragment(),
myPresenter
.
userLogin
()
}
myPresenter
.
myRotationChart
()
banner_view
.
startAutoScroll
()
// 刷新喜马拉雅信息流
...
...
@@ -218,6 +216,7 @@ class MyFragment : BaseFragment(),
myPresenter
.
getSignInHomePageMsg
()
myPresenter
.
myHotActivity
()
myPresenter
.
getHallBaseMsg
()
myPresenter
.
myRotationChart
()
userConfig
=
data
handleRecyData
()
...
...
@@ -364,12 +363,16 @@ class MyFragment : BaseFragment(),
mAdBannerAdapter
?.
setOnPageClickListener
(
this
)
mAdBannerAdapter
?.
let
{
val
list
=
mutableListOf
<
RotationChartBean
.
ListBean
?>()
if
(
mBannerData
?.
list
!
=
null
||
mBannerData
?.
list
!!
.
size
==
0
)
{
if
(
mBannerData
?.
list
=
=
null
||
mBannerData
?.
list
!!
.
size
==
0
)
{
list
.
addAll
(
it
.
mDatas
)
banner_view
.
setStopScroll
(
true
)
banner_view
.
stopAutoScroll
()
}
else
{
list
.
addAll
(
mBannerData
!!
.
list
)
banner_view
.
setStopScroll
(
false
)
banner_view
.
startAutoScroll
()
}
list
.
add
(
data
.
position
,
null
)
it
.
setData
(
list
)
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/widgets/BannerView.java
View file @
bb1506aa
...
...
@@ -64,6 +64,8 @@ public class BannerView extends FrameLayout {
private
boolean
isAnimScroll
;
private
boolean
isAutoScroll
;
private
boolean
isStopScroll
=
false
;
private
View
mRootView
;
private
Handler
mHandler
=
new
Handler
(
Looper
.
getMainLooper
());
private
AutoScrollTask
mScrollTask
;
...
...
@@ -171,12 +173,17 @@ public class BannerView extends FrameLayout {
}
}
// 一直给自己发消息
mHandler
.
postDelayed
(
this
,
mScrollDuration
);
if
(!
isStopScroll
)
{
mHandler
.
postDelayed
(
this
,
mScrollDuration
);
}
}
void
start
()
{
mHandler
.
removeCallbacks
(
this
);
mHandler
.
postDelayed
(
this
,
mScrollDuration
);
if
(!
isStopScroll
)
{
mHandler
.
removeCallbacks
(
this
);
mHandler
.
postDelayed
(
this
,
mScrollDuration
);
}
}
void
stop
()
{
...
...
@@ -359,6 +366,11 @@ public class BannerView extends FrameLayout {
}
public
void
setCurrentIndex
(
int
position
)
{
mViewPager
.
setCurrentItem
(
position
);
}
public
void
setStopScroll
(
boolean
stopScroll
)
{
isStopScroll
=
stopScroll
;
}
}
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