Skip to content

Commit

Permalink
Merge branch 'release/v3.1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepenz committed Jan 15, 2018
2 parents 4fab84f + 5cdaeae commit d61c4ce
Show file tree
Hide file tree
Showing 15 changed files with 47 additions and 33 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,26 @@ You can try it out here [Google Play](https://play.google.com/store/apps/details

The library is split up into core, commons, and extensions. The core functions are included in the following dependency.
```gradle
implementation 'com.mikepenz:fastadapter:3.1.1@aar'
implementation 'com.mikepenz:fastadapter:3.1.2@aar'
implementation 'com.android.support:appcompat-v7:${latestSupportLib}'
implementation 'com.android.support:recyclerview-v7:${latestSupportLib}'
```

The commons package comes with some useful helpers (which are not needed in all cases) This one for example includes the `FastItemAdapter`
```gradle
implementation 'com.mikepenz:fastadapter-commons:3.1.1@aar'
implementation 'com.mikepenz:fastadapter-commons:3.1.2@aar'
```

Expandable support is included and can be added via this
```gradle
implementation 'com.mikepenz:fastadapter-extensions-expandable:3.1.1@aar'
implementation 'com.mikepenz:fastadapter-extensions-expandable:3.1.2@aar'
//The tiny Materialize library used for its useful helper classes
implementation 'com.mikepenz:materialize:${latestVersion}@aar'
```

Many helper classes are included in the following dependency. (This functionality also needs the `Expandable` extension
```gradle
implementation 'com.mikepenz:fastadapter-extensions:3.1.1@aar'
implementation 'com.mikepenz:fastadapter-extensions:3.1.2@aar'
implementation 'com.android.support:design:${versions.supportLib}'
//The tiny Materialize library used for its useful helper classes
implementation 'com.mikepenz:materialize:${latestVersion}@aar'
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
defaultConfig {
minSdkVersion setup.minSdk
targetSdkVersion setup.targetSdk
versionCode 3110
versionName '3.1.1'
versionCode 3120
versionName '3.1.2'

setProperty("archivesBaseName", "FastAdapter-v$versionName-c$versionCode")
}
Expand Down
4 changes: 2 additions & 2 deletions library-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
defaultConfig {
minSdkVersion setup.minSdk
targetSdkVersion setup.targetSdk
versionCode 3110
versionName '3.1.1'
versionCode 3120
versionName '3.1.2'

consumerProguardFiles 'consumer-proguard-rules.pro'

Expand Down
4 changes: 2 additions & 2 deletions library-core/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
POM_NAME=FastAdapter Library
POM_ARTIFACT_ID=fastadapter
POM_PACKAGING=aar
VERSION_NAME=3.1.1
VERSION_CODE=3110
VERSION_NAME=3.1.2
VERSION_CODE=3120
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public interface IItemList<Item> {

void set(List<Item> items, int preItemCount, @Nullable IAdapterNotifier adapterNotifier);

void setNewList(List<Item> items);
void setNewList(List<Item> items, boolean notify);

void addAll(int position, List<Item> items, int preItemCount);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,12 +351,13 @@ public ModelAdapter<Model, Item> setNewList(List<Model> list, boolean retainFilt
getItemFilter().performFiltering(null);
}

mItems.setNewList(items);
mapPossibleTypes(mItems.getItems());
mapPossibleTypes(items);

if (filter != null && retainFilter) {
boolean publishResults = filter != null && retainFilter;
if (publishResults) {
getItemFilter().publishResults(filter, getItemFilter().performFiltering(filter));
}
mItems.setNewList(items, !publishResults);

return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void move(int fromPosition, int toPosition, int preItemCount) {
public void addAll(List<Item> items, int preItemCount) {
mItems.addAll(items);
if (mComparator != null) {
Collections.sort(items, mComparator);
Collections.sort(mItems, mComparator);
}
getFastAdapter().notifyAdapterDataSetChanged();
}
Expand All @@ -89,8 +89,19 @@ public void addAll(List<Item> items, int preItemCount) {
public void addAll(int position, List<Item> items, int preItemCount) {
mItems.addAll(position - preItemCount, items);
if (mComparator != null) {
Collections.sort(items, mComparator);
Collections.sort(mItems, mComparator);
}
getFastAdapter().notifyAdapterDataSetChanged();
}

@Override
public void setNewList(List<Item> items, boolean notify) {
mItems = new ArrayList<>(items);
if (mComparator != null) {
Collections.sort(mItems, mComparator);
}
if(notify) {
getFastAdapter().notifyAdapterDataSetChanged();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public boolean isEmpty() {
@Override
public void set(int position, Item item) {
mItems.set(position, item);
getFastAdapter().notifyAdapterItemInserted(position);
getFastAdapter().notifyAdapterItemChanged(position);
}

@Override
Expand Down Expand Up @@ -132,8 +132,10 @@ public void set(List<Item> items, int preItemCount, @Nullable IAdapterNotifier a
}

@Override
public void setNewList(List<Item> items) {
public void setNewList(List<Item> items, boolean notify) {
mItems = new ArrayList<>(items);
getFastAdapter().notifyAdapterDataSetChanged();
if(notify) {
getFastAdapter().notifyAdapterDataSetChanged();
}
}
}
4 changes: 2 additions & 2 deletions library-extensions-expandable/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
defaultConfig {
minSdkVersion setup.minSdk
targetSdkVersion setup.targetSdk
versionCode 3110
versionName '3.1.1'
versionCode 3120
versionName '3.1.2'
}
buildTypes {
release {
Expand Down
4 changes: 2 additions & 2 deletions library-extensions-expandable/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
POM_NAME=FastAdapter Library-Extensions-Expandable
POM_ARTIFACT_ID=fastadapter-extensions-expandable
POM_PACKAGING=aar
VERSION_NAME=3.1.1
VERSION_CODE=3110
VERSION_NAME=3.1.2
VERSION_CODE=3120
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ public interface IExpandable<T, Item extends IItem & ISubItem> {
/**
* use this method to set if the Expandable item is currently expanded
*
* @param collapsed true if expanded (opened)
* @param expanded true if expanded (opened)
* @return this
*/
T withIsExpanded(boolean collapsed);
T withIsExpanded(boolean expanded);

/**
* use this method to set the subItems of this item
Expand Down
4 changes: 2 additions & 2 deletions library-extensions/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
defaultConfig {
minSdkVersion setup.minSdk
targetSdkVersion setup.targetSdk
versionCode 3110
versionName '3.1.1'
versionCode 3120
versionName '3.1.2'

consumerProguardFiles 'consumer-proguard-rules.pro'
}
Expand Down
4 changes: 2 additions & 2 deletions library-extensions/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
POM_NAME=FastAdapter Library-Extensions
POM_ARTIFACT_ID=fastadapter-extensions
POM_PACKAGING=aar
VERSION_NAME=3.1.1
VERSION_CODE=3110
VERSION_NAME=3.1.2
VERSION_CODE=3120
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
defaultConfig {
minSdkVersion setup.minSdk
targetSdkVersion setup.targetSdk
versionCode 3110
versionName '3.1.1'
versionCode 3120
versionName '3.1.2'
}
buildTypes {
release {
Expand Down
4 changes: 2 additions & 2 deletions library/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
POM_NAME=FastAdapter Library
POM_ARTIFACT_ID=fastadapter-commons
POM_PACKAGING=aar
VERSION_NAME=3.1.1
VERSION_CODE=3110
VERSION_NAME=3.1.2
VERSION_CODE=3120

0 comments on commit d61c4ce

Please sign in to comment.