You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+79-59Lines changed: 79 additions & 59 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,21 +5,20 @@
5
5
6
6
# FlexibleAdapter
7
7
8
-
###### A pattern for every RecyclerView
9
-
- Stable _light_ version: 4.2 built on 2015.12.16
10
-
- NEW! Beta version: 5.0.0-b6 built on 2016.05.01 (usable library!)
8
+
###### The only Adapter multi-function for your RecyclerView
9
+
- NEW! Beta version: 5.0.0-b7 built on 2016.06.20 (usable library!) (111KB)
11
10
12
11
####ANNOUNCEMENT: Important and Revolutionary changes are foreseen in v5.0.0. Please see [issues](https://github.com/davideas/FlexibleAdapter/issues) and [releases](https://github.com/davideas/FlexibleAdapter/releases).
13
12
14
-
> When initially Android introduced the RecyclerView widget, we had to implement the Adapter in several applications, again and again to provide the items for our views. Since I created this library, it has become easy to configure how views will be displayed in a list. Thanks to a library like this, nobody wants to use a ListView anymore.
13
+
> When initially Android introduced the RecyclerView widget, we had to implement a custom Adapter in several applications, again and again to provide the items for our views. Since I created this library, it has become easy to configure how views will be displayed in a list. Thanks to a library like this, nobody wants to use a ListView anymore.
15
14
16
-
The FlexibleAdapter helps developers to simplify this process without to worry about the adapter anymore. It's easy to extends, it has predefined logic for different situations and prevents common mistakes.
15
+
The FlexibleAdapter helps developers to simplify this process without to worry about the Adapter anymore. It's easy to extend, it has predefined logic for different situations and prevents common mistakes.
17
16
This library is configurable and it guides the developers (thanks to quality comments on the methods) to create a better user experience and now, even more with the new ViewHolders and new actions.
18
17
19
18
#### Main functionalities
20
19
* Simple item selection with ripple effect, Single & Multi selection mode.
21
20
* Restore deleted items (undo delete), **NEW** works with Expandable items too!
22
-
* FastScroller, **NEW** now in the library and with GridLayout support.
21
+
* FastScroller, **NEW** now in the library supporting all the 3 Layouts.
23
22
* Customizable ItemDecoration.
24
23
* SearchFilter with Spannable text, **NEW** now items are animated. Works with sub items too!
25
24
* Add and Remove items with custom animations.
@@ -29,12 +28,14 @@ This library is configurable and it guides the developers (thanks to quality com
29
28
***NEW!** Drag&Drop and Swipe-To-Dismiss with Leave-Behind pattern, with <u>Selection Coherence</u>.
30
29
***NEW!** Headers/Sections with sticky behaviour fully clickable, collapsible, automatic linkage!
31
30
***NEW!** Auto mapping ViewTypes with Item interfaces.
32
-
***NEW!** 1 simple constructor for all events.
33
-
***NEW!** EndlessScroll with Adapter binding.
31
+
***NEW!** Innovative EndlessScroll with Adapter binding (<u>No OnScrollListener</u>).
34
32
***NEW!** UndoHelper & ActionModeHelper.
33
+
***NEW!** DrawableUtils for dynamic backgrounds (<u>No XML</u>).
34
+
***NEW!** 1 simple constructor for all events.
35
+
***NEW!** Easy runtime position calculation for adding/moving items in sections.
35
36
36
37
#### How is made
37
-
Some simple functionalities have been implemented thanks to the some Blogs (see at the bottom of the page), merged and methods have been improved for speed and scalability, for all Activities that use a RecyclerView.
38
+
Some simple functionalities have been implemented thanks to some Blogs (see at the bottom of the page), merged and methods have been improved for speed and scalability, for all Activities that use a RecyclerView.
38
39
39
40
* At lower level there is `SelectableAdapter` class. It provides selection functionalities and it's able to _maintain the state_ after the rotation: you just need to call the onSave/onRestore methods from the Activity!
40
41
* At middle level, the `AnimatorAdapter` class has been added to give some animation at startup and when user scrolls.
@@ -47,15 +48,16 @@ Some simple functionalities have been implemented thanks to the some Blogs (see
Active discussion [Test FlexibleAdapter v5.0.0](https://github.com/davideas/FlexibleAdapter/issues/39).
83
+
Active discussion [Snapshots and Pre-Releases for FlexibleAdapter v5.0.0](https://github.com/davideas/FlexibleAdapter/issues/39).
86
84
87
85
# Wiki!
88
86
I strong suggest to read the **new [Wiki](https://github.com/davideas/FlexibleAdapter/wiki) pages**.
@@ -92,57 +90,72 @@ Wiki pages have been completely reviewed to support all the coming functionaliti
92
90
Not all pages are filled, working in progress :-)
93
91
94
92
# Change Log
95
-
###### v5.0.0-b6 - 2016.05.01
96
-
_Refactor_
97
-
- Removed `isSelected()` and `setSelected()` from `IFlexible` interface.
98
-
- Deprecated and removed `getSectionableOf()` in favor of the new `getSectionItems()`.
99
-
- Improved instance state on rotation.
100
-
- Renamed package `eu.davidea.examples` in `eu.davidea.samples`.
93
+
###### v5.0.0-b7 - 2016.06.20
94
+
_Deprecation and Refactoring_ (Changes that you have to take care from all previous versions)
95
+
- Refactored class signature for `IHeader` and `IExpandable` and their abstract implementation, [see #117].
96
+
- Refactored method `moveItem()` to `swapItem()`.
97
+
- Separated the initialization of expanded items at start up [see #86]: `expandItemsAtStartUp()` must be explicitly called by the user in Activity creation phase, `expandItemsAtStartUp()` method now uses the existent `expand()` method with initialization info.
98
+
- Items are _NOT_ Draggable and Swipeable by default.
99
+
- Experimenting `TreeSet` instead of `ArrayList` for `mSelectedPositions`. As consequence `getSelectedPositions()` returns a _copied_ List from the Set (already sorted, no duplication)!
100
+
- Deprecated method `addSection()` with refHeader, will be removed from next release.
- Added **EndlessScroll/OnLoadMore**, using adapter binding, _not scroll listener!_[See #43].
107
-
- Modified `DividerItemDecorator` to accept a custom resource and gap between sections [See #60].
108
-
- New methods: `addSection()`, `addItemToSection()`[See #62].
109
-
- Improved `isEnabled()` on `IExpandable` items.
110
-
- Improved methods `getSectionItems()` and `getHeaderItems()`.
111
-
- Support for `StaggeredGridLayoutManager` when using Adapter Animation.
112
-
- Added possibility to filter Header item AND to keep the header also if a subItem has been filtered in [See #73].
113
-
114
-
_Multi-level expansion_
115
-
- Added possibility to chain Expandable items into others expandable [See #63].
116
-
- Item restoration works in multi-level expansion: expanded children are forced to collapse before restoration.
117
-
- Selection coherence in multi-level expansion.
118
-
119
-
_FastScroller_
120
-
- Added a small gap between bubble and handle.
121
-
- Auto handling a change of a new LayoutManager when `FastScroller` is configured. Now FastScroller should work in every situations.
122
-
- Added SmoothScroll for `GridLayoutManager` and optimized smooth scrolling classes.
103
+
- Dragging and swiping can be enabled by type [see #80].
104
+
- Alpha animation, when enabling / disabling sticky headers.
105
+
- Added new method `getItemTouchHelperCallback()` to customize Swipe and Drag behaviors.
106
+
- Added new method `calculatePositionFor()`.
107
+
- Added new method `addSection()` with Comparator object.
108
+
- Added new method `moveItem()` that simply moves an item without swapping it.
109
+
- Added new method `calculatePositionFor()` useful for new items of every type, a custom `Comparator` is needed.
110
+
- Improved method `addItemToSection()` see JavaDoc.
111
+
- Improved method `updateDataSet()`, optionally items can be animated, when `false` a `notifyDataSetChanged()` will be executed.
112
+
- Added 2 new overload methods for `expand()` series [see #110].
113
+
- Added class `UndoHelper.SimpleActionListener` to simplify the development.
114
+
- Added class `DrawableUtils` to manage the background Drawables at runtime without XML configuration [see #35].
115
+
- Added new base interface `OnActionStateListener` for `OnItemMoveListener` and `OnItemSwipeListener` to overcome the drag issue with the `SwipeRefreshLayout`, [see #104 and #83].
116
+
- Added possibility to change mode how `DividerItemDecorator` is drawn, over or (default) underneath the item [see #106].
117
+
- Added `applyAndAnimateMovedItems()` when using `animateTo()` (in filter and `updateDataSet()`).
118
+
- Full support for `StaggeredGridLayout`[see #107].
119
+
- Better selection management: made public `addSelection()`, `removeSelection()`, the new 2 methods don't notify any change as `toggleSelection()` does.
120
+
-`Utils.colorAccent` is now public.
121
+
-`onUpdateEmptyView()` is now called only if there was a change from 0 / to 0 itemCount [see #113].
122
+
- Chaining the Adapter for all initialization and configuration methods (sets).
- Fixed StickyHeaders with `GridLayoutManager` when all sub-items of a section fit the single row of span count [See #61].
127
-
- Fixed #74: Initialization of the stickyHeader is laid out in post.
128
-
- Fixed the automatic linkage for headers and sections when delete and undo.
129
-
- Fixed the automatic linkage for headers and sections. Force collapsing when dragging expandable.
130
-
- Fixed NPE when setting a null `FastScroller` instance [See #66].
131
-
- Fixed new position in `addSection()`.
132
-
- Adjusted behaviours for swipe and drag view activation.
133
-
- Fixed the delay on the 1st item when animating the view.
126
+
- Fixed headers showing after rotation [see #88].
127
+
- Fixed `addItemToSection` when Header is hidden: item is now added to the unique visible list.
128
+
- Solution to improve ViewHolder with sticky behaviour, (user has to pass `true` as new parameter to the FVH super.constructor). [see #78, #79 and #92].
129
+
- Removed useless call in `onChanged()`, causing duplication of subItems when updating the data set [see #95 and #96].
130
+
- Fixed hidden status when removing a Header item.
131
+
- Fixed Item does not updated after `updateDataSet()`[see #94].
132
+
- Fixed NPE bug during filter and null subList [see #103].
133
+
- Fixed NPE on originalText in `Utils.hightlightText()`[see #112].
134
+
- Fixed expansion status after filtering expandable items.
135
+
- Fixed animation changes when calling method `animateTo()`.
136
+
- Fixed ArrayIndexOutOfBoundsException with StaggeredGridLayoutManager [see #87, part of changes of #107].
137
+
- Adjusted selection flags when removing items and fixed small bug when restoring items after applying the filter and vice-versa.
138
+
- Method `onUpdateEmptyView()` is now called when passing null or empty new list in `updateDataSet()`.
139
+
- Filter on restore instance state bug [see #111].
140
+
- Fixed header View params when higher than Item view params [see P.R. #116].
141
+
- Fixed Constraint on `FlexibleViewHolder` when using StickyHeader functionality, as consequence changed class signature of `IHeader` item interface and its implementation. Also changed the class signature of `IExpandable` item interface and its implementation to have a ViewHolder of type `ExpandableViewHolder` as well [see #117].
134
142
135
143
_Demo App_
136
-
- Big code reorganization using fragments [See #36].
137
-
- Fixed #64 for demo app for API < 23.
138
-
- Enabled Header and Sections example with Design BottomSheet.
139
-
- Enabled FragmentSelectionModes example.
140
-
- Enabled Instagram example with Endless Scroll with Glide lib.
144
+
- Added new example Fragment for StaggeredLayout with multiple functionalities:
145
+
- merge/split items at runtime (position are recalculated);
146
+
- move item with animation taking care of the groups using the new function `calculatePositionFor()`;
147
+
- automatic sorting when adding new items using the new function `addItemToSection()`;
148
+
- example of Comparator object;
149
+
- change Drawable background at runtime, maintaining the ripple effect (no XML is used).
150
+
- Fix for SwipeRefreshLayout to be displayed on the top of StickyHeaders Layout [see #83].
151
+
- SwipeRefresh with StickyHeader is not compatible with Dragging feature, added comments in the layout to show the difference #83: User must disable the SwipeRefreshLayout programmatically, to do it, I added a new callback function and relative listener `OnActionStateListener`.
152
+
- Adjusted demo App behavior when filtering with Endless Scrolling.
153
+
- Several minor changes.
141
154
142
155
###### Old releases
143
156
See [releases](https://github.com/davideas/FlexibleAdapter/releases) for old versions.
0 commit comments