Skip to content

Commit

Permalink
Merge branch 'release/0.9.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
h6ah4i committed May 17, 2016
2 parents 04e9b99 + 0a6c6a1 commit 5d3685a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Target platforms
Latest version
---

- Version 0.9.0 (May 8, 2016) ([RELEASE NOTES](./RELEASE-NOTES.md))
- Version 0.9.1 (May 17, 2016) ([RELEASE NOTES](./RELEASE-NOTES.md))


Getting started
Expand All @@ -42,7 +42,7 @@ This library is published on jCenter. Just add these lines to `build.gradle`.

```groovy
dependencies {
compile ('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.9.0@aar'){
compile ('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.9.1@aar'){
transitive=true
}
}
Expand Down
5 changes: 5 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.9.1
[Bug fixes]
- Fix broken drag and drop behavior on API level 10


## 0.9.0
[New features]
- Introduce `DraggableItemAdapter.onCheckCanDrop()` callback (issue #233)
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 18
versionName "0.9.0"
versionCode 19
versionName "0.9.1"
vectorDrawables.useSupportLibrary = true
}

Expand Down
2 changes: 0 additions & 2 deletions example/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-sdk tools:overrideLibrary="com.wnafee.vector"/>

<application
android:allowBackup="true"
android:fullBackupContent="false"
Expand Down
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.9.0
VERSION_CODE=18
VERSION_NAME=0.9.1
VERSION_CODE=19

# 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 @@ -959,10 +959,7 @@ private void updateDragDirectionMask() {
}

if (canSwap) {
final boolean isLinearLayout = CustomRecyclerViewUtils.isLinearLayout(CustomRecyclerViewUtils.getLayoutType(rv));
final boolean smoothSwapping = isLinearLayout && (mSwapTargetItemOperator != null);

swapItems(rv, draggingItemCurrentPosition, draggingItem, swapTarget.holder, smoothSwapping);
swapItems(rv, draggingItemCurrentPosition, draggingItem, swapTarget.holder);
}

if (mSwapTargetItemOperator != null) {
Expand Down Expand Up @@ -1189,8 +1186,7 @@ private void swapItems(
RecyclerView rv,
int draggingItemAdapterPosition,
@Nullable RecyclerView.ViewHolder draggingItem,
@NonNull RecyclerView.ViewHolder swapTargetHolder,
boolean smoothSwapping) {
@NonNull RecyclerView.ViewHolder swapTargetHolder) {

final Rect swapTargetMargins = CustomRecyclerViewUtils.getLayoutMargins(swapTargetHolder.itemView, mTmpRect1);
@SuppressWarnings("UnnecessaryLocalVariable") final int fromPosition = draggingItemAdapterPosition;
Expand All @@ -1210,9 +1206,12 @@ private void swapItems(
return;
}

final boolean isLinearLayout = CustomRecyclerViewUtils.isLinearLayout(CustomRecyclerViewUtils.getLayoutType(rv));
final boolean swapNextItemSmoothlyInLinearLayout = isLinearLayout && (!supportsViewTranslation() || !mCheckCanDrop);

//noinspection StatementWithEmptyBody
if (diffPosition == 0) {
} else if ((diffPosition == 1) && (draggingItem != null) && smoothSwapping) {
} else if ((diffPosition == 1) && (draggingItem != null) && swapNextItemSmoothlyInLinearLayout) {
final View v1 = draggingItem.itemView;
final View v2 = swapTargetHolder.itemView;
final Rect m1 = mDraggingItemInfo.margins;
Expand Down

0 comments on commit 5d3685a

Please sign in to comment.