Skip to content

Commit

Permalink
Merge branch 'release/v0.9.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepenz committed Jan 25, 2016
2 parents 79d10b5 + 3384d57 commit ae50d15
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ You can try it out here [Google Play](https://play.google.com/store/apps/details
#Include in your project
##Using Maven
```javascript
compile('com.mikepenz:fastadapter:0.9.5@aar') {
compile('com.mikepenz:fastadapter:0.9.6@aar') {
transitive = true
}
```
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
defaultConfig {
minSdkVersion 11
targetSdkVersion 23
versionCode 95
versionName '0.9.5'
versionCode 96
versionName '0.9.6'

applicationVariants.all { variant ->
variant.outputs.each { output ->
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Maven stuff
VERSION_NAME=0.9.5
VERSION_CODE=95
VERSION_NAME=0.9.6
VERSION_CODE=96
GROUP=com.mikepenz

POM_DESCRIPTION=FastAdapter Library
Expand Down
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
defaultConfig {
minSdkVersion 10
targetSdkVersion 23
versionCode 95
versionName '0.9.5'
versionCode 96
versionName '0.9.6'
}
buildTypes {
release {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,30 @@ public <T> T setSubItems(IExpandable<T, Item> collapsible, List<Item> subItems)
* @param items
*/
public void set(List<Item> items) {
int newItemsCount = items.size();
int previousItemsCount = mItems.size();
int itemsBeforeThisAdapter = getFastAdapter().getItemCount(getOrder());

//remove all previous items
if (!mItems.isEmpty()) {
clear();
mItems.clear();
}

//add all new items to the list
mItems.addAll(items);

//now properly notify the adapter about the changes
if (newItemsCount > previousItemsCount) {
if (previousItemsCount > 0) {
getFastAdapter().notifyAdapterItemRangeChanged(itemsBeforeThisAdapter, previousItemsCount);
}
getFastAdapter().notifyAdapterItemRangeInserted(itemsBeforeThisAdapter + newItemsCount - 1, newItemsCount - previousItemsCount);
} else if (newItemsCount > 0 && newItemsCount < previousItemsCount) {
getFastAdapter().notifyAdapterItemRangeChanged(itemsBeforeThisAdapter, newItemsCount);
getFastAdapter().notifyAdapterItemRangeRemoved(itemsBeforeThisAdapter + newItemsCount - 1, previousItemsCount - newItemsCount);
} else if (newItemsCount == 0) {
getFastAdapter().notifyAdapterItemRangeRemoved(itemsBeforeThisAdapter, previousItemsCount);
}
add(items);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<b>FastAdapter</b>, the bullet proof, fast and easy to use adapter library, which minimizes developing time to a fraction...
]]>
</string>
<string name="library_fastadapter_libraryVersion">0.9.5</string>
<string name="library_fastadapter_libraryVersion">0.9.6</string>
<string name="library_fastadapter_libraryWebsite">https://github.com/mikepenz/FastAdapter</string>
<string name="library_fastadapter_licenseId">apache_2_0</string>
<string name="library_fastadapter_isOpenSource">true</string>
Expand Down

0 comments on commit ae50d15

Please sign in to comment.