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

Commit b6b86f2

Browse files
authored
Merge pull request #12 from DevAhamed/develop
v1.2.0 release
2 parents 82c950b + 8985b21 commit b6b86f2

31 files changed

+381
-417
lines changed

README.md

Lines changed: 67 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ The minimum API level supported by this library is API 9.
1818

1919
```gradle
2020
dependencies {
21-
// ... other dependencies here
22-
compile 'com.github.devahamed:multi-view-adapter:1.1.0'
21+
compile 'com.github.devahamed:multi-view-adapter:1.2.0'
22+
23+
// If you want to use data binding
24+
compile 'com.github.devahamed:multi-view-adapter-databinding:1.2.0'
2325
}
2426
```
2527

@@ -54,15 +56,72 @@ You can read more about this library here in this [Medium article](https://mediu
5456

5557
## Features
5658

57-
1. Supports different span count for different ItemBinders.
58-
2. Adds different ItemDecoration for different ItemBinders.
59-
3. Items can be selected - Single and Multiple selection options are available.
60-
4. Out of the box support for DiffUtil.
59+
1. Multiple data set can be added to the adapter. [WikiDoc](https://github.com/DevAhamed/MultiViewAdapter/wiki/Multiple-Data-Set)
60+
2. Adds different ItemDecoration for different ItemBinders. [WikiDoc](https://github.com/DevAhamed/MultiViewAdapter/wiki/Custom-Item-Decoration)
61+
3. Single and Multiple selection options are available. [WikiDoc](https://github.com/DevAhamed/MultiViewAdapter/wiki/Choice-Modes)
62+
4. Out of the box support for DiffUtil. [WikiDoc](https://github.com/DevAhamed/MultiViewAdapter/wiki/DiffUtil-and-Payload)
63+
5. Custom span count for every binder. [WikiDoc](https://github.com/DevAhamed/MultiViewAdapter/wiki/Grid-Adapter)
64+
6. Data binding support. [WikiDoc](https://github.com/DevAhamed/MultiViewAdapter/wiki/Data-Binding)
65+
7. Advanced drag and drop support. [WikiDoc](https://github.com/DevAhamed/MultiViewAdapter/wiki/Drag-and-Drop)
66+
8. Swipe to dismiss. [WikiDoc](https://github.com/DevAhamed/MultiViewAdapter/wiki/Swipe-To-Dismiss)
67+
9. Infinite scrolling. [WikiDoc](https://github.com/DevAhamed/MultiViewAdapter/wiki/Infinite-Scrolling)
68+
10. Helper class for contextual action mode. [WikiDoc](https://github.com/DevAhamed/MultiViewAdapter/wiki/Contextual-Action-Mode)
69+
11. Items can be expanded/collapsed. [WikiDoc](https://github.com/DevAhamed/MultiViewAdapter/wiki/Expandable-Item)
70+
12. Groups can be expanded/collapsed. [WikiDoc](https://github.com/DevAhamed/MultiViewAdapter/wiki/Expandable-Group)
71+
72+
## File Templates
73+
74+
This library has default file templates for creating Adapters, ItemBinders for given model name. Take a look at wiki page for using the file templates. [Wiki page](https://github.com/DevAhamed/MultiViewAdapter/wiki/File-Templates)
6175

6276
## Usage
63-
To get some idea about the MultiViewAdapter features kindly look at sample app code.
64-
Also we have comprehensive wiki pages as well. Take a look at [JCenter](https://github.com/DevAhamed/MultiViewAdapter/wiki).
77+
Let us display list of cars. No fuss. Here is the entire code.
78+
79+
80+
<b>CarBinder</b>
81+
82+
```java
83+
class CarBinder extends ItemBinder<CarModel, CarBinder.CarViewHolder> {
84+
85+
@Override public CarViewHolder create(LayoutInflater inflater, ViewGroup parent) {
86+
return new CarViewHolder(inflater.inflate(R.layout.item_car, parent, false));
87+
}
88+
89+
@Override public boolean canBindData(Object item) {
90+
return item instanceof CarModel;
91+
}
92+
93+
@Override public void bind(CarViewHolder holder, CarModel item) {
94+
// Bind the data here
95+
}
96+
97+
static class CarViewHolder extends BaseViewHolder<CarModel> {
98+
// Normal ViewHolder code
99+
}
100+
}
101+
```
102+
103+
<b>In your Activity/Fragment</b>
104+
105+
```java
106+
class CarListActivity extends Activity {
107+
108+
private RecyclerView recyclerView;
109+
private List<CarModel> cars;
110+
111+
public void initViews() {
112+
SimpleRecyclerAdapter<CarModel, CarBinder> adapter =
113+
new SimpleRecyclerAdapter<>(new CarBinder());
65114

115+
recyclerView.setAdapter(adapter);
116+
adapter.setDataList(cars);
117+
}
118+
}
119+
```
120+
Now you are good to go.
121+
<br/>
122+
<br/>
123+
For advanced usage and features kindly take a look at sample app code.
124+
Also we have comprehensive wiki pages as well. Take a look at [Wiki home](https://github.com/DevAhamed/MultiViewAdapter/wiki).
66125

67126
## Changelog
68127
See the project's Releases page for a list of versions with their changelog. [View Releases](https://github.com/DevAhamed/MultiViewAdapter/releases)<br/>

bintray.gradle

Lines changed: 0 additions & 67 deletions
This file was deleted.

build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ buildscript {
33
jcenter()
44
}
55
dependencies {
6-
classpath 'com.android.tools.build:gradle:2.3.2'
7-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
8-
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
6+
classpath 'com.android.tools.build:gradle:2.3.3'
97
}
108
}
119

install.gradle

Lines changed: 0 additions & 41 deletions
This file was deleted.

multi-view-adapter-databinding/build.gradle

Lines changed: 49 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,16 @@
1515
*/
1616

1717
apply plugin: 'com.android.library'
18+
apply plugin: 'com.novoda.bintray-release'
1819

19-
def devPropertiesFile = rootProject.file("developer.properties");
20-
def devProperties = new Properties()
21-
devProperties.load(new FileInputStream(devPropertiesFile))
20+
buildscript {
21+
repositories {
22+
jcenter()
23+
}
24+
dependencies {
25+
classpath 'com.novoda:bintray-release:0.5.0'
26+
}
27+
}
2228

2329
android {
2430
compileSdkVersion 25
@@ -28,7 +34,7 @@ android {
2834
minSdkVersion 9
2935
targetSdkVersion 25
3036
versionCode 1
31-
versionName "1.0"
37+
versionName "1.2.0"
3238

3339
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
3440
}
@@ -50,30 +56,47 @@ dependencies {
5056
}
5157
}
5258

53-
ext {
54-
55-
bintrayRepo = devProperties['repoName']
56-
bintrayName = devProperties['artifactId']
57-
58-
publishedGroupId = devProperties['groupId']
59-
libraryName = devProperties['repoName']
60-
artifact = devProperties['artifactIdDataBinding']
61-
62-
libraryDescription = 'Additional DataBinding support for MultiViewAdapter'
63-
64-
siteUrl = 'https://github.com/DevAhamed/MultiViewAdapter'
65-
gitUrl = 'https://github.com/DevAhamed/MultiViewAdapter.git'
59+
publish {
60+
userOrg = 'devahamed'
61+
groupId = 'com.github.devahamed'
62+
artifactId = 'multi-view-adapter-databinding'
63+
publishVersion = '1.2.0'
64+
repoName = 'MultiViewAdapter'
65+
desc = 'Additional DataBinding support for MultiViewAdapter'
66+
website = 'https://github.com/DevAhamed/MultiViewAdapter'
67+
}
6668

67-
libraryVersion = '1.1.0'
69+
if (project.hasProperty("android")) {
70+
// Android libraries
71+
task sourcesJar(type: Jar) {
72+
classifier = 'sources'
73+
from android.sourceSets.main.java.srcDirs
74+
}
6875

69-
developerId = devProperties['devId']
70-
developerName = devProperties['devName']
71-
developerEmail = devProperties['devEmail']
76+
task javadoc(type: Javadoc) {
77+
source = android.sourceSets.main.java.srcDirs
78+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
79+
failOnError true
80+
}
81+
afterEvaluate {
82+
javadoc.classpath +=
83+
files(android.libraryVariants.collect { variant -> variant.javaCompile.classpath.files
84+
})
85+
}
86+
} else {
87+
// Java libraries
88+
task sourcesJar(type: Jar, dependsOn: classes) {
89+
classifier = 'sources'
90+
from sourceSets.main.allSource
91+
}
92+
}
7293

73-
licenseName = 'The Apache Software License, Version 2.0'
74-
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
75-
allLicenses = ["Apache-2.0"]
94+
task javadocJar(type: Jar, dependsOn: javadoc) {
95+
classifier = 'javadoc'
96+
from javadoc.destinationDir
7697
}
7798

78-
apply from: '../install.gradle'
79-
apply from: '../bintray.gradle'
99+
artifacts {
100+
archives javadocJar
101+
archives sourcesJar
102+
}

0 commit comments

Comments
 (0)