Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
I
ImageVideoBanner
Project
Project
Details
Activity
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jiangjiantao
ImageVideoBanner
Commits
70319ef7
Commit
70319ef7
authored
Oct 14, 2020
by
gaodapeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了部分逻辑,把replace改成setData,方便多次设置
parent
5f36cec8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
28 deletions
+25
-28
ImageVideoBanner.java
...rc/main/java/com/widget/imagebanner/ImageVideoBanner.java
+13
-16
AndroidManifest.xml
imageVideoBanner/src/main/AndroidManifest.xml
+12
-12
No files found.
banner/src/main/java/com/widget/imagebanner/ImageVideoBanner.java
View file @
70319ef7
...
@@ -86,8 +86,10 @@ public class ImageVideoBanner extends FrameLayout implements ImageVideoFragment.
...
@@ -86,8 +86,10 @@ public class ImageVideoBanner extends FrameLayout implements ImageVideoFragment.
}
}
public
void
replaceData
(
List
<
com
.
widget
.
imagebanner
.
bean
.
BannerBean
>
listBean
)
{
public
void
setData
(
List
<
com
.
widget
.
imagebanner
.
bean
.
BannerBean
>
listBean
)
{
mAdapter
.
replaceData
(
listBean
);
if
(
listBean
!=
null
)
{
mAdapter
.
setData
(
listBean
);
}
}
}
public
void
addData
(
List
<
com
.
widget
.
imagebanner
.
bean
.
BannerBean
>
listBean
)
{
public
void
addData
(
List
<
com
.
widget
.
imagebanner
.
bean
.
BannerBean
>
listBean
)
{
...
@@ -207,8 +209,10 @@ public class ImageVideoBanner extends FrameLayout implements ImageVideoFragment.
...
@@ -207,8 +209,10 @@ public class ImageVideoBanner extends FrameLayout implements ImageVideoFragment.
public
void
startBanner
()
{
public
void
startBanner
()
{
//如果第一页是视频 不用定时器
//如果第一页是视频 不用定时器
if
(
mList
.
get
(
0
).
getType
()
==
0
)
{
if
(
mList
.
size
()
>
0
)
{
startBanner
(
period
);
if
(
mList
.
get
(
0
).
getType
()
==
0
)
{
startBanner
(
period
);
}
}
}
}
}
...
@@ -288,24 +292,17 @@ public class ImageVideoBanner extends FrameLayout implements ImageVideoFragment.
...
@@ -288,24 +292,17 @@ public class ImageVideoBanner extends FrameLayout implements ImageVideoFragment.
return
false
;
return
false
;
}
}
public
void
replaceData
(
List
<
BannerBean
>
listBean
)
{
public
void
setData
(
@NonNull
List
<
BannerBean
>
listBean
)
{
// 新数据和原来数据对比,不一致才去刷新
// 新数据和原来数据对比,不一致才去刷新
boolean
change
=
compareData
(
listBean
);
boolean
change
=
compareData
(
listBean
);
if
(!
change
)
{
if
(!
change
)
{
notifyDataSetChanged
();
notifyDataSetChanged
();
// startBanner();
return
;
return
;
}
}
if
(
null
!=
listBean
)
{
mList
.
clear
();
mList
.
clear
();
addData
(
listBean
);
addData
(
listBean
);
notifyDataSetChanged
();
//如果第一张是图片 需要开启定时器
autoCurrIndex
=
0
;
if
(
listBean
.
get
(
0
).
getType
()
==
0
)
{
startBanner
();
}
autoCurrIndex
=
0
;
// startBanner();
}
}
}
...
...
imageVideoBanner/src/main/AndroidManifest.xml
View file @
70319ef7
...
@@ -15,18 +15,18 @@
...
@@ -15,18 +15,18 @@
android:supportsRtl=
"true"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
>
android:theme=
"@style/AppTheme"
>
<
!--<activity-->
<
activity
<!--android:name=".MainActivity"-->
android:name=
".MainActivity"
<!--android:configChanges="orientation|keyboardHidden|screenSize|keyboard|navigation"-->
android:configChanges=
"orientation|keyboardHidden|screenSize|keyboard|navigation"
<!--android:exported="true"-->
android:exported=
"true"
<!--android:launchMode="singleTask"-->
android:launchMode=
"singleTask"
<!--android:screenOrientation="portrait">--
>
android:screenOrientation=
"portrait"
>
<
!--<intent-filter>--
>
<
intent-filter
>
<
!--<action android:name="android.intent.action.MAIN" />--
>
<
action
android:name=
"android.intent.action.MAIN"
/
>
<
!--<category android:name="android.intent.category.LAUNCHER" />--
>
<
category
android:name=
"android.intent.category.LAUNCHER"
/
>
<
!--</intent-filter>--
>
<
/intent-filter
>
<
!--</activity>--
>
<
/activity
>
</application>
</application>
...
...
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