diff --git a/README.md b/README.md index 6a71e772..b67bb2fe 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This RecyclerView extension library provides Google's Inbox app like swiping, Pl [ ![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) -[![Method Count](https://img.shields.io/badge/Methods and size-core: 1684 | deps: 19003 | 230 KB-e91e63.svg) ](http://www.methodscount.com/?lib=com.h6ah4i.android.widget.advrecyclerview%3Aadvrecyclerview%3A0.10.2) +[![Method Count](https://img.shields.io/badge/Methods and size-core: 1684 | deps: 21547 | 230 KB-e91e63.svg) ](http://www.methodscount.com/?lib=com.h6ah4i.android.widget.advrecyclerview%3Aadvrecyclerview%3A0.10.3) --- ### Download the example app @@ -32,7 +32,7 @@ Target platforms Latest version --- -- Version 0.10.2 (November 27, 2016) ([RELEASE NOTES](./RELEASE-NOTES.md)) +- Version 0.10.3 (January 21, 2017) ([RELEASE NOTES](./RELEASE-NOTES.md)) Getting started @@ -42,7 +42,7 @@ This library is published on jCenter. Just add these lines to `build.gradle`. ```gradle dependencies { - compile ('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.10.2@aar'){ + compile ('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.10.3@aar'){ transitive=true } } diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 34c76132..21eb0c5f 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,6 +1,17 @@ ## 0.10.2 [Bug fixes] -- Fix createDraggingItemImage() method regression (issue #325) +- Fixed IllegalStateException on touching a group item while RecyclerView is calculating layout (issue #339) +- Fixed onBindGroupViewHolder()/onBindChildViewHolder() method with palyloads parameter not used bug + +[Improvements] +- Reduce overdraws of "Button under swipeable item" (PR #331, thx. @AnirudhaAgashe) +- Updated support library to v25.1.0 + + +## 0.10.2 +[Bug fixes] +- Fixed createDraggingItemImage() method regression (issue #325) + ## 0.10.1 [Improvements] diff --git a/build.gradle b/build.gradle index ef7ae5ac..f46d6535 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.2' + classpath 'com.android.tools.build:gradle:2.2.3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/common/android-set-common-properties.gradle b/common/android-set-common-properties.gradle index c9d472be..c36b4158 100644 --- a/common/android-set-common-properties.gradle +++ b/common/android-set-common-properties.gradle @@ -15,12 +15,12 @@ */ android { - compileSdkVersion 23 + compileSdkVersion 25 if (System.getenv("JITPACK") == "true") { - buildToolsVersion '23.0.2' + buildToolsVersion '25.0.2' } else { - buildToolsVersion '23.0.3' + buildToolsVersion '25.0.2' } compileOptions { diff --git a/example/build.gradle b/example/build.gradle index 10b38640..29e7521b 100644 --- a/example/build.gradle +++ b/example/build.gradle @@ -25,8 +25,8 @@ android { applicationId "com.h6ah4i.android.example.advrecyclerview" minSdkVersion 9 targetSdkVersion 25 - versionCode 24 - versionName "0.10.2" + versionCode 25 + versionName "0.10.3" vectorDrawables.useSupportLibrary = true } @@ -60,6 +60,8 @@ if (loadSigningConfigFromPropertiesFile( dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile project(':library') - compile 'com.android.support:design:25.0.1' - compile 'com.h6ah4i.android.tablayouthelper:tablayouthelper:0.7.0' + compile 'com.android.support:design:25.1.0' + compile ('com.h6ah4i.android.tablayouthelper:tablayouthelper:0.7.0') { + exclude group: 'com.android.support' + } } diff --git a/example/src/main/java/com/h6ah4i/android/example/advrecyclerview/demo_s_button/SwipeableWithButtonExampleAdapter.java b/example/src/main/java/com/h6ah4i/android/example/advrecyclerview/demo_s_button/SwipeableWithButtonExampleAdapter.java index 8961199d..3fca1ee6 100644 --- a/example/src/main/java/com/h6ah4i/android/example/advrecyclerview/demo_s_button/SwipeableWithButtonExampleAdapter.java +++ b/example/src/main/java/com/h6ah4i/android/example/advrecyclerview/demo_s_button/SwipeableWithButtonExampleAdapter.java @@ -23,6 +23,7 @@ import android.view.ViewGroup; import android.widget.Button; import android.widget.FrameLayout; +import android.widget.RelativeLayout; import android.widget.TextView; import com.h6ah4i.android.example.advrecyclerview.R; @@ -60,12 +61,14 @@ public interface EventListener { public static class MyViewHolder extends AbstractSwipeableItemViewHolder { public FrameLayout mContainer; + public RelativeLayout mBehindViews; public TextView mTextView; public Button mButton; public MyViewHolder(View v) { super(v); mContainer = (FrameLayout) v.findViewById(R.id.container); + mBehindViews = (RelativeLayout) v.findViewById(R.id.behind_views); mTextView = (TextView) v.findViewById(android.R.id.text1); mButton = (Button) v.findViewById(android.R.id.button1); } @@ -188,20 +191,11 @@ public int onGetSwipeReactionType(MyViewHolder holder, int position, int x, int @Override public void onSetSwipeBackground(MyViewHolder holder, int position, int type) { - int bgRes = 0; - switch (type) { - case Swipeable.DRAWABLE_SWIPE_NEUTRAL_BACKGROUND: - bgRes = R.drawable.bg_swipe_item_neutral; - break; - case Swipeable.DRAWABLE_SWIPE_LEFT_BACKGROUND: - bgRes = R.drawable.bg_swipe_item_left; - break; - case Swipeable.DRAWABLE_SWIPE_RIGHT_BACKGROUND: - bgRes = R.drawable.bg_swipe_item_right; - break; + if (type == Swipeable.DRAWABLE_SWIPE_NEUTRAL_BACKGROUND) { + holder.mBehindViews.setVisibility(View.GONE); + } else { + holder.mBehindViews.setVisibility(View.VISIBLE); } - - holder.itemView.setBackgroundResource(bgRes); } @Override diff --git a/example/src/main/java/com/h6ah4i/android/example/advrecyclerview/demo_s_viewpager/ViewPagerSwipeableExampleAdapter.java b/example/src/main/java/com/h6ah4i/android/example/advrecyclerview/demo_s_viewpager/ViewPagerSwipeableExampleAdapter.java index f7ab772d..9d786bd4 100644 --- a/example/src/main/java/com/h6ah4i/android/example/advrecyclerview/demo_s_viewpager/ViewPagerSwipeableExampleAdapter.java +++ b/example/src/main/java/com/h6ah4i/android/example/advrecyclerview/demo_s_viewpager/ViewPagerSwipeableExampleAdapter.java @@ -16,6 +16,8 @@ package com.h6ah4i.android.example.advrecyclerview.demo_s_viewpager; +import android.graphics.Color; +import android.support.v4.content.ContextCompat; import android.support.v4.view.ViewCompat; import android.support.v7.widget.RecyclerView; import android.util.Log; @@ -130,6 +132,11 @@ public int onGetSwipeReactionType(MyViewHolder holder, int position, int x, int @Override public void onSetSwipeBackground(MyViewHolder holder, int position, int type) { + if (type == Swipeable.DRAWABLE_SWIPE_NEUTRAL_BACKGROUND) { + holder.itemView.setBackgroundColor(Color.TRANSPARENT); + } else { + holder.itemView.setBackgroundColor(ContextCompat.getColor(holder.itemView.getContext(), R.color.bg_swipe_item_gray)); + } } @Override diff --git a/example/src/main/res/layout/list_item_view_pager.xml b/example/src/main/res/layout/list_item_view_pager.xml index cc942d3c..35c3514b 100644 --- a/example/src/main/res/layout/list_item_view_pager.xml +++ b/example/src/main/res/layout/list_item_view_pager.xml @@ -20,14 +20,13 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" - android:layout_height="@dimen/list_item_height" - android:background="@color/bg_swipe_item_gray"> + android:layout_height="@dimen/list_item_height"> diff --git a/example/src/main/res/layout/list_item_with_leave_behind_button.xml b/example/src/main/res/layout/list_item_with_leave_behind_button.xml index 094d50f7..b78ada11 100644 --- a/example/src/main/res/layout/list_item_with_leave_behind_button.xml +++ b/example/src/main/res/layout/list_item_with_leave_behind_button.xml @@ -20,13 +20,15 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" - android:layout_height="64dp" - android:background="@drawable/bg_swipe_item_neutral"> + android:layout_height="64dp"> + android:background="@color/bg_swipe_item_gray" + android:visibility="gone" + tools:visibility="visible">