Skip to content

Commit

Permalink
Merge branch 'release/v0.9.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepenz committed Jan 25, 2016
2 parents ae50d15 + c5cfccd commit 77afc69
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 16 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.6@aar') {
compile('com.mikepenz:fastadapter:0.9.7@aar') {
transitive = true
}
```
Expand Down
6 changes: 3 additions & 3 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 96
versionName '0.9.6'
versionCode 97
versionName '0.9.7'

applicationVariants.all { variant ->
variant.outputs.each { output ->
Expand Down Expand Up @@ -52,7 +52,7 @@ dependencies {

//used to generate the drawer on the left
//https://github.com/mikepenz/MaterialDrawer
compile('com.mikepenz:materialdrawer:5.0.0.fastAdapter.b14-SNAPSHOT@aar') {
compile('com.mikepenz:materialdrawer:5.0.0.fastAdapter.b15-SNAPSHOT@aar') {
transitive = true
exclude module: "fastadapter"
}
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.6
VERSION_CODE=96
VERSION_NAME=0.9.7
VERSION_CODE=97
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 96
versionName '0.9.6'
versionCode 97
versionName '0.9.7'
}
buildTypes {
release {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ public <T> T setSubItems(IExpandable<T, Item> collapsible, List<Item> subItems)

/**
* set a new list of items and apply it to the existing list (clear - add) for this adapter
* Note may consider using setNewList if the items list is a reference to the list which is used inside the adapter
*
* @param items
*/
Expand All @@ -153,25 +154,33 @@ public void set(List<Item> items) {
int previousItemsCount = mItems.size();
int itemsBeforeThisAdapter = getFastAdapter().getItemCount(getOrder());

//remove all previous items
if (!mItems.isEmpty()) {
mItems.clear();
//make sure the new items list is not a reference of the already mItems list
if (items != mItems) {
//remove all previous items
if (!mItems.isEmpty()) {
mItems.clear();
}

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

//add all new items to the list
mItems.addAll(items);
//map the types
mapPossibleTypes(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);
getFastAdapter().notifyAdapterItemRangeInserted(itemsBeforeThisAdapter + previousItemsCount, newItemsCount - previousItemsCount);
} else if (newItemsCount > 0 && newItemsCount < previousItemsCount) {
getFastAdapter().notifyAdapterItemRangeChanged(itemsBeforeThisAdapter, newItemsCount);
getFastAdapter().notifyAdapterItemRangeRemoved(itemsBeforeThisAdapter + newItemsCount - 1, previousItemsCount - newItemsCount);
getFastAdapter().notifyAdapterItemRangeRemoved(itemsBeforeThisAdapter + newItemsCount, previousItemsCount - newItemsCount);
} else if (newItemsCount == 0) {
getFastAdapter().notifyAdapterItemRangeRemoved(itemsBeforeThisAdapter, previousItemsCount);
} else {
getFastAdapter().notifyAdapterDataSetChanged();
}
}

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.6</string>
<string name="library_fastadapter_libraryVersion">0.9.7</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 77afc69

Please sign in to comment.