Skip to content

Commit

Permalink
Resolves #200 Deprecated support for DiffUtil
Browse files Browse the repository at this point in the history
  • Loading branch information
davideas committed Dec 1, 2016
1 parent 67090be commit 5f6be23
Showing 1 changed file with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3961,8 +3961,10 @@ public FlexibleAdapter setAnimateToLimit(int limit) {
/**
* @return true to calculate animation changes with DiffUtil, false to use default calculation.
* @see #setAnimateChangesWithDiffUtil(boolean)
* @deprecated DiffUtil is slower than the internal implementation, you can use it until
* final release.
*/
//TODO: Deprecation: DiffUtil is slower than the internal implementation
@Deprecated
public boolean isAnimateChangesWithDiffUtil() {
return useDiffUtil;
}
Expand All @@ -3978,8 +3980,10 @@ public boolean isAnimateChangesWithDiffUtil() {
* calculation.
* @return this Adapter, so the call can be chained
* @see #setDiffUtilCallback(DiffUtilCallback)
* @deprecated DiffUtil is slower than the internal implementation, you can use it until
* final release.
*/
//TODO: Deprecation: DiffUtil is slower than the internal implementation
@Deprecated
public FlexibleAdapter setAnimateChangesWithDiffUtil(boolean useDiffUtil) {
this.useDiffUtil = useDiffUtil;
return this;
Expand All @@ -3992,14 +3996,16 @@ public FlexibleAdapter setAnimateChangesWithDiffUtil(boolean useDiffUtil) {
* @param diffUtilCallback the custom callback that DiffUtil will call
* @return this Adapter, so the call can be chained
* @see #setAnimateChangesWithDiffUtil(boolean)
* @deprecated DiffUtil is slower than the internal implementation, you can use it until
* final release.
*/
//TODO: Deprecation: DiffUtil is slower than the internal implementation
@Deprecated
public FlexibleAdapter setDiffUtilCallback(DiffUtilCallback diffUtilCallback) {
this.diffUtilCallback = diffUtilCallback;
return this;
}

//TODO: Deprecation: DiffUtil is slower than the internal implementation
@Deprecated //TODO: Call animateTo instead.
private synchronized void animateDiff(@Nullable List<T> newItems, Payload payloadChange) {
if (useDiffUtil) {
Log.v(TAG, "Animate changes with DiffUtils! oldSize=" + getItemCount() + " newSize=" + newItems.size());
Expand Down Expand Up @@ -5256,8 +5262,11 @@ public boolean handleMessage(Message message) {
* The old and new lists are available as:
* <p>- {@code protected List<T> oldItems;}
* <br/>- {@code protected List<T> newItems;}
*
* @deprecated DiffUtil is slower than the internal implementation, you can use it until
* final release.
*/
//TODO: Deprecation: DiffUtil is slower than the internal implementation
@Deprecated
public static class DiffUtilCallback<T> extends DiffUtil.Callback {

protected List<T> oldItems;
Expand Down

0 comments on commit 5f6be23

Please sign in to comment.