Skip to content
This repository was archived by the owner on Jan 2, 2021. It is now read-only.

Commit a4e449f

Browse files
committed
Merge branch 'release/v0.9.1'
2 parents fa54feb + f4d1e2c commit a4e449f

File tree

5 files changed

+19
-10
lines changed

5 files changed

+19
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The minimum API level supported by this library is API 14.
1717
```gradle
1818
dependencies {
1919
// ... other dependencies here
20-
compile 'com.github.devahamed:multi-view-adapter:0.9.0'
20+
compile 'com.github.devahamed:multi-view-adapter:0.9.1'
2121
}
2222
```
2323

bintray.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ if (project.hasProperty("android")) {
1212
task javadoc(type: Javadoc) {
1313
source = android.sourceSets.main.java.srcDirs
1414
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
15-
failOnError false
15+
failOnError true
16+
}
17+
afterEvaluate {
18+
javadoc.classpath +=
19+
files(android.libraryVariants.collect { variant -> variant.javaCompile.classpath.files
20+
})
1621
}
1722
} else {
1823
// Java libraries

multi-view-adapter/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ ext {
4343
siteUrl = 'https://github.com/DevAhamed/MultiViewAdapter'
4444
gitUrl = 'https://github.com/DevAhamed/MultiViewAdapter.git'
4545

46-
libraryVersion = '0.9.0'
46+
libraryVersion = '0.9.1'
4747

4848
developerId = devProperties['devId']
4949
developerName = devProperties['devName']

multi-view-adapter/src/main/java/com/ahamed/multiviewadapter/BaseDataManager.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ public final List<M> getSelectedItems() {
9393
* DataItemManager}. It should be used in conjunction with the {@link SelectableAdapter}.
9494
* Exception will be thrown if calling {@link DataListManager} is not used in the {@link
9595
* SelectableAdapter}.
96+
*
97+
* @param selectedItems List of selected items
9698
*/
9799
public final void setSelectedItems(List<M> selectedItems) {
98100
if (!(adapter instanceof SelectableAdapter)) {
@@ -104,14 +106,13 @@ public final void setSelectedItems(List<M> selectedItems) {
104106
}
105107
SparseBooleanArray oldSelectedItems = this.selectedItems.clone();
106108
this.selectedItems = new SparseBooleanArray();
107-
int i = 0;
108109
for (M m : selectedItems) {
109110
boolean isSelected = contains(m);
110-
this.selectedItems.put(i, isSelected);
111-
if (oldSelectedItems.get(i, false) != isSelected) {
112-
onItemSelectionToggled(i, isSelected);
111+
int index = indexOf(m);
112+
this.selectedItems.put(index, isSelected);
113+
if (oldSelectedItems.get(index, false) != isSelected) {
114+
onItemSelectionToggled(index, isSelected);
113115
}
114-
i++;
115116
}
116117
}
117118

@@ -135,6 +136,8 @@ public final void setSelectedItems(List<M> selectedItems) {
135136
* DataItemManager}. It should be used in conjunction with the {@link SelectableAdapter}.
136137
* Exception will be thrown if calling {@link DataListManager} is not used in the {@link
137138
* SelectableAdapter}.
139+
*
140+
* @param selectedItem Selected item
138141
*/
139142
public final void setSelectedItem(M selectedItem) {
140143
if (!(adapter instanceof SelectableAdapter)) {

multi-view-adapter/src/main/java/com/ahamed/multiviewadapter/ItemBinder.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ public ItemBinder(ItemDecorator itemDecorator) {
3838

3939
/**
4040
* @param item The object from the data set
41-
* @return boolean value which determines whether the {@link ItemBinder} can bind the {@param
42-
* item} to the ViewHolder
41+
* @return boolean value which determines whether the {@link ItemBinder} can bind the
42+
* item to the ViewHolder
4343
*/
4444
public abstract boolean canBindData(Object item);
4545

@@ -64,6 +64,7 @@ public void bind(VH holder, M item, List payloads) {
6464
*
6565
* @param maxSpanCount The maximum span count of the {@link GridLayoutManager} used inside the
6666
* RecyclerView
67+
* @return Returns the span size
6768
*/
6869
public int getSpanSize(int maxSpanCount) {
6970
return 1;

0 commit comments

Comments
 (0)