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

Commit

Permalink
Merge pull request #12 from DevAhamed/develop
Browse files Browse the repository at this point in the history
v1.2.0 release
  • Loading branch information
DevAhamed authored Jun 14, 2017
2 parents 82c950b + 8985b21 commit b6b86f2
Show file tree
Hide file tree
Showing 31 changed files with 381 additions and 417 deletions.
75 changes: 67 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ The minimum API level supported by this library is API 9.

```gradle
dependencies {
// ... other dependencies here
compile 'com.github.devahamed:multi-view-adapter:1.1.0'
compile 'com.github.devahamed:multi-view-adapter:1.2.0'
// If you want to use data binding
compile 'com.github.devahamed:multi-view-adapter-databinding:1.2.0'
}
```

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

## Features

1. Supports different span count for different ItemBinders.
2. Adds different ItemDecoration for different ItemBinders.
3. Items can be selected - Single and Multiple selection options are available.
4. Out of the box support for DiffUtil.
1. Multiple data set can be added to the adapter. [WikiDoc](https://github.com/DevAhamed/MultiViewAdapter/wiki/Multiple-Data-Set)
2. Adds different ItemDecoration for different ItemBinders. [WikiDoc](https://github.com/DevAhamed/MultiViewAdapter/wiki/Custom-Item-Decoration)
3. Single and Multiple selection options are available. [WikiDoc](https://github.com/DevAhamed/MultiViewAdapter/wiki/Choice-Modes)
4. Out of the box support for DiffUtil. [WikiDoc](https://github.com/DevAhamed/MultiViewAdapter/wiki/DiffUtil-and-Payload)
5. Custom span count for every binder. [WikiDoc](https://github.com/DevAhamed/MultiViewAdapter/wiki/Grid-Adapter)
6. Data binding support. [WikiDoc](https://github.com/DevAhamed/MultiViewAdapter/wiki/Data-Binding)
7. Advanced drag and drop support. [WikiDoc](https://github.com/DevAhamed/MultiViewAdapter/wiki/Drag-and-Drop)
8. Swipe to dismiss. [WikiDoc](https://github.com/DevAhamed/MultiViewAdapter/wiki/Swipe-To-Dismiss)
9. Infinite scrolling. [WikiDoc](https://github.com/DevAhamed/MultiViewAdapter/wiki/Infinite-Scrolling)
10. Helper class for contextual action mode. [WikiDoc](https://github.com/DevAhamed/MultiViewAdapter/wiki/Contextual-Action-Mode)
11. Items can be expanded/collapsed. [WikiDoc](https://github.com/DevAhamed/MultiViewAdapter/wiki/Expandable-Item)
12. Groups can be expanded/collapsed. [WikiDoc](https://github.com/DevAhamed/MultiViewAdapter/wiki/Expandable-Group)

## File Templates

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)

## Usage
To get some idea about the MultiViewAdapter features kindly look at sample app code.
Also we have comprehensive wiki pages as well. Take a look at [JCenter](https://github.com/DevAhamed/MultiViewAdapter/wiki).
Let us display list of cars. No fuss. Here is the entire code.


<b>CarBinder</b>

```java
class CarBinder extends ItemBinder<CarModel, CarBinder.CarViewHolder> {

@Override public CarViewHolder create(LayoutInflater inflater, ViewGroup parent) {
return new CarViewHolder(inflater.inflate(R.layout.item_car, parent, false));
}

@Override public boolean canBindData(Object item) {
return item instanceof CarModel;
}

@Override public void bind(CarViewHolder holder, CarModel item) {
// Bind the data here
}

static class CarViewHolder extends BaseViewHolder<CarModel> {
// Normal ViewHolder code
}
}
```

<b>In your Activity/Fragment</b>

```java
class CarListActivity extends Activity {

private RecyclerView recyclerView;
private List<CarModel> cars;

public void initViews() {
SimpleRecyclerAdapter<CarModel, CarBinder> adapter =
new SimpleRecyclerAdapter<>(new CarBinder());

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

## Changelog
See the project's Releases page for a list of versions with their changelog. [View Releases](https://github.com/DevAhamed/MultiViewAdapter/releases)<br/>
Expand Down
67 changes: 0 additions & 67 deletions bintray.gradle

This file was deleted.

4 changes: 1 addition & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.android.tools.build:gradle:2.3.3'
}
}

Expand Down
41 changes: 0 additions & 41 deletions install.gradle

This file was deleted.

75 changes: 49 additions & 26 deletions multi-view-adapter-databinding/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@
*/

apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'

def devPropertiesFile = rootProject.file("developer.properties");
def devProperties = new Properties()
devProperties.load(new FileInputStream(devPropertiesFile))
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.novoda:bintray-release:0.5.0'
}
}

android {
compileSdkVersion 25
Expand All @@ -28,7 +34,7 @@ android {
minSdkVersion 9
targetSdkVersion 25
versionCode 1
versionName "1.0"
versionName "1.2.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
Expand All @@ -50,30 +56,47 @@ dependencies {
}
}

ext {

bintrayRepo = devProperties['repoName']
bintrayName = devProperties['artifactId']

publishedGroupId = devProperties['groupId']
libraryName = devProperties['repoName']
artifact = devProperties['artifactIdDataBinding']

libraryDescription = 'Additional DataBinding support for MultiViewAdapter'

siteUrl = 'https://github.com/DevAhamed/MultiViewAdapter'
gitUrl = 'https://github.com/DevAhamed/MultiViewAdapter.git'
publish {
userOrg = 'devahamed'
groupId = 'com.github.devahamed'
artifactId = 'multi-view-adapter-databinding'
publishVersion = '1.2.0'
repoName = 'MultiViewAdapter'
desc = 'Additional DataBinding support for MultiViewAdapter'
website = 'https://github.com/DevAhamed/MultiViewAdapter'
}

libraryVersion = '1.1.0'
if (project.hasProperty("android")) {
// Android libraries
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}

developerId = devProperties['devId']
developerName = devProperties['devName']
developerEmail = devProperties['devEmail']
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
failOnError true
}
afterEvaluate {
javadoc.classpath +=
files(android.libraryVariants.collect { variant -> variant.javaCompile.classpath.files
})
}
} else {
// Java libraries
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
}

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

apply from: '../install.gradle'
apply from: '../bintray.gradle'
artifacts {
archives javadocJar
archives sourcesJar
}
Loading

0 comments on commit b6b86f2

Please sign in to comment.