Closed davideas closed 6 years ago
While importing the library v5.0.0-b2 in another project, I got some difficulties implementation. Please be patient since I am working hard to simplify them for next beta: I'm changing the signature of the classes and reviewing the Item interfaces.
New pre-release v5.0.0-b3 with new functionalities, many fixes and improvements. (You can download the apk from the release page). Now it is really usable. Suggestions are welcome.
dependencies {
compile 'eu.davidea:flexible-adapter:5.0.0-b3'
}
For next pre-release:
New 5.0.0-SNAPSHOT.
Fixes
Headers
Others additions and improvements
Note: Currently Headers are ISectionable objects containing the attached item which is updated if an event on this item occurs, the headers are scanned to identify if one of them has that item and so it is updated. I'm thinking/working to invert how a header is recognized and assigned, in such way: any item can be an ISectionable object containing the reference to another item that WILL BE the Header. This could simplify the logic and reduce bugs and maintenance, I need to analyse this point.
New 5.0.0-SNAPSHOT has been published. Related Apk is avalable under the latest release.
Refactor IFlexibleItem to IFlexible. Sorry for this, but it's now more coherent with the others interfaces names.
Improvements Cast optimization: removed unnecessary 8 casts by changing some parameters of methods from generic object T to IFlexible and IExpandable types, this should be transparent.
Headers
Finally, I have evaluated better the Headers/Sections items and decided to invert how a header is created and recognized by the Adapter. Benefits of this change:
It reduces maintenance and potential future bugs, It should have higher performance Less memory usage (removed the internal list of headers).
New 5.0.0-SNAPSHOT has been published. Related Apk is available under the latest release.
Filter Added IFilterable item interface. New clean way to filter items, Items now can implement filter() method in order to be collected for the filtered list.
Headers Added support for Orphan Headers.
Fixes Fixed hidden header silent un-linkage when deleting an item with a header.
New pre-release v5.0.0-b4 with new functionalities (Sections and Sticky headers included) and lot of improvements. (You can download the apk from the release page).
dependencies {
compile 'eu.davidea:flexible-adapter:5.0.0-b4'
}
New 5.0.0-SNAPSHOT has been published.
Headers
Wanted to say how amazing that lib is! Just discovered it and already digging it a lot. I forked it so will try to help as much as i can. Thanks
@farfromrefug Thanks a lot! I'm working hard.
Feel free to Fork but be sure to modify the dev branch. Also, advise me in advance what are you going to modify in order to coordinates the commits and the work.
Hello. I think that it would be better if the examples are completely separated. Currently i'm trying to understand how the sticky headers work in the beta version, and it's pretty hard.
Awesome lib btw.
Yes @BoldijarPaul, thank you for your message, another Activity showing how headers/sections work has to be done, and not only that, however, I have very few time in this period, maybe in April or later.
New 5.0.0-SNAPSHOT has been published. Related Apk is available under the latest release.
Refactor
setHeader(header)
in ISectionable
interface is changed to void method.
Headers
StickyHeaderDecoration
is now deprecated, as consequence enableStickyHeaders(maxCachedHeaders)
is also deprecated: use enableStickyHeaders()
.getStickySectionHeadersHolder()
(comment is exhaustive).Improvements Multiple code improvements with SonarQube tool, thanks to @georgekankava
Fixes
Fixed NPE in isEnabled(position)
when position is unknown.
Good job davideas. On Mar 26, 2016 8:19 PM, "Davide Steduto" notifications@github.com wrote:
New 5.0.0-SNAPSHOT has been published. Related Apk is available under the latest release https://github.com/davideas/FlexibleAdapter/releases.
Refactor setHeader(header) in ISectionable interface is changed to void method.
Headers
- Now headers are clickable when sticky! StickyHeaders can now benefit of the existing click listeners in FlexibleViewHolder.
- StickyHeaderDecoration is now deprecated, as consequence enableStickyHeaders(maxCachedHeaders) is also deprecated: use enableStickyHeaders().
- Pay attention at the method getStickySectionHeadersHolder() (comment is exhaustive).
Improvements Multiple code improvements with SonarQube tool, thanks to @georgekankava https://github.com/georgekankava
Fixes Fixed NPE in isEnabled(position) when position is unknown.
— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/davideas/FlexibleAdapter/issues/39#issuecomment-201913207
New 5.0.0-SNAPSHOT has been published.
Refactor
Refactored constructor of AbstractSectionableItem
that now accepts the IHeader
item.
Headers
IHeader
item combined with IExpandable
item.AbstractExpandableHeaderItem
, an Expandable section item with Header ready to be used.Improvements
Added new method hasNewSearchText()
.
Fixes
Demo App
FlexibleItemHolder
to use simultaneously the same modelData object in multiple RecyclerView/Adapters.FragmentExpandableSections
.New pre-release v5.0.0-b5 many improvements and fixes. (You can download the apk from the release page).
dependencies {
compile 'eu.davidea:flexible-adapter:5.0.0-b5'
}
For the next beta(6), I will focus on Endless Scrolling, Helpers and a new FastScroller.
New 5.0.0-SNAPSHOT has been published. Related Apk is available under the latest release.
Deprecation
isSelected()
and setSelected()
from IFlexible
interfacegetSectionableOf()
in favor of the new getSectionItems()
.Improvements
addSection()
, addItemToSection()
(not tested yet).DividerItemDecoration
to show a gap between the sections #60.isEnabled()
on IExpandable
items.Multi-level expansion
FastScroller
FastScroller
is configured. Now FastScroller should work in every situations.GridLayoutManager
and optimized smooth scrolling classes.Fixes
GridLayoutManager
when all sub-items of a section fit the single row of span count #61.FastScroller
instance #66.Demo App
New pre-release v5.0.0-b6 many improvements and fixes. (You can download the apk from the release page). With this pre-release, the code is available in master branch as well.
dependencies {
compile 'eu.davidea:flexible-adapter:5.0.0-b6'
}
New 5.0.0-SNAPSHOT has been published. Related Apk is available under the latest release.
Deprecation
TreeSet
instead of ArrayList
for mSelectedPositions
. As consequence getSelectedPositions()
returns a copied List from the Set (already sorted, no duplication)!Improvements
getItemTouchHelperCallback()
to customize Swipe and Drag behaviors.UndoHelper.SimpleActionListener
to simplify the development.Utils.colorAccent
is now public.addSelection()
, removeSelection()
.Fixes
addItemToSection
when Header is hidden: item is now added to the unique visible list.Demo App
New 5.0.0-SNAPSHOT has been published. Related Apk is available under the latest release.
Deprecation
moveItem()
to swapItem()
.expandItemsAtStartUp()
must be explicitly called by the user in Activity creation phase, expandItemsAtStartUp() method now uses the existent expand()
method with initialization info.Improvements
moveItem()
that simply moves an item without swapping them.calculatePositionFor()
.updateDataSet()
, optionally items can be animated, when false
a notifyDataSetChanged()
will be executed.calculatePositionFor()
useful for new items of every type, a custom Comparator
is needed.applyAndAnimateMovedItems()
when using animateTo()
(in filter and updateDataSet()
).OnActionStateListener
for OnItemMoveListener
and OnItemSwipeListener
to overcome the drag issue with the SwipeRefreshLayout
, issues #104 and #83.StaggeredGridLayout
#107DividerItemDecorator
is drawn, over or (default) underneath the item #106onUpdateEmptyView()
is now called only if there was a change from 0 / to 0 itemCount #113expand()
series #110.Fixes
true
as new parameter to the FVH super.constructor). Issues #78, #79 and #92. THIS IS NOT YET THE FINAL SOLUTION.onChanged()
, causing duplication of subItems when updating the data set, issues #95 and #96.updateDataSet()
.Demo App
OnActionStateListener
.Road map for final release:
Looks like a sweet library. I'm going to start using this on a new project today. Thanks!
New 5.0.0-SNAPSHOT has been published. Related Apk is available under the latest release.
Deprecation and Refactoring
addSection()
with refHeader.IHeader
and IExpandable
and their abstract implementation.Improvements
DrawableUtils
to manage the background Drawables at runtime without XML configuration #35.addSection()
with Comparator object.addItemToSection()
see JavaDoc.Fixes
onUpdateEmptyView()
is now called when passing null or empty new list in updateDataSet()
.Utils.hightlightText()
.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.Demo App
calculatePositionFor()
;addItemToSection()
;New pre-release v5.0.0-b7 many improvements and fixes. (You can download the apk from the release page).
dependencies {
compile 'eu.davidea:flexible-adapter:5.0.0-b7'
}
New 5.0.0-SNAPSHOT has been published. No Apk of this version is provided.
Deprecation and Refactoring
setPermanentDelete()
: default value starts with true
. Creating the UndoHelper
instance, the value will be set to false
automatically.Improvements
@since
for all methods.getSectionItemPositions()
. It resolves #132.setAnimateToLimit()
.notifyDataSetChanged()
. Animation during filtering will be performed if the total items are below the limit of 600 (modifiable value) "current items" OR "filtered items"; Above this limit, notifyDataSetChanged()
will be called with no animation. Note: updateDataSet()
is also affected by this limit, it improves performance during the refresh operation with big list.FlexibleViewHolder.setDragHandleView()
is not final anymore!Fixes
onLoadMore()
is now protected to be manually called only when METHOD B (binding items in classic way) is implemented.getStickySectionHeadersHolder()
should return a ViewGroup with LayoutParams coherent and initialized by the user who knows how these params has to be initialized. An exception will be raised if params are nulls.onUpdateEmptyView()
is not being correctly called in updateDataSet() if size > 0
.Demo App
New 5.0.0-SNAPSHOT has been published. This time the Apk is available under the latest release. It includes all the changes of the previous SNAPSHOT plus the following.
Deprecation and Refactoring
shouldAnimate
default value from true
to false
. Items are not animated anymore by default, you need to enable the scrolling animations with .setAnimationOnScrolling(true)
.setOnlyEntryAnimation()
is set true, shouldAnimate
is automatically set true, however when the screen is filled with last visible item, shouldAnimate
is again false.//TODO: deprecation?
. Those methods are under evaluation and could disappear in the final release.DividerItemDecoration
withOffset()
.Improvements
setNotifyMoveOfFilteredItems()
.updateDataSet()
is now run Asynchronously too.collapseAll()
with big list.showAllHeader()
and hideAllHeaders()
.Utils
class findFirst/LastCompletelyVisibleItemPosition()
.Fixes
calculatePositionFor()
doesn't work correctly when used for addItem()
.updateDataSet()
.Demo App
SplashActivity
.FragmentAsyncFilter
, here you can customize the Adapter and the database dynamically.DatabaseType
enumeration and created ConfigurationDatabase
.New 5.0.0-SNAPSHOT has been published. The Apk is available under the latest release. It includes all the changes of the previous SNAPSHOT plus the following.
Deprecation and Refactoring
shouldMoveItem()
callback in OnItemMoveListener
.Improvements
updateDataSet()
with no notifyItemXXX() on headers.setDisplayHeadersAtStartUp()
and showAllHeaders()
to avoid duplication of headers by a non correct initialization. As consequence 2 effects are now possible when calling setDisplayHeadersAtStartUp()
read method comment, documentation will follow.addItems()
can be safely called, but no scrolling animation on loading can be performed.updateDataSet()
is also compatible with the last status of sub levels.Fixes
calculatePositionFor()
doesn't work correctly when used with addItem()
.Demo App
New pre-release v5.0.0-b8 many improvements and fixes. (You can download the apk from the release page).
dependencies {
compile 'eu.davidea:flexible-adapter:5.0.0-b8'
}
Hi davideas, i get this error while i add your library to my project.
Error:(24, 13) Failed to resolve: eu.davidea:flexible-adapter:5.0.0-b8
i use jcenter for repository
I've figured it out, at url
https://dl.bintray.com/davideas/maven/eu/davidea/flexible-adapter/
version b8 not exists, thats why gradle report error
@frozts91, now should work as normal. The plugin didn't upload at the correct position, before.
New 5.0.0-SNAPSHOT has been published. The Apk is available under the latest release. It includes the release beta8, plus the following.
Improvements
ItemTouchHelperCallback
can now be set).onPostFilter()
and onPostUpdate()
that allow to modify the list just after the Asynchronous filter and update.DiffUtil
and to animate changes with this new Android class, after an update or filter operations, BUT it's strongly suggested to use the default calculation. See demoApp in Async Filter example to compare the 2 solutions: the Default results faster at least of the double!Fixes
Demo App
New 5.0.0-SNAPSHOT has been published. The Apk is available under the latest release. It includes the release beta8, all previous points, and the following.
Improvements
clear()
and clearAllBut(viewTypesToRetain)
, see #201.addItem(item)
, see #201.Handler
can be overridden: new internal class HandlerCallback
has been created.Fixes
hideAllHeaders()
might lead to NullPointerException (Fixed NPE and modified behavior when hiding headers: now, it doesn't disable anymore the sticky flag)New 5.0.0-SNAPSHOT has been published. The Apk is available under the latest release. It includes the release beta8, all previous points, and the following (rc1 ready).
Note: If you come from previous versions, update your code following the Wiki page Migrations.
New features
pageSize
and targetCount
. Wiki page will be adapted shortly, for the moment, check the demoApp code.Deprecation and Refactoring
Improvements
shouldNotifyParentOnClick()
.clearAll()
and selectAll()
don't notify change anymore.getAllBoundViewHolders()
.ActionModeHelper
, which has a new method: getActivatedPosition()
Fixes
adjustSelection()
when adding new items and some items are already selected.Demo App
First release candidate v5.0.0-rc1: new features, improvements and fixes. (You can download the apk from the release page).
dependencies {
compile 'eu.davidea:flexible-adapter:5.0.0-rc1'
}
New 5.0.0-SNAPSHOT has been published.
Improvements
Fixes
New 5.0.0-SNAPSHOT has been published.
Improvements
getItemViewType
now returns zero when item not found.Fixes
HandlerCallback
mistakenly erases default Runnables posted on it's mHandler
.autoCollapseOnExpand(true)
seems not notify the header.getSectionItemPositions()
.New 5.0.0-SNAPSHOT has been published.
Note: With this update you MUST review your code, see deprecations below here and if you come from previous versions/snapshots, update your code following the Wiki page Migrations.
The Apk is available under the latest release. It includes the release rc1, all previous points, and the following:
Deprecations / New Behaviors
onPostUpdate()
and onPostFilter()
now require to call super()
otherwise the emptyView won't get notified!Improvements
updateDataSet()
and filterItems()
: now hidden items are restored before applying the feature, so they won't get notified for removing and adding same items, but only for updating. This will improve performance avoiding useless notifications.getItemViewType
now returns zero when item not found.state_pressed
for API < 21.isFiltering()
, returns true
if the AsyncTask is currently running.getCurrentItems()
, returns the current internal list unmodifiable.updateDataSet()
ANIMATE_TO_LIMIT
to 1000
items.Fixes
Notes
New 5.0.0-SNAPSHOT has been published.
Note: With this update you MUST review your code, see deprecations below here and if you come from previous versions/snapshots, update your code following the Wiki page Migrations.
The Apk is available under the latest release. It includes the release rc1, all previous points, and the following:
Deprecations / New Behaviors
getLayoutRes()
, createViewHolder()
and bindViewHolder()
.DividerItemDecoration
to FlexibleItemDecoration
.Utils
to FlexibleUtils
.Improvements
Fixes
DemoApp
Notes
Second release candidate v5.0.0-rc2: new features, improvements and fixes. (You can download the apk from the release page).
dependencies {
compile 'eu.davidea:flexible-adapter:5.0.0-rc2'
compile 'eu.davidea:flexible-adapter-databinding:1.0.0-b1@aar'
}
New 5.0.0-SNAPSHOT has been published.
OnStickyHeaderChangeListener
.setStickyHeaderElevation
now accepts only dpi value.getBubbleText()
in IFlexible
. For who inherits from AbstractFlexibleItem
, this change has default implementation returning position + 1
. For who implements directly from IFlexible
this method must be implemented.IFlexibleLayoutManager
.BubbleTextCreator
can be set in FastScroller.New 5.0.0-SNAPSHOT has been published. The Apk is available under the latest release. It includes the release rc2, all previous points, and the following (rc3 ready).
Note: If you come from previous versions, update your code following the Wiki page Migrations.
getItemViewType
in IFlexible
. This gives flexibility to reuse same Layout for multiple item types as explained in #430. For who inherits from AbstractFlexibleItem, this change is transparent. For who implements directly from IFlexible
this method must be implemented.UndoHelper
⚠️ Warning: This is a temporary state of work and might change in the near future, depends by the work in progress to support the new swipe capability.
- Resolves #438 - Deprecated
OnActionListener
in UndoHelper alsoonPreAction()
andonPostAction()
.
New comprehensive methods name: Renamed the 2 callbacks methods inOnUndoListener
and renamed also the methodremove
series:.withAction(int action, OnActionListener listener) >>> .withAction(@Action int action) .remove(...) >>> .start(...) // Still returns Snackbar object
OnActionListener >>> !!deprecated!! // Please read related javaDoc
OnUndoListener.onDeleteConfirmed(int action) >>> onActionConfirmed(@Action int action, int event) OnUndoListener.onUndoConfirmed(int action) >>> onActionCanceled(@Action int action)
- Resolves #434 - Consecutive Undo requests option & improved the general stability. New method to commit one by one the swiped items and undo only the latest action. Also, it will clear the internal memory references at the end of the dismissal event!
``` java
.withConsecutive(true/false) // Default value is false (accumulate items to undo)
onActionConfirmed(@Action int action, int event);
onActionCanceled
is always called because of event type "action" only (user pressed on snackbar action button) and therefore not provided.
onActionCanceled(@Action int action);
highlightWords()
.highlightText()
with multi-span in same text.setEndlessScrollListener
crashes when logging is enabled.New 5.0.0-SNAPSHOT has been published.
ExpandableViewHolder#onClick
should always call super()
.highlightText
and highlightWords
text loose the upper case during the scan.bindViewHolder
method is causing a problem with GreenDao.New 5.0.0-SNAPSHOT has been published. New beta2 UI and beta2 LiveData extenstions.
UnsupportedOperationException
for immutable list on sort.DiffUtil
is back 😉setHeadersShown(boolean)
to manually change the flag to indicate that headers are already inserted in the main list by the user.initStickyHeadersHolder
on orientation change.addListener
and removeListener
methods.
This is an open discussion to keep track of all the work in progress of the next coming pre-releases in order to arrive to a stable and final version.
In this major release (5.0.0) there will be lot of new features, while trying to simplify the configuration to speed up the development. A full list of the features and improvements, with their status, can be found here Milestone 5.0.0. However we can identify them in:
In order to do them, I am completely changing and refactoring the code, names and how the Adapter will be extended to override its methods.
Gradle configuration
As soon as a new SNAPSHOT is ready and usable I will communicate it here.
Suggestions
Naming convention adopted
5.0.0-SNAPSHOT
It will replace the existent library (with that name) in the maven snapshot repository. So you don't have to manually change the version in the dependencies, but expect to upgrade your code in order to continue to compile your project.
Gradle has internal caching system with default time of 24h. Passed this time it will fetch the new Snapshot file from repository, if a new exists.
5.0.0-bX
5.0.0-rcX
5.0.0