Skip to content

Commit

Permalink
Merge branch 'release/0.8.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
h6ah4i committed Nov 4, 2015
2 parents 084324d + 88dcc9e commit 6277705
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 48 deletions.
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# How to Contribute

## [IMPORTANT] When opening a Pull Request

This project is actively developed on the [`develop`](/h6ah4i/android-advancedrecyclerview/tree/develop) branch. **Please change the base branch to `develop`**.

<img src="images/contributing_pull_request.png" width="400" />

## Issue reports

When creating an issue report, please provide sufficient information of the issue;

- Version of the Advanced RecyclerView library
- What happens?
- What is the expected behavior?
- How to reproduce?
- *If the issue is hard to reproduce or only occurs in the specific condition, please upload minimal project which can reproduce the same issue.*

These information are optional but recommended because it also helps me to determine what is wrong.

- Dump of the call stack (if crash occurs)
- Version of the Support libraries
- Android OS version
40 changes: 4 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Advanced RecyclerView

This RecyclerView extension library provides Google's Inbox app like swiping, Play Music app like drag-and-drop sorting and expandable item features. Works on API level 9 or later.

[ ![Download](https://api.bintray.com/packages/h6ah4i/maven/android-advancedrecyclerview/images/download.svg) ](https://bintray.com/h6ah4i/maven/android-advancedrecyclerview/_latestVersion)
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Advanced%20RecyclerView-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1432)

---
Expand Down Expand Up @@ -32,7 +33,7 @@ Target platforms
Latest version
---

- Version 0.8.3 (Oct. 27, 2015) ([RELEASE NOTES](./RELEASE-NOTES.md))
- Version 0.8.4 (Nov. 4, 2015) ([RELEASE NOTES](./RELEASE-NOTES.md))

*If you are using support library v23.0.x, please use v0.8.1 instead.*

Expand All @@ -44,45 +45,12 @@ This library is published on jCenter. Just add these lines to `build.gradle`.

```groovy
dependencies {
compile ('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.8.3@aar'){
compile ('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.8.4@aar'){
transitive=true
}
}
```

---

*This library is provided as the AAR format.
The source jar file won't be downloaded automatically (due to the current Gradle and Anndroid Studio limitation), so javadoc comments are not displayed on IDE.*

**Here is a workaround thanks to the superb [AARLinkSources](https://github.com/xujiaao/AARLinkSources) Gradle plugin !**

```groovy
buildscript {
repositories {
maven { url 'https://raw.github.com/xujiaao/mvn-repository/master/releases' }
}
dependencies {
classpath 'com.github.xujiaao:aarLinkSources:1.0.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'aar-link-sources'
android {
...
}
dependencies {
compile ('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.8.3@aar'){
transitive=true
}
aarLinkSources 'com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.8.3:sources@jar'
}
```

Migration Guide
---

Expand All @@ -91,7 +59,7 @@ The version 0.8.0 has fixed a lot of issues and introduced some new features. So
### Swipe

The `SwipeableItemAdapter` interface has been changed drastically.
Also, some methods and some constants are marked as deprecated because vertical swipe feature is added.
Also, some methods and some constants are marked as deprecated because vertical swipe feature is added.

#### Recommended way
Implement the new `SwipeableItemAdapter.onItemSwipe()` method which returns `SwipeResultAction` objects.
Expand Down
4 changes: 4 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.8.4
- Fixed issue #142 (Recycler View crash on destroy)


## 0.8.3
- Fixed issue #131 (Bottom padding of recycler view offsets the dragging item [Drag drop] bug)
- Fixed issue #133 (Wrong item position used when data set changes during swipe bug)
Expand Down
4 changes: 2 additions & 2 deletions example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ android {
applicationId "com.h6ah4i.android.example.advrecyclerview"
minSdkVersion 9
targetSdkVersion 23
versionCode 13
versionName "0.8.3"
versionCode 14
versionName "0.8.4"
}

signingConfigs {
Expand Down
Binary file added images/contributing_pull_request.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions library/library-data.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# suppress inspection "UnusedProperty" for whole file
# common
VERSION_NAME=0.8.3
VERSION_CODE=13
VERSION_NAME=0.8.4
VERSION_CODE=14

# for maven-publish
POM_GROUP_ID=com.h6ah4i.android.widget.advrecyclerview
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ public BaseWrapperAdapter(RecyclerView.Adapter<VH> adapter) {
super.setHasStableIds(mWrappedAdapter.hasStableIds());
}

private boolean isWrappedAdapterAlive(){
return mWrappedAdapter!=null;
}

public void release() {
onRelease();

Expand All @@ -58,33 +62,40 @@ public RecyclerView.Adapter<VH> getWrappedAdapter() {

@Override
public void onAttachedToRecyclerView(RecyclerView recyclerView) {
mWrappedAdapter.onAttachedToRecyclerView(recyclerView);
if (isWrappedAdapterAlive())
mWrappedAdapter.onAttachedToRecyclerView(recyclerView);
}

@Override
public void onDetachedFromRecyclerView(RecyclerView recyclerView) {
mWrappedAdapter.onDetachedFromRecyclerView(recyclerView);
if (isWrappedAdapterAlive())
mWrappedAdapter.onDetachedFromRecyclerView(recyclerView);
}

@Override
public void onViewAttachedToWindow(VH holder) {
mWrappedAdapter.onViewAttachedToWindow(holder);
if (isWrappedAdapterAlive())
mWrappedAdapter.onViewAttachedToWindow(holder);
}

@Override
public void onViewDetachedFromWindow(VH holder) {
mWrappedAdapter.onViewDetachedFromWindow(holder);
if (isWrappedAdapterAlive())
mWrappedAdapter.onViewDetachedFromWindow(holder);
}

@Override
public void onViewRecycled(VH holder) {
mWrappedAdapter.onViewRecycled(holder);
if (isWrappedAdapterAlive())
mWrappedAdapter.onViewRecycled(holder);
}

@Override
public void setHasStableIds(boolean hasStableIds) {
super.setHasStableIds(hasStableIds);
mWrappedAdapter.setHasStableIds(hasStableIds);

if (isWrappedAdapterAlive())
mWrappedAdapter.setHasStableIds(hasStableIds);
}

@Override
Expand All @@ -94,12 +105,13 @@ public VH onCreateViewHolder(ViewGroup parent, int viewType) {

@Override
public void onBindViewHolder(VH holder, int position) {
mWrappedAdapter.onBindViewHolder(holder, position);
if (isWrappedAdapterAlive())
mWrappedAdapter.onBindViewHolder(holder, position);
}

@Override
public int getItemCount() {
return mWrappedAdapter.getItemCount();
return isWrappedAdapterAlive() ? mWrappedAdapter.getItemCount() : 0;
}

@Override
Expand Down

0 comments on commit 6277705

Please sign in to comment.