Skip to content

Commit

Permalink
优化更新方法
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaomsh committed Jun 5, 2019
1 parent d4abfea commit faf7062
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion LibBanner/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ publish {
userOrg = 'songwenchao0714'
groupId = 'com.ms'
artifactId = 'Banner'
publishVersion = '2.3.14'
publishVersion = '2.3.15'
desc = 'A simple banner lib'
website = 'https://github.com/wenchaosong/Banner'
}
4 changes: 4 additions & 0 deletions LibBanner/src/main/java/com/ms/banner/Banner.java
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ public Banner setPages(List<?> datas, BannerViewHolder creator) {
}

public void update(List<?> imageUrls, List<String> titles) {
if (imageUrls == null || titles == null || imageUrls.size() != titles.size()) {
update(null);
return;
}
this.titles.clear();
this.titles.addAll(titles);
update(imageUrls);
Expand Down
4 changes: 4 additions & 0 deletions LibBanner/src/main/java/com/ms/banner/BannerNew.java
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,10 @@ public BannerNew setPages(List<?> datas, BannerViewHolder creator) {
}

public void update(List<?> imageUrls, List<String> titles) {
if (imageUrls == null || titles == null || imageUrls.size() != titles.size()) {
update(null);
return;
}
this.titles.clear();
this.titles.addAll(titles);
update(imageUrls);
Expand Down
2 changes: 1 addition & 1 deletion LibBannerAndroidx/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ publish {
userOrg = 'songwenchao0714'
groupId = 'com.ms'
artifactId = 'Banner-androidx'
publishVersion = '2.3.14'
publishVersion = '2.3.15'
desc = 'A simple banner lib'
website = 'https://github.com/wenchaosong/Banner'
}
4 changes: 4 additions & 0 deletions LibBannerAndroidx/src/main/java/com/ms/banner/Banner.java
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ public Banner setPages(List<?> datas, BannerViewHolder creator) {
}

public void update(List<?> imageUrls, List<String> titles) {
if (imageUrls == null || titles == null || imageUrls.size() != titles.size()) {
update(null);
return;
}
this.titles.clear();
this.titles.addAll(titles);
update(imageUrls);
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
#### Step 1.依赖banner
```
dependencies{
implementation 'com.ms:Banner:2.3.14'
implementation 'com.ms:Banner-androidx:2.3.14'
implementation 'com.ms:Banner:2.3.15'
implementation 'com.ms:Banner-androidx:2.3.15'
}
```
或者引用本地lib
Expand Down
2 changes: 1 addition & 1 deletion demo/src/main/res/layout/activity_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
android:layout_height="0dp"
android:layout_weight="1" />

<com.bottom.PageNavigationView
<com.ms.bottombar.PageNavigationView
android:id="@+id/tab"
android:layout_width="match_parent"
android:layout_height="50dp"
Expand Down

0 comments on commit faf7062

Please sign in to comment.