Skip to content

Commit

Permalink
v4.0.1 Configuration for JCenter #9.
Browse files Browse the repository at this point in the history
Refactored module names, package signatures and gradle build files.
  • Loading branch information
davideas committed Nov 1, 2015
1 parent 57ee592 commit 6e6c537
Show file tree
Hide file tree
Showing 131 changed files with 908 additions and 89 deletions.
37 changes: 23 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-FlexibleAdapter-green.svg?style=flat)](https://android-arsenal.com/details/1/2207)
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-FlexibleAdapter-green.svg?style=flat)](https://android-arsenal.com/details/1/2207) [![Download](https://api.bintray.com/packages/davideas/maven/flexible-adapter/images/download.svg) ](https://bintray.com/davideas/maven/flexible-adapter/_latestVersion)

# Flexible Adapter

###### A pattern for every RecyclerView - Master branch: v4 of 2015.10.18
###### A pattern for every RecyclerView - Master branch: v4 of 2015.11.01

#### Main functionalities
* Base item selection (but also SINGLE & MULTI selection mode) in the Recycler View with ripple effect.
Expand All @@ -26,11 +26,15 @@ Finally note that, this adapter handles the basic clicks: _single_ and _long cli
![Search screen](/screenshots/search.png) ![Undo Screen](/screenshots/undo.png)

#Setup
Ultra simple:
No needs to create and import a library for just 2 files, so just *copy* SelectableAdapter.java & FlexibleAdapter.java in your *common* package and start to *extend* FlexibleAdapter from your custom Adapter (see my ExampleAdapter).
Using JCenter repo (bintray.com)
```
dependencies {
compile 'eu.davidea:flexible-adapter:4.0.1'
}
```
Or you can just *copy* SelectableAdapter.java & FlexibleAdapter.java in your *common* package and start to *extend* FlexibleAdapter from your custom Adapter (see my ExampleAdapter).

Remember to initialize `mItems` (List already included in FlexibleAdapter) in order to manage list items. Method `updateDataSet(..)` can help in this.

#### Pull requests / Issues / Improvement requests
Feel free to contribute and ask!

Expand Down Expand Up @@ -126,18 +130,23 @@ public class MainActivity extends AppCompatActivity {
```

# Change Log
###### v4 - 2015.10.18
- Added **FilterAsyncTask** to asynchronously load the list (This might not work well and binding is excluded from Async)
- Enabled **Search** filter through _updateDataSet_ method (Note: as the example is made, the search regenerate the list!)
###### v4.0.1 - 2015.11.01
- Refactored module names, package signatures and gradle build files. Code remains unchanged.
- Configuration for JCenter, now FlexibleAdapter is a lightweight standalone library!
**Note:** FastScroller and ItemAnimators are excluded from the library, but you can see them in the example App.

###### v4.0 - 2015.10.18
- Added **FilterAsyncTask** to asynchronously load the list (This might not work well and binding is excluded from Async).
- Enabled **Search** filter through _updateDataSet_ method (Note: as the example is made, the search regenerate the list!).
- Included some ItemAnimators from https://github.com/wasabeef/recyclerview-animators
(in the example SlideInRightAnimator is used), but all need to be adapted if used with Support v23.1.0
(in the example SlideInRightAnimator is used), but all need to be adapted if used with Support v23.1.0.
- Included and customized **FastScroller** library from https://github.com/AndroidDeveloperLB/LollipopContactsRecyclerViewFastScroller
My version has FrameLayout extended instead of LinearLayout, and a friendly layout.
- Added **SwipeRefreshLayout**, just an usage example
- Use of Handler instead of TimerTask while Undo
- _FlexibleAdapter_ can now return deleted items before they are removed from memory
- _SelectableAdapter.selectAll()_ can now skip selection on one specific ViewType
- Adapted MainActivity
- Added **SwipeRefreshLayout**, just an usage example.
- Use of Handler instead of TimerTask while Undo.
- _FlexibleAdapter_ can now return deleted items before they are removed from memory.
- _SelectableAdapter.selectAll()_ can now skip selection on one specific ViewType.
- Adapted MainActivity.

###### Old releases
See [releases](https://github.com/davideas/FlexibleAdapter/releases) for old versions.
Expand Down
51 changes: 51 additions & 0 deletions bintray.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
apply plugin: 'com.jfrog.bintray'

version = libraryVersion

task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}

task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar
archives sourcesJar
}

// Bintray
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")

configurations = ['archives']
pkg {
repo = bintrayRepo
name = bintrayName
desc = libraryDescription
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = allLicenses
publish = true
publicDownloadNumbers = true
version {
desc = libraryDescription
gpg {
sign = true //Determines whether to GPG sign the files. The default is false
passphrase = properties.getProperty("bintray.gpg.password")
//Optional. The passphrase for GPG signing'
}
}
}
}
51 changes: 49 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,55 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
ext {
//Author
developerId = 'davideas'
developerName = 'Davide Steduto'
developerEmail = '[email protected]'

//Library
libraryCode = 8
libraryVersion = '4.0.1'
libraryDate = " of 2015.11.01"
libraryDescription = 'A pattern for every RecyclerView'
libraryName = 'FlexibleAdapter'

//Library Repository
bintrayRepo = 'maven'
bintrayName = 'flexible-adapter'
publishedGroupId = 'eu.davidea'
artifact = bintrayName
siteUrl = 'https://github.com/davideas/FlexibleAdapter'
gitUrl = 'https://github.com/davideas/FlexibleAdapter.git'

//Support and Build tools version
minSdk = 14
targetSdk = 23
buildTools = '23.0.1'
supportLibrary = '23.0.1'

//Support Libraries dependencies
supportDependencies = [
design : "com.android.support:design:${supportLibrary}",
recyclerview : "com.android.support:recyclerview-v7:${supportLibrary}",
cardview : "com.android.support:cardview-v7:${supportLibrary}",
appcompat : "com.android.support:appcompat-v7:${supportLibrary}",
customtabs : "com.android.support:customtabs:${supportLibrary}",
support : "com.android.support:support-v13:${supportLibrary}'",
annotations : "com.android.support:support-annotations:${supportLibrary}"
]

licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]
}

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'

classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand All @@ -17,3 +60,7 @@ allprojects {
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
34 changes: 34 additions & 0 deletions flexible-adapter-app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion targetSdk
buildToolsVersion buildTools

defaultConfig {
applicationId "eu.davidea.examples.flexibleadapter"
minSdkVersion minSdk
targetSdkVersion targetSdk
versionCode versionCode
versionName libraryVersion + libraryDate
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
//compile 'eu.davidea:flexible-adapter:4.0.1'
compile project (":flexible-adapter-lib")
compile supportDependencies.appcompat
compile (supportDependencies.design) {
exclude module: 'support-v4'
exclude module: 'support-annotations'
}
compile (supportDependencies.recyclerview) {
exclude module: 'support-v4';
exclude module: 'support-annotations'
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="eu.davidea.flexibleadapter" >
package="eu.davidea.examples.flexibleadapter">

<application
android:allowBackup="true"
Expand Down
Binary file added flexible-adapter-app/src/main/ic_launcher-web.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package eu.davidea.anim;
package eu.davidea.examples.anim;

import android.support.v4.view.ViewPropertyAnimatorListener;
import android.support.v7.widget.RecyclerView;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package eu.davidea.anim;
package eu.davidea.examples.anim;
/*
* Copyright (C) 2015 Wasabeef
* Copyright (C) 2014 The Android Open Source Project
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package eu.davidea.anim;
package eu.davidea.examples.anim;

import android.support.v4.view.ViewCompat;
import android.support.v4.view.ViewPropertyAnimatorCompat;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package eu.davidea.anim;
package eu.davidea.examples.anim;

import android.graphics.Point;
import android.support.v4.view.ViewCompat;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package eu.davidea.anim;
package eu.davidea.examples.anim;

import android.support.v4.view.ViewCompat;
import android.support.v4.view.ViewPropertyAnimatorCompat;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package eu.davidea.anim;
package eu.davidea.examples.anim;

/**
* This class handles the pending que for you.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package eu.davidea.anim;
package eu.davidea.examples.anim;

/**
* Copyright (C) 2015 Wasabeef
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package eu.davidea.anim;
package eu.davidea.examples.anim;

import android.support.v4.view.ViewCompat;
import android.support.v4.view.ViewPropertyAnimatorCompat;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package eu.davidea.anim;
package eu.davidea.examples.anim;

import android.support.v4.view.ViewCompat;
import android.view.View;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package eu.davidea.fastscroller;
package eu.davidea.examples.fastscroller;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package eu.davidea.flexibleadapter;
package eu.davidea.examples.flexibleadapter;

import android.annotation.SuppressLint;
import android.app.DialogFragment;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package eu.davidea.flexibleadapter;
package eu.davidea.examples.flexibleadapter;

import android.content.Context;
import android.graphics.Typeface;
Expand All @@ -18,8 +18,8 @@
import java.util.List;
import java.util.Locale;

import eu.davidea.common.FlexibleAdapter;
import eu.davidea.fastscroller.FastScroller;
import eu.davidea.examples.fastscroller.FastScroller;
import eu.davidea.flexibleadapter.FlexibleAdapter;
import eu.davidea.utils.Utils;


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package eu.davidea.flexibleadapter;
package eu.davidea.examples.flexibleadapter;

import java.io.Serializable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package eu.davidea.flexibleadapter;
package eu.davidea.examples.flexibleadapter;

import android.annotation.TargetApi;
import android.app.SearchManager;
Expand Down Expand Up @@ -28,10 +28,10 @@
import android.widget.TextView;
import android.widget.Toast;

import eu.davidea.anim.SlideInRightAnimator;
import eu.davidea.common.FlexibleAdapter;
import eu.davidea.common.SimpleDividerItemDecoration;
import eu.davidea.fastscroller.FastScroller;
import eu.davidea.examples.anim.SlideInRightAnimator;
import eu.davidea.examples.fastscroller.FastScroller;
import eu.davidea.flexibleadapter.FlexibleAdapter;
import eu.davidea.utils.Utils;

public class MainActivity extends AppCompatActivity implements
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package eu.davidea.flexibleadapter;
package eu.davidea.examples.flexibleadapter;

import android.annotation.SuppressLint;
import android.app.DialogFragment;
import android.app.Fragment;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.DialogInterface.OnShowListener;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.text.Html;
Expand All @@ -14,8 +13,6 @@
import android.view.View;
import android.widget.TextView;

import eu.davidea.utils.Utils;

public class MessageDialog extends DialogFragment {

public static final String TAG = MessageDialog.class.getSimpleName();
Expand Down Expand Up @@ -52,7 +49,6 @@ public AlertDialog onCreateDialog(Bundle savedInstanceState) {

AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());//), R.style.AppTheme_AlertDialog);
builder.setTitle(getArguments().getString(ARG_TITLE))
//.setIconAttribute(android.R.attr.alertDialogIcon)
.setIcon(getArguments().getInt(ARG_ICON))
.setView(dialogView)
.setPositiveButton(R.string.OK, new OnClickListener() {
Expand All @@ -63,12 +59,6 @@ public void onClick(DialogInterface dialog, int which) {
});

final AlertDialog dialog = builder.create();
dialog.setOnShowListener(new OnShowListener() {
@Override
public void onShow(DialogInterface dialog) {
Utils.hideSoftInput(getActivity());
}
});

return dialog;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package eu.davidea.flexibleadapter;
package eu.davidea.examples.flexibleadapter;

import android.animation.ValueAnimator;
import android.content.Context;
Expand Down
Loading

0 comments on commit 6e6c537

Please sign in to comment.