Skip to content

Commit

Permalink
Merge branch 'release/0.10.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
h6ah4i committed Feb 25, 2017
2 parents 4b92d78 + 2b59665 commit ef2a8a2
Show file tree
Hide file tree
Showing 20 changed files with 391 additions and 95 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: 21547 | 230 KB-e91e63.svg) ](http://www.methodscount.com/?lib=com.h6ah4i.android.widget.advrecyclerview%3Aadvrecyclerview%3A0.10.3)
[![Method Count](https://img.shields.io/badge/Methods and size-core: 1704 | deps: 21568 | 232 KB-e91e63.svg) ](http://www.methodscount.com/?lib=com.h6ah4i.android.widget.advrecyclerview%3Aadvrecyclerview%3A0.10.4)
---

### Download the example app
Expand All @@ -32,7 +32,12 @@ Target platforms
Latest version
---

- Version 0.10.3 (January 21, 2017) ([RELEASE NOTES](./RELEASE-NOTES.md))
- Version 0.10.4 (February 25, 2017) ([RELEASE NOTES](./RELEASE-NOTES.md))


**Breaking Change Info**

- **v0.10.4:** `OnGroupExpandListener` and `OnGroupCollapseListener` takes `payload` parameter. (related: [issue #350](https://github.com/h6ah4i/android-advancedrecyclerview/issues/350))


Getting started
Expand All @@ -42,7 +47,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.3@aar'){
compile ('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.10.4@aar'){
transitive=true
}
}
Expand Down Expand Up @@ -166,7 +171,7 @@ Primary classes/interfaces
Other examples
---

|
|
### iOS Mail app like swipe action

<img src="images/other_example_ios_mail.png" width="200" />
Expand Down
22 changes: 21 additions & 1 deletion RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
## 0.10.4
[BREAKING CHANGE]
- The `payload` parameter is added to `OnGroupExpandListener` and `OnGroupCollapseListener` (issue #350)
(commit: 353406ea43657dead1ba65207b95e9067e457f6d)

[New features]
- Added fine control of initial state of group items by
`ExpandableItemAdapter.getInitialGroupExpandedState()` (issue #346)
- Added variants of `expandGroup()`/`collapseGroup()` methods which has a `payload` parameter (issue #350)

[Bug fixes]
- Fixed NullPointerException issue (issue #358 & PR #362, thanks @polyak01 !)
- Fix swipe amount not applied before laid out item views in proportional mode (issue #361)

[Improvements]
- Added scrolling support while dragging in NestedScrollView (issue #351)
- Updated support library to v25.2.0



## 0.10.3
[Bug fixes]
- Fixed IllegalStateException on touching a group item while RecyclerView is calculating layout (issue #339)
Expand Down Expand Up @@ -25,7 +45,7 @@
## 0.10.0
[New features]
- Introduced ComposedAdapter
- Introudced Headers and Footers support
- Introduced Headers and Footers support
- Added new demos for new adapter related features
- Made dragging item appearance controllable (issue #193, #292)
- Added AFTER_SWIPE_REACTION_DO_NOTHING (pull request #308)
Expand Down
8 changes: 4 additions & 4 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 25
versionCode 25
versionName "0.10.3"
versionCode 26
versionName "0.10.4"
vectorDrawables.useSupportLibrary = true
}

Expand Down Expand Up @@ -60,8 +60,8 @@ if (loadSigningConfigFromPropertiesFile(
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':library')
compile 'com.android.support:design:25.1.0'
compile ('com.h6ah4i.android.tablayouthelper:tablayouthelper:0.7.0') {
compile 'com.android.support:design:25.2.0'
compile ('com.h6ah4i.android.tablayouthelper:tablayouthelper:0.8.0') {
exclude group: 'com.android.support'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ public boolean onOptionsItemSelected(MenuItem item) {
}

@Override
public void onGroupCollapse(int groupPosition, boolean fromUser) {
public void onGroupCollapse(int groupPosition, boolean fromUser, Object payload) {
}

@Override
public void onGroupExpand(int groupPosition, boolean fromUser) {
public void onGroupExpand(int groupPosition, boolean fromUser, Object payload) {
// NOTE: fromUser is false because explicitly calling the
// RecyclerViewExpandableItemManager.expand() method in adapter
adjustScrollPositionOnGroupExpanded(groupPosition);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,14 @@ public boolean onCheckCanExpandOrCollapseGroup(MyGroupViewHolder holder, int gro
return true;
}

@Override
public boolean getInitialGroupExpandedState(int groupPosition) {
// NOTE:
// This method can also be used to control initial state of group items.
// Make sure to call `setDefaultGroupsExpandedState(false)` to take effect.
return false;
}

// NOTE: This method is called from Fragment
public void addGroupAndChildItemsBottom(int groupCount, int childCount) {
int groupPosition = mProvider.getGroupCount();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
mRecyclerViewExpandableItemManager = new RecyclerViewExpandableItemManager(eimSavedState);

// Expand all group items by default. This method must be called before creating a wrapper adapter.
//
// FYI: AbstractExpandableItemAdapter.getInitialGroupExpandedState() can also be used if you
// need fine control of initial group items' state.
mRecyclerViewExpandableItemManager.setDefaultGroupsExpandedState(true);

//adapter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ public void onDestroyView() {
}

@Override
public void onGroupCollapse(int groupPosition, boolean fromUser) {
public void onGroupCollapse(int groupPosition, boolean fromUser, Object payload) {
}

@Override
public void onGroupExpand(int groupPosition, boolean fromUser) {
public void onGroupExpand(int groupPosition, boolean fromUser, Object payload) {
if (fromUser) {
adjustScrollPositionOnGroupExpanded(groupPosition);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,11 @@ public void onDestroyView() {
}

@Override
public void onGroupCollapse(int groupPosition, boolean fromUser) {
public void onGroupCollapse(int groupPosition, boolean fromUser, Object payload) {
}

@Override
public void onGroupExpand(int groupPosition, boolean fromUser) {
public void onGroupExpand(int groupPosition, boolean fromUser, Object payload) {
if (fromUser) {
adjustScrollPositionOnGroupExpanded(groupPosition);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,11 @@ public void onDestroyView() {
}

@Override
public void onGroupCollapse(int groupPosition, boolean fromUser) {
public void onGroupCollapse(int groupPosition, boolean fromUser, Object payload) {
}

@Override
public void onGroupExpand(int groupPosition, boolean fromUser) {
public void onGroupExpand(int groupPosition, boolean fromUser, Object payload) {
if (fromUser) {
adjustScrollPositionOnGroupExpanded(groupPosition);
}
Expand Down
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ android {
}

dependencies {
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:recyclerview-v7:25.1.0'
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:recyclerview-v7:25.2.0'

testCompile 'junit:junit:4.12'
testCompile 'org.hamcrest:hamcrest-library:1.3'
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.10.3
VERSION_CODE=25
VERSION_NAME=0.10.4
VERSION_CODE=26

# 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 @@ -178,7 +178,7 @@ public void setupDraggingItemEffects(DraggingItemEffectsInfo info) {
mAlphaInterpolator = info.alphaInterpolator;
}

public void start(MotionEvent e, DraggingItemInfo draggingItemInfo) {
public void start(DraggingItemInfo draggingItemInfo, int touchX, int touchY) {
if (mStarted) {
return;
}
Expand All @@ -199,7 +199,7 @@ public void start(MotionEvent e, DraggingItemInfo draggingItemInfo) {
// hide
itemView.setVisibility(View.INVISIBLE);

update(e, true);
update(touchX, touchY, true);

mRecyclerView.addItemDecoration(this);
mStartMillis = System.currentTimeMillis();
Expand Down Expand Up @@ -263,9 +263,9 @@ public void finish(boolean animate) {
mStarted = false;
}

public boolean update(MotionEvent e, boolean force) {
mTouchPositionX = (int) (e.getX() + 0.5f);
mTouchPositionY = (int) (e.getY() + 0.5f);
public boolean update(int touchX, int touchY, boolean force) {
mTouchPositionX = touchX;
mTouchPositionY = touchY;

return refresh(force);
}
Expand Down
Loading

0 comments on commit ef2a8a2

Please sign in to comment.