From 0afb9be979575df26c94205937ab0def997577c1 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 11:24:20 +0100 Subject: [PATCH 01/57] * cleanup (Generic)FastItemAdapter --- .../commons/adapters/FastItemAdapter.java | 253 +----------------- .../adapters/GenericFastItemAdapter.java | 129 +-------- 2 files changed, 2 insertions(+), 380 deletions(-) diff --git a/library/src/main/java/com/mikepenz/fastadapter/commons/adapters/FastItemAdapter.java b/library/src/main/java/com/mikepenz/fastadapter/commons/adapters/FastItemAdapter.java index 835b54d21..94dd51c18 100644 --- a/library/src/main/java/com/mikepenz/fastadapter/commons/adapters/FastItemAdapter.java +++ b/library/src/main/java/com/mikepenz/fastadapter/commons/adapters/FastItemAdapter.java @@ -1,16 +1,9 @@ package com.mikepenz.fastadapter.commons.adapters; -import android.widget.Filter; - import com.mikepenz.fastadapter.FastAdapter; -import com.mikepenz.fastadapter.IExpandable; import com.mikepenz.fastadapter.IItem; -import com.mikepenz.fastadapter.IItemAdapter; -import com.mikepenz.fastadapter.ISubItem; import com.mikepenz.fastadapter.adapters.ItemAdapter; -import java.util.List; - /** * Created by mikepenz on 18.01.16. */ @@ -29,251 +22,7 @@ public FastItemAdapter() { * * @return the ItemAdapter used inside this FastItemAdapter */ - public ItemAdapter getItemAdapter() { + public ItemAdapter items() { return mItemAdapter; } - - /** - * defines if the IdDistributor is used to provide an ID to all added items which do not yet define an id - * - * @param useIdDistributor false if the IdDistributor shouldn't be used - * @return this - */ - public FastItemAdapter withUseIdDistributor(boolean useIdDistributor) { - mItemAdapter.withUseIdDistributor(useIdDistributor); - return this; - } - - /** - * @return the filter used to filter items - */ - public Filter getItemFilter() { - return mItemAdapter.getItemFilter(); - } - - /** - * define the predicate used to filter the list inside the ItemFilter - * - * @param filterPredicate the predicate used to filter the list inside the ItemFilter - * @return this - */ - public FastItemAdapter withFilterPredicate(IItemAdapter.Predicate filterPredicate) { - this.mItemAdapter.withFilterPredicate(filterPredicate); - return this; - } - - /** - * filters the items with the constraint using the provided Predicate - * - * @param constraint the string used to filter the list - */ - public void filter(CharSequence constraint) { - mItemAdapter.filter(constraint); - } - - /** - * @return the order of the items within the FastAdapter - */ - public int getOrder() { - return mItemAdapter.getOrder(); - } - - /** - * @return the count of items within this adapter - */ - public int getAdapterItemCount() { - return mItemAdapter.getAdapterItemCount(); - } - - - /** - * @return the items within this adapter - */ - public List getAdapterItems() { - return mItemAdapter.getAdapterItems(); - } - - /** - * Searches for the given item and calculates it's relative position - * - * @param item the item which is searched for - * @return the relative position - */ - public int getAdapterPosition(Item item) { - return mItemAdapter.getAdapterPosition(item); - } - - /** - * returns the global position if the relative position within this adapter was given - * - * @param position the relative postion - * @return the global position - */ - public int getGlobalPosition(int position) { - return mItemAdapter.getGlobalPosition(position); - } - - /** - * @param position the relative position - * @return the item inside this adapter - */ - public Item getAdapterItem(int position) { - return mItemAdapter.getAdapterItem(position); - } - - /** - * sets the subItems of the given collapsible - * This method also makes sure identifiers are set if we use the IdDistributor - * - * @param collapsible the collapsible which gets the subItems set - * @param subItems the subItems for this collapsible item - * @return the item type of the collapsible - */ - public , S extends IItem & ISubItem> T setSubItems(T collapsible, List subItems) { - return mItemAdapter.setSubItems(collapsible, subItems); - } - - /** - * set a new list of items and apply it to the existing list (clear - add) for this adapter - * - * @param items the new items to set - */ - public FastItemAdapter set(List items) { - mItemAdapter.set(items); - return this; - } - - /** - * sets a complete new list of items onto this adapter, using the new list. Calls notifyDataSetChanged - * - * @param items the new items to set - */ - public FastItemAdapter setNewList(List items) { - mItemAdapter.setNewList(items); - return this; - } - - /** - * add an array of items to the end of the existing items - * - * @param items the items to add - */ - @SafeVarargs - public final FastItemAdapter add(Item... items) { - mItemAdapter.add(items); - return this; - } - - /** - * add a list of items to the end of the existing items - * - * @param items the items to add - */ - public FastItemAdapter add(List items) { - mItemAdapter.add(items); - return this; - } - - /** - * add an array of items at the given position within the existing items - * - * @param position the global position - * @param items the items to add - */ - @SafeVarargs - public final FastItemAdapter add(int position, Item... items) { - mItemAdapter.add(position, items); - return this; - } - - /** - * add a list of items at the given position within the existing items - * - * @param position the global position - * @param items the items to add - */ - public FastItemAdapter add(int position, List items) { - mItemAdapter.add(position, items); - return this; - } - - /** - * sets an item at the given position, overwriting the previous item - * - * @param position the global position - * @param item the item to set - */ - public FastItemAdapter set(int position, Item item) { - mItemAdapter.set(position, item); - return this; - } - - /** - * add an item at the end of the existing items - * - * @param item the item to add - */ - public FastItemAdapter add(Item item) { - mItemAdapter.add(item); - return this; - } - - /** - * add an item at the given position within the existing icons - * - * @param position the global position - * @param item the item to add - */ - public FastItemAdapter add(int position, Item item) { - mItemAdapter.add(position, item); - return this; - } - - /** - * moves an item within the list from a position to a position - * - * @param fromPosition the position global from which we want to move - * @param toPosition the global position to which to move - * @return this - */ - public FastItemAdapter move(int fromPosition, int toPosition) { - mItemAdapter.move(fromPosition, toPosition); - return this; - } - - /** - * removes an item at the given position within the existing icons - * - * @param position the global position - */ - public FastItemAdapter remove(int position) { - mItemAdapter.remove(position); - return this; - } - - /** - * removes a range of items starting with the given position within the existing icons - * - * @param position the global position - * @param itemCount the count of items removed - */ - public FastItemAdapter removeItemRange(int position, int itemCount) { - mItemAdapter.removeRange(position, itemCount); - return this; - } - - /** - * removes all items of this adapter - */ - public FastItemAdapter clear() { - mItemAdapter.clear(); - return this; - } - - /** - * convenient functions, to force to remap all possible types for the RecyclerView - */ - public void remapMappedTypes() { - mItemAdapter.remapMappedTypes(); - } } diff --git a/library/src/main/java/com/mikepenz/fastadapter/commons/adapters/GenericFastItemAdapter.java b/library/src/main/java/com/mikepenz/fastadapter/commons/adapters/GenericFastItemAdapter.java index 8fd2acab0..5d95544a2 100644 --- a/library/src/main/java/com/mikepenz/fastadapter/commons/adapters/GenericFastItemAdapter.java +++ b/library/src/main/java/com/mikepenz/fastadapter/commons/adapters/GenericFastItemAdapter.java @@ -5,8 +5,6 @@ import com.mikepenz.fastadapter.adapters.GenericItemAdapter; import com.mikepenz.fastadapter.utils.Function; -import java.util.List; - /** * Created by fabianterhorst on 31.03.16. */ @@ -36,132 +34,7 @@ public GenericFastItemAdapter(Function itemFactory) { * * @return the GenericItemAdapter used inside this GenericFastItemAdapter */ - public GenericItemAdapter getGenericItemAdapter() { + public GenericItemAdapter items() { return mItemAdapter; } - - /** - * returns the list of the model generated from the list of items - * - * @return the list with all model objects - */ - public List getModels() { - return mItemAdapter.getModels(); - } - - /** - * set a new list of models for this adapter - * - * @param models the set models - */ - public GenericFastItemAdapter setModel(List models) { - mItemAdapter.setModel(models); - return this; - } - - /** - * sets a complete new list of items onto this adapter, using the new list. Calls notifyDataSetChanged - * - * @param models the set models - */ - public GenericFastItemAdapter setNewModel(List models) { - mItemAdapter.setNewModel(models); - return this; - } - - /** - * add an array of models - * - * @param models the added models - */ - @SafeVarargs - public final GenericFastItemAdapter addModel(Model... models) { - mItemAdapter.addModel(models); - return this; - } - - /** - * add a list of models - * - * @param models the added models - */ - public GenericFastItemAdapter addModel(List models) { - mItemAdapter.addModel(models); - return this; - } - - /** - * add an array of models at a given (global) position - * - * @param position the global position - * @param models the added models - */ - @SafeVarargs - public final GenericFastItemAdapter addModel(int position, Model... models) { - mItemAdapter.addModel(position, models); - return this; - } - - /** - * add a list of models at a given (global) position - * - * @param position the global position - * @param models the added models - */ - public GenericFastItemAdapter addModel(int position, List models) { - mItemAdapter.addModel(position, models); - return this; - } - - /** - * set a model at a given position - * - * @param position the global position - * @param model the set model - */ - public GenericFastItemAdapter setModel(int position, Model model) { - mItemAdapter.setModel(position, model); - return this; - } - - /** - * clear all models - */ - public GenericFastItemAdapter clearModel() { - mItemAdapter.clearModel(); - return this; - } - - /** - * moves an model within the list from a position to a position - * - * @param fromPosition the position global from which we want to move - * @param toPosition the global position to which to move - * @return this - */ - public GenericFastItemAdapter moveModel(int fromPosition, int toPosition) { - mItemAdapter.moveModel(fromPosition, toPosition); - return this; - } - - /** - * remove a range oof model items starting with the (global) position and the size - * - * @param position the global position - * @param itemCount the count of items which were removed - */ - public GenericFastItemAdapter removeModelRange(int position, int itemCount) { - mItemAdapter.removeModelRange(position, itemCount); - return this; - } - - /** - * remove a model at the given (global) position - * - * @param position the global position - */ - public GenericFastItemAdapter removeModel(int position) { - mItemAdapter.removeModel(position); - return this; - } } From 47290161320c1b991f7d6f3d45caab43e1bbf55f Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 11:24:54 +0100 Subject: [PATCH 02/57] * cleanup FastAdater(BottomSheet)Dialog --- .../dialog/FastAdapterBottomSheetDialog.java | 47 +++++++++--------- .../dialog/FastAdapterDialog.java | 49 +++++++++---------- 2 files changed, 47 insertions(+), 49 deletions(-) diff --git a/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/dialog/FastAdapterBottomSheetDialog.java b/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/dialog/FastAdapterBottomSheetDialog.java index 39e0fa8bb..6a93b1958 100644 --- a/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/dialog/FastAdapterBottomSheetDialog.java +++ b/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/dialog/FastAdapterBottomSheetDialog.java @@ -27,26 +27,24 @@ public class FastAdapterBottomSheetDialog extends BottomShee public FastAdapterBottomSheetDialog(Context context) { super(context); - this.mRecyclerView = createRecyclerView(); + init(); } public FastAdapterBottomSheetDialog(Context context, int theme) { super(context, theme); - this.mRecyclerView = createRecyclerView(); + init(); } /** * Create the RecyclerView and set it as the dialog view. * - * @return the created RecyclerView */ - private RecyclerView createRecyclerView() { - RecyclerView recyclerView = new RecyclerView(getContext()); + private void init() { + mRecyclerView = new RecyclerView(getContext()); RecyclerView.LayoutParams params = new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); - recyclerView.setLayoutParams(params); - setContentView(recyclerView); - return recyclerView; + mRecyclerView.setLayoutParams(params); + setContentView(mRecyclerView); } /** @@ -80,16 +78,17 @@ public FastAdapterBottomSheetDialog withItems(@NonNull List items) { mFastItemAdapter = new FastItemAdapter<>(); mRecyclerView.setAdapter(mFastItemAdapter); } - mFastItemAdapter.set(items); + mFastItemAdapter.items().set(items); return this; } - public FastAdapterBottomSheetDialog withItems(@NonNull Item... items) { + @SafeVarargs + public final FastAdapterBottomSheetDialog withItems(@NonNull Item... items) { if (mFastItemAdapter == null) { mFastItemAdapter = new FastItemAdapter<>(); mRecyclerView.setAdapter(mFastItemAdapter); } - mFastItemAdapter.add(items); + mFastItemAdapter.items().add(items); return this; } @@ -202,7 +201,7 @@ public FastAdapterBottomSheetDialog withOnTouchListener(FastAdapter.OnTouc * @param items the new items to set */ public FastAdapterBottomSheetDialog set(List items) { - mFastItemAdapter.set(items); + mFastItemAdapter.items().set(items); return this; } @@ -212,7 +211,7 @@ public FastAdapterBottomSheetDialog set(List items) { * @param items the new items to set */ public FastAdapterBottomSheetDialog setNewList(List items) { - mFastItemAdapter.setNewList(items); + mFastItemAdapter.items().setNewList(items); return this; } @@ -223,7 +222,7 @@ public FastAdapterBottomSheetDialog setNewList(List items) { */ @SafeVarargs public final FastAdapterBottomSheetDialog add(Item... items) { - mFastItemAdapter.add(items); + mFastItemAdapter.items().add(items); return this; } @@ -233,7 +232,7 @@ public final FastAdapterBottomSheetDialog add(Item... items) { * @param items the items to add */ public FastAdapterBottomSheetDialog add(List items) { - mFastItemAdapter.add(items); + mFastItemAdapter.items().add(items); return this; } @@ -245,7 +244,7 @@ public FastAdapterBottomSheetDialog add(List items) { */ @SafeVarargs public final FastAdapterBottomSheetDialog add(int position, Item... items) { - mFastItemAdapter.add(position, items); + mFastItemAdapter.items().add(position, items); return this; } @@ -256,7 +255,7 @@ public final FastAdapterBottomSheetDialog add(int position, Item... items) * @param items the items to add */ public FastAdapterBottomSheetDialog add(int position, List items) { - mFastItemAdapter.add(position, items); + mFastItemAdapter.items().add(position, items); return this; } @@ -267,7 +266,7 @@ public FastAdapterBottomSheetDialog add(int position, List items) { * @param item the item to set */ public FastAdapterBottomSheetDialog set(int position, Item item) { - mFastItemAdapter.set(position, item); + mFastItemAdapter.items().set(position, item); return this; } @@ -277,7 +276,7 @@ public FastAdapterBottomSheetDialog set(int position, Item item) { * @param item the item to add */ public FastAdapterBottomSheetDialog add(Item item) { - mFastItemAdapter.add(item); + mFastItemAdapter.items().add(item); return this; } @@ -288,7 +287,7 @@ public FastAdapterBottomSheetDialog add(Item item) { * @param item the item to add */ public FastAdapterBottomSheetDialog add(int position, Item item) { - mFastItemAdapter.add(position, item); + mFastItemAdapter.items().add(position, item); return this; } @@ -300,7 +299,7 @@ public FastAdapterBottomSheetDialog add(int position, Item item) { * @return this */ public FastAdapterBottomSheetDialog move(int fromPosition, int toPosition) { - mFastItemAdapter.move(fromPosition, toPosition); + mFastItemAdapter.items().move(fromPosition, toPosition); return this; } @@ -310,7 +309,7 @@ public FastAdapterBottomSheetDialog move(int fromPosition, int toPosition) * @param position the global position */ public FastAdapterBottomSheetDialog remove(int position) { - mFastItemAdapter.remove(position); + mFastItemAdapter.items().remove(position); return this; } @@ -321,7 +320,7 @@ public FastAdapterBottomSheetDialog remove(int position) { * @param itemCount the count of items removed */ public FastAdapterBottomSheetDialog removeItemRange(int position, int itemCount) { - mFastItemAdapter.removeItemRange(position, itemCount); + mFastItemAdapter.items().removeRange(position, itemCount); return this; } @@ -329,7 +328,7 @@ public FastAdapterBottomSheetDialog removeItemRange(int position, int item * removes all items of this adapter */ public FastAdapterBottomSheetDialog clear() { - mFastItemAdapter.clear(); + mFastItemAdapter.items().clear(); return this; } } \ No newline at end of file diff --git a/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/dialog/FastAdapterDialog.java b/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/dialog/FastAdapterDialog.java index ba69115ae..a04a2fea5 100644 --- a/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/dialog/FastAdapterDialog.java +++ b/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/dialog/FastAdapterDialog.java @@ -24,26 +24,24 @@ public class FastAdapterDialog extends AlertDialog { public FastAdapterDialog(Context context) { super(context); - this.mRecyclerView = createRecyclerView(); + init(); } public FastAdapterDialog(Context context, int theme) { super(context, theme); - this.mRecyclerView = createRecyclerView(); + init(); } /** * Create the RecyclerView and set it as the dialog view. * - * @return the created RecyclerView */ - private RecyclerView createRecyclerView() { - RecyclerView recyclerView = new RecyclerView(getContext()); + private void init() { + mRecyclerView = new RecyclerView(getContext()); RecyclerView.LayoutParams params = new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); - recyclerView.setLayoutParams(params); - setView(recyclerView); - return recyclerView; + mRecyclerView.setLayoutParams(params); + setView(mRecyclerView); } /** @@ -77,16 +75,17 @@ public FastAdapterDialog withItems(@NonNull List items) { mFastItemAdapter = new FastItemAdapter<>(); mRecyclerView.setAdapter(mFastItemAdapter); } - mFastItemAdapter.set(items); + mFastItemAdapter.items().set(items); return this; } - public FastAdapterDialog withItems(@NonNull Item... items) { + @SafeVarargs + public final FastAdapterDialog withItems(@NonNull Item... items) { if (mFastItemAdapter == null) { mFastItemAdapter = new FastItemAdapter<>(); mRecyclerView.setAdapter(mFastItemAdapter); } - mFastItemAdapter.add(items); + mFastItemAdapter.items().add(items); return this; } @@ -317,7 +316,7 @@ public FastAdapterDialog withOnTouchListener(FastAdapter.OnTouchListener set(List items) { - mFastItemAdapter.set(items); + mFastItemAdapter.items().set(items); return this; } @@ -327,7 +326,7 @@ public FastAdapterDialog set(List items) { * @param items the new items to set */ public FastAdapterDialog setNewList(List items) { - mFastItemAdapter.setNewList(items); + mFastItemAdapter.items().setNewList(items); return this; } @@ -338,7 +337,7 @@ public FastAdapterDialog setNewList(List items) { */ @SafeVarargs public final FastAdapterDialog add(Item... items) { - mFastItemAdapter.add(items); + mFastItemAdapter.items().add(items); return this; } @@ -348,7 +347,7 @@ public final FastAdapterDialog add(Item... items) { * @param items the items to add */ public FastAdapterDialog add(List items) { - mFastItemAdapter.add(items); + mFastItemAdapter.items().add(items); return this; } @@ -360,7 +359,7 @@ public FastAdapterDialog add(List items) { */ @SafeVarargs public final FastAdapterDialog add(int position, Item... items) { - mFastItemAdapter.add(position, items); + mFastItemAdapter.items().add(position, items); return this; } @@ -371,7 +370,7 @@ public final FastAdapterDialog add(int position, Item... items) { * @param items the items to add */ public FastAdapterDialog add(int position, List items) { - mFastItemAdapter.add(position, items); + mFastItemAdapter.items().add(position, items); return this; } @@ -382,7 +381,7 @@ public FastAdapterDialog add(int position, List items) { * @param item the item to set */ public FastAdapterDialog set(int position, Item item) { - mFastItemAdapter.set(position, item); + mFastItemAdapter.items().set(position, item); return this; } @@ -392,7 +391,7 @@ public FastAdapterDialog set(int position, Item item) { * @param item the item to add */ public FastAdapterDialog add(Item item) { - mFastItemAdapter.add(item); + mFastItemAdapter.items().add(item); return this; } @@ -403,7 +402,7 @@ public FastAdapterDialog add(Item item) { * @param item the item to add */ public FastAdapterDialog add(int position, Item item) { - mFastItemAdapter.add(position, item); + mFastItemAdapter.items().add(position, item); return this; } @@ -415,7 +414,7 @@ public FastAdapterDialog add(int position, Item item) { * @return this */ public FastAdapterDialog move(int fromPosition, int toPosition) { - mFastItemAdapter.move(fromPosition, toPosition); + mFastItemAdapter.items().move(fromPosition, toPosition); return this; } @@ -425,7 +424,7 @@ public FastAdapterDialog move(int fromPosition, int toPosition) { * @param position the global position */ public FastAdapterDialog remove(int position) { - mFastItemAdapter.remove(position); + mFastItemAdapter.items().remove(position); return this; } @@ -435,8 +434,8 @@ public FastAdapterDialog remove(int position) { * @param position the global position * @param itemCount the count of items removed */ - public FastAdapterDialog removeItemRange(int position, int itemCount) { - mFastItemAdapter.removeItemRange(position, itemCount); + public FastAdapterDialog removeRange(int position, int itemCount) { + mFastItemAdapter.items().removeRange(position, itemCount); return this; } @@ -444,7 +443,7 @@ public FastAdapterDialog removeItemRange(int position, int itemCount) { * removes all items of this adapter */ public FastAdapterDialog clear() { - mFastItemAdapter.clear(); + mFastItemAdapter.items().clear(); return this; } } From 76fbc053376f15a62892733c92a07d841c8f1462 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 11:27:34 +0100 Subject: [PATCH 03/57] * more cleanup in FastAdapter(BottomSheet)Dialog --- .../dialog/FastAdapterBottomSheetDialog.java | 202 +----------------- .../dialog/FastAdapterDialog.java | 202 +----------------- 2 files changed, 18 insertions(+), 386 deletions(-) diff --git a/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/dialog/FastAdapterBottomSheetDialog.java b/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/dialog/FastAdapterBottomSheetDialog.java index 6a93b1958..3fa5c429a 100644 --- a/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/dialog/FastAdapterBottomSheetDialog.java +++ b/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/dialog/FastAdapterBottomSheetDialog.java @@ -9,8 +9,8 @@ import android.view.ViewGroup; import com.mikepenz.fastadapter.AbstractAdapter; -import com.mikepenz.fastadapter.FastAdapter; import com.mikepenz.fastadapter.IItem; +import com.mikepenz.fastadapter.adapters.ItemAdapter; import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter; import java.util.List; @@ -35,6 +35,14 @@ public FastAdapterBottomSheetDialog(Context context, int theme) { init(); } + public FastItemAdapter getFastItemAdapter() { + return mFastItemAdapter; + } + + public ItemAdapter items() { + return mFastItemAdapter.items(); + } + /** * Create the RecyclerView and set it as the dialog view. * @@ -139,196 +147,4 @@ public void show() { public RecyclerView getRecyclerView() { return mRecyclerView; } - - /** - * Define the OnClickListener which will be used for a single item - * - * @param onClickListener the OnClickListener which will be used for a single item - * @return this - */ - public FastAdapterBottomSheetDialog withOnClickListener(FastAdapter.OnClickListener onClickListener) { - this.mFastItemAdapter.withOnClickListener(onClickListener); - return this; - } - - /** - * Define the OnPreClickListener which will be used for a single item and is called after all internal methods are done - * - * @param onPreClickListener the OnPreClickListener which will be called after a single item was clicked and all internal methods are done - * @return this - */ - public FastAdapterBottomSheetDialog withOnPreClickListener(FastAdapter.OnClickListener onPreClickListener) { - this.mFastItemAdapter.withOnPreClickListener(onPreClickListener); - return this; - } - - /** - * Define the OnLongClickListener which will be used for a single item - * - * @param onLongClickListener the OnLongClickListener which will be used for a single item - * @return this - */ - public FastAdapterBottomSheetDialog withOnLongClickListener(FastAdapter.OnLongClickListener onLongClickListener) { - this.mFastItemAdapter.withOnLongClickListener(onLongClickListener); - return this; - } - - /** - * Define the OnLongClickListener which will be used for a single item and is called after all internal methods are done - * - * @param onPreLongClickListener the OnLongClickListener which will be called after a single item was clicked and all internal methods are done - * @return this - */ - public FastAdapterBottomSheetDialog withOnPreLongClickListener(FastAdapter.OnLongClickListener onPreLongClickListener) { - this.mFastItemAdapter.withOnPreLongClickListener(onPreLongClickListener); - return this; - } - - /** - * Define the TouchListener which will be used for a single item - * - * @param onTouchListener the TouchListener which will be used for a single item - * @return this - */ - public FastAdapterBottomSheetDialog withOnTouchListener(FastAdapter.OnTouchListener onTouchListener) { - this.mFastItemAdapter.withOnTouchListener(onTouchListener); - return this; - } - - /** - * set a new list of items and apply it to the existing list (clear - add) for this adapter - * - * @param items the new items to set - */ - public FastAdapterBottomSheetDialog set(List items) { - mFastItemAdapter.items().set(items); - return this; - } - - /** - * sets a complete new list of items onto this adapter, using the new list. Calls notifyDataSetChanged - * - * @param items the new items to set - */ - public FastAdapterBottomSheetDialog setNewList(List items) { - mFastItemAdapter.items().setNewList(items); - return this; - } - - /** - * add an array of items to the end of the existing items - * - * @param items the items to add - */ - @SafeVarargs - public final FastAdapterBottomSheetDialog add(Item... items) { - mFastItemAdapter.items().add(items); - return this; - } - - /** - * add a list of items to the end of the existing items - * - * @param items the items to add - */ - public FastAdapterBottomSheetDialog add(List items) { - mFastItemAdapter.items().add(items); - return this; - } - - /** - * add an array of items at the given position within the existing items - * - * @param position the global position - * @param items the items to add - */ - @SafeVarargs - public final FastAdapterBottomSheetDialog add(int position, Item... items) { - mFastItemAdapter.items().add(position, items); - return this; - } - - /** - * add a list of items at the given position within the existing items - * - * @param position the global position - * @param items the items to add - */ - public FastAdapterBottomSheetDialog add(int position, List items) { - mFastItemAdapter.items().add(position, items); - return this; - } - - /** - * sets an item at the given position, overwriting the previous item - * - * @param position the global position - * @param item the item to set - */ - public FastAdapterBottomSheetDialog set(int position, Item item) { - mFastItemAdapter.items().set(position, item); - return this; - } - - /** - * add an item at the end of the existing items - * - * @param item the item to add - */ - public FastAdapterBottomSheetDialog add(Item item) { - mFastItemAdapter.items().add(item); - return this; - } - - /** - * add an item at the given position within the existing icons - * - * @param position the global position - * @param item the item to add - */ - public FastAdapterBottomSheetDialog add(int position, Item item) { - mFastItemAdapter.items().add(position, item); - return this; - } - - /** - * moves an item within the list from a position to a position - * - * @param fromPosition the position global from which we want to move - * @param toPosition the global position to which to move - * @return this - */ - public FastAdapterBottomSheetDialog move(int fromPosition, int toPosition) { - mFastItemAdapter.items().move(fromPosition, toPosition); - return this; - } - - /** - * removes an item at the given position within the existing icons - * - * @param position the global position - */ - public FastAdapterBottomSheetDialog remove(int position) { - mFastItemAdapter.items().remove(position); - return this; - } - - /** - * removes a range of items starting with the given position within the existing icons - * - * @param position the global position - * @param itemCount the count of items removed - */ - public FastAdapterBottomSheetDialog removeItemRange(int position, int itemCount) { - mFastItemAdapter.items().removeRange(position, itemCount); - return this; - } - - /** - * removes all items of this adapter - */ - public FastAdapterBottomSheetDialog clear() { - mFastItemAdapter.items().clear(); - return this; - } } \ No newline at end of file diff --git a/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/dialog/FastAdapterDialog.java b/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/dialog/FastAdapterDialog.java index a04a2fea5..2cde40d94 100644 --- a/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/dialog/FastAdapterDialog.java +++ b/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/dialog/FastAdapterDialog.java @@ -10,8 +10,8 @@ import android.view.ViewGroup; import com.mikepenz.fastadapter.AbstractAdapter; -import com.mikepenz.fastadapter.FastAdapter; import com.mikepenz.fastadapter.IItem; +import com.mikepenz.fastadapter.adapters.ItemAdapter; import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter; import java.util.List; @@ -32,6 +32,14 @@ public FastAdapterDialog(Context context, int theme) { init(); } + public FastItemAdapter getFastItemAdapter() { + return mFastItemAdapter; + } + + public ItemAdapter items() { + return mFastItemAdapter.items(); + } + /** * Create the RecyclerView and set it as the dialog view. * @@ -254,196 +262,4 @@ public void show() { public RecyclerView getRecyclerView() { return mRecyclerView; } - - /** - * Define the OnClickListener which will be used for a single item - * - * @param onClickListener the OnClickListener which will be used for a single item - * @return this - */ - public FastAdapterDialog withOnClickListener(FastAdapter.OnClickListener onClickListener) { - this.mFastItemAdapter.withOnClickListener(onClickListener); - return this; - } - - /** - * Define the OnPreClickListener which will be used for a single item and is called after all internal methods are done - * - * @param onPreClickListener the OnPreClickListener which will be called after a single item was clicked and all internal methods are done - * @return this - */ - public FastAdapterDialog withOnPreClickListener(FastAdapter.OnClickListener onPreClickListener) { - this.mFastItemAdapter.withOnPreClickListener(onPreClickListener); - return this; - } - - /** - * Define the OnLongClickListener which will be used for a single item - * - * @param onLongClickListener the OnLongClickListener which will be used for a single item - * @return this - */ - public FastAdapterDialog withOnLongClickListener(FastAdapter.OnLongClickListener onLongClickListener) { - this.mFastItemAdapter.withOnLongClickListener(onLongClickListener); - return this; - } - - /** - * Define the OnLongClickListener which will be used for a single item and is called after all internal methods are done - * - * @param onPreLongClickListener the OnLongClickListener which will be called after a single item was clicked and all internal methods are done - * @return this - */ - public FastAdapterDialog withOnPreLongClickListener(FastAdapter.OnLongClickListener onPreLongClickListener) { - this.mFastItemAdapter.withOnPreLongClickListener(onPreLongClickListener); - return this; - } - - /** - * Define the TouchListener which will be used for a single item - * - * @param onTouchListener the TouchListener which will be used for a single item - * @return this - */ - public FastAdapterDialog withOnTouchListener(FastAdapter.OnTouchListener onTouchListener) { - this.mFastItemAdapter.withOnTouchListener(onTouchListener); - return this; - } - - /** - * set a new list of items and apply it to the existing list (clear - add) for this adapter - * - * @param items the new items to set - */ - public FastAdapterDialog set(List items) { - mFastItemAdapter.items().set(items); - return this; - } - - /** - * sets a complete new list of items onto this adapter, using the new list. Calls notifyDataSetChanged - * - * @param items the new items to set - */ - public FastAdapterDialog setNewList(List items) { - mFastItemAdapter.items().setNewList(items); - return this; - } - - /** - * add an array of items to the end of the existing items - * - * @param items the items to add - */ - @SafeVarargs - public final FastAdapterDialog add(Item... items) { - mFastItemAdapter.items().add(items); - return this; - } - - /** - * add a list of items to the end of the existing items - * - * @param items the items to add - */ - public FastAdapterDialog add(List items) { - mFastItemAdapter.items().add(items); - return this; - } - - /** - * add an array of items at the given position within the existing items - * - * @param position the global position - * @param items the items to add - */ - @SafeVarargs - public final FastAdapterDialog add(int position, Item... items) { - mFastItemAdapter.items().add(position, items); - return this; - } - - /** - * add a list of items at the given position within the existing items - * - * @param position the global position - * @param items the items to add - */ - public FastAdapterDialog add(int position, List items) { - mFastItemAdapter.items().add(position, items); - return this; - } - - /** - * sets an item at the given position, overwriting the previous item - * - * @param position the global position - * @param item the item to set - */ - public FastAdapterDialog set(int position, Item item) { - mFastItemAdapter.items().set(position, item); - return this; - } - - /** - * add an item at the end of the existing items - * - * @param item the item to add - */ - public FastAdapterDialog add(Item item) { - mFastItemAdapter.items().add(item); - return this; - } - - /** - * add an item at the given position within the existing icons - * - * @param position the global position - * @param item the item to add - */ - public FastAdapterDialog add(int position, Item item) { - mFastItemAdapter.items().add(position, item); - return this; - } - - /** - * moves an item within the list from a position to a position - * - * @param fromPosition the position global from which we want to move - * @param toPosition the global position to which to move - * @return this - */ - public FastAdapterDialog move(int fromPosition, int toPosition) { - mFastItemAdapter.items().move(fromPosition, toPosition); - return this; - } - - /** - * removes an item at the given position within the existing icons - * - * @param position the global position - */ - public FastAdapterDialog remove(int position) { - mFastItemAdapter.items().remove(position); - return this; - } - - /** - * removes a range of items starting with the given position within the existing icons - * - * @param position the global position - * @param itemCount the count of items removed - */ - public FastAdapterDialog removeRange(int position, int itemCount) { - mFastItemAdapter.items().removeRange(position, itemCount); - return this; - } - - /** - * removes all items of this adapter - */ - public FastAdapterDialog clear() { - mFastItemAdapter.items().clear(); - return this; - } } From 38d0a85699ff223aa625bd081724129d10191e34 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 11:28:38 +0100 Subject: [PATCH 04/57] * fix deprecated tests --- library/build.gradle | 8 ++++---- .../java/com/mikepenz/fastadapter/FastAdapterTest.java | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/library/build.gradle b/library/build.gradle index d59040dd2..2b93717f6 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -38,10 +38,10 @@ dependencies { testCompile 'junit:junit:4.12' testCompile 'org.mockito:mockito-all:1.10.19' - testCompile 'org.robolectric:robolectric:3.1.1' - testCompile 'org.robolectric:robolectric-utils:3.1.1' - testCompile 'org.robolectric:shadows-core:3.1.1' - testCompile 'org.robolectric:shadows-support-v4:3.1.1' + testCompile 'org.robolectric:robolectric:3.1.4' + testCompile 'org.robolectric:robolectric-utils:3.1.4' + testCompile 'org.robolectric:shadows-core:3.1.4' + testCompile 'org.robolectric:shadows-support-v4:3.1.4' testCompile 'com.squareup.assertj:assertj-android:1.1.1' testCompile 'com.squareup.assertj:assertj-android-design:1.1.1@aar' testCompile 'com.squareup.assertj:assertj-android-appcompat-v7:1.1.1@aar' diff --git a/library/src/test/java/com/mikepenz/fastadapter/FastAdapterTest.java b/library/src/test/java/com/mikepenz/fastadapter/FastAdapterTest.java index 148c74f59..4a6506b16 100644 --- a/library/src/test/java/com/mikepenz/fastadapter/FastAdapterTest.java +++ b/library/src/test/java/com/mikepenz/fastadapter/FastAdapterTest.java @@ -7,7 +7,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.robolectric.RobolectricGradleTestRunner; +import org.robolectric.RobolectricTestRunner; import java.util.ArrayList; import java.util.List; @@ -21,7 +21,7 @@ /** * @author Shubham Chaudhary on 17/03/16 */ -@RunWith(RobolectricGradleTestRunner.class) +@RunWith(RobolectricTestRunner.class) public class FastAdapterTest { private FastAdapter adapter; private ItemAdapter itemAdapter; From 827135c7dfb243f3393a2540efdac26b155071e2 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 11:29:10 +0100 Subject: [PATCH 05/57] * update samples --- .../fastadapter/app/CheckBoxSampleActivity.java | 2 +- .../app/EndlessScrollListActivity.java | 14 +++++++------- ...xpandableMultiselectDeleteSampleActivity.java | 6 +++--- .../app/ExpandableSampleActivity.java | 2 +- .../fastadapter/app/IconGridActivity.java | 2 +- .../fastadapter/app/ImageListActivity.java | 2 +- .../fastadapter/app/MopubAdsActivity.java | 2 +- .../app/RadioButtonSampleActivity.java | 2 +- .../mikepenz/fastadapter/app/RealmActivity.java | 2 +- .../fastadapter/app/SimpleItemListActivity.java | 12 ++++++------ .../mikepenz/fastadapter/app/SortActivity.java | 10 +++++----- .../fastadapter/app/SwipeListActivity.java | 16 ++++++++-------- .../RangeSelectorHelper.java | 8 ++++---- 13 files changed, 40 insertions(+), 40 deletions(-) diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/CheckBoxSampleActivity.java b/app/src/main/java/com/mikepenz/fastadapter/app/CheckBoxSampleActivity.java index 9efd303cd..3191ce572 100644 --- a/app/src/main/java/com/mikepenz/fastadapter/app/CheckBoxSampleActivity.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/CheckBoxSampleActivity.java @@ -84,7 +84,7 @@ public boolean onClick(View v, IAdapter adapter, CheckBoxSam x++; } } - fastItemAdapter.add(items); + fastItemAdapter.items().add(items); //restore selections (this has to be done after the items were added fastItemAdapter.withSavedInstanceState(savedInstanceState); diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/EndlessScrollListActivity.java b/app/src/main/java/com/mikepenz/fastadapter/app/EndlessScrollListActivity.java index aea600bf8..313d3e2c9 100755 --- a/app/src/main/java/com/mikepenz/fastadapter/app/EndlessScrollListActivity.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/EndlessScrollListActivity.java @@ -78,7 +78,7 @@ public boolean onClick(View v, IAdapter adapter, SimpleItem item, in }); //configure the itemAdapter - fastItemAdapter.withFilterPredicate(new IItemAdapter.Predicate() { + fastItemAdapter.items().withFilterPredicate(new IItemAdapter.Predicate() { @Override public boolean filter(SimpleItem item, CharSequence constraint) { //return true if we should filter it out @@ -87,7 +87,7 @@ public boolean filter(SimpleItem item, CharSequence constraint) { } }); - fastItemAdapter.getItemAdapter().withItemFilterListener(this); + fastItemAdapter.items().withItemFilterListener(this); //get our recyclerView and do basic setup RecyclerView recyclerView = (RecyclerView) findViewById(R.id.rv); @@ -106,7 +106,7 @@ public void onLoadMore(final int currentPage) { public void run() { footerAdapter.clear(); for (int i = 1; i < 16; i++) { - fastItemAdapter.add(fastItemAdapter.getAdapterItemCount(), new SimpleItem().withName("Item " + i + " Page " + currentPage)); + fastItemAdapter.items().add(fastItemAdapter.items().getAdapterItemCount(), new SimpleItem().withName("Item " + i + " Page " + currentPage)); } } }, 2000); @@ -118,7 +118,7 @@ public void run() { for (int i = 1; i < 16; i++) { items.add(new SimpleItem().withName("Item " + i + " Page " + 1)); } - fastItemAdapter.add(items); + fastItemAdapter.items().add(items); //add drag and drop for item touchCallback = new SimpleDragCallback(this); @@ -169,14 +169,14 @@ public boolean onCreateOptionsMenu(Menu menu) { @Override public boolean onQueryTextSubmit(String s) { touchCallback.setIsDragEnabled(false); - fastItemAdapter.filter(s); + fastItemAdapter.items().filter(s); return true; } @Override public boolean onQueryTextChange(String s) { - fastItemAdapter.filter(s); + fastItemAdapter.items().filter(s); touchCallback.setIsDragEnabled(TextUtils.isEmpty(s)); return true; } @@ -190,7 +190,7 @@ public boolean onQueryTextChange(String s) { @Override public boolean itemTouchOnMove(int oldPosition, int newPosition) { - Collections.swap(fastItemAdapter.getAdapterItems(), oldPosition, newPosition); // change position + Collections.swap(fastItemAdapter.items().getAdapterItems(), oldPosition, newPosition); // change position fastItemAdapter.notifyAdapterItemMoved(oldPosition, newPosition); return true; } diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/ExpandableMultiselectDeleteSampleActivity.java b/app/src/main/java/com/mikepenz/fastadapter/app/ExpandableMultiselectDeleteSampleActivity.java index 0d0656dcf..46e32a5a0 100644 --- a/app/src/main/java/com/mikepenz/fastadapter/app/ExpandableMultiselectDeleteSampleActivity.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/ExpandableMultiselectDeleteSampleActivity.java @@ -107,7 +107,7 @@ public boolean onLongClick(View v, IAdapter adapter, IItem item, int posi .withTitleProvider(new ActionModeHelper.ActionModeTitleProvider() { @Override public String getTitle(int selected) { - return selected + "/" + SubItemUtil.countItems(fastItemAdapter.getItemAdapter(), false); + return selected + "/" + SubItemUtil.countItems(fastItemAdapter.items(), false); } }) // important so that the helper knows, that is should use the SubItemUtil for validating it's state @@ -164,7 +164,7 @@ public int getSelectedSubItems() { items.add(sampleItem); } } - fastItemAdapter.add(items); + fastItemAdapter.items().add(items); fastItemAdapter.expand(); fastItemAdapter.withSelectionListener(new ISelectionListener() { @@ -173,7 +173,7 @@ public void onSelectionChanged(IItem item, boolean selected) { if (item instanceof SimpleSubItem) { IItem headerItem = ((SimpleSubItem) item).getParent(); if (headerItem != null) { - int pos = fastItemAdapter.getAdapterPosition(headerItem); + int pos = fastItemAdapter.items().getAdapterPosition(headerItem); // Important: notify the header directly, not via the notifyadapterItemChanged! // we just want to update the view and we are sure, nothing else has to be done fastItemAdapter.notifyItemChanged(pos); diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/ExpandableSampleActivity.java b/app/src/main/java/com/mikepenz/fastadapter/app/ExpandableSampleActivity.java index 617f2685c..007a12626 100755 --- a/app/src/main/java/com/mikepenz/fastadapter/app/ExpandableSampleActivity.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/ExpandableSampleActivity.java @@ -77,7 +77,7 @@ protected void onCreate(Bundle savedInstanceState) { items.add(new SimpleSubItem().withName("Test " + i).withIdentifier(100 + i)); } } - fastItemAdapter.add(items); + fastItemAdapter.items().add(items); //restore selections (this has to be done after the items were added fastItemAdapter.withSavedInstanceState(savedInstanceState); diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/IconGridActivity.java b/app/src/main/java/com/mikepenz/fastadapter/app/IconGridActivity.java index c3b8e47e8..2d1dc50e3 100755 --- a/app/src/main/java/com/mikepenz/fastadapter/app/IconGridActivity.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/IconGridActivity.java @@ -104,7 +104,7 @@ public int compare(final ITypeface object1, final ITypeface object2) { } //fill with some sample data - fastItemAdapter.add(items); + fastItemAdapter.items().add(items); //if first start we want to expand the item with ID 2 if (savedInstanceState != null) { diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/ImageListActivity.java b/app/src/main/java/com/mikepenz/fastadapter/app/ImageListActivity.java index 9cd5e981b..dedf41a14 100755 --- a/app/src/main/java/com/mikepenz/fastadapter/app/ImageListActivity.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/ImageListActivity.java @@ -69,7 +69,7 @@ public boolean onClick(View v, IAdapter adapter, ImageItem item, int rv.setAdapter(mFastItemAdapter); //fill with some sample data - mFastItemAdapter.add(ImageDummyData.getImageItems()); + mFastItemAdapter.items().add(ImageDummyData.getImageItems()); //restore selections (this has to be done after the items were added mFastItemAdapter.withSavedInstanceState(savedInstanceState); diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/MopubAdsActivity.java b/app/src/main/java/com/mikepenz/fastadapter/app/MopubAdsActivity.java index 30a0683a5..e41655608 100644 --- a/app/src/main/java/com/mikepenz/fastadapter/app/MopubAdsActivity.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/MopubAdsActivity.java @@ -48,7 +48,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { mAdapter.withOnClickListener(this); for (int i = 65; i <= 90; i++) { - mAdapter.add(new LetterItem(String.valueOf((char) i))); + mAdapter.items().add(new LetterItem(String.valueOf((char) i))); } ViewBinder viewBinder = new ViewBinder.Builder(R.layout.native_ad_item) diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/RadioButtonSampleActivity.java b/app/src/main/java/com/mikepenz/fastadapter/app/RadioButtonSampleActivity.java index f86765421..adeb159c0 100644 --- a/app/src/main/java/com/mikepenz/fastadapter/app/RadioButtonSampleActivity.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/RadioButtonSampleActivity.java @@ -85,7 +85,7 @@ public boolean onClick(View v, IAdapter adapter, RadioBut x++; } } - fastItemAdapter.add(items); + fastItemAdapter.items().add(items); //restore selections (this has to be done after the items were added fastItemAdapter.withSavedInstanceState(savedInstanceState); diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/RealmActivity.java b/app/src/main/java/com/mikepenz/fastadapter/app/RealmActivity.java index a3b5f6723..72011e4c9 100755 --- a/app/src/main/java/com/mikepenz/fastadapter/app/RealmActivity.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/RealmActivity.java @@ -76,7 +76,7 @@ public void onChange(RealmResults userItems) { //This will call twice //1.) from findAllAsync() //2.) from createData() - mFastItemAdapter.setNewList(userItems); + mFastItemAdapter.items().setNewList(userItems); } }); diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/SimpleItemListActivity.java b/app/src/main/java/com/mikepenz/fastadapter/app/SimpleItemListActivity.java index 9e7b93ceb..884991ef1 100755 --- a/app/src/main/java/com/mikepenz/fastadapter/app/SimpleItemListActivity.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/SimpleItemListActivity.java @@ -76,7 +76,7 @@ public boolean onClick(View v, IAdapter adapter, SimpleItem item, in }); //configure the itemAdapter - fastItemAdapter.withFilterPredicate(new IItemAdapter.Predicate() { + fastItemAdapter.items().withFilterPredicate(new IItemAdapter.Predicate() { @Override public boolean filter(SimpleItem item, CharSequence constraint) { //return true if we should filter it out @@ -85,7 +85,7 @@ public boolean filter(SimpleItem item, CharSequence constraint) { } }); - fastItemAdapter.getItemAdapter().withItemFilterListener(this); + fastItemAdapter.items().withItemFilterListener(this); //get our recyclerView and do basic setup RecyclerView recyclerView = (RecyclerView) findViewById(R.id.rv); @@ -109,7 +109,7 @@ public boolean filter(SimpleItem item, CharSequence constraint) { x++; } } - fastItemAdapter.add(items); + fastItemAdapter.items().add(items); //add drag and drop for item touchCallback = new SimpleDragCallback(this); @@ -160,14 +160,14 @@ public boolean onCreateOptionsMenu(Menu menu) { @Override public boolean onQueryTextSubmit(String s) { touchCallback.setIsDragEnabled(false); - fastItemAdapter.filter(s); + fastItemAdapter.items().filter(s); return true; } @Override public boolean onQueryTextChange(String s) { - fastItemAdapter.filter(s); + fastItemAdapter.items().filter(s); touchCallback.setIsDragEnabled(TextUtils.isEmpty(s)); return true; } @@ -181,7 +181,7 @@ public boolean onQueryTextChange(String s) { @Override public boolean itemTouchOnMove(int oldPosition, int newPosition) { - Collections.swap(fastItemAdapter.getAdapterItems(), oldPosition, newPosition); // change position + Collections.swap(fastItemAdapter.items().getAdapterItems(), oldPosition, newPosition); // change position fastItemAdapter.notifyAdapterItemMoved(oldPosition, newPosition); return true; } diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/SortActivity.java b/app/src/main/java/com/mikepenz/fastadapter/app/SortActivity.java index 90de737c6..62bf6300d 100644 --- a/app/src/main/java/com/mikepenz/fastadapter/app/SortActivity.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/SortActivity.java @@ -106,10 +106,10 @@ public boolean onClick(View v, IAdapter adapter, } //we sort the list - fastItemAdapter.getItemAdapter().withComparator(getComparator()); + fastItemAdapter.items().withComparator(getComparator()); //initial filling of the list - fastItemAdapter.setNewList(generateUnsortedList()); + fastItemAdapter.items().setNewList(generateUnsortedList()); //restore selections (this has to be done after the items were added fastItemAdapter.withSavedInstanceState(savedInstanceState); @@ -153,20 +153,20 @@ public boolean onOptionsItemSelected(MenuItem item) { //Set the new sorting strategy sortingStrategy = SORT_NONE; //randomize the items - Collections.shuffle(fastItemAdapter.getAdapterItems()); + Collections.shuffle(fastItemAdapter.items().getAdapterItems()); fastItemAdapter.notifyDataSetChanged(); return true; case R.id.item_sort_asc: //Set the new sorting strategy sortingStrategy = SORT_ASCENDING; //Set the new comparator to the list - fastItemAdapter.getItemAdapter().withComparator(getComparator()); + fastItemAdapter.items().withComparator(getComparator()); return true; case R.id.item_sort_desc: //Set the new sorting strategy sortingStrategy = SORT_DESCENDING; //Set the new comparator to the list - fastItemAdapter.getItemAdapter().withComparator(getComparator()); + fastItemAdapter.items().withComparator(getComparator()); return true; case android.R.id.home: Toast.makeText(getApplicationContext(), "selections = " + diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/SwipeListActivity.java b/app/src/main/java/com/mikepenz/fastadapter/app/SwipeListActivity.java index 3ef8a6390..c349426e7 100644 --- a/app/src/main/java/com/mikepenz/fastadapter/app/SwipeListActivity.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/SwipeListActivity.java @@ -74,7 +74,7 @@ public boolean onClick(View v, IAdapter adapter, SwipeableItem it }); //configure the itemAdapter - fastItemAdapter.withFilterPredicate(new IItemAdapter.Predicate() { + fastItemAdapter.items().withFilterPredicate(new IItemAdapter.Predicate() { @Override public boolean filter(SwipeableItem item, CharSequence constraint) { //return true if we should filter it out @@ -99,7 +99,7 @@ public boolean filter(SwipeableItem item, CharSequence constraint) { x++; } } - fastItemAdapter.add(items); + fastItemAdapter.items().add(items); //add drag and drop for item @@ -170,14 +170,14 @@ public boolean onCreateOptionsMenu(Menu menu) { @Override public boolean onQueryTextSubmit(String s) { touchCallback.setIsDragEnabled(false); - fastItemAdapter.filter(s); + fastItemAdapter.items().filter(s); return true; } @Override public boolean onQueryTextChange(String s) { - fastItemAdapter.filter(s); + fastItemAdapter.items().filter(s); touchCallback.setIsDragEnabled(TextUtils.isEmpty(s)); return true; } @@ -191,7 +191,7 @@ public boolean onQueryTextChange(String s) { @Override public boolean itemTouchOnMove(int oldPosition, int newPosition) { - Collections.swap(fastItemAdapter.getAdapterItems(), oldPosition, newPosition); // change position + Collections.swap(fastItemAdapter.items().getAdapterItems(), oldPosition, newPosition); // change position fastItemAdapter.notifyAdapterItemMoved(oldPosition, newPosition); return true; } @@ -214,9 +214,9 @@ public void itemSwiped(int position, int direction) { @Override public void run() { item.setSwipedAction(null); - int position = fastItemAdapter.getAdapterPosition(item); + int position = fastItemAdapter.items().getAdapterPosition(item); if (position != RecyclerView.NO_POSITION) { - fastItemAdapter.remove(position); + fastItemAdapter.items().remove(position); } } }; @@ -228,7 +228,7 @@ public void run() { public void run() { rv.removeCallbacks(removeRunnable); item.setSwipedDirection(0); - int position = fastItemAdapter.getAdapterPosition(item); + int position = fastItemAdapter.items().getAdapterPosition(item); if (position != RecyclerView.NO_POSITION) { fastItemAdapter.notifyItemChanged(position); } diff --git a/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/RangeSelectorHelper.java b/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/RangeSelectorHelper.java index cad713aa7..f0fcec337 100644 --- a/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/RangeSelectorHelper.java +++ b/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/RangeSelectorHelper.java @@ -62,7 +62,7 @@ public void reset() { public boolean onLongClick(int index) { if (mLastLongPressIndex == null) { // we only consider long presses on not selected items - if (mFastAdapter.getAdapterItem(index).isSelectable()) { + if (mFastAdapter.items().getAdapterItem(index).isSelectable()) { mLastLongPressIndex = index; // we select this item as well mFastAdapter.select(index); @@ -90,7 +90,7 @@ private void selectRange(int from, int to, boole } for (int i = from; i <= to; i++) { - if (mFastAdapter.getAdapterItem(i).isSelectable()) { + if (mFastAdapter.items().getAdapterItem(i).isSelectable()) { if (select) { mFastAdapter.select(i); } @@ -98,8 +98,8 @@ private void selectRange(int from, int to, boole mFastAdapter.deselect(i); } } - if (mSupportSubItems && mFastAdapter.getAdapterItem(i) instanceof IExpandable) - SubItemUtil.selectAllSubItems(mFastAdapter, (T)mFastAdapter.getAdapterItem(i), select, true); + if (mSupportSubItems && mFastAdapter.items().getAdapterItem(i) instanceof IExpandable) + SubItemUtil.selectAllSubItems(mFastAdapter, (T)mFastAdapter.items().getAdapterItem(i), select, true); } if (mActionModeHelper != null) From b5d37cd30186f5658fb17d0cf1ac1319bc517086 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 11:29:26 +0100 Subject: [PATCH 06/57] * fix SimpleDragCallback --- .../fastadapter_extensions/drag/SimpleDragCallback.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/drag/SimpleDragCallback.java b/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/drag/SimpleDragCallback.java index 3cbad17a9..f58d67544 100644 --- a/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/drag/SimpleDragCallback.java +++ b/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/drag/SimpleDragCallback.java @@ -67,7 +67,7 @@ public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHol RecyclerView.Adapter adapter = recyclerView.getAdapter(); ItemAdapter itemAdapter = null; if (adapter instanceof FastItemAdapter) { - itemAdapter = ((FastItemAdapter) adapter).getItemAdapter(); + itemAdapter = ((FastItemAdapter) adapter).items(); } else if (adapter instanceof ItemAdapter) { itemAdapter = (ItemAdapter) adapter; } From 556f4e8eacdabafdc3e435c27e559502bf02a931 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 11:29:38 +0100 Subject: [PATCH 07/57] * cleanup generic sample --- .../app/MultiTypeGenericItemActivity.java | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/MultiTypeGenericItemActivity.java b/app/src/main/java/com/mikepenz/fastadapter/app/MultiTypeGenericItemActivity.java index 04cd07761..c1301140b 100755 --- a/app/src/main/java/com/mikepenz/fastadapter/app/MultiTypeGenericItemActivity.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/MultiTypeGenericItemActivity.java @@ -8,12 +8,11 @@ import android.view.MenuItem; import android.view.View; -import com.mikepenz.fastadapter.FastAdapter; -import com.mikepenz.fastadapter.adapters.GenericItemAdapter; import com.mikepenz.fastadapter.app.generic.GenericIconItem; import com.mikepenz.fastadapter.app.generic.IconModel; import com.mikepenz.fastadapter.app.generic.RightGenericIconItem; import com.mikepenz.fastadapter.app.generic.RightIconModel; +import com.mikepenz.fastadapter.commons.adapters.GenericFastItemAdapter; import com.mikepenz.fastadapter.utils.Function; import com.mikepenz.iconics.Iconics; import com.mikepenz.iconics.typeface.ITypeface; @@ -27,7 +26,7 @@ public class MultiTypeGenericItemActivity extends AppCompatActivity { //save our FastAdapter - private FastAdapter fastAdapter; + private GenericFastItemAdapter genericFastItemAdapter; @Override protected void onCreate(Bundle savedInstanceState) { @@ -45,17 +44,7 @@ protected void onCreate(Bundle savedInstanceState) { //create our FastAdapter which will manage everything - fastAdapter = new FastAdapter(); - fastAdapter.withSelectable(true); - - //get our recyclerView and do basic setup - RecyclerView rv = (RecyclerView) findViewById(R.id.rv); - - //init our gridLayoutManager and configure RV - GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 3); - - //if you need multiple items for different models you can also do this be defining a Function which get's the model object and returns the item (extends IItem) - GenericItemAdapter itemAdapter = new GenericItemAdapter<>(new Function() { + genericFastItemAdapter = new GenericFastItemAdapter<>(new Function() { @Override public GenericIconItem apply(IconModel o) { if (o instanceof RightIconModel) { @@ -65,10 +54,17 @@ public GenericIconItem apply(IconModel o) { } } }); + genericFastItemAdapter.withSelectable(true); + + //get our recyclerView and do basic setup + RecyclerView rv = (RecyclerView) findViewById(R.id.rv); + + //init our gridLayoutManager and configure RV + GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 3); rv.setLayoutManager(gridLayoutManager); rv.setItemAnimator(new SlideDownAlphaAnimator()); - rv.setAdapter(itemAdapter.wrap(fastAdapter)); + rv.setAdapter(genericFastItemAdapter); //order fonts by their name List mFonts = new ArrayList<>(Iconics.getRegisteredFonts(this)); @@ -94,10 +90,10 @@ public int compare(final ITypeface object1, final ITypeface object2) { } //fill with some sample data - itemAdapter.addModel(models); + genericFastItemAdapter.items().addModel(models); //restore selections (this has to be done after the items were added - fastAdapter.withSavedInstanceState(savedInstanceState); + genericFastItemAdapter.withSavedInstanceState(savedInstanceState); //set the back arrow in the toolbar getSupportActionBar().setDisplayHomeAsUpEnabled(true); @@ -107,7 +103,7 @@ public int compare(final ITypeface object1, final ITypeface object2) { @Override protected void onSaveInstanceState(Bundle outState) { //add the values which need to be saved from the adapter to the bundel - outState = fastAdapter.saveInstanceState(outState); + outState = genericFastItemAdapter.saveInstanceState(outState); super.onSaveInstanceState(outState); } From 5cc0722b1e1db3931ba7d37fe64e119e9de27e51 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 11:38:33 +0100 Subject: [PATCH 08/57] * add dex count plugin and update gradle version --- app/build.gradle | 1 + build.gradle | 3 ++- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index ba669410d..8e41e8aa1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,5 +1,6 @@ apply plugin: 'com.android.application' apply plugin: 'realm-android' +apply plugin: 'com.getkeepsafe.dexcount' //wrap with try and catch so the build is working even if the signing stuff is missing try { apply from: '../../../signing.gradle' diff --git a/build.gradle b/build.gradle index 1b237432b..34ac3c91e 100644 --- a/build.gradle +++ b/build.gradle @@ -4,9 +4,10 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.2' + classpath 'com.android.tools.build:gradle:2.3.0-beta1' classpath 'com.novoda:bintray-release:0.3.4' classpath "io.realm:realm-gradle-plugin:1.1.0" + classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.6.2' } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ade156cc8..b8bbd65ec 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Tue Aug 23 20:03:34 CEST 2016 +#Mon Dec 19 11:34:07 CET 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-3.2-all.zip From 0bd61fbbf2b99e07cd65bbe34fda835fb7bbf1e6 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 12:31:40 +0100 Subject: [PATCH 09/57] * filter should return true if item should stay and item adapter cleanup --- README.md | 2 +- .../java/com/mikepenz/fastadapter/IItemAdapter.java | 2 +- .../mikepenz/fastadapter/adapters/ItemAdapter.java | 11 ++++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 37f9a0fea..f4c2faea9 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,7 @@ fastAdapter.filter("yourSearchTerm"); fastAdapter.withFilterPredicate(new IItemAdapter.Predicate() { @Override public boolean filter(Item item, CharSequence constraint) { - return item.getName().startsWith(String.valueOf(constraint)); + return !item.getName().startsWith(String.valueOf(constraint)); } }); ``` diff --git a/library-core/src/main/java/com/mikepenz/fastadapter/IItemAdapter.java b/library-core/src/main/java/com/mikepenz/fastadapter/IItemAdapter.java index 3221a6bb3..b4d118879 100644 --- a/library-core/src/main/java/com/mikepenz/fastadapter/IItemAdapter.java +++ b/library-core/src/main/java/com/mikepenz/fastadapter/IItemAdapter.java @@ -95,7 +95,7 @@ interface Predicate { /** * @param item the item which is checked if it should get filtered * @param constraint the string constraint used to filter items away - * @return false if it should stay. true if it should get filtered away + * @return true if it should stay. false if it should get filtered away */ boolean filter(Item item, CharSequence constraint); } diff --git a/library-core/src/main/java/com/mikepenz/fastadapter/adapters/ItemAdapter.java b/library-core/src/main/java/com/mikepenz/fastadapter/adapters/ItemAdapter.java index 138338929..cd03a5337 100644 --- a/library-core/src/main/java/com/mikepenz/fastadapter/adapters/ItemAdapter.java +++ b/library-core/src/main/java/com/mikepenz/fastadapter/adapters/ItemAdapter.java @@ -102,7 +102,7 @@ public ItemAdapter withItemFilterListener(ItemFilterListener listener) { } //the listener which will be called after the items were filtered - protected ItemFilterListener mItemFilterListener; + private ItemFilterListener mItemFilterListener; /** * interface for the ItemFilterListener @@ -112,7 +112,7 @@ public interface ItemFilterListener { } // - protected Comparator mComparator; + private Comparator mComparator; /** * define a comparator which will be used to sort the list "everytime" it is altered @@ -133,7 +133,7 @@ public ItemAdapter withComparator(Comparator comparator) { * @param sortNow specifies if we use the provided comparator to sort now * @return this */ - public ItemAdapter withComparator(Comparator comparator, boolean sortNow) { + private ItemAdapter withComparator(Comparator comparator, boolean sortNow) { this.mComparator = comparator; //we directly sort the list with the defined comparator @@ -466,7 +466,7 @@ public ItemAdapter clear() { * ItemFilter which extends the Filter api provided by Android * This calls automatically all required methods, just overwrite the filterItems method */ - public class ItemFilter extends Filter { + private class ItemFilter extends Filter { private List mOriginalItems; private CharSequence mConstraint; @@ -498,7 +498,7 @@ protected FilterResults performFiltering(CharSequence constraint) { // We perform filtering operation if (mFilterPredicate != null) { for (Item item : mOriginalItems) { - if (!mFilterPredicate.filter(item, constraint)) { + if (mFilterPredicate.filter(item, constraint)) { filteredItems.add(item); } } @@ -516,6 +516,7 @@ public CharSequence getConstraint() { return mConstraint; } + @SuppressWarnings("unchecked") @Override protected void publishResults(CharSequence constraint, FilterResults results) { // Now we have to inform the adapter about the new list filtered From 39d2d376d8799455b59d02958bd705645756ba3b Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 12:32:00 +0100 Subject: [PATCH 10/57] * simplify click listener helper --- .../fastadapter/helpers/ClickListenerHelper.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/library-core/src/main/java/com/mikepenz/fastadapter/helpers/ClickListenerHelper.java b/library-core/src/main/java/com/mikepenz/fastadapter/helpers/ClickListenerHelper.java index 3cd6be567..7f4d1492b 100644 --- a/library-core/src/main/java/com/mikepenz/fastadapter/helpers/ClickListenerHelper.java +++ b/library-core/src/main/java/com/mikepenz/fastadapter/helpers/ClickListenerHelper.java @@ -126,11 +126,8 @@ public boolean onLongClick(View v) { //we get the adapterPosition from the viewHolder int pos = mFastAdapter.getHolderAdapterPosition(viewHolder); //make sure the click was done on a valid item - if (pos != RecyclerView.NO_POSITION) { - //we update our item with the changed property - return ((LongClickEventHook) event).onLongClick(v, pos, mFastAdapter, mFastAdapter.getItem(pos)); - } - return false; + //we update our item with the changed property + return pos != RecyclerView.NO_POSITION && ((LongClickEventHook) event).onLongClick(v, pos, mFastAdapter, mFastAdapter.getItem(pos)); } }); } else if (event instanceof TouchEventHook) { @@ -140,11 +137,8 @@ public boolean onTouch(View v, MotionEvent e) { //we get the adapterPosition from the viewHolder int pos = mFastAdapter.getHolderAdapterPosition(viewHolder); //make sure the click was done on a valid item - if (pos != RecyclerView.NO_POSITION) { - //we update our item with the changed property - return ((TouchEventHook) event).onTouch(v, e, pos, mFastAdapter, mFastAdapter.getItem(pos)); - } - return false; + //we update our item with the changed property + return pos != RecyclerView.NO_POSITION && ((TouchEventHook) event).onTouch(v, e, pos, mFastAdapter, mFastAdapter.getItem(pos)); } }); } else if (event instanceof CustomEventHook) { From 823fb9de2e7e56011f5d899a690a04f9709bb4b8 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 12:32:09 +0100 Subject: [PATCH 11/57] * cleanup generic item adapter --- .../mikepenz/fastadapter/adapters/GenericItemAdapter.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library-core/src/main/java/com/mikepenz/fastadapter/adapters/GenericItemAdapter.java b/library-core/src/main/java/com/mikepenz/fastadapter/adapters/GenericItemAdapter.java index 6d6c1261a..1da7127db 100644 --- a/library-core/src/main/java/com/mikepenz/fastadapter/adapters/GenericItemAdapter.java +++ b/library-core/src/main/java/com/mikepenz/fastadapter/adapters/GenericItemAdapter.java @@ -170,7 +170,7 @@ public GenericItemAdapter removeModel(int position) { * @param models the models * @return the list of items referencing the models */ - protected List toItems(List models) { + private List toItems(List models) { if (models == null) { return Collections.emptyList(); } @@ -189,15 +189,15 @@ protected List toItems(List models) { * @param model the model class we want to wrap into a typedItem * @return our typedItem */ - protected Item toItem(Model model) { + private Item toItem(Model model) { return mItemFactory.apply(model); } - protected static class ReflectionBasedItemFactory implements Function { + private static class ReflectionBasedItemFactory implements Function { private final Class modelClass; private final Class itemClass; - public ReflectionBasedItemFactory(Class modelClass, Class itemClass) { + ReflectionBasedItemFactory(Class modelClass, Class itemClass) { this.modelClass = modelClass; this.itemClass = itemClass; } From 034fa074ff4150dad2261b2397381dcd44edfff0 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 12:38:21 +0100 Subject: [PATCH 12/57] * remove backward compatibility for api 11 from sample --- .../fastadapter/app/SwipeListActivity.java | 37 ++++++++----------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/SwipeListActivity.java b/app/src/main/java/com/mikepenz/fastadapter/app/SwipeListActivity.java index c349426e7..e3c7fa7f5 100644 --- a/app/src/main/java/com/mikepenz/fastadapter/app/SwipeListActivity.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/SwipeListActivity.java @@ -2,7 +2,6 @@ import android.graphics.Color; import android.graphics.drawable.Drawable; -import android.os.Build; import android.os.Bundle; import android.support.v4.content.ContextCompat; import android.support.v7.app.AppCompatActivity; @@ -22,8 +21,8 @@ import com.mikepenz.fastadapter.FastAdapter; import com.mikepenz.fastadapter.IAdapter; import com.mikepenz.fastadapter.IItemAdapter; -import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter; import com.mikepenz.fastadapter.app.items.SwipeableItem; +import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter; import com.mikepenz.fastadapter_extensions.drag.ItemTouchCallback; import com.mikepenz.fastadapter_extensions.drag.SimpleDragCallback; import com.mikepenz.fastadapter_extensions.swipe.SimpleSwipeCallback; @@ -164,27 +163,23 @@ public boolean onCreateOptionsMenu(Menu menu) { //search icon menu.findItem(R.id.search).setIcon(new IconicsDrawable(this, MaterialDesignIconic.Icon.gmi_search).color(Color.BLACK).actionBar()); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { - final SearchView searchView = (SearchView) menu.findItem(R.id.search).getActionView(); - searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { - @Override - public boolean onQueryTextSubmit(String s) { - touchCallback.setIsDragEnabled(false); - fastItemAdapter.items().filter(s); - return true; - } + final SearchView searchView = (SearchView) menu.findItem(R.id.search).getActionView(); + searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { + @Override + public boolean onQueryTextSubmit(String s) { + touchCallback.setIsDragEnabled(false); + fastItemAdapter.items().filter(s); + return true; + } - @Override - public boolean onQueryTextChange(String s) { - fastItemAdapter.items().filter(s); - touchCallback.setIsDragEnabled(TextUtils.isEmpty(s)); - return true; - } - }); - } else { - menu.findItem(R.id.search).setVisible(false); - } + @Override + public boolean onQueryTextChange(String s) { + fastItemAdapter.items().filter(s); + touchCallback.setIsDragEnabled(TextUtils.isEmpty(s)); + return true; + } + }); return super.onCreateOptionsMenu(menu); } From b5062adba1271a07dd7fb2754618c26690854666 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 12:45:00 +0100 Subject: [PATCH 13/57] * more sample cleanup --- .../com/mikepenz/fastadapter/app/IconGridActivity.java | 9 ++++----- .../fastadapter/app/MultiselectSampleActivity.java | 6 +++--- .../fastadapter/app/StickyHeaderSampleActivity.java | 7 +++---- .../com/mikepenz/fastadapter/app/SwipeListActivity.java | 3 +-- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/IconGridActivity.java b/app/src/main/java/com/mikepenz/fastadapter/app/IconGridActivity.java index 2d1dc50e3..6e95c4fcc 100755 --- a/app/src/main/java/com/mikepenz/fastadapter/app/IconGridActivity.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/IconGridActivity.java @@ -9,10 +9,9 @@ import android.view.MenuItem; import android.view.View; -import com.mikepenz.fastadapter.IItem; -import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter; import com.mikepenz.fastadapter.app.items.IconItem; import com.mikepenz.fastadapter.app.items.expandable.SimpleSubExpandableItem; +import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter; import com.mikepenz.iconics.Iconics; import com.mikepenz.iconics.context.IconicsLayoutInflater; import com.mikepenz.iconics.typeface.ITypeface; @@ -26,7 +25,7 @@ public class IconGridActivity extends AppCompatActivity { //save our FastAdapter - private FastItemAdapter fastItemAdapter; + private FastItemAdapter fastItemAdapter; @Override protected void onCreate(Bundle savedInstanceState) { @@ -47,7 +46,7 @@ protected void onCreate(Bundle savedInstanceState) { new MaterializeBuilder().withActivity(this).build(); //create our FastAdapter which will manage everything - fastItemAdapter = new FastItemAdapter(); + fastItemAdapter = new FastItemAdapter<>(); //get our recyclerView and do basic setup RecyclerView rv = (RecyclerView) findViewById(R.id.rv); @@ -91,7 +90,7 @@ public int compare(final ITypeface object1, final ITypeface object2) { .withName(font.getFontName()) .withIdentifier(count); - ArrayList icons = new ArrayList<>(); + ArrayList icons = new ArrayList<>(); for (String icon : font.getIcons()) { IconItem iconItem = new IconItem(); iconItem.withIcon(font.getIcon(icon)); diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/MultiselectSampleActivity.java b/app/src/main/java/com/mikepenz/fastadapter/app/MultiselectSampleActivity.java index 7b2ac7a69..2177f1da4 100755 --- a/app/src/main/java/com/mikepenz/fastadapter/app/MultiselectSampleActivity.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/MultiselectSampleActivity.java @@ -32,7 +32,7 @@ public class MultiselectSampleActivity extends AppCompatActivity { //save our FastAdapter private FastAdapter mFastAdapter; - private UndoHelper mUndoHelper; + private UndoHelper mUndoHelper; private ActionModeHelper mActionModeHelper; @@ -54,7 +54,7 @@ protected void onCreate(Bundle savedInstanceState) { mFastAdapter = new FastAdapter<>(); // - mUndoHelper = new UndoHelper(mFastAdapter, new UndoHelper.UndoListener() { + mUndoHelper = new UndoHelper<>(mFastAdapter, new UndoHelper.UndoListener() { @Override public void commitRemove(Set positions, ArrayList> removed) { Log.e("UndoHelper", "Positions: " + positions.toString() + " Removed: " + removed.size()); @@ -161,7 +161,7 @@ public boolean onOptionsItemSelected(MenuItem item) { /** * Our ActionBarCallBack to showcase the CAB */ - class ActionBarCallBack implements ActionMode.Callback { + private class ActionBarCallBack implements ActionMode.Callback { @Override public boolean onActionItemClicked(ActionMode mode, MenuItem item) { diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/StickyHeaderSampleActivity.java b/app/src/main/java/com/mikepenz/fastadapter/app/StickyHeaderSampleActivity.java index ecab2572d..a51a072d0 100755 --- a/app/src/main/java/com/mikepenz/fastadapter/app/StickyHeaderSampleActivity.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/StickyHeaderSampleActivity.java @@ -10,7 +10,6 @@ import android.view.View; import com.mikepenz.fastadapter.FastAdapter; -import com.mikepenz.fastadapter.IItem; import com.mikepenz.fastadapter.adapters.HeaderAdapter; import com.mikepenz.fastadapter.adapters.ItemAdapter; import com.mikepenz.fastadapter.app.adapters.StickyHeaderAdapter; @@ -51,8 +50,8 @@ protected void onCreate(Bundle savedInstanceState) { //create our adapters final StickyHeaderAdapter stickyHeaderAdapter = new StickyHeaderAdapter(); - final HeaderAdapter headerAdapter = new HeaderAdapter(); - final ItemAdapter itemAdapter = new ItemAdapter(); + final HeaderAdapter headerAdapter = new HeaderAdapter<>(); + final ItemAdapter itemAdapter = new ItemAdapter<>(); //configure our fastAdapter //as we provide id's for the items we want the hasStableIds enabled to speed up things @@ -70,7 +69,7 @@ protected void onCreate(Bundle savedInstanceState) { //fill with some sample data headerAdapter.add(new SimpleItem().withName("Header").withIdentifier(1)); - List items = new ArrayList<>(); + List items = new ArrayList<>(); for (int i = 1; i <= 100; i++) { items.add(new SimpleItem().withName("Test " + i).withHeader(headers[i / 5]).withIdentifier(100 + i)); } diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/SwipeListActivity.java b/app/src/main/java/com/mikepenz/fastadapter/app/SwipeListActivity.java index e3c7fa7f5..075a654be 100644 --- a/app/src/main/java/com/mikepenz/fastadapter/app/SwipeListActivity.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/SwipeListActivity.java @@ -44,7 +44,6 @@ public class SwipeListActivity extends AppCompatActivity implements ItemTouchCal //drag & drop private SimpleDragCallback touchCallback; - private ItemTouchHelper touchHelper; @Override protected void onCreate(Bundle savedInstanceState) { @@ -122,7 +121,7 @@ public boolean filter(SwipeableItem item, CharSequence constraint) { .withBackgroundSwipeRight(ContextCompat.getColor(this, R.color.md_blue_900)) .withLeaveBehindSwipeRight(leaveBehindDrawableRight); - touchHelper = new ItemTouchHelper(touchCallback); // Create ItemTouchHelper and pass with parameter the SimpleDragCallback + ItemTouchHelper touchHelper = new ItemTouchHelper(touchCallback); touchHelper.attachToRecyclerView(recyclerView); // Attach ItemTouchHelper to RecyclerView //restore selections (this has to be done after the items were added From e8ae4403e17216459017c7dce950bc79f7f4c069 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 13:07:14 +0100 Subject: [PATCH 14/57] * revert ItemAdapter privates --- .../java/com/mikepenz/fastadapter/adapters/ItemAdapter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library-core/src/main/java/com/mikepenz/fastadapter/adapters/ItemAdapter.java b/library-core/src/main/java/com/mikepenz/fastadapter/adapters/ItemAdapter.java index cd03a5337..19ff00538 100644 --- a/library-core/src/main/java/com/mikepenz/fastadapter/adapters/ItemAdapter.java +++ b/library-core/src/main/java/com/mikepenz/fastadapter/adapters/ItemAdapter.java @@ -133,7 +133,7 @@ public ItemAdapter withComparator(Comparator comparator) { * @param sortNow specifies if we use the provided comparator to sort now * @return this */ - private ItemAdapter withComparator(Comparator comparator, boolean sortNow) { + public ItemAdapter withComparator(Comparator comparator, boolean sortNow) { this.mComparator = comparator; //we directly sort the list with the defined comparator @@ -466,7 +466,7 @@ public ItemAdapter clear() { * ItemFilter which extends the Filter api provided by Android * This calls automatically all required methods, just overwrite the filterItems method */ - private class ItemFilter extends Filter { + public class ItemFilter extends Filter { private List mOriginalItems; private CharSequence mConstraint; From 59d929d136ce18a24e90b00a1163982a0bcfda5d Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 13:17:13 +0100 Subject: [PATCH 15/57] * improve RecyclerViewCacheUtil performance --- .../commons/utils/RecyclerViewCacheUtil.java | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/library/src/main/java/com/mikepenz/fastadapter/commons/utils/RecyclerViewCacheUtil.java b/library/src/main/java/com/mikepenz/fastadapter/commons/utils/RecyclerViewCacheUtil.java index 313b6e7a9..910ed80b1 100644 --- a/library/src/main/java/com/mikepenz/fastadapter/commons/utils/RecyclerViewCacheUtil.java +++ b/library/src/main/java/com/mikepenz/fastadapter/commons/utils/RecyclerViewCacheUtil.java @@ -1,11 +1,10 @@ package com.mikepenz.fastadapter.commons.utils; import android.support.v7.widget.RecyclerView; +import android.util.SparseArray; import com.mikepenz.fastadapter.IItem; -import java.util.HashMap; -import java.util.Map; import java.util.Stack; /** @@ -35,28 +34,28 @@ public RecyclerViewCacheUtil withCacheSize(int cacheSize) { public void apply(RecyclerView recyclerView, Iterable items) { if (items != null) { //we pre-create the views for our cache - HashMap> cache = new HashMap<>(); + SparseArray> cache = new SparseArray<>(); for (Item d : items) { - if (!cache.containsKey(d.getType())) { + Stack holders = cache.get(d.getType()); + if (holders == null) { cache.put(d.getType(), new Stack()); - } - - if (mCacheSize == -1 || cache.get(d.getType()).size() <= mCacheSize) { - cache.get(d.getType()).push(d.getViewHolder(recyclerView)); + } else if (mCacheSize == -1 || holders.size() <= mCacheSize) { + holders.push(d.getViewHolder(recyclerView)); } RecyclerView.RecycledViewPool recyclerViewPool = new RecyclerView.RecycledViewPool(); //we fill the pool - for (Map.Entry> entry : cache.entrySet()) { - recyclerViewPool.setMaxRecycledViews(entry.getKey(), mCacheSize); - - for (RecyclerView.ViewHolder holder : entry.getValue()) { + for (int i = 0, length = cache.size(); i < length; i++) { + int key = cache.keyAt(i); + Stack entry = cache.get(key); + recyclerViewPool.setMaxRecycledViews(key, mCacheSize); + for (RecyclerView.ViewHolder holder : entry) { recyclerViewPool.putRecycledView(holder); } - //make sure to clear the stack - entry.getValue().clear(); + entry.clear(); + } //make sure to clear the cache From bf1651869a6510bfca4a5b1cde73b45b9e631816 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 13:37:25 +0100 Subject: [PATCH 16/57] * add benchmark tests --- library/build.gradle | 5 ++ .../fastadapter/FastAdapterBenchmark.java | 57 +++++++++++++++ .../fastadapter/TestDataGenerator.java | 38 ++++++++++ .../com/mikepenz/fastadapter/TestItem.java | 71 +++++++++++++++++++ .../resources/robolectric.properties | 3 + library/src/main/AndroidManifest.xml | 6 +- 6 files changed, 179 insertions(+), 1 deletion(-) create mode 100644 library/src/androidTest/java/com/mikepenz/fastadapter/FastAdapterBenchmark.java create mode 100644 library/src/androidTest/java/com/mikepenz/fastadapter/TestDataGenerator.java create mode 100644 library/src/androidTest/java/com/mikepenz/fastadapter/TestItem.java create mode 100644 library/src/androidTest/resources/robolectric.properties diff --git a/library/build.gradle b/library/build.gradle index 2b93717f6..b5ab6678e 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -49,6 +49,11 @@ dependencies { exclude group: "com.android.support", module: "support-annotations" exclude group: "com.android.support", module: "support-v4" } + androidTestCompile "com.android.support:support-annotations:${rootProject.ext.supportLibVersion}" + androidTestCompile 'com.android.support.test:runner:0.5' + androidTestCompile 'com.android.support.test:rules:0.5' + androidTestCompile 'junit:junit:4.12' + androidTestCompile 'dk.ilios:spanner:0.6.0' } tasks.withType(Test) { diff --git a/library/src/androidTest/java/com/mikepenz/fastadapter/FastAdapterBenchmark.java b/library/src/androidTest/java/com/mikepenz/fastadapter/FastAdapterBenchmark.java new file mode 100644 index 000000000..94731ca9c --- /dev/null +++ b/library/src/androidTest/java/com/mikepenz/fastadapter/FastAdapterBenchmark.java @@ -0,0 +1,57 @@ +package com.mikepenz.fastadapter; + +import android.support.test.InstrumentationRegistry; + +import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter; + +import org.junit.runner.RunWith; + +import java.io.File; + +import dk.ilios.spanner.AfterExperiment; +import dk.ilios.spanner.BeforeExperiment; +import dk.ilios.spanner.Benchmark; +import dk.ilios.spanner.BenchmarkConfiguration; +import dk.ilios.spanner.Param; +import dk.ilios.spanner.SpannerConfig; +import dk.ilios.spanner.config.RuntimeInstrumentConfig; +import dk.ilios.spanner.junit.SpannerRunner; + +/** + * Created by fabianterhorst on 19.12.16. + */ + +@RunWith(SpannerRunner.class) +public class FastAdapterBenchmark { + + private File filesDir = InstrumentationRegistry.getTargetContext().getFilesDir(); + private File resultsDir = new File(filesDir, "results"); + + @BenchmarkConfiguration + public SpannerConfig configuration = new SpannerConfig.Builder() + .saveResults(resultsDir, FastAdapterBenchmark.class.getCanonicalName() + ".json") // Save results to disk + .medianFailureLimit(Float.MAX_VALUE) // Fail if difference vs. baseline is to big. Should normally be 10-15% (0.15) + .addInstrument(RuntimeInstrumentConfig.defaultConfig()) // Configure how benchmark is run/measured + .build(); + + // Public test parameters (value chosen and injected by Experiment) + @Param(value = {"java.util.Date", "java.lang.Object"}) + public String value; + + private FastItemAdapter fastItemAdapter; + + @BeforeExperiment + public void before() { + fastItemAdapter = new FastItemAdapter<>(); + } + + @AfterExperiment + public void after() { + + } + + @Benchmark + public void addItems() { + fastItemAdapter.items().add(TestDataGenerator.genTestItem(100)); + } +} diff --git a/library/src/androidTest/java/com/mikepenz/fastadapter/TestDataGenerator.java b/library/src/androidTest/java/com/mikepenz/fastadapter/TestDataGenerator.java new file mode 100644 index 000000000..894903a0b --- /dev/null +++ b/library/src/androidTest/java/com/mikepenz/fastadapter/TestDataGenerator.java @@ -0,0 +1,38 @@ +package com.mikepenz.fastadapter; + +import android.support.annotation.NonNull; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by fabianterhorst on 29.03.16. + */ +public class TestDataGenerator { + public static List genTestItemList(int size) { + List list = new ArrayList<>(); + for (int i = 0; i < size; i++) { + TestItem testItem = genTestItem(i); + list.add(testItem); + } + return list; + } + + public static List genTestItemWithSubItemsList(int size, int levels) { + List list = new ArrayList<>(); + for (int i = 0; i < size; i++) { + TestItem testItem = genTestItem(i); + if (levels > 0) { + testItem.withSubItems(genTestItemWithSubItemsList(size, levels - 1)); + } + list.add(testItem); + } + return list; + } + + @NonNull + public static TestItem genTestItem(int i) { + TestItem testItem = new TestItem().withIdentifier(i); + return testItem; + } +} diff --git a/library/src/androidTest/java/com/mikepenz/fastadapter/TestItem.java b/library/src/androidTest/java/com/mikepenz/fastadapter/TestItem.java new file mode 100644 index 000000000..2aaf0cba7 --- /dev/null +++ b/library/src/androidTest/java/com/mikepenz/fastadapter/TestItem.java @@ -0,0 +1,71 @@ +package com.mikepenz.fastadapter; + +import android.support.v7.widget.RecyclerView; +import android.view.View; + +import com.mikepenz.fastadapter.items.AbstractItem; + +import java.util.List; + +/** + * Created by fabianterhorst on 29.03.16. + */ +public class TestItem extends AbstractItem implements IExpandable, ISubItem { + + private List mSubItems; + private TestItem mParent; + private boolean mExpanded = false; + + @Override + public int getLayoutRes() { + return -1; + } + + @Override + public int getType() { + return -1; + } + + @Override + public boolean isExpanded() { + return mExpanded; + } + + @Override + public TestItem withIsExpanded(boolean expanded) { + mExpanded = expanded; + return this; + } + + @Override + public List getSubItems() { + return mSubItems; + } + + @Override + public boolean isAutoExpanding() { + return true; + } + + public TestItem withSubItems(List subItems) { + this.mSubItems = subItems; + return this; + } + + @Override + public TestItem getParent() { + return mParent; + } + + @Override + public TestItem withParent(TestItem parent) { + this.mParent = parent; + return this; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + public ViewHolder(View view) { + super(view); + } + } +} diff --git a/library/src/androidTest/resources/robolectric.properties b/library/src/androidTest/resources/robolectric.properties new file mode 100644 index 000000000..3010fb610 --- /dev/null +++ b/library/src/androidTest/resources/robolectric.properties @@ -0,0 +1,3 @@ +constants=com.mikepenz.fastadapter.BuildConfig +packageName=com.mikepenz.fastadapter +sdk=21 diff --git a/library/src/main/AndroidManifest.xml b/library/src/main/AndroidManifest.xml index 4cc01b9b0..a40f39204 100644 --- a/library/src/main/AndroidManifest.xml +++ b/library/src/main/AndroidManifest.xml @@ -1,2 +1,6 @@ - + + + + From 0f507f214666a784a158176e7b26f0c1c28cce8b Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 13:49:16 +0100 Subject: [PATCH 17/57] * add benchmark to travis --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 33494066a..742b16917 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,9 @@ android: jdk: - oraclejdk8 -script: ./gradlew clean test +script: + - ./gradlew clean test + - ./gradlew connectedAndroidTest branches: except: From 6622fce3b7795e738a007e682f2fea9afc6b424c Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 13:54:04 +0100 Subject: [PATCH 18/57] * update gradle wrapper, build tools and support libs --- build.gradle | 6 +- gradle/wrapper/gradle-wrapper.jar | Bin 53637 -> 54224 bytes gradle/wrapper/gradle-wrapper.properties | 4 +- gradlew | 69 +++++++++++++---------- gradlew.bat | 14 ++--- 5 files changed, 49 insertions(+), 44 deletions(-) diff --git a/build.gradle b/build.gradle index 34ac3c91e..71e218e6e 100644 --- a/build.gradle +++ b/build.gradle @@ -15,8 +15,8 @@ buildscript { // project and then reference this from the modules ext { compileSdkVersion = 25 - buildToolsVersion = "25.0.0" - supportLibVersion = "25.0.1" + buildToolsVersion = "25.0.2" + supportLibVersion = "25.1.0" } allprojects { @@ -27,5 +27,5 @@ allprojects { } task wrapper(type: Wrapper) { - gradleVersion = '2.14.1' + gradleVersion = '3.2' } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 05ef575b0cd0173fc735f2857ce4bd594ce4f6bd..d6e2637affb74a80bfbe87bd2da57e81b2f3c661 100644 GIT binary patch delta 24305 zcmY(qV{j(G7A+c1Y}>Xb#>BR5+x}wPwr!ge+s+r;nk4h)ocrqDI#s=ES9f*)>aOm! z)?OW23_f2Dj;JUD4gm`S0u2o!Z)z`%L1M?E+-ud1c6y*QS68+Dt z3Sx-==4q<`lV6!o{?p(54hJ2F1_4Py0|B8pJW8)K9gHesK&u%5`U2?9s*+SB*;62`A zxX=N^UnqC`N8oRQf38<|jkp8sof^ z`_W4eggr4!apH(^kh0|7&L$+hxW>h~A;8Bb!nwdxKtL$-4hxf@5dDy^Dqoq+$;!Ww z)hWx%=OH$dYENX+w%+9_JCV)`S)~oA6FDbD66RoYvwW)v@9c`o6!5n69lzlRo+tXl zRF8S90M8EqgN1q8qDbXGf3Y#>(MfAsW$QOR=~_(gP(9+&DN8)zZ|qshT!>RG zkt^l1JS2algfRGpaj$TjRc+*~dX1^Vxz;^)@O!{zCRJ*8C6kF-6O~-XRaGoDH%$8p zdeK#yhCyXlxU>O^bC;{&s6W>pjJYc`T0_$}D92k*HI)1ki&0OH)TpYtu<5IAxbY{UyxFb-9-H{#_RaR<&TE%2= z^CYkVmTf1Ke;DyAL{?X_)e#-JI`k{vrpMzYl-oyY0#6P`~f_Wl)&sw zM4~mKwWlQ#DKn+3F`iCcvcgASsla{F`jlj)nMdKlR-B-}ZyXf|$IRPF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QXc~Xk@%w+49rUpjGhfRp`iitF1qOQi{T%1U3iEA$_?-} z5%>na5}ggt%QODJ!IS3T{4dCIcAs9JrT-1GvjFF8P88@&{P!&dzLH)XXSbA-B|zQJ zh?+M5rtz~5&a?zt{b>Q6@pGz>xou)GNZ0^RuD_Y!-@0%P8vyCX4xkNEoYOTCXLK@K zlr#}>4Q08lTwUmFOg;kVG}%jZ3I`x>R22o_VVE_Z*I(QCdaH4uM1Zw>V-V)-MG&g#K=DC5BF$U(d zG_G1rURwfzuAt_dmw+>1NjpX$DTL!6rEGzH#wlPt8AK4UT-cwZE}S|D(tkX1mcPviV5g7^xP>4*&uZx4nY8OEkU6M)F3}h` zlcdFgrj&uj(Q`9VMRnBnOX%X0kT79PQgmRu_Fuc4V}}0oHoif zkj?_qc`w<5mIEClQs?pPj-FAYs!-YRZ=(7q&(|=O32DL9*`K+4iSA#6$}`gtJt`*o zQL42~Fu%dz1!oDa0pHrXFUx-q%(p+t;e8N$xC2{CIFfx{g3y2lnxO% zAgC352nk&R?luFrMsK0CDK_99$bzQ(!H;#MFM$->P^SGy&hMjto~Iy)`4VvMEs!zJ OhfhidftbHLyYhc|0OAb* diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b8bbd65ec..7dfb98167 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Dec 19 11:34:07 CET 2016 +#Mon Dec 19 13:53:35 CET 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-3.2.1-bin.zip diff --git a/gradlew b/gradlew index 9d82f7891..4ef3a871f 100755 --- a/gradlew +++ b/gradlew @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh ############################################################################## ## @@ -6,12 +6,30 @@ ## ############################################################################## -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" @@ -30,6 +48,7 @@ die ( ) { cygwin=false msys=false darwin=false +nonstop=false case "`uname`" in CYGWIN* ) cygwin=true @@ -40,26 +59,11 @@ case "`uname`" in MINGW* ) msys=true ;; + NONSTOP* ) + nonstop=true + ;; esac -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -85,7 +89,7 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then @@ -150,11 +154,18 @@ if $cygwin ; then esac fi -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" +# Escape application args +for s in "${@}" ; do + s=\"$s\" + APP_ARGS=$APP_ARGS" "$s +done + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- "$DEFAULT_JVM_OPTS" "$JAVA_OPTS" "$GRADLE_OPTS" "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index aec99730b..e95643d6a 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -8,14 +8,14 @@ @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome @@ -46,10 +46,9 @@ echo location of your Java installation. goto fail :init -@rem Get command-line arguments, handling Windowz variants +@rem Get command-line arguments, handling Windows variants if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args :win9xME_args @rem Slurp the command line arguments. @@ -60,11 +59,6 @@ set _SKIP=2 if "x%~1" == "x" goto execute set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ :execute @rem Setup the command line From 5ecd176611ea1fe66c7b49bc4104fa0b362424d2 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 14:01:21 +0100 Subject: [PATCH 19/57] * update Realm --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 71e218e6e..83920ab99 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.0-beta1' classpath 'com.novoda:bintray-release:0.3.4' - classpath "io.realm:realm-gradle-plugin:1.1.0" + classpath "io.realm:realm-gradle-plugin:2.2.1" classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.6.2' } } From 68f8f22a2f01aae15b6ac1261f1289edf5f62f8f Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 14:01:51 +0100 Subject: [PATCH 20/57] * use travis android emulator --- .travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.travis.yml b/.travis.yml index 742b16917..a371c7b74 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,8 +20,16 @@ android: jdk: - oraclejdk8 +before_script: + - chmod +x .buildscript/deploy_snapshot.sh + - echo no | android create avd --force -n test -t android-21 --abi armeabi-v7a + - emulator -avd test -no-skin -no-audio -no-window & + - android-wait-for-emulator + - adb shell input keyevent 82 & + script: - ./gradlew clean test + - adb devices - ./gradlew connectedAndroidTest branches: From 530a7bed75f57af5942a20b3bc6d83602ecd57ec Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 14:10:30 +0100 Subject: [PATCH 21/57] * fix travis --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a371c7b74..b1de45b16 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,6 @@ jdk: - oraclejdk8 before_script: - - chmod +x .buildscript/deploy_snapshot.sh - echo no | android create avd --force -n test -t android-21 --abi armeabi-v7a - emulator -avd test -no-skin -no-audio -no-window & - android-wait-for-emulator From 26794856231798f9c370585a5a7f928714bdda25 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 14:21:28 +0100 Subject: [PATCH 22/57] * update travis build tools --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b1de45b16..7a8ea8389 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ android: - tools # The BuildTools version used by your project - - build-tools-25.0.0 + - build-tools-25.0.2 # The SDK version used to compile your project - android-25 From 6295e18cd61e673c6d4f53404e9900377f6de1a3 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 14:34:39 +0100 Subject: [PATCH 23/57] =?UTF-8?q?*=20realm=20config=20don=C2=B4t=20need=20?= =?UTF-8?q?a=20context=20anymore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mikepenz/fastadapter/app/CustomApplication.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/CustomApplication.java b/app/src/main/java/com/mikepenz/fastadapter/app/CustomApplication.java index bcbe33dad..537a0e91e 100644 --- a/app/src/main/java/com/mikepenz/fastadapter/app/CustomApplication.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/CustomApplication.java @@ -14,7 +14,7 @@ public class CustomApplication extends Application { public void onCreate() { super.onCreate(); // The Realm file will be located in Context.getFilesDir() with name "default.realm" - RealmConfiguration config = new RealmConfiguration.Builder(this).build(); + RealmConfiguration config = new RealmConfiguration.Builder().build(); Realm.setDefaultConfiguration(config); } } From 14a4b201b41569e94428d237b28a9442c6694d43 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 14:52:24 +0100 Subject: [PATCH 24/57] * increase heap size --- app/build.gradle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index 8e41e8aa1..f9c4b393f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,6 +11,10 @@ android { compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion + dexOptions { + javaMaxHeapSize "2g" + } + defaultConfig { minSdkVersion 14 targetSdkVersion 25 From 5522eaf72acdaf63643c2adcc591d699b126989e Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 14:55:10 +0100 Subject: [PATCH 25/57] * rebuild before benchmark --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 7a8ea8389..677e49d9a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,6 +28,7 @@ before_script: script: - ./gradlew clean test + - ./gradlew build --stacktrace - adb devices - ./gradlew connectedAndroidTest From ccbaed740902e13d0490557ad1b983385ed79239 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 14:57:30 +0100 Subject: [PATCH 26/57] * specify android test runner --- library/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/library/build.gradle b/library/build.gradle index b5ab6678e..bf84e02a8 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -9,6 +9,7 @@ android { targetSdkVersion 25 versionCode 210 versionName '2.1.0' + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { From 47c260fdd09c6ee99c1f3745d6e86ad6ac365cfc Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 16:37:42 +0100 Subject: [PATCH 27/57] * cleanup benchmark --- .../fastadapter/FastAdapterBenchmark.java | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/library/src/androidTest/java/com/mikepenz/fastadapter/FastAdapterBenchmark.java b/library/src/androidTest/java/com/mikepenz/fastadapter/FastAdapterBenchmark.java index 94731ca9c..c19e2f62a 100644 --- a/library/src/androidTest/java/com/mikepenz/fastadapter/FastAdapterBenchmark.java +++ b/library/src/androidTest/java/com/mikepenz/fastadapter/FastAdapterBenchmark.java @@ -1,20 +1,12 @@ package com.mikepenz.fastadapter; -import android.support.test.InstrumentationRegistry; - import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter; import org.junit.runner.RunWith; -import java.io.File; - import dk.ilios.spanner.AfterExperiment; import dk.ilios.spanner.BeforeExperiment; import dk.ilios.spanner.Benchmark; -import dk.ilios.spanner.BenchmarkConfiguration; -import dk.ilios.spanner.Param; -import dk.ilios.spanner.SpannerConfig; -import dk.ilios.spanner.config.RuntimeInstrumentConfig; import dk.ilios.spanner.junit.SpannerRunner; /** @@ -24,20 +16,6 @@ @RunWith(SpannerRunner.class) public class FastAdapterBenchmark { - private File filesDir = InstrumentationRegistry.getTargetContext().getFilesDir(); - private File resultsDir = new File(filesDir, "results"); - - @BenchmarkConfiguration - public SpannerConfig configuration = new SpannerConfig.Builder() - .saveResults(resultsDir, FastAdapterBenchmark.class.getCanonicalName() + ".json") // Save results to disk - .medianFailureLimit(Float.MAX_VALUE) // Fail if difference vs. baseline is to big. Should normally be 10-15% (0.15) - .addInstrument(RuntimeInstrumentConfig.defaultConfig()) // Configure how benchmark is run/measured - .build(); - - // Public test parameters (value chosen and injected by Experiment) - @Param(value = {"java.util.Date", "java.lang.Object"}) - public String value; - private FastItemAdapter fastItemAdapter; @BeforeExperiment @@ -52,6 +30,6 @@ public void after() { @Benchmark public void addItems() { - fastItemAdapter.items().add(TestDataGenerator.genTestItem(100)); + fastItemAdapter.items().setNewList(TestDataGenerator.genTestItemList(100)); } } From 97f11342e6376af440a082d6d67b1f0c892ac635 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 17:58:24 +0100 Subject: [PATCH 28/57] * init ItemFilter only when needed --- .../com/mikepenz/fastadapter/adapters/ItemAdapter.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/library-core/src/main/java/com/mikepenz/fastadapter/adapters/ItemAdapter.java b/library-core/src/main/java/com/mikepenz/fastadapter/adapters/ItemAdapter.java index 19ff00538..50d37062b 100644 --- a/library-core/src/main/java/com/mikepenz/fastadapter/adapters/ItemAdapter.java +++ b/library-core/src/main/java/com/mikepenz/fastadapter/adapters/ItemAdapter.java @@ -49,7 +49,7 @@ public boolean isUseIdDistributor() { } //filters the items - private Filter mItemFilter = new ItemFilter(); + private Filter mItemFilter; /** * allows you to define your own Filter implementation instead of the default `ItemFilter` @@ -66,6 +66,9 @@ public ItemAdapter withItemFilter(Filter itemFilter) { * @return the filter used to filter items */ public Filter getItemFilter() { + if (mItemFilter == null) { + mItemFilter = new ItemFilter(); + } return mItemFilter; } @@ -89,7 +92,7 @@ public ItemAdapter withFilterPredicate(Predicate filterPredicate) { * @param constraint the string used to filter the list */ public void filter(CharSequence constraint) { - mItemFilter.filter(constraint); + getItemFilter().filter(constraint); } /** From ceb3c07b36caa76978d7cdf24bbd472d35ccb2c3 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 19 Dec 2016 17:59:00 +0100 Subject: [PATCH 29/57] * improve benchmarks --- .../fastadapter/FastAdapterBenchmark.java | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/library/src/androidTest/java/com/mikepenz/fastadapter/FastAdapterBenchmark.java b/library/src/androidTest/java/com/mikepenz/fastadapter/FastAdapterBenchmark.java index c19e2f62a..9ee9357c6 100644 --- a/library/src/androidTest/java/com/mikepenz/fastadapter/FastAdapterBenchmark.java +++ b/library/src/androidTest/java/com/mikepenz/fastadapter/FastAdapterBenchmark.java @@ -1,12 +1,19 @@ package com.mikepenz.fastadapter; -import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter; +import android.support.test.InstrumentationRegistry; + +import com.mikepenz.fastadapter.adapters.ItemAdapter; import org.junit.runner.RunWith; +import java.io.File; + import dk.ilios.spanner.AfterExperiment; import dk.ilios.spanner.BeforeExperiment; import dk.ilios.spanner.Benchmark; +import dk.ilios.spanner.BenchmarkConfiguration; +import dk.ilios.spanner.SpannerConfig; +import dk.ilios.spanner.config.RuntimeInstrumentConfig; import dk.ilios.spanner.junit.SpannerRunner; /** @@ -16,11 +23,25 @@ @RunWith(SpannerRunner.class) public class FastAdapterBenchmark { - private FastItemAdapter fastItemAdapter; + private File filesDir = InstrumentationRegistry.getTargetContext().getFilesDir(); + private File resultsDir = new File(filesDir, "results"); + + @BenchmarkConfiguration + public SpannerConfig configuration = new SpannerConfig.Builder() + .saveResults(resultsDir, FastAdapterBenchmark.class.getCanonicalName() + ".json") // Save results to disk + .medianFailureLimit(Float.MAX_VALUE) // Fail if difference vs. baseline is to big. Should normally be 10-15% (0.15) + .addInstrument(RuntimeInstrumentConfig.defaultConfig()) // Configure how benchmark is run/measured + .maxBenchmarkThreads(1) + .build(); + + private ItemAdapter itemAdapter; + private FastAdapter fastAdapter; @BeforeExperiment public void before() { - fastItemAdapter = new FastItemAdapter<>(); + itemAdapter = new ItemAdapter<>(); + fastAdapter = new FastAdapter<>(); + itemAdapter.wrap(fastAdapter); } @AfterExperiment @@ -30,6 +51,6 @@ public void after() { @Benchmark public void addItems() { - fastItemAdapter.items().setNewList(TestDataGenerator.genTestItemList(100)); + itemAdapter.setNewList(TestDataGenerator.genTestItemList(1000)); } } From aafdee3ec29adad79ed854209529a3c2cb7ef77e Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Tue, 20 Dec 2016 10:48:05 +0100 Subject: [PATCH 30/57] * improve item id generation --- .../fastadapter/adapters/ItemAdapter.java | 51 ------------------ .../fastadapter/items/AbstractItem.java | 10 ++++ .../fastadapter/utils/IdDistributor.java | 54 ------------------- .../main/java/io/realm/RealmItemAdapter.java | 5 -- .../commons/utils/FastAdapterDiffUtil.java | 5 -- 5 files changed, 10 insertions(+), 115 deletions(-) delete mode 100644 library-core/src/main/java/com/mikepenz/fastadapter/utils/IdDistributor.java diff --git a/library-core/src/main/java/com/mikepenz/fastadapter/adapters/ItemAdapter.java b/library-core/src/main/java/com/mikepenz/fastadapter/adapters/ItemAdapter.java index 50d37062b..f9b7d9886 100644 --- a/library-core/src/main/java/com/mikepenz/fastadapter/adapters/ItemAdapter.java +++ b/library-core/src/main/java/com/mikepenz/fastadapter/adapters/ItemAdapter.java @@ -7,7 +7,6 @@ import com.mikepenz.fastadapter.IItem; import com.mikepenz.fastadapter.IItemAdapter; import com.mikepenz.fastadapter.ISubItem; -import com.mikepenz.fastadapter.utils.IdDistributor; import java.util.ArrayList; import java.util.Collections; @@ -27,27 +26,6 @@ public class ItemAdapter extends AbstractAdapter imple //the items handled and managed by this item private List mItems = new ArrayList<>(); - //defines if the IdDistributor is used to set ID's to all added items - private boolean mUseIdDistributor = true; - - /** - * defines if the IdDistributor is used to provide an ID to all added items which do not yet define an id - * - * @param useIdDistributor false if the IdDistributor shouldn't be used - * @return this - */ - public ItemAdapter withUseIdDistributor(boolean useIdDistributor) { - this.mUseIdDistributor = useIdDistributor; - return this; - } - - /** - * @return if we use the idDistributor with this adapter - */ - public boolean isUseIdDistributor() { - return mUseIdDistributor; - } - //filters the items private Filter mItemFilter; @@ -235,9 +213,6 @@ public Item getAdapterItem(int position) { * @return the item type of the collapsible */ public , S extends IItem & ISubItem> T setSubItems(T collapsible, List subItems) { - if (mUseIdDistributor) { - IdDistributor.checkIds(subItems); - } return collapsible.withSubItems(subItems); } @@ -249,10 +224,6 @@ public , S extends IItem & ISubItem * @param items the items to set */ public ItemAdapter set(List items) { - if (mUseIdDistributor) { - IdDistributor.checkIds(items); - } - //first collapse all items getFastAdapter().collapse(false); @@ -304,10 +275,6 @@ public ItemAdapter set(List items) { * @param items the new items to set */ public ItemAdapter setNewList(List items) { - if (mUseIdDistributor) { - IdDistributor.checkIds(items); - } - mItems = new ArrayList<>(items); mapPossibleTypes(mItems); @@ -344,9 +311,6 @@ public final ItemAdapter add(Item... items) { * @param items the items to add */ public ItemAdapter add(List items) { - if (mUseIdDistributor) { - IdDistributor.checkIds(items); - } int countBefore = mItems.size(); mItems.addAll(items); mapPossibleTypes(items); @@ -378,9 +342,6 @@ public final ItemAdapter add(int position, Item... items) { * @param items the items to add */ public ItemAdapter add(int position, List items) { - if (mUseIdDistributor) { - IdDistributor.checkIds(items); - } if (items != null && items.size() > 0) { mItems.addAll(position - getFastAdapter().getPreItemCountByOrder(getOrder()), items); mapPossibleTypes(items); @@ -397,9 +358,6 @@ public ItemAdapter add(int position, List items) { * @param item the item to set */ public ItemAdapter set(int position, Item item) { - if (mUseIdDistributor) { - IdDistributor.checkId(item); - } mItems.set(position - getFastAdapter().getPreItemCount(position), item); mapPossibleType(item); @@ -591,9 +549,6 @@ public final ItemAdapter add(Item... items) { */ public ItemAdapter add(List items) { if (mOriginalItems != null && items.size() > 0) { - if (mUseIdDistributor) { - IdDistributor.checkIds(items); - } mOriginalItems.addAll(items); performFiltering(mConstraint); return ItemAdapter.this; @@ -621,9 +576,6 @@ public final ItemAdapter add(int position, Item... items) { */ public ItemAdapter add(int position, List items) { if (mOriginalItems != null && items.size() > 0) { - if (mUseIdDistributor) { - IdDistributor.checkIds(items); - } mOriginalItems.addAll(position - getFastAdapter().getPreItemCountByOrder(getOrder()), items); performFiltering(mConstraint); return ItemAdapter.this; @@ -640,9 +592,6 @@ public ItemAdapter add(int position, List items) { */ public ItemAdapter set(int position, Item item) { if (mOriginalItems != null) { - if (mUseIdDistributor) { - IdDistributor.checkId(item); - } mOriginalItems.set(position - getFastAdapter().getPreItemCount(position), item); performFiltering(mConstraint); return ItemAdapter.this; diff --git a/library-core/src/main/java/com/mikepenz/fastadapter/items/AbstractItem.java b/library-core/src/main/java/com/mikepenz/fastadapter/items/AbstractItem.java index 59e3b5a0e..8a761bcec 100644 --- a/library-core/src/main/java/com/mikepenz/fastadapter/items/AbstractItem.java +++ b/library-core/src/main/java/com/mikepenz/fastadapter/items/AbstractItem.java @@ -25,6 +25,16 @@ public abstract class AbstractItem List checkIds(@NonNull List items) { - for (int i = 0, size = items.size(); i < size; i++) { - checkId(items.get(i)); - } - return items; - } - - /** - * set an unique identifier for all items which do not have one set already - * - * @param items - * @return - */ - public static T[] checkIds(@NonNull T... items) { - for (T item : items) { - checkId(item); - } - return items; - } - - /** - * set an unique identifier for the item which do not have one set already - * - * @param item - * @return - */ - public static T checkId(@NonNull T item) { - if (item.getIdentifier() == -1) { - item.withIdentifier(idDistributor.incrementAndGet()); - } - return item; - } -} diff --git a/library-extensions-realm/src/main/java/io/realm/RealmItemAdapter.java b/library-extensions-realm/src/main/java/io/realm/RealmItemAdapter.java index 6df825a53..fdcbbab4e 100644 --- a/library-extensions-realm/src/main/java/io/realm/RealmItemAdapter.java +++ b/library-extensions-realm/src/main/java/io/realm/RealmItemAdapter.java @@ -24,7 +24,6 @@ import com.mikepenz.fastadapter.IItem; import com.mikepenz.fastadapter.ISubItem; import com.mikepenz.fastadapter.adapters.ItemAdapter; -import com.mikepenz.fastadapter.utils.IdDistributor; import java.util.Iterator; import java.util.List; @@ -63,10 +62,6 @@ public RealmItemAdapter(@Nullable OrderedRealmCollection data, boolean aut public void onChange(Object results) { if (results instanceof List) { List items = (List) results; - - if (isUseIdDistributor()) { - IdDistributor.checkIds(items); - } mapPossibleTypes(items); if (hasAutoUpdates || notified < 1) { diff --git a/library/src/main/java/com/mikepenz/fastadapter/commons/utils/FastAdapterDiffUtil.java b/library/src/main/java/com/mikepenz/fastadapter/commons/utils/FastAdapterDiffUtil.java index 0d5c75b47..0d6a9de19 100644 --- a/library/src/main/java/com/mikepenz/fastadapter/commons/utils/FastAdapterDiffUtil.java +++ b/library/src/main/java/com/mikepenz/fastadapter/commons/utils/FastAdapterDiffUtil.java @@ -6,7 +6,6 @@ import com.mikepenz.fastadapter.IItem; import com.mikepenz.fastadapter.adapters.ItemAdapter; -import com.mikepenz.fastadapter.utils.IdDistributor; import java.util.Collections; import java.util.List; @@ -17,10 +16,6 @@ public class FastAdapterDiffUtil { public static , Item extends IItem> A set(final A adapter, final List items, final DiffCallback callback, final boolean detectMoves) { - if (adapter.isUseIdDistributor()) { - IdDistributor.checkIds(items); - } - //first collapse all items adapter.getFastAdapter().collapse(false); From 8138af0b8b7ffc5c048c27899ab2934cf94b9bb8 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Tue, 20 Dec 2016 10:52:41 +0100 Subject: [PATCH 31/57] * update benchmarks --- .../fastadapter/FastAdapterBenchmark.java | 29 +++++++++++++++++-- .../fastadapter/TestDataGenerator.java | 17 ++++++++++- .../com/mikepenz/fastadapter/TestItem.java | 7 +++++ 3 files changed, 50 insertions(+), 3 deletions(-) diff --git a/library/src/androidTest/java/com/mikepenz/fastadapter/FastAdapterBenchmark.java b/library/src/androidTest/java/com/mikepenz/fastadapter/FastAdapterBenchmark.java index 9ee9357c6..d11e322ff 100644 --- a/library/src/androidTest/java/com/mikepenz/fastadapter/FastAdapterBenchmark.java +++ b/library/src/androidTest/java/com/mikepenz/fastadapter/FastAdapterBenchmark.java @@ -7,6 +7,7 @@ import org.junit.runner.RunWith; import java.io.File; +import java.util.List; import dk.ilios.spanner.AfterExperiment; import dk.ilios.spanner.BeforeExperiment; @@ -36,12 +37,16 @@ public class FastAdapterBenchmark { private ItemAdapter itemAdapter; private FastAdapter fastAdapter; + private List items; + private List noIdItems; @BeforeExperiment public void before() { itemAdapter = new ItemAdapter<>(); fastAdapter = new FastAdapter<>(); itemAdapter.wrap(fastAdapter); + items = TestDataGenerator.genTestItemList(1000); + noIdItems = TestDataGenerator.genNoIdTestItemList(1000); } @AfterExperiment @@ -50,7 +55,27 @@ public void after() { } @Benchmark - public void addItems() { - itemAdapter.setNewList(TestDataGenerator.genTestItemList(1000)); + public void generateNoIdTestItemList() { + TestDataGenerator.genNoIdTestItemList(1000); + } + + @Benchmark + public void generateItems() { + TestDataGenerator.genTestItemList(1000); + } + + @Benchmark + public void setNewList() { + itemAdapter.setNewList(items); + } + + @Benchmark + public void add() { + itemAdapter.add(items); + } + + @Benchmark + public void set() { + itemAdapter.set(items); } } diff --git a/library/src/androidTest/java/com/mikepenz/fastadapter/TestDataGenerator.java b/library/src/androidTest/java/com/mikepenz/fastadapter/TestDataGenerator.java index 894903a0b..cb0f5f73e 100644 --- a/library/src/androidTest/java/com/mikepenz/fastadapter/TestDataGenerator.java +++ b/library/src/androidTest/java/com/mikepenz/fastadapter/TestDataGenerator.java @@ -18,6 +18,15 @@ public static List genTestItemList(int size) { return list; } + public static List genNoIdTestItemList(int size) { + List list = new ArrayList<>(); + for (int i = 0; i < size; i++) { + TestItem testItem = genTestItem(); + list.add(testItem); + } + return list; + } + public static List genTestItemWithSubItemsList(int size, int levels) { List list = new ArrayList<>(); for (int i = 0; i < size; i++) { @@ -32,7 +41,13 @@ public static List genTestItemWithSubItemsList(int size, int levels) { @NonNull public static TestItem genTestItem(int i) { - TestItem testItem = new TestItem().withIdentifier(i); + TestItem testItem = new TestItem(i); + return testItem; + } + + @NonNull + public static TestItem genTestItem() { + TestItem testItem = new TestItem(); return testItem; } } diff --git a/library/src/androidTest/java/com/mikepenz/fastadapter/TestItem.java b/library/src/androidTest/java/com/mikepenz/fastadapter/TestItem.java index 2aaf0cba7..e05b26b3d 100644 --- a/library/src/androidTest/java/com/mikepenz/fastadapter/TestItem.java +++ b/library/src/androidTest/java/com/mikepenz/fastadapter/TestItem.java @@ -16,6 +16,13 @@ public class TestItem extends AbstractItem implem private TestItem mParent; private boolean mExpanded = false; + public TestItem() { + } + + public TestItem(long identifier) { + super(identifier); + } + @Override public int getLayoutRes() { return -1; From 51e4bcff8f7974b0dc3c69eb2aa0ffb10c94231e Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Tue, 20 Dec 2016 10:59:52 +0100 Subject: [PATCH 32/57] =?UTF-8?q?*=20real=20id=20generation=20to=20support?= =?UTF-8?q?=20items=20that=20doesn't=C2=B4t=20extend=20AbstractItem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fastadapter/adapters/ItemAdapter.java | 48 +++++++++++++++++ .../fastadapter/utils/IdDistributor.java | 54 +++++++++++++++++++ .../main/java/io/realm/RealmItemAdapter.java | 5 ++ .../commons/utils/FastAdapterDiffUtil.java | 5 ++ 4 files changed, 112 insertions(+) create mode 100644 library-core/src/main/java/com/mikepenz/fastadapter/utils/IdDistributor.java diff --git a/library-core/src/main/java/com/mikepenz/fastadapter/adapters/ItemAdapter.java b/library-core/src/main/java/com/mikepenz/fastadapter/adapters/ItemAdapter.java index f9b7d9886..6a46f8b01 100644 --- a/library-core/src/main/java/com/mikepenz/fastadapter/adapters/ItemAdapter.java +++ b/library-core/src/main/java/com/mikepenz/fastadapter/adapters/ItemAdapter.java @@ -7,6 +7,7 @@ import com.mikepenz.fastadapter.IItem; import com.mikepenz.fastadapter.IItemAdapter; import com.mikepenz.fastadapter.ISubItem; +import com.mikepenz.fastadapter.utils.IdDistributor; import java.util.ArrayList; import java.util.Collections; @@ -26,6 +27,27 @@ public class ItemAdapter extends AbstractAdapter imple //the items handled and managed by this item private List mItems = new ArrayList<>(); + //defines if the IdDistributor is used to set ID's to all added items + private boolean mUseIdDistributor = false; + + /** + * defines if the IdDistributor is used to provide an ID to all added items which do not yet define an id + * + * @param useIdDistributor false if the IdDistributor shouldn't be used + * @return this + */ + public ItemAdapter withUseIdDistributor(boolean useIdDistributor) { + this.mUseIdDistributor = useIdDistributor; + return this; + } + + /** + * @return if we use the idDistributor with this adapter + */ + public boolean isUseIdDistributor() { + return mUseIdDistributor; + } + //filters the items private Filter mItemFilter; @@ -224,6 +246,10 @@ public , S extends IItem & ISubItem * @param items the items to set */ public ItemAdapter set(List items) { + if (mUseIdDistributor) { + IdDistributor.checkIds(items); + } + //first collapse all items getFastAdapter().collapse(false); @@ -275,6 +301,10 @@ public ItemAdapter set(List items) { * @param items the new items to set */ public ItemAdapter setNewList(List items) { + if (mUseIdDistributor) { + IdDistributor.checkIds(items); + } + mItems = new ArrayList<>(items); mapPossibleTypes(mItems); @@ -311,6 +341,9 @@ public final ItemAdapter add(Item... items) { * @param items the items to add */ public ItemAdapter add(List items) { + if (mUseIdDistributor) { + IdDistributor.checkIds(items); + } int countBefore = mItems.size(); mItems.addAll(items); mapPossibleTypes(items); @@ -342,6 +375,9 @@ public final ItemAdapter add(int position, Item... items) { * @param items the items to add */ public ItemAdapter add(int position, List items) { + if (mUseIdDistributor) { + IdDistributor.checkIds(items); + } if (items != null && items.size() > 0) { mItems.addAll(position - getFastAdapter().getPreItemCountByOrder(getOrder()), items); mapPossibleTypes(items); @@ -358,6 +394,9 @@ public ItemAdapter add(int position, List items) { * @param item the item to set */ public ItemAdapter set(int position, Item item) { + if (mUseIdDistributor) { + IdDistributor.checkId(item); + } mItems.set(position - getFastAdapter().getPreItemCount(position), item); mapPossibleType(item); @@ -549,6 +588,9 @@ public final ItemAdapter add(Item... items) { */ public ItemAdapter add(List items) { if (mOriginalItems != null && items.size() > 0) { + if (mUseIdDistributor) { + IdDistributor.checkIds(items); + } mOriginalItems.addAll(items); performFiltering(mConstraint); return ItemAdapter.this; @@ -576,6 +618,9 @@ public final ItemAdapter add(int position, Item... items) { */ public ItemAdapter add(int position, List items) { if (mOriginalItems != null && items.size() > 0) { + if (mUseIdDistributor) { + IdDistributor.checkIds(items); + } mOriginalItems.addAll(position - getFastAdapter().getPreItemCountByOrder(getOrder()), items); performFiltering(mConstraint); return ItemAdapter.this; @@ -592,6 +637,9 @@ public ItemAdapter add(int position, List items) { */ public ItemAdapter set(int position, Item item) { if (mOriginalItems != null) { + if (mUseIdDistributor) { + IdDistributor.checkId(item); + } mOriginalItems.set(position - getFastAdapter().getPreItemCount(position), item); performFiltering(mConstraint); return ItemAdapter.this; diff --git a/library-core/src/main/java/com/mikepenz/fastadapter/utils/IdDistributor.java b/library-core/src/main/java/com/mikepenz/fastadapter/utils/IdDistributor.java new file mode 100644 index 000000000..6414a71b6 --- /dev/null +++ b/library-core/src/main/java/com/mikepenz/fastadapter/utils/IdDistributor.java @@ -0,0 +1,54 @@ +package com.mikepenz.fastadapter.utils; + +import android.support.annotation.NonNull; + +import com.mikepenz.fastadapter.IIdentifyable; + +import java.util.List; +import java.util.concurrent.atomic.AtomicLong; + +/** + * Created by mikepenz on 19.09.15. + */ +public class IdDistributor { + private static final AtomicLong idDistributor = new AtomicLong(9000000000000000000L); + + /** + * set an unique identifier for all items which do not have one set already + * + * @param items + * @return + */ + public static List checkIds(@NonNull List items) { + for (int i = 0, size = items.size(); i < size; i++) { + checkId(items.get(i)); + } + return items; + } + + /** + * set an unique identifier for all items which do not have one set already + * + * @param items + * @return + */ + public static T[] checkIds(@NonNull T... items) { + for (T item : items) { + checkId(item); + } + return items; + } + + /** + * set an unique identifier for the item which do not have one set already + * + * @param item + * @return + */ + public static T checkId(@NonNull T item) { + if (item.getIdentifier() == -1) { + item.withIdentifier(idDistributor.incrementAndGet()); + } + return item; + } +} diff --git a/library-extensions-realm/src/main/java/io/realm/RealmItemAdapter.java b/library-extensions-realm/src/main/java/io/realm/RealmItemAdapter.java index fdcbbab4e..6df825a53 100644 --- a/library-extensions-realm/src/main/java/io/realm/RealmItemAdapter.java +++ b/library-extensions-realm/src/main/java/io/realm/RealmItemAdapter.java @@ -24,6 +24,7 @@ import com.mikepenz.fastadapter.IItem; import com.mikepenz.fastadapter.ISubItem; import com.mikepenz.fastadapter.adapters.ItemAdapter; +import com.mikepenz.fastadapter.utils.IdDistributor; import java.util.Iterator; import java.util.List; @@ -62,6 +63,10 @@ public RealmItemAdapter(@Nullable OrderedRealmCollection data, boolean aut public void onChange(Object results) { if (results instanceof List) { List items = (List) results; + + if (isUseIdDistributor()) { + IdDistributor.checkIds(items); + } mapPossibleTypes(items); if (hasAutoUpdates || notified < 1) { diff --git a/library/src/main/java/com/mikepenz/fastadapter/commons/utils/FastAdapterDiffUtil.java b/library/src/main/java/com/mikepenz/fastadapter/commons/utils/FastAdapterDiffUtil.java index 0d6a9de19..0d5c75b47 100644 --- a/library/src/main/java/com/mikepenz/fastadapter/commons/utils/FastAdapterDiffUtil.java +++ b/library/src/main/java/com/mikepenz/fastadapter/commons/utils/FastAdapterDiffUtil.java @@ -6,6 +6,7 @@ import com.mikepenz.fastadapter.IItem; import com.mikepenz.fastadapter.adapters.ItemAdapter; +import com.mikepenz.fastadapter.utils.IdDistributor; import java.util.Collections; import java.util.List; @@ -16,6 +17,10 @@ public class FastAdapterDiffUtil { public static , Item extends IItem> A set(final A adapter, final List items, final DiffCallback callback, final boolean detectMoves) { + if (adapter.isUseIdDistributor()) { + IdDistributor.checkIds(items); + } + //first collapse all items adapter.getFastAdapter().collapse(false); From badadf251233953db07e5f800abda29068ccca71 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Tue, 20 Dec 2016 11:02:33 +0100 Subject: [PATCH 33/57] * abstract item identifier should be private --- .../main/java/com/mikepenz/fastadapter/items/AbstractItem.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library-core/src/main/java/com/mikepenz/fastadapter/items/AbstractItem.java b/library-core/src/main/java/com/mikepenz/fastadapter/items/AbstractItem.java index 8a761bcec..86c72dc87 100644 --- a/library-core/src/main/java/com/mikepenz/fastadapter/items/AbstractItem.java +++ b/library-core/src/main/java/com/mikepenz/fastadapter/items/AbstractItem.java @@ -23,7 +23,7 @@ */ public abstract class AbstractItem implements IItem, IClickable { // the identifier for this item - protected long mIdentifier = -1; + private long mIdentifier = -1; private static long currentIdentifier = 0; From c86185530debe79a884b754de5869b8f265f0fdf Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Tue, 20 Dec 2016 11:05:21 +0100 Subject: [PATCH 34/57] * remove deprecated setModel in GenericAbstractItem --- .../com/mikepenz/fastadapter/items/GenericAbstractItem.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/library-core/src/main/java/com/mikepenz/fastadapter/items/GenericAbstractItem.java b/library-core/src/main/java/com/mikepenz/fastadapter/items/GenericAbstractItem.java index 39b8cb7e0..cc435b372 100644 --- a/library-core/src/main/java/com/mikepenz/fastadapter/items/GenericAbstractItem.java +++ b/library-core/src/main/java/com/mikepenz/fastadapter/items/GenericAbstractItem.java @@ -21,11 +21,6 @@ public Model getModel() { return mModel; } - @Deprecated - public GenericAbstractItem setModel(Model model) { - return withModel(model); - } - public GenericAbstractItem withModel(Model model) { this.mModel = model; return this; From 7859e33b83cb6e98c85760905f4425ad4c906eb5 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Tue, 20 Dec 2016 11:11:50 +0100 Subject: [PATCH 35/57] * improve drag drop util --- .../mikepenz/fastadapter_extensions/utilities/DragDropUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/utilities/DragDropUtil.java b/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/utilities/DragDropUtil.java index a039a988e..1c3717bfe 100644 --- a/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/utilities/DragDropUtil.java +++ b/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/utilities/DragDropUtil.java @@ -19,7 +19,7 @@ public class DragDropUtil * @param holder the view holder * @param holder the item */ - public static void bindDragHandle(final RecyclerView.ViewHolder holder, final IExtendedDraggable item) { + public static void bindDragHandle(final VH holder, final IExtendedDraggable item) { // if necessary, init the drag handle, which will start the drag when touched if (item.getTouchHelper() != null && item.getDragView(holder) != null) { item.getDragView(holder).setOnTouchListener(new View.OnTouchListener() { From 6a3f0f6577bd8db5e4693211aa0641abb343f9c3 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Thu, 22 Dec 2016 10:24:22 +0100 Subject: [PATCH 36/57] * add test cases for issues --- .../java/com/mikepenz/fastadapter/Issues.java | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 library/src/test/java/com/mikepenz/fastadapter/Issues.java diff --git a/library/src/test/java/com/mikepenz/fastadapter/Issues.java b/library/src/test/java/com/mikepenz/fastadapter/Issues.java new file mode 100644 index 000000000..225baf4c7 --- /dev/null +++ b/library/src/test/java/com/mikepenz/fastadapter/Issues.java @@ -0,0 +1,34 @@ +package com.mikepenz.fastadapter; + +import com.mikepenz.fastadapter.adapters.FooterAdapter; +import com.mikepenz.fastadapter.adapters.HeaderAdapter; +import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.robolectric.RobolectricTestRunner; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Created by fabianterhorst on 22.12.16. + */ + +@RunWith(RobolectricTestRunner.class) +public class Issues { + + @Test + public void test298() { + HeaderAdapter headerAdapter = new HeaderAdapter<>(); + FastItemAdapter fastItemAdapter = new FastItemAdapter<>(); + FooterAdapter footerAdapter = new FooterAdapter<>(); + headerAdapter.wrap(footerAdapter.wrap(fastItemAdapter.items())); + fastItemAdapter.items().add(new TestItem()); + fastItemAdapter.items().add(new TestItem()); + fastItemAdapter.items().add(new TestItem()); + int countBefore = fastItemAdapter.items().getAdapterItemCount(); + fastItemAdapter.items().getAdapterItems().add(new TestItem()); + int position = fastItemAdapter.getPreItemCountByOrder(fastItemAdapter.items().getOrder()) + countBefore; + assertThat(position).isEqualTo(3); + } +} From acb450fa3d34b5dc0aa618b3180a1c5b6105d9d6 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Thu, 22 Dec 2016 10:28:21 +0100 Subject: [PATCH 37/57] * reproduce #298 --- .../java/com/mikepenz/fastadapter/Issues.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/library/src/test/java/com/mikepenz/fastadapter/Issues.java b/library/src/test/java/com/mikepenz/fastadapter/Issues.java index 225baf4c7..0314f2325 100644 --- a/library/src/test/java/com/mikepenz/fastadapter/Issues.java +++ b/library/src/test/java/com/mikepenz/fastadapter/Issues.java @@ -31,4 +31,21 @@ public void test298() { int position = fastItemAdapter.getPreItemCountByOrder(fastItemAdapter.items().getOrder()) + countBefore; assertThat(position).isEqualTo(3); } + + @Test + public void reproduce298() { + HeaderAdapter headerAdapter = new HeaderAdapter<>(); + FastItemAdapter fastItemAdapter = new FastItemAdapter<>(); + FooterAdapter footerAdapter = new FooterAdapter<>(); + headerAdapter.wrap(footerAdapter.wrap(fastItemAdapter.items())); + footerAdapter.add(new TestItem()); + fastItemAdapter.items().add(new TestItem()); + fastItemAdapter.items().add(new TestItem()); + fastItemAdapter.items().add(new TestItem()); + headerAdapter.add(new TestItem()); + int countBefore = fastItemAdapter.items().getAdapterItemCount(); + fastItemAdapter.items().getAdapterItems().add(new TestItem()); + int position = fastItemAdapter.getPreItemCountByOrder(fastItemAdapter.items().getOrder()) + countBefore; + assertThat(position).isNotEqualTo(5); + } } From 71e4c72adf79565ea19933d0cbdb9c89c9b4fa5a Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Thu, 22 Dec 2016 10:42:03 +0100 Subject: [PATCH 38/57] * add wrap size test --- .../mikepenz/fastadapter/FastAdapterTest.java | 17 +++++++++ .../java/com/mikepenz/fastadapter/Issues.java | 38 ------------------- 2 files changed, 17 insertions(+), 38 deletions(-) diff --git a/library/src/test/java/com/mikepenz/fastadapter/FastAdapterTest.java b/library/src/test/java/com/mikepenz/fastadapter/FastAdapterTest.java index 4a6506b16..a19387e2a 100644 --- a/library/src/test/java/com/mikepenz/fastadapter/FastAdapterTest.java +++ b/library/src/test/java/com/mikepenz/fastadapter/FastAdapterTest.java @@ -2,7 +2,10 @@ import android.support.v7.widget.RecyclerView; +import com.mikepenz.fastadapter.adapters.FooterAdapter; +import com.mikepenz.fastadapter.adapters.HeaderAdapter; import com.mikepenz.fastadapter.adapters.ItemAdapter; +import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter; import org.junit.Before; import org.junit.Test; @@ -192,4 +195,18 @@ public void withBindViewHolderListener_OnBindViewHolder_Callback() throws Except verify(listener, only()).onBindViewHolder(holder, 10, new ArrayList()); } + + @Test + public void wrapSize() { + HeaderAdapter headerAdapter = new HeaderAdapter<>(); + FastItemAdapter fastItemAdapter = new FastItemAdapter<>(); + FooterAdapter footerAdapter = new FooterAdapter<>(); + headerAdapter.wrap(footerAdapter.wrap(fastItemAdapter.items())); + headerAdapter.add(new TestItem()); + fastItemAdapter.items().add(new TestItem()); + fastItemAdapter.items().add(new TestItem()); + fastItemAdapter.items().add(new TestItem()); + footerAdapter.add(new TestItem()); + assertThat(fastItemAdapter.getItemCount()).isEqualTo(5); + } } diff --git a/library/src/test/java/com/mikepenz/fastadapter/Issues.java b/library/src/test/java/com/mikepenz/fastadapter/Issues.java index 0314f2325..9a305d238 100644 --- a/library/src/test/java/com/mikepenz/fastadapter/Issues.java +++ b/library/src/test/java/com/mikepenz/fastadapter/Issues.java @@ -1,15 +1,8 @@ package com.mikepenz.fastadapter; -import com.mikepenz.fastadapter.adapters.FooterAdapter; -import com.mikepenz.fastadapter.adapters.HeaderAdapter; -import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter; - -import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; -import static org.assertj.core.api.Assertions.assertThat; - /** * Created by fabianterhorst on 22.12.16. */ @@ -17,35 +10,4 @@ @RunWith(RobolectricTestRunner.class) public class Issues { - @Test - public void test298() { - HeaderAdapter headerAdapter = new HeaderAdapter<>(); - FastItemAdapter fastItemAdapter = new FastItemAdapter<>(); - FooterAdapter footerAdapter = new FooterAdapter<>(); - headerAdapter.wrap(footerAdapter.wrap(fastItemAdapter.items())); - fastItemAdapter.items().add(new TestItem()); - fastItemAdapter.items().add(new TestItem()); - fastItemAdapter.items().add(new TestItem()); - int countBefore = fastItemAdapter.items().getAdapterItemCount(); - fastItemAdapter.items().getAdapterItems().add(new TestItem()); - int position = fastItemAdapter.getPreItemCountByOrder(fastItemAdapter.items().getOrder()) + countBefore; - assertThat(position).isEqualTo(3); - } - - @Test - public void reproduce298() { - HeaderAdapter headerAdapter = new HeaderAdapter<>(); - FastItemAdapter fastItemAdapter = new FastItemAdapter<>(); - FooterAdapter footerAdapter = new FooterAdapter<>(); - headerAdapter.wrap(footerAdapter.wrap(fastItemAdapter.items())); - footerAdapter.add(new TestItem()); - fastItemAdapter.items().add(new TestItem()); - fastItemAdapter.items().add(new TestItem()); - fastItemAdapter.items().add(new TestItem()); - headerAdapter.add(new TestItem()); - int countBefore = fastItemAdapter.items().getAdapterItemCount(); - fastItemAdapter.items().getAdapterItems().add(new TestItem()); - int position = fastItemAdapter.getPreItemCountByOrder(fastItemAdapter.items().getOrder()) + countBefore; - assertThat(position).isNotEqualTo(5); - } } From 3d0551cb0415407951b453523178b1f3c7f19e0a Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Wed, 28 Dec 2016 09:50:14 +0100 Subject: [PATCH 39/57] * Add nullable support in GenericItemAdapter Function --- .../fastadapter/adapters/GenericItemAdapter.java | 14 ++++++++++++-- .../com/mikepenz/fastadapter/utils/Function.java | 3 +++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/library-core/src/main/java/com/mikepenz/fastadapter/adapters/GenericItemAdapter.java b/library-core/src/main/java/com/mikepenz/fastadapter/adapters/GenericItemAdapter.java index 1da7127db..ed2bb2970 100644 --- a/library-core/src/main/java/com/mikepenz/fastadapter/adapters/GenericItemAdapter.java +++ b/library-core/src/main/java/com/mikepenz/fastadapter/adapters/GenericItemAdapter.java @@ -1,5 +1,7 @@ package com.mikepenz.fastadapter.adapters; +import android.support.annotation.Nullable; + import com.mikepenz.fastadapter.IGenericItem; import com.mikepenz.fastadapter.utils.Function; @@ -118,7 +120,10 @@ public GenericItemAdapter addModel(int position, List models * @param model the set model */ public GenericItemAdapter setModel(int position, Model model) { - super.set(position, toItem(model)); + Item item = toItem(model); + if (item != null) { + super.set(position, item); + } return this; } @@ -177,8 +182,12 @@ private List toItems(List models) { int size = models.size(); List items = new ArrayList<>(size); + Item item; for (int i = 0; i < size; i++) { - items.add(toItem(models.get(i))); + item = toItem(models.get(i)); + if (item != null) { + items.add(item); + } } return items; } @@ -189,6 +198,7 @@ private List toItems(List models) { * @param model the model class we want to wrap into a typedItem * @return our typedItem */ + @Nullable private Item toItem(Model model) { return mItemFactory.apply(model); } diff --git a/library-core/src/main/java/com/mikepenz/fastadapter/utils/Function.java b/library-core/src/main/java/com/mikepenz/fastadapter/utils/Function.java index 89feddddb..0a9053d86 100644 --- a/library-core/src/main/java/com/mikepenz/fastadapter/utils/Function.java +++ b/library-core/src/main/java/com/mikepenz/fastadapter/utils/Function.java @@ -1,10 +1,13 @@ package com.mikepenz.fastadapter.utils; +import android.support.annotation.Nullable; + /** * Created by Ahmed Ragab on 24/01/16. */ public interface Function { + @Nullable Output apply(Input input); } From 9894cf973a08bfc69c22c0387e62e95e20a743a7 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Wed, 28 Dec 2016 09:51:49 +0100 Subject: [PATCH 40/57] =?UTF-8?q?*=20issues=20aren=C2=B4t=20used=20current?= =?UTF-8?q?ly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/src/test/java/com/mikepenz/fastadapter/Issues.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/library/src/test/java/com/mikepenz/fastadapter/Issues.java b/library/src/test/java/com/mikepenz/fastadapter/Issues.java index 9a305d238..fe2980203 100644 --- a/library/src/test/java/com/mikepenz/fastadapter/Issues.java +++ b/library/src/test/java/com/mikepenz/fastadapter/Issues.java @@ -1,13 +1,10 @@ package com.mikepenz.fastadapter; -import org.junit.runner.RunWith; -import org.robolectric.RobolectricTestRunner; - /** * Created by fabianterhorst on 22.12.16. */ -@RunWith(RobolectricTestRunner.class) +//@RunWith(RobolectricTestRunner.class) public class Issues { } From b5aaec84484c4187237e103ac38d6cdebb521703 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Wed, 11 Jan 2017 12:54:32 +0100 Subject: [PATCH 41/57] * update gradle and android build tools plugin --- build.gradle | 4 ++-- gradle/wrapper/gradle-wrapper.jar | Bin 54224 -> 54208 bytes gradle/wrapper/gradle-wrapper.properties | 4 ++-- gradlew | 11 ++++++----- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index 83920ab99..42029fe82 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.3.0-beta1' + classpath 'com.android.tools.build:gradle:2.3.0-beta2' classpath 'com.novoda:bintray-release:0.3.4' classpath "io.realm:realm-gradle-plugin:2.2.1" classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.6.2' @@ -27,5 +27,5 @@ allprojects { } task wrapper(type: Wrapper) { - gradleVersion = '3.2' + gradleVersion = '3.3' } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index d6e2637affb74a80bfbe87bd2da57e81b2f3c661..a94d0287f0738701f73c55df98c63b598a968914 100644 GIT binary patch delta 4749 zcmZ`*2{@G78~>PWlM%9vF_vtF22t5Uk`k#ziPG4@;L3893KNwsLVU^+Dk|M%Uy?01 z`@SVg)@~9h%fFk1{^y&}_i^ueo-@z)&Ut^ocRA-h=WR{Jm8ask4jJLr@IeqeJB0U@ zG>qgD;4q)!3sg#oDie}!8Vorusg2={kWH~qmaM0 zMf>ZqFB{y3j;d$CJEb=kLfw$Z3_7XQ*edi$$|uO3Mdd`r#M;7-1l2}&U7s?mSCg`zUZ^aDe;z#7|Mgp6XaB<2 z8XYFJ5b6gX@_jB}Ucnbi>4Wr8jUk@{71zS044tP-EK6I%1v}@Yy{Do`3XcX)Z97JC z=rK9k5E6dUAn}0$E!L%`BwWPMm(5iqCi{*XS>#CJ_(XK6rDoY14l!>LCXzEQ=O-Utc-Zs7^6A3%1lR4g1^%^(nn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55FB4C2n%UieX$0y_BK?QEocu;BCH=GDd&r=XA?JiKuI zA4_D=LmZz3j6*?1u|`G3bfcVZF$~+zZiMa3UAmI9hlo)s^dL&(`#?#C{d(4;>6O=& z`XvK;1%RFohMsCA9nW1!{Da Date: Wed, 1 Mar 2017 13:08:05 +0100 Subject: [PATCH 42/57] * update realm to v3.0.0 --- .../java/com/mikepenz/fastadapter/app/CustomApplication.java | 4 +--- .../java/com/mikepenz/fastadapter/app/RealmActivity.java | 5 ++--- build.gradle | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/CustomApplication.java b/app/src/main/java/com/mikepenz/fastadapter/app/CustomApplication.java index 537a0e91e..b6f021b3c 100644 --- a/app/src/main/java/com/mikepenz/fastadapter/app/CustomApplication.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/CustomApplication.java @@ -3,7 +3,6 @@ import android.app.Application; import io.realm.Realm; -import io.realm.RealmConfiguration; /** * Created by mikepenz on 04.07.16. @@ -14,7 +13,6 @@ public class CustomApplication extends Application { public void onCreate() { super.onCreate(); // The Realm file will be located in Context.getFilesDir() with name "default.realm" - RealmConfiguration config = new RealmConfiguration.Builder().build(); - Realm.setDefaultConfiguration(config); + Realm.init(getApplicationContext()); } } diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/RealmActivity.java b/app/src/main/java/com/mikepenz/fastadapter/app/RealmActivity.java index 72011e4c9..1378d024f 100755 --- a/app/src/main/java/com/mikepenz/fastadapter/app/RealmActivity.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/RealmActivity.java @@ -142,9 +142,8 @@ public void onChange(RealmResults userItems) { mRealm.executeTransactionAsync(new Realm.Transaction() { @Override public void execute(Realm realm) { - RealmSampleUserItem newUser = realm.createObject(RealmSampleUserItem.class); - newUser.withName("Sample Realm Element " + newPrimaryKey) - .withIdentifier(newPrimaryKey); + RealmSampleUserItem newUser = realm.createObject(RealmSampleUserItem.class, newPrimaryKey); + newUser.withName("Sample Realm Element " + newPrimaryKey); } }); } diff --git a/build.gradle b/build.gradle index 8a7ffa7fd..ef31dee5d 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.0-rc1' classpath 'com.novoda:bintray-release:0.3.4' - classpath "io.realm:realm-gradle-plugin:2.2.1" + classpath "io.realm:realm-gradle-plugin:3.0.0" classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.6.2' } } From c962d096bc37d18eb1e54d69c51638916bdd947b Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Wed, 1 Mar 2017 13:34:53 +0100 Subject: [PATCH 43/57] * update realm sample --- .../fastadapter/app/RealmActivity.java | 36 ++++++++++++++++--- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/RealmActivity.java b/app/src/main/java/com/mikepenz/fastadapter/app/RealmActivity.java index 1378d024f..88d3665d9 100755 --- a/app/src/main/java/com/mikepenz/fastadapter/app/RealmActivity.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/RealmActivity.java @@ -14,8 +14,8 @@ import com.mikepenz.fastadapter.FastAdapter; import com.mikepenz.fastadapter.IAdapter; -import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter; import com.mikepenz.fastadapter.app.items.RealmSampleUserItem; +import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter; import com.mikepenz.iconics.IconicsDrawable; import com.mikepenz.itemanimators.AlphaInAnimator; import com.mikepenz.material_design_iconic_typeface_library.MaterialDesignIconic; @@ -24,6 +24,8 @@ import java.util.LinkedList; import java.util.List; +import io.realm.OrderedCollectionChangeSet; +import io.realm.OrderedRealmCollectionChangeListener; import io.realm.Realm; import io.realm.RealmChangeListener; import io.realm.RealmResults; @@ -70,13 +72,37 @@ public boolean onClick(View v, IAdapter adapter, RealmSampl mRealm = Realm.getDefaultInstance(); //Add a realm on change listener (don´t forget to close this realm instance before adding this listener again) - mRealm.where(RealmSampleUserItem.class).findAllAsync().addChangeListener(new RealmChangeListener>() { + mRealm.where(RealmSampleUserItem.class).findAllAsync().addChangeListener(new OrderedRealmCollectionChangeListener>() { @Override - public void onChange(RealmResults userItems) { + public void onChange(RealmResults realmSampleUserItems, OrderedCollectionChangeSet orderedCollectionChangeSet) { //This will call twice //1.) from findAllAsync() //2.) from createData() - mFastItemAdapter.items().setNewList(userItems); + mFastItemAdapter.items().getAdapterItems().clear(); + mFastItemAdapter.items().getAdapterItems().addAll(realmSampleUserItems); + mFastItemAdapter.items().mapPossibleTypes(realmSampleUserItems); + // null Changes means the async query returns the first time. + if (orderedCollectionChangeSet == null) { + mFastItemAdapter.notifyAdapterDataSetChanged(); + return; + } + // For deletions, the adapter has to be notified in reverse order. + OrderedCollectionChangeSet.Range[] deletions = orderedCollectionChangeSet.getDeletionRanges(); + for (int i = deletions.length - 1; i >= 0; i--) { + OrderedCollectionChangeSet.Range range = deletions[i]; + mFastItemAdapter.notifyAdapterItemRangeRemoved(range.startIndex, range.length); + + } + + OrderedCollectionChangeSet.Range[] insertions = orderedCollectionChangeSet.getInsertionRanges(); + for (OrderedCollectionChangeSet.Range range : insertions) { + mFastItemAdapter.notifyAdapterItemRangeInserted(range.startIndex, range.length); + } + + OrderedCollectionChangeSet.Range[] modifications = orderedCollectionChangeSet.getChangeRanges(); + for (OrderedCollectionChangeSet.Range range : modifications) { + mFastItemAdapter.notifyAdapterItemRangeChanged(range.startIndex, range.length); + } } }); @@ -138,7 +164,7 @@ public void onChange(RealmResults userItems) { //Remove the change listener userItems.removeChangeListener(this); //Store the primary key to get access from a other thread - final long newPrimaryKey = userItems.last().getIdentifier() + 1; + final long newPrimaryKey = userItems.max("mIdentifier").longValue() + 1; mRealm.executeTransactionAsync(new Realm.Transaction() { @Override public void execute(Realm realm) { From 92295b31fd348d7a5149a196b589e34c40eb2be1 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Wed, 1 Mar 2017 13:38:41 +0100 Subject: [PATCH 44/57] * simplify insert --- .../fastadapter/app/RealmActivity.java | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/RealmActivity.java b/app/src/main/java/com/mikepenz/fastadapter/app/RealmActivity.java index 88d3665d9..553493ffa 100755 --- a/app/src/main/java/com/mikepenz/fastadapter/app/RealmActivity.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/RealmActivity.java @@ -27,7 +27,6 @@ import io.realm.OrderedCollectionChangeSet; import io.realm.OrderedRealmCollectionChangeListener; import io.realm.Realm; -import io.realm.RealmChangeListener; import io.realm.RealmResults; public class RealmActivity extends AppCompatActivity { @@ -158,20 +157,12 @@ public boolean onOptionsItemSelected(MenuItem item) { onBackPressed(); return true; case R.id.item_add: - mRealm.where(RealmSampleUserItem.class).findAllAsync().addChangeListener(new RealmChangeListener>() { + mRealm.executeTransactionAsync(new Realm.Transaction() { @Override - public void onChange(RealmResults userItems) { - //Remove the change listener - userItems.removeChangeListener(this); - //Store the primary key to get access from a other thread - final long newPrimaryKey = userItems.max("mIdentifier").longValue() + 1; - mRealm.executeTransactionAsync(new Realm.Transaction() { - @Override - public void execute(Realm realm) { - RealmSampleUserItem newUser = realm.createObject(RealmSampleUserItem.class, newPrimaryKey); - newUser.withName("Sample Realm Element " + newPrimaryKey); - } - }); + public void execute(Realm realm) { + final long newPrimaryKey = realm.where(RealmSampleUserItem.class).max("mIdentifier").longValue() + 1; + RealmSampleUserItem newUser = realm.createObject(RealmSampleUserItem.class, newPrimaryKey); + newUser.withName("Sample Realm Element " + newPrimaryKey); } }); return true; From 6746f18fa8a2f889f7ff03a50fbde09c33dfac73 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Wed, 1 Mar 2017 13:47:28 +0100 Subject: [PATCH 45/57] * add possibility to set an own ClickListenerHelper * only allocate ClickListenerHelper if needed --- .../com/mikepenz/fastadapter/FastAdapter.java | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java b/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java index b6037d68b..56905d2fd 100644 --- a/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java +++ b/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java @@ -93,10 +93,20 @@ private static int floorIndex(SparseArray sparseArray, int key) { * default CTOR */ public FastAdapter() { - clickListenerHelper = new ClickListenerHelper<>(this); setHasStableIds(true); } + /** + * Define a custom ClickListenerHelper + * + * @param clickListenerHelper the ClickListenerHelper + * @return this + */ + public FastAdapter withClickListenerHelper(ClickListenerHelper clickListenerHelper) { + this.clickListenerHelper = clickListenerHelper; + return this; + } + /** * adds a new event hook for an item * NOTE: this has to be called before adding the first items, as this won't be called anymore after the ViewHolders were created @@ -105,6 +115,9 @@ public FastAdapter() { * @return this */ public FastAdapter withItemEvent(EventHook eventHook) { + if (clickListenerHelper == null) { + clickListenerHelper = new ClickListenerHelper<>(this); + } clickListenerHelper.addEventHook(eventHook); return this; } @@ -541,14 +554,16 @@ public boolean onTouch(View v, MotionEvent event, int position, FastAdapter Date: Wed, 1 Mar 2017 13:54:47 +0100 Subject: [PATCH 46/57] * remove unnecessary semicolons --- .../main/java/com/mikepenz/fastadapter/utils/AdapterUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library-core/src/main/java/com/mikepenz/fastadapter/utils/AdapterUtil.java b/library-core/src/main/java/com/mikepenz/fastadapter/utils/AdapterUtil.java index 0a04718a4..06bb120e5 100644 --- a/library-core/src/main/java/com/mikepenz/fastadapter/utils/AdapterUtil.java +++ b/library-core/src/main/java/com/mikepenz/fastadapter/utils/AdapterUtil.java @@ -66,7 +66,7 @@ public static Set adjustPosition(Set positions, int startPosit //if we removed items and we are within the bounds we have to check if the item was removed //adjustBy is negative in this case if (position > startPosition + adjustBy && position <= startPosition) { - ;//we are within the removed items range we don't add this item anymore + //we are within the removed items range we don't add this item anymore } else { //otherwise we adjust our position newPositions.add(position + adjustBy); @@ -102,7 +102,7 @@ public static SparseIntArray adjustPosition(SparseIntArray positions, int startP //if we removed items and we are within the bounds we have to check if the item was removed //adjustBy is negative in this case if (position > startPosition + adjustBy && position <= startPosition) { - ;//we are within the removed items range we don't add this item anymore + //we are within the removed items range we don't add this item anymore } else { //otherwise we adjust our position newPositions.put(position + adjustBy, positions.valueAt(i)); From 3dd49f71ac973c7882276eae9e082d451af387a4 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Wed, 1 Mar 2017 14:37:42 +0100 Subject: [PATCH 47/57] * add new IHookable interface * items that are implementing the new interface can specify event hooks * the event hooks are getting registered when the item gets added to the adapter for the first time --- .../com/mikepenz/fastadapter/FastAdapter.java | 24 +++++++++++++++++++ .../com/mikepenz/fastadapter/IHookable.java | 15 ++++++++++++ .../helpers/ClickListenerHelper.java | 12 ++++++++++ 3 files changed, 51 insertions(+) create mode 100644 library-core/src/main/java/com/mikepenz/fastadapter/IHookable.java diff --git a/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java b/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java index 56905d2fd..0477e18d9 100644 --- a/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java +++ b/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java @@ -2,6 +2,7 @@ import android.os.Bundle; import android.support.annotation.NonNull; +import android.support.annotation.Nullable; import android.support.v4.util.ArraySet; import android.support.v7.widget.RecyclerView; import android.util.Log; @@ -19,6 +20,7 @@ import com.mikepenz.fastadapter.utils.AdapterUtil; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.Iterator; import java.util.List; @@ -122,6 +124,24 @@ public FastAdapter withItemEvent(EventHook eventHook) { return this; } + /** + * adds new event hooks for an item + * NOTE: this has to be called before adding the first items, as this won't be called anymore after the ViewHolders were created + * + * @param eventHooks the event hooks to be added for an item + * @return this + */ + public FastAdapter withItemEvents(@Nullable Collection> eventHooks) { + if (eventHooks == null) { + return this; + } + if (clickListenerHelper == null) { + clickListenerHelper = new ClickListenerHelper<>(this); + } + clickListenerHelper.addEventHooks(eventHooks); + return this; + } + /** * Define the OnClickListener which will be used for a single item * @@ -413,6 +433,10 @@ public > void registerAdapter(A adapter) { public void registerTypeInstance(Item item) { if (mTypeInstances.indexOfKey(item.getType()) < 0) { mTypeInstances.put(item.getType(), item); + //check if the item implements hookable when its added for the first time + if (item instanceof IHookable) { + withItemEvents(((IHookable) item).getEventHooks()); + } } } diff --git a/library-core/src/main/java/com/mikepenz/fastadapter/IHookable.java b/library-core/src/main/java/com/mikepenz/fastadapter/IHookable.java new file mode 100644 index 000000000..2723ba5ab --- /dev/null +++ b/library-core/src/main/java/com/mikepenz/fastadapter/IHookable.java @@ -0,0 +1,15 @@ +package com.mikepenz.fastadapter; + +import com.mikepenz.fastadapter.listeners.EventHook; + +import java.util.List; + +/** + * Created by fabianterhorst on 01.03.17. + */ +public interface IHookable { + /** + * @return the event hooks for the item + */ + List> getEventHooks(); +} diff --git a/library-core/src/main/java/com/mikepenz/fastadapter/helpers/ClickListenerHelper.java b/library-core/src/main/java/com/mikepenz/fastadapter/helpers/ClickListenerHelper.java index 0c641c535..34f439320 100644 --- a/library-core/src/main/java/com/mikepenz/fastadapter/helpers/ClickListenerHelper.java +++ b/library-core/src/main/java/com/mikepenz/fastadapter/helpers/ClickListenerHelper.java @@ -14,6 +14,7 @@ import com.mikepenz.fastadapter.listeners.TouchEventHook; import java.util.Arrays; +import java.util.Collection; import java.util.LinkedList; import java.util.List; @@ -76,6 +77,17 @@ public ClickListenerHelper addEventHook(EventHook eventHook) { return this; } + /** + * adds new eventHooks + * note this will not add new event hooks for existing viewHolders after it was created + * + * @param eventHooks new eventHooks + * @return this + */ + public ClickListenerHelper addEventHooks(Collection> eventHooks) { + this.eventHooks.addAll(eventHooks); + return this; + } /** * binds the hooks to the viewHolder From 3e00c3a83c378107e5c99783c4774572b37e43cc Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Wed, 1 Mar 2017 14:55:01 +0100 Subject: [PATCH 48/57] * fix realm item adapter --- .../src/main/java/io/realm/RealmItemAdapter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library-extensions-realm/src/main/java/io/realm/RealmItemAdapter.java b/library-extensions-realm/src/main/java/io/realm/RealmItemAdapter.java index 6df825a53..0186e6b8c 100644 --- a/library-extensions-realm/src/main/java/io/realm/RealmItemAdapter.java +++ b/library-extensions-realm/src/main/java/io/realm/RealmItemAdapter.java @@ -180,7 +180,7 @@ private void addListener(@NonNull OrderedRealmCollection data) { } else if (data instanceof RealmList) { RealmList realmList = (RealmList) data; //noinspection unchecked - realmList.realm.handlerController.addChangeListenerAsWeakReference(listener); + realmList.realm.addListener(listener); } else { throw new IllegalArgumentException("RealmCollection not supported: " + data.getClass()); } @@ -193,7 +193,7 @@ private void removeListener(@NonNull OrderedRealmCollection data) { } else if (data instanceof RealmList) { RealmList realmList = (RealmList) data; //noinspection unchecked - realmList.realm.handlerController.removeWeakChangeListener(listener); + realmList.realm.removeListener(listener); } else { throw new IllegalArgumentException("RealmCollection not supported: " + data.getClass()); } From 7934911a38ecc2fc5a054382da16568a11f918e0 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Wed, 1 Mar 2017 15:14:58 +0100 Subject: [PATCH 49/57] * update realm adapter to 3.0 --- .../main/java/io/realm/RealmItemAdapter.java | 90 ++++++++++++------- 1 file changed, 56 insertions(+), 34 deletions(-) diff --git a/library-extensions-realm/src/main/java/io/realm/RealmItemAdapter.java b/library-extensions-realm/src/main/java/io/realm/RealmItemAdapter.java index 0186e6b8c..345664b4b 100644 --- a/library-extensions-realm/src/main/java/io/realm/RealmItemAdapter.java +++ b/library-extensions-realm/src/main/java/io/realm/RealmItemAdapter.java @@ -45,37 +45,53 @@ public class RealmItemAdapter extends ItemAdapter { private final boolean hasAutoUpdates; - private final RealmChangeListener listener; + private final OrderedRealmCollectionChangeListener listener; @Nullable private OrderedRealmCollection adapterData; - private int notified = 0; - - public RealmItemAdapter(@Nullable OrderedRealmCollection data, boolean autoUpdate) { - this.adapterData = data; - this.hasAutoUpdates = autoUpdate; - - // Right now don't use generics, since we need maintain two different - // types of listeners until RealmList is properly supported. - // See https://github.com/realm/realm-java/issues/989 - this.listener = hasAutoUpdates ? new RealmChangeListener() { + private OrderedRealmCollectionChangeListener createListener() { + return new OrderedRealmCollectionChangeListener() { @Override - public void onChange(Object results) { - if (results instanceof List) { - List items = (List) results; - + public void onChange(Object collection, OrderedCollectionChangeSet changeSet) { + if (collection instanceof List) { + List items = (List) collection; if (isUseIdDistributor()) { IdDistributor.checkIds(items); } mapPossibleTypes(items); + } + // null Changes means the async query returns the first time. + if (changeSet == null) { + notifyDataSetChanged(); + return; + } + // For deletions, the adapter has to be notified in reverse order. + OrderedCollectionChangeSet.Range[] deletions = changeSet.getDeletionRanges(); + for (int i = deletions.length - 1; i >= 0; i--) { + OrderedCollectionChangeSet.Range range = deletions[i]; + notifyItemRangeRemoved(range.startIndex, range.length); + } - if (hasAutoUpdates || notified < 1) { - getFastAdapter().notifyAdapterDataSetChanged(); - notified++; - } + OrderedCollectionChangeSet.Range[] insertions = changeSet.getInsertionRanges(); + for (OrderedCollectionChangeSet.Range range : insertions) { + notifyItemRangeInserted(range.startIndex, range.length); + } + + OrderedCollectionChangeSet.Range[] modifications = changeSet.getChangeRanges(); + for (OrderedCollectionChangeSet.Range range : modifications) { + notifyItemRangeChanged(range.startIndex, range.length); } } - } : null; + }; + } + + public RealmItemAdapter(@Nullable OrderedRealmCollection data, boolean autoUpdate) { + if (data != null && !data.isManaged()) + throw new IllegalStateException("Only use this adapter with managed RealmCollection, " + + "for un-managed lists you can just use the BaseRecyclerViewAdapter"); + this.adapterData = data; + this.hasAutoUpdates = autoUpdate; + this.listener = hasAutoUpdates ? createListener() : null; } @Override @@ -118,10 +134,10 @@ public int getAdapterPosition(Item item) { } //noinspection ConstantConditions - Iterator iter = adapterData.iterator(); + Iterator iterator = adapterData.iterator(); int count = 0; - while (iter.hasNext()) { - if (iter.next().getIdentifier() == item.getIdentifier()) { + while (iterator.hasNext()) { + if (iterator.next().getIdentifier() == item.getIdentifier()) { return count; } count++; @@ -136,8 +152,9 @@ public int getAdapterPosition(Item item) { * @param index index of the item. * @return the item at the specified position, {@code null} if adapter data is not valid. */ + @SuppressWarnings("WeakerAccess") @Nullable - public Item getAdapterItem(int index) { + public Item getItem(int index) { //noinspection ConstantConditions return isDataValid() ? adapterData.get(index) : null; } @@ -158,9 +175,11 @@ public OrderedRealmCollection getData() { * * @param data the new {@link OrderedRealmCollection} to display. */ + @SuppressWarnings("WeakerAccess") public void updateData(@Nullable OrderedRealmCollection data) { if (hasAutoUpdates) { - if (adapterData != null) { + if (isDataValid()) { + //noinspection ConstantConditions removeListener(adapterData); } if (data != null) { @@ -174,13 +193,13 @@ public void updateData(@Nullable OrderedRealmCollection data) { private void addListener(@NonNull OrderedRealmCollection data) { if (data instanceof RealmResults) { - RealmResults realmResults = (RealmResults) data; + RealmResults results = (RealmResults) data; //noinspection unchecked - realmResults.addChangeListener(listener); + results.addChangeListener(listener); } else if (data instanceof RealmList) { - RealmList realmList = (RealmList) data; + RealmList list = (RealmList) data; //noinspection unchecked - realmList.realm.addListener(listener); + list.addChangeListener(listener); } else { throw new IllegalArgumentException("RealmCollection not supported: " + data.getClass()); } @@ -188,12 +207,13 @@ private void addListener(@NonNull OrderedRealmCollection data) { private void removeListener(@NonNull OrderedRealmCollection data) { if (data instanceof RealmResults) { - RealmResults realmResults = (RealmResults) data; - realmResults.removeChangeListener(listener); + RealmResults results = (RealmResults) data; + //noinspection unchecked + results.removeChangeListener(listener); } else if (data instanceof RealmList) { - RealmList realmList = (RealmList) data; + RealmList list = (RealmList) data; //noinspection unchecked - realmList.realm.removeListener(listener); + list.removeChangeListener(listener); } else { throw new IllegalArgumentException("RealmCollection not supported: " + data.getClass()); } @@ -250,7 +270,9 @@ public ItemAdapter removeRange(int position, int itemCount) { @Override public ItemAdapter clear() { - adapterData.clear(); + if (adapterData != null) { + adapterData.clear(); + } return this; } } \ No newline at end of file From b91b5004c94b9a2d83a9e61ab318521f1d4d9e77 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Wed, 1 Mar 2017 15:17:56 +0100 Subject: [PATCH 50/57] * improve realm adapter --- .../src/main/java/io/realm/RealmItemAdapter.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/library-extensions-realm/src/main/java/io/realm/RealmItemAdapter.java b/library-extensions-realm/src/main/java/io/realm/RealmItemAdapter.java index 345664b4b..1d3d37654 100644 --- a/library-extensions-realm/src/main/java/io/realm/RealmItemAdapter.java +++ b/library-extensions-realm/src/main/java/io/realm/RealmItemAdapter.java @@ -53,13 +53,10 @@ private OrderedRealmCollectionChangeListener createListener() { return new OrderedRealmCollectionChangeListener() { @Override public void onChange(Object collection, OrderedCollectionChangeSet changeSet) { - if (collection instanceof List) { - List items = (List) collection; - if (isUseIdDistributor()) { - IdDistributor.checkIds(items); - } - mapPossibleTypes(items); + if (isUseIdDistributor() && adapterData != null) { + IdDistributor.checkIds(adapterData); } + mapPossibleTypes(adapterData); // null Changes means the async query returns the first time. if (changeSet == null) { notifyDataSetChanged(); From 34b4d8d6892a16332f6db30f49371707e6859832 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Wed, 1 Mar 2017 15:19:33 +0100 Subject: [PATCH 51/57] * update realm extension plugin version --- library-extensions-realm/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library-extensions-realm/build.gradle b/library-extensions-realm/build.gradle index 0238502db..7a1eb9cf7 100644 --- a/library-extensions-realm/build.gradle +++ b/library-extensions-realm/build.gradle @@ -6,7 +6,7 @@ buildscript { jcenter() } dependencies { - classpath "io.realm:realm-gradle-plugin:1.1.1" + classpath "io.realm:realm-gradle-plugin:3.0.0" } } From 570cf448aa0934a64fc390ad1b469a4d565e76e3 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Wed, 1 Mar 2017 16:19:47 +0100 Subject: [PATCH 52/57] * remove view holder factory --- .../app/generic/GenericIconItem.java | 23 +----- .../app/items/CheckBoxSampleItem.java | 24 +----- .../fastadapter/app/items/IconItem.java | 23 +----- .../fastadapter/app/items/ImageItem.java | 25 +------ .../fastadapter/app/items/LetterItem.java | 5 ++ .../app/items/RadioButtonSampleItem.java | 26 +------ .../app/items/SimpleImageItem.java | 31 ++------ .../fastadapter/app/items/SimpleItem.java | 26 +------ .../fastadapter/app/items/SwipeableItem.java | 24 +----- .../expandable/SimpleSubExpandableItem.java | 24 +----- .../app/items/expandable/SimpleSubItem.java | 24 +----- .../fastadapter/items/AbstractItem.java | 73 +------------------ .../items/GenericAbstractItem.java | 7 -- .../fastadapter/utils/ViewHolderFactory.java | 13 ---- .../items/ProgressItem.java | 13 +--- .../items/SingleLineItem.java | 13 +--- .../items/ThreeLineItem.java | 13 +--- .../items/TwoLineItem.java | 13 +--- 18 files changed, 41 insertions(+), 359 deletions(-) delete mode 100644 library-core/src/main/java/com/mikepenz/fastadapter/utils/ViewHolderFactory.java diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/generic/GenericIconItem.java b/app/src/main/java/com/mikepenz/fastadapter/app/generic/GenericIconItem.java index cfb1bc209..b5f997af1 100644 --- a/app/src/main/java/com/mikepenz/fastadapter/app/generic/GenericIconItem.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/generic/GenericIconItem.java @@ -6,7 +6,6 @@ import com.mikepenz.fastadapter.app.R; import com.mikepenz.fastadapter.items.GenericAbstractItem; -import com.mikepenz.fastadapter.utils.ViewHolderFactory; import com.mikepenz.iconics.view.IconicsImageView; import java.util.List; @@ -18,8 +17,6 @@ * Created by mikepenz on 28.12.15. */ public class GenericIconItem extends GenericAbstractItem { - //the static ViewHolderFactory which will be used to generate the ViewHolder for this Item - private static final ViewHolderFactory FACTORY = new ItemFactory(); public GenericIconItem(IconModel icon) { super(icon); @@ -66,25 +63,9 @@ public void unbindView(ViewHolder holder) { holder.name.setText(null); } - /** - * our ItemFactory implementation which creates the ViewHolder for our adapter. - * It is highly recommended to implement a ViewHolderFactory as it is 0-1ms faster for ViewHolder creation, - * and it is also many many times more efficient if you define custom listeners on views within your item. - */ - protected static class ItemFactory implements ViewHolderFactory { - public ViewHolder create(View v) { - return new ViewHolder(v); - } - } - - /** - * return our ViewHolderFactory implementation here - * - * @return - */ @Override - public ViewHolderFactory getFactory() { - return FACTORY; + public ViewHolder getViewHolder(View v) { + return new ViewHolder(v); } /** diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/items/CheckBoxSampleItem.java b/app/src/main/java/com/mikepenz/fastadapter/app/items/CheckBoxSampleItem.java index 4bca150da..043ed4a3f 100644 --- a/app/src/main/java/com/mikepenz/fastadapter/app/items/CheckBoxSampleItem.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/items/CheckBoxSampleItem.java @@ -11,7 +11,6 @@ import com.mikepenz.fastadapter.app.R; import com.mikepenz.fastadapter.items.AbstractItem; import com.mikepenz.fastadapter.listeners.ClickEventHook; -import com.mikepenz.fastadapter.utils.ViewHolderFactory; import com.mikepenz.materialdrawer.holder.StringHolder; import java.util.List; @@ -23,8 +22,6 @@ * Created by mikepenz on 28.12.15. */ public class CheckBoxSampleItem extends AbstractItem { - //the static ViewHolderFactory which will be used to generate the ViewHolder for this Item - private static final ViewHolderFactory FACTORY = new ItemFactory(); public String header; public StringHolder name; @@ -99,28 +96,11 @@ public void unbindView(ViewHolder holder) { holder.description.setText(null); } - /** - * our ItemFactory implementation which creates the ViewHolder for our adapter. - * It is highly recommended to implement a ViewHolderFactory as it is 0-1ms faster for ViewHolder creation, - * and it is also many many times more efficient if you define custom listeners on views within your item. - */ - protected static class ItemFactory implements ViewHolderFactory { - public ViewHolder create(View v) { - return new ViewHolder(v); - } - } - - /** - * return our ViewHolderFactory implementation here - * - * @return - */ @Override - public ViewHolderFactory getFactory() { - return FACTORY; + public ViewHolder getViewHolder(View v) { + return new ViewHolder(v); } - /** * our ViewHolder */ diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/items/IconItem.java b/app/src/main/java/com/mikepenz/fastadapter/app/items/IconItem.java index 6acdc523c..09fd4d240 100644 --- a/app/src/main/java/com/mikepenz/fastadapter/app/items/IconItem.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/items/IconItem.java @@ -9,7 +9,6 @@ import com.mikepenz.fastadapter.ISubItem; import com.mikepenz.fastadapter.app.R; import com.mikepenz.fastadapter.items.AbstractItem; -import com.mikepenz.fastadapter.utils.ViewHolderFactory; import com.mikepenz.iconics.typeface.IIcon; import com.mikepenz.iconics.view.IconicsImageView; @@ -22,8 +21,6 @@ * Created by mikepenz on 28.12.15. */ public class IconItem extends AbstractItem, IconItem.ViewHolder> implements ISubItem { - //the static ViewHolderFactory which will be used to generate the ViewHolder for this Item - private static final ViewHolderFactory FACTORY = new ItemFactory(); public IIcon mIcon; private T mParent; @@ -90,25 +87,9 @@ public void unbindView(ViewHolder holder) { holder.image.setImageDrawable(null); } - /** - * our ItemFactory implementation which creates the ViewHolder for our adapter. - * It is highly recommended to implement a ViewHolderFactory as it is 0-1ms faster for ViewHolder creation, - * and it is also many many times more efficient if you define custom listeners on views within your item. - */ - protected static class ItemFactory implements ViewHolderFactory { - public ViewHolder create(View v) { - return new ViewHolder(v); - } - } - - /** - * return our ViewHolderFactory implementation here - * - * @return - */ @Override - public ViewHolderFactory getFactory() { - return FACTORY; + public ViewHolder getViewHolder(View v) { + return new ViewHolder(v); } /** diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/items/ImageItem.java b/app/src/main/java/com/mikepenz/fastadapter/app/items/ImageItem.java index bea0f79b3..95251187c 100644 --- a/app/src/main/java/com/mikepenz/fastadapter/app/items/ImageItem.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/items/ImageItem.java @@ -20,7 +20,6 @@ import com.mikepenz.fastadapter.helpers.ClickListenerHelper; import com.mikepenz.fastadapter.items.AbstractItem; import com.mikepenz.fastadapter.listeners.ClickEventHook; -import com.mikepenz.fastadapter.utils.ViewHolderFactory; import com.mikepenz.iconics.view.IconicsImageView; import java.util.List; @@ -32,8 +31,6 @@ * Created by mikepenz on 28.12.15. */ public class ImageItem extends AbstractItem { - //the static ViewHolderFactory which will be used to generate the ViewHolder for this Item - private static final ViewHolderFactory FACTORY = new ItemFactory(); public String mImageUrl; public String mName; @@ -112,15 +109,9 @@ public void unbindView(ViewHolder holder) { holder.imageView.setImageDrawable(null); } - /** - * our ItemFactory implementation which creates the ViewHolder for our adapter. - * It is highly recommended to implement a ViewHolderFactory as it is 0-1ms faster for ViewHolder creation, - * and it is also many many times more efficient if you define custom listeners on views within your item. - */ - protected static class ItemFactory implements ViewHolderFactory { - public ViewHolder create(View v) { - return new ViewHolder(v); - } + @Override + public ViewHolder getViewHolder(View v) { + return new ViewHolder(v); } /** @@ -163,16 +154,6 @@ public static void viewPropertyStartCompat(ViewPropertyAnimator animator) { } } - /** - * return our ViewHolderFactory implementation here - * - * @return - */ - @Override - public ViewHolderFactory getFactory() { - return FACTORY; - } - /** * our ViewHolder */ diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/items/LetterItem.java b/app/src/main/java/com/mikepenz/fastadapter/app/items/LetterItem.java index 3080c389e..d043d9b5c 100644 --- a/app/src/main/java/com/mikepenz/fastadapter/app/items/LetterItem.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/items/LetterItem.java @@ -32,6 +32,11 @@ public void unbindView(ViewHolder holder) { holder.text.setText(null); } + @Override + public ViewHolder getViewHolder(View v) { + return new ViewHolder(v); + } + @Override public int getType() { return R.id.fastadapter_letter_item_id; diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/items/RadioButtonSampleItem.java b/app/src/main/java/com/mikepenz/fastadapter/app/items/RadioButtonSampleItem.java index f55daa48e..62395d1d6 100644 --- a/app/src/main/java/com/mikepenz/fastadapter/app/items/RadioButtonSampleItem.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/items/RadioButtonSampleItem.java @@ -7,11 +7,10 @@ import android.widget.RadioButton; import android.widget.TextView; -import com.mikepenz.fastadapter.app.R; import com.mikepenz.fastadapter.FastAdapter; +import com.mikepenz.fastadapter.app.R; import com.mikepenz.fastadapter.items.AbstractItem; import com.mikepenz.fastadapter.listeners.ClickEventHook; -import com.mikepenz.fastadapter.utils.ViewHolderFactory; import com.mikepenz.materialdrawer.holder.StringHolder; import java.util.List; @@ -24,8 +23,6 @@ * Created by mikepenz on 28.12.15. */ public class RadioButtonSampleItem extends AbstractItem { - //the static ViewHolderFactory which will be used to generate the ViewHolder for this Item - private static final ViewHolderFactory FACTORY = new ItemFactory(); public String header; public StringHolder name; @@ -100,28 +97,11 @@ public void unbindView(ViewHolder holder) { holder.description.setText(null); } - /** - * our ItemFactory implementation which creates the ViewHolder for our adapter. - * It is highly recommended to implement a ViewHolderFactory as it is 0-1ms faster for ViewHolder creation, - * and it is also many many times more efficient if you define custom listeners on views within your item. - */ - protected static class ItemFactory implements ViewHolderFactory { - public ViewHolder create(View v) { - return new ViewHolder(v); - } - } - - /** - * return our ViewHolderFactory implementation here - * - * @return - */ @Override - public ViewHolderFactory getFactory() { - return FACTORY; + public ViewHolder getViewHolder(View v) { + return new ViewHolder(v); } - /** * our ViewHolder */ diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/items/SimpleImageItem.java b/app/src/main/java/com/mikepenz/fastadapter/app/items/SimpleImageItem.java index 3c2359db5..80ae7e9bc 100644 --- a/app/src/main/java/com/mikepenz/fastadapter/app/items/SimpleImageItem.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/items/SimpleImageItem.java @@ -9,9 +9,8 @@ import com.bumptech.glide.Glide; import com.mikepenz.fastadapter.app.R; -import com.mikepenz.fastadapter.items.AbstractItem; import com.mikepenz.fastadapter.commons.utils.FastAdapterUIUtils; -import com.mikepenz.fastadapter.utils.ViewHolderFactory; +import com.mikepenz.fastadapter.items.AbstractItem; import com.mikepenz.materialize.util.UIUtils; import java.util.List; @@ -23,12 +22,10 @@ * Created by mikepenz on 28.12.15. */ public class SimpleImageItem extends AbstractItem { - //the static ViewHolderFactory which will be used to generate the ViewHolder for this Item - private static final ViewHolderFactory FACTORY = new ItemFactory(); - public String mImageUrl; - public String mName; - public String mDescription; + private String mImageUrl; + private String mName; + private String mDescription; public SimpleImageItem withImage(String imageUrl) { this.mImageUrl = imageUrl; @@ -99,25 +96,9 @@ public void unbindView(ViewHolder holder) { holder.imageDescription.setText(null); } - /** - * our ItemFactory implementation which creates the ViewHolder for our adapter. - * It is highly recommended to implement a ViewHolderFactory as it is 0-1ms faster for ViewHolder creation, - * and it is also many many times more efficient if you define custom listeners on views within your item. - */ - protected static class ItemFactory implements ViewHolderFactory { - public ViewHolder create(View v) { - return new ViewHolder(v); - } - } - - /** - * return our ViewHolderFactory implementation here - * - * @return - */ @Override - public ViewHolderFactory getFactory() { - return FACTORY; + public ViewHolder getViewHolder(View v) { + return new ViewHolder(v); } /** diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/items/SimpleItem.java b/app/src/main/java/com/mikepenz/fastadapter/app/items/SimpleItem.java index ec4288b97..faa39eefa 100644 --- a/app/src/main/java/com/mikepenz/fastadapter/app/items/SimpleItem.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/items/SimpleItem.java @@ -10,9 +10,8 @@ import com.mikepenz.fastadapter.IDraggable; import com.mikepenz.fastadapter.IItem; import com.mikepenz.fastadapter.app.R; -import com.mikepenz.fastadapter.items.AbstractItem; import com.mikepenz.fastadapter.commons.utils.FastAdapterUIUtils; -import com.mikepenz.fastadapter.utils.ViewHolderFactory; +import com.mikepenz.fastadapter.items.AbstractItem; import com.mikepenz.materialdrawer.holder.StringHolder; import com.mikepenz.materialize.util.UIUtils; @@ -25,8 +24,6 @@ * Created by mikepenz on 28.12.15. */ public class SimpleItem extends AbstractItem implements IDraggable { - //the static ViewHolderFactory which will be used to generate the ViewHolder for this Item - private static final ViewHolderFactory FACTORY = new ItemFactory(); public String header; public StringHolder name; @@ -117,28 +114,11 @@ public void unbindView(ViewHolder holder) { holder.description.setText(null); } - /** - * our ItemFactory implementation which creates the ViewHolder for our adapter. - * It is highly recommended to implement a ViewHolderFactory as it is 0-1ms faster for ViewHolder creation, - * and it is also many many times more efficient if you define custom listeners on views within your item. - */ - protected static class ItemFactory implements ViewHolderFactory { - public ViewHolder create(View v) { - return new ViewHolder(v); - } - } - - /** - * return our ViewHolderFactory implementation here - * - * @return - */ @Override - public ViewHolderFactory getFactory() { - return FACTORY; + public ViewHolder getViewHolder(View v) { + return new ViewHolder(v); } - /** * our ViewHolder */ diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/items/SwipeableItem.java b/app/src/main/java/com/mikepenz/fastadapter/app/items/SwipeableItem.java index 1f2bf7cbe..d7b1aa98c 100644 --- a/app/src/main/java/com/mikepenz/fastadapter/app/items/SwipeableItem.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/items/SwipeableItem.java @@ -11,7 +11,6 @@ import com.mikepenz.fastadapter.ISwipeable; import com.mikepenz.fastadapter.app.R; import com.mikepenz.fastadapter.items.AbstractItem; -import com.mikepenz.fastadapter.utils.ViewHolderFactory; import com.mikepenz.materialdrawer.holder.StringHolder; import java.util.List; @@ -23,8 +22,6 @@ * Created by Mattias on 2016-02-15. */ public class SwipeableItem extends AbstractItem implements ISwipeable { - //the static ViewHolderFactory which will be used to generate the ViewHolder for this Item - private static final ViewHolderFactory FACTORY = new ItemFactory(); public StringHolder name; public StringHolder description; @@ -136,28 +133,11 @@ public void unbindView(ViewHolder holder) { holder.swipedActionRunnable = null; } - /** - * our ItemFactory implementation which creates the ViewHolder for our adapter. - * It is highly recommended to implement a ViewHolderFactory as it is 0-1ms faster for ViewHolder creation, - * and it is also many many times more efficient if you define custom listeners on views within your item. - */ - protected static class ItemFactory implements ViewHolderFactory { - public ViewHolder create(View v) { - return new ViewHolder(v); - } - } - - /** - * return our ViewHolderFactory implementation here - * - * @return - */ @Override - public ViewHolderFactory getFactory() { - return FACTORY; + public ViewHolder getViewHolder(View v) { + return new ViewHolder(v); } - /** * our ViewHolder */ diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/items/expandable/SimpleSubExpandableItem.java b/app/src/main/java/com/mikepenz/fastadapter/app/items/expandable/SimpleSubExpandableItem.java index e9c906cae..d9d2bee9d 100644 --- a/app/src/main/java/com/mikepenz/fastadapter/app/items/expandable/SimpleSubExpandableItem.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/items/expandable/SimpleSubExpandableItem.java @@ -17,7 +17,6 @@ import com.mikepenz.fastadapter.app.R; import com.mikepenz.fastadapter.commons.items.AbstractExpandableItem; import com.mikepenz.fastadapter.commons.utils.FastAdapterUIUtils; -import com.mikepenz.fastadapter.utils.ViewHolderFactory; import com.mikepenz.materialdrawer.holder.StringHolder; import com.mikepenz.materialize.util.UIUtils; @@ -30,8 +29,6 @@ * Created by mikepenz on 28.12.15. */ public class SimpleSubExpandableItem extends AbstractExpandableItem, SimpleSubExpandableItem.ViewHolder, SubItem> { - //the static ViewHolderFactory which will be used to generate the ViewHolder for this Item - private static final ViewHolderFactory FACTORY = new ItemFactory(); public String header; public StringHolder name; @@ -160,28 +157,11 @@ public void unbindView(ViewHolder holder) { holder.icon.clearAnimation(); } - /** - * our ItemFactory implementation which creates the ViewHolder for our adapter. - * It is highly recommended to implement a ViewHolderFactory as it is 0-1ms faster for ViewHolder creation, - * and it is also many many times more efficient if you define custom listeners on views within your item. - */ - protected static class ItemFactory implements ViewHolderFactory { - public ViewHolder create(View v) { - return new ViewHolder(v); - } - } - - /** - * return our ViewHolderFactory implementation here - * - * @return - */ @Override - public ViewHolderFactory getFactory() { - return FACTORY; + public ViewHolder getViewHolder(View v) { + return new ViewHolder(v); } - /** * our ViewHolder */ diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/items/expandable/SimpleSubItem.java b/app/src/main/java/com/mikepenz/fastadapter/app/items/expandable/SimpleSubItem.java index 5af149427..3984453d3 100644 --- a/app/src/main/java/com/mikepenz/fastadapter/app/items/expandable/SimpleSubItem.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/items/expandable/SimpleSubItem.java @@ -15,7 +15,6 @@ import com.mikepenz.fastadapter.app.R; import com.mikepenz.fastadapter.commons.items.AbstractExpandableItem; import com.mikepenz.fastadapter.commons.utils.FastAdapterUIUtils; -import com.mikepenz.fastadapter.utils.ViewHolderFactory; import com.mikepenz.materialdrawer.holder.StringHolder; import com.mikepenz.materialize.util.UIUtils; @@ -25,8 +24,6 @@ import butterknife.ButterKnife; public class SimpleSubItem extends AbstractExpandableItem> implements IDraggable { - //the static ViewHolderFactory which will be used to generate the ViewHolder for this Item - private static final ViewHolderFactory FACTORY = new ItemFactory(); public String header; public StringHolder name; @@ -117,28 +114,11 @@ public void unbindView(ViewHolder holder) { holder.description.setText(null); } - /** - * our ItemFactory implementation which creates the ViewHolder for our adapter. - * It is highly recommended to implement a ViewHolderFactory as it is 0-1ms faster for ViewHolder creation, - * and it is also many many times more efficient if you define custom listeners on views within your item. - */ - protected static class ItemFactory implements ViewHolderFactory { - public ViewHolder create(View v) { - return new ViewHolder(v); - } - } - - /** - * return our ViewHolderFactory implementation here - * - * @return - */ @Override - public ViewHolderFactory getFactory() { - return FACTORY; + public ViewHolder getViewHolder(View v) { + return new ViewHolder(v); } - /** * our ViewHolder */ diff --git a/library-core/src/main/java/com/mikepenz/fastadapter/items/AbstractItem.java b/library-core/src/main/java/com/mikepenz/fastadapter/items/AbstractItem.java index 86c72dc87..bfc56d32d 100644 --- a/library-core/src/main/java/com/mikepenz/fastadapter/items/AbstractItem.java +++ b/library-core/src/main/java/com/mikepenz/fastadapter/items/AbstractItem.java @@ -10,10 +10,7 @@ import com.mikepenz.fastadapter.FastAdapter; import com.mikepenz.fastadapter.IClickable; import com.mikepenz.fastadapter.IItem; -import com.mikepenz.fastadapter.utils.ViewHolderFactory; -import java.lang.reflect.Constructor; -import java.lang.reflect.ParameterizedType; import java.util.Collections; import java.util.List; @@ -249,56 +246,14 @@ public VH getViewHolder(ViewGroup parent) { return getViewHolder(LayoutInflater.from(parent.getContext()).inflate(getLayoutRes(), parent, false)); } - protected ViewHolderFactory mFactory; - - /** - * set the view holder factory of this item - * - * @param factory to be set - * @return - */ - public Item withFactory(ViewHolderFactory factory) { - this.mFactory = factory; - return (Item) this; - } - - /** - * the abstract method to retrieve the ViewHolder factory - * The ViewHolder factory implementation should look like (see the commented code above) - * - * @return - */ - public ViewHolderFactory getFactory() { - if (mFactory == null) { - try { - this.mFactory = new ReflectionBasedViewHolderFactory<>(viewHolderType()); - } catch (Exception e) { - throw new RuntimeException("please set a ViewHolderFactory"); - } - } - - return mFactory; - } - - /** - * gets the viewHolder via the generic superclass - * - * @return the class of the ViewHolder - */ - protected Class viewHolderType() { - return ((Class) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[1]); - } /** * This method returns the ViewHolder for our item, using the provided View. - * By default it will try to get the ViewHolder from the ViewHolderFactory. If this one is not implemented it will go over the generic way, wasting ~5ms * * @param v * @return the ViewHolder for this Item */ - public VH getViewHolder(View v) { - return getFactory().create(v); - } + public abstract VH getViewHolder(View v); /** * If this item equals to the given identifier @@ -334,30 +289,4 @@ public boolean equals(Object o) { public int hashCode() { return Long.valueOf(mIdentifier).hashCode(); } - - protected static class ReflectionBasedViewHolderFactory implements ViewHolderFactory { - private final Class clazz; - - public ReflectionBasedViewHolderFactory(Class clazz) { - this.clazz = clazz; - } - - @Override - public VH create(View v) { - try { - try { - Constructor constructor = clazz.getDeclaredConstructor(View.class); - //could be that the constructor is not public - constructor.setAccessible(true); - return constructor.newInstance(v); - } catch (NoSuchMethodException e) { - //maybe that viewholder has a default view - return clazz.newInstance(); - } - } catch (Exception e) { - // I am really out of options, you could have just set - throw new RuntimeException("You have to provide a ViewHolder with a constructor which takes a view!"); - } - } - } } diff --git a/library-core/src/main/java/com/mikepenz/fastadapter/items/GenericAbstractItem.java b/library-core/src/main/java/com/mikepenz/fastadapter/items/GenericAbstractItem.java index cc435b372..186ce5370 100644 --- a/library-core/src/main/java/com/mikepenz/fastadapter/items/GenericAbstractItem.java +++ b/library-core/src/main/java/com/mikepenz/fastadapter/items/GenericAbstractItem.java @@ -4,8 +4,6 @@ import com.mikepenz.fastadapter.IGenericItem; -import java.lang.reflect.ParameterizedType; - /** * Created by mikepenz on 14.07.15. * Implements the general methods of the IItem interface to speed up development. @@ -25,9 +23,4 @@ public Model getModel() { this.mModel = model; return this; } - - @Override - protected Class viewHolderType() { - return ((Class) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[2]); - } } \ No newline at end of file diff --git a/library-core/src/main/java/com/mikepenz/fastadapter/utils/ViewHolderFactory.java b/library-core/src/main/java/com/mikepenz/fastadapter/utils/ViewHolderFactory.java deleted file mode 100644 index abb013b56..000000000 --- a/library-core/src/main/java/com/mikepenz/fastadapter/utils/ViewHolderFactory.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.mikepenz.fastadapter.utils; - -import android.support.v7.widget.RecyclerView; -import android.view.View; - -/** - * the interface for the ViewHolderFactory - * - * @param - */ -public interface ViewHolderFactory { - T create(View v); -} \ No newline at end of file diff --git a/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/items/ProgressItem.java b/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/items/ProgressItem.java index cde1f6fe0..7fa00e6b9 100644 --- a/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/items/ProgressItem.java +++ b/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/items/ProgressItem.java @@ -6,7 +6,6 @@ import com.mikepenz.fastadapter.commons.utils.FastAdapterUIUtils; import com.mikepenz.fastadapter.items.AbstractItem; -import com.mikepenz.fastadapter.utils.ViewHolderFactory; import com.mikepenz.library_extensions.R; import java.util.List; @@ -14,8 +13,6 @@ public class ProgressItem extends AbstractItem { - private static final ViewHolderFactory FACTORY = new ItemFactory(); - @Override public int getType() { return R.id.progress_item_id; @@ -39,15 +36,9 @@ public void unbindView(ViewHolder holder) { } - protected static class ItemFactory implements ViewHolderFactory { - public ViewHolder create(View v) { - return new ViewHolder(v); - } - } - @Override - public ViewHolderFactory getFactory() { - return FACTORY; + public ViewHolder getViewHolder(View v) { + return new ViewHolder(v); } protected static class ViewHolder extends RecyclerView.ViewHolder { diff --git a/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/items/SingleLineItem.java b/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/items/SingleLineItem.java index 01f1d418e..87682aa69 100644 --- a/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/items/SingleLineItem.java +++ b/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/items/SingleLineItem.java @@ -11,7 +11,6 @@ import com.mikepenz.fastadapter.commons.utils.FastAdapterUIUtils; import com.mikepenz.fastadapter.items.AbstractItem; -import com.mikepenz.fastadapter.utils.ViewHolderFactory; import com.mikepenz.library_extensions.R; import com.mikepenz.materialize.holder.ImageHolder; import com.mikepenz.materialize.holder.StringHolder; @@ -23,8 +22,6 @@ */ public class SingleLineItem extends AbstractItem { - private static final ViewHolderFactory FACTORY = new ItemFactory(); - private StringHolder mName; private ImageHolder mAvatar, mIcon; @@ -126,15 +123,9 @@ public void unbindView(ViewHolder holder) { holder.icon.setVisibility(View.VISIBLE); } - protected static class ItemFactory implements ViewHolderFactory { - public ViewHolder create(View v) { - return new ViewHolder(v); - } - } - @Override - public ViewHolderFactory getFactory() { - return FACTORY; + public ViewHolder getViewHolder(View v) { + return new ViewHolder(v); } protected static class ViewHolder extends RecyclerView.ViewHolder { diff --git a/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/items/ThreeLineItem.java b/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/items/ThreeLineItem.java index e90a35c68..7f1524c2f 100644 --- a/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/items/ThreeLineItem.java +++ b/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/items/ThreeLineItem.java @@ -11,7 +11,6 @@ import com.mikepenz.fastadapter.commons.utils.FastAdapterUIUtils; import com.mikepenz.fastadapter.items.AbstractItem; -import com.mikepenz.fastadapter.utils.ViewHolderFactory; import com.mikepenz.library_extensions.R; import com.mikepenz.materialize.holder.ImageHolder; import com.mikepenz.materialize.holder.StringHolder; @@ -23,8 +22,6 @@ */ public class ThreeLineItem extends AbstractItem { - private static final ViewHolderFactory FACTORY = new ItemFactory(); - private StringHolder mName, mDescription; private ImageHolder mAvatar, mIcon; @@ -133,15 +130,9 @@ public void unbindView(ViewHolder holder) { holder.icon.setVisibility(View.VISIBLE); } - protected static class ItemFactory implements ViewHolderFactory { - public ViewHolder create(View v) { - return new ViewHolder(v); - } - } - @Override - public ViewHolderFactory getFactory() { - return FACTORY; + public ViewHolder getViewHolder(View v) { + return new ViewHolder(v); } protected static class ViewHolder extends RecyclerView.ViewHolder { diff --git a/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/items/TwoLineItem.java b/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/items/TwoLineItem.java index db35326e3..460356580 100644 --- a/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/items/TwoLineItem.java +++ b/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/items/TwoLineItem.java @@ -11,7 +11,6 @@ import com.mikepenz.fastadapter.commons.utils.FastAdapterUIUtils; import com.mikepenz.fastadapter.items.AbstractItem; -import com.mikepenz.fastadapter.utils.ViewHolderFactory; import com.mikepenz.library_extensions.R; import com.mikepenz.materialize.holder.ImageHolder; import com.mikepenz.materialize.holder.StringHolder; @@ -23,8 +22,6 @@ */ public class TwoLineItem extends AbstractItem { - private static final ViewHolderFactory FACTORY = new ItemFactory(); - private StringHolder mName, mDescription; private ImageHolder mAvatar, mIcon; @@ -137,15 +134,9 @@ public void unbindView(ViewHolder holder) { holder.icon.setVisibility(View.VISIBLE); } - protected static class ItemFactory implements ViewHolderFactory { - public ViewHolder create(View v) { - return new ViewHolder(v); - } - } - @Override - public ViewHolderFactory getFactory() { - return FACTORY; + public ViewHolder getViewHolder(View v) { + return new ViewHolder(v); } protected static class ViewHolder extends RecyclerView.ViewHolder { From d6c4d1fd1c2674a16106139343b5ba80da10ace9 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 27 Mar 2017 15:44:04 +0200 Subject: [PATCH 53/57] * fix test item --- library/src/test/java/com/mikepenz/fastadapter/TestItem.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/src/test/java/com/mikepenz/fastadapter/TestItem.java b/library/src/test/java/com/mikepenz/fastadapter/TestItem.java index 2aaf0cba7..1d3085612 100644 --- a/library/src/test/java/com/mikepenz/fastadapter/TestItem.java +++ b/library/src/test/java/com/mikepenz/fastadapter/TestItem.java @@ -63,6 +63,11 @@ public TestItem withParent(TestItem parent) { return this; } + @Override + public ViewHolder getViewHolder(View v) { + return new ViewHolder(v); + } + public static class ViewHolder extends RecyclerView.ViewHolder { public ViewHolder(View view) { super(view); From a0880dcb94f581b6fe7b41da10cf26798e293826 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Mon, 27 Mar 2017 17:02:31 +0200 Subject: [PATCH 54/57] * fix another test item --- .../androidTest/java/com/mikepenz/fastadapter/TestItem.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/src/androidTest/java/com/mikepenz/fastadapter/TestItem.java b/library/src/androidTest/java/com/mikepenz/fastadapter/TestItem.java index e05b26b3d..cfe9a4a84 100644 --- a/library/src/androidTest/java/com/mikepenz/fastadapter/TestItem.java +++ b/library/src/androidTest/java/com/mikepenz/fastadapter/TestItem.java @@ -70,6 +70,11 @@ public TestItem withParent(TestItem parent) { return this; } + @Override + public ViewHolder getViewHolder(View v) { + return new ViewHolder(v); + } + public static class ViewHolder extends RecyclerView.ViewHolder { public ViewHolder(View view) { super(view); From 42369f62817cde895f77258b9eadb7bd51ab9bdd Mon Sep 17 00:00:00 2001 From: Mike Penz Date: Fri, 31 Mar 2017 13:59:03 +0200 Subject: [PATCH 55/57] * use final gradle build tools * update to support libs 25.3.1 * gradle 3.4.1 --- build.gradle | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index ef31dee5d..a8b2d00f3 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.3.0-rc1' + classpath 'com.android.tools.build:gradle:2.3.0' classpath 'com.novoda:bintray-release:0.3.4' classpath "io.realm:realm-gradle-plugin:3.0.0" classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.6.2' @@ -16,7 +16,7 @@ buildscript { ext { compileSdkVersion = 25 buildToolsVersion = "25.0.2" - supportLibVersion = "25.2.0" + supportLibVersion = "25.3.1" } allprojects { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 7aff90ebb..3fc500968 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Feb 24 17:29:26 CET 2017 +#Fri Mar 31 13:44:02 CEST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip From b5a74a3c6a160e4e1f4401bfaf110df609101333 Mon Sep 17 00:00:00 2001 From: Mike Penz Date: Fri, 31 Mar 2017 14:27:41 +0200 Subject: [PATCH 56/57] * if we have any listener for the FastAdapter and the clickListenerHelper == null. create one --- .../src/main/java/com/mikepenz/fastadapter/FastAdapter.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java b/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java index 0477e18d9..7f092cc2e 100644 --- a/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java +++ b/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java @@ -578,6 +578,10 @@ public boolean onTouch(View v, MotionEvent event, int position, FastAdapter(this); + } if (clickListenerHelper != null) { //handle click behavior clickListenerHelper.attachToView(fastAdapterViewClickListener, holder, holder.itemView); From 893e93a0b0ba3829420a99a424a7367f6b0a0da0 Mon Sep 17 00:00:00 2001 From: Mike Penz Date: Mon, 3 Apr 2017 17:15:34 +0200 Subject: [PATCH 57/57] * use v3 compatible MaterialDrawer * set alpha v3 version name and code --- app/build.gradle | 2 +- library-core/build.gradle | 4 ++-- library-core/gradle.properties | 4 ++-- library-extensions-firebase/gradle.properties | 4 ++-- library-extensions-realm/gradle.properties | 4 ++-- library-extensions/build.gradle | 4 ++-- library-extensions/gradle.properties | 4 ++-- library/build.gradle | 4 ++-- library/gradle.properties | 4 ++-- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 95117d700..e934b2ede 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -71,7 +71,7 @@ dependencies { //used to generate the drawer on the left //https://github.com/mikepenz/MaterialDrawer - compile('com.mikepenz:materialdrawer:5.8.0@aar') { + compile('com.mikepenz:materialdrawer:6.0.0.alpha-SNAPSHOT@aar') { transitive = true exclude module: "fastadapter" } diff --git a/library-core/build.gradle b/library-core/build.gradle index 35bf3b449..ff8e2bd43 100644 --- a/library-core/build.gradle +++ b/library-core/build.gradle @@ -7,8 +7,8 @@ android { defaultConfig { minSdkVersion 14 targetSdkVersion 25 - versionCode 217 - versionName '2.1.7' + versionCode 3000 + versionName '3.0.0.alpha' } buildTypes { release { diff --git a/library-core/gradle.properties b/library-core/gradle.properties index 0dcf89a0f..4d50e9f29 100755 --- a/library-core/gradle.properties +++ b/library-core/gradle.properties @@ -1,5 +1,5 @@ POM_NAME=FastAdapter Library POM_ARTIFACT_ID=fastadapter POM_PACKAGING=aar -VERSION_NAME=2.1.7 -VERSION_CODE=217 \ No newline at end of file +VERSION_NAME=3.0.0.alpha-SNAPSHOT +VERSION_CODE=3000 \ No newline at end of file diff --git a/library-extensions-firebase/gradle.properties b/library-extensions-firebase/gradle.properties index 6ed6b1183..d6206e37f 100755 --- a/library-extensions-firebase/gradle.properties +++ b/library-extensions-firebase/gradle.properties @@ -1,5 +1,5 @@ POM_NAME=FastAdapter Library-Extensions-Firebase POM_ARTIFACT_ID=fastadapter-extensions-firebase POM_PACKAGING=aar -VERSION_NAME=2.1.0 -VERSION_CODE=2100 \ No newline at end of file +VERSION_NAME=3.0.0.alpha-SNAPSHOT +VERSION_CODE=3000 \ No newline at end of file diff --git a/library-extensions-realm/gradle.properties b/library-extensions-realm/gradle.properties index 47570edb2..b9d651ae4 100755 --- a/library-extensions-realm/gradle.properties +++ b/library-extensions-realm/gradle.properties @@ -1,5 +1,5 @@ POM_NAME=FastAdapter Library-Extensions-Realm POM_ARTIFACT_ID=fastadapter-extensions-realm POM_PACKAGING=aar -VERSION_NAME=2.1.0 -VERSION_CODE=2100 \ No newline at end of file +VERSION_NAME=3.0.0.alpha-SNAPSHOT +VERSION_CODE=3000 \ No newline at end of file diff --git a/library-extensions/build.gradle b/library-extensions/build.gradle index f18060cc1..3c6b18df7 100644 --- a/library-extensions/build.gradle +++ b/library-extensions/build.gradle @@ -7,8 +7,8 @@ android { defaultConfig { minSdkVersion 14 targetSdkVersion 25 - versionCode 2170 - versionName '2.1.7' + versionCode 3000 + versionName '3.0.0.alpha' } buildTypes { release { diff --git a/library-extensions/gradle.properties b/library-extensions/gradle.properties index 5762debd3..164a288ad 100755 --- a/library-extensions/gradle.properties +++ b/library-extensions/gradle.properties @@ -1,5 +1,5 @@ POM_NAME=FastAdapter Library-Extensions POM_ARTIFACT_ID=fastadapter-extensions POM_PACKAGING=aar -VERSION_NAME=2.1.7 -VERSION_CODE=2170 \ No newline at end of file +VERSION_NAME=3.0.0.alpha-SNAPSHOT +VERSION_CODE=3000 \ No newline at end of file diff --git a/library/build.gradle b/library/build.gradle index bf84e02a8..c20ec05c8 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -7,8 +7,8 @@ android { defaultConfig { minSdkVersion 14 targetSdkVersion 25 - versionCode 210 - versionName '2.1.0' + versionCode 3000 + versionName '3.0.0.alpha' testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { diff --git a/library/gradle.properties b/library/gradle.properties index 320c8e753..bc361ec2b 100755 --- a/library/gradle.properties +++ b/library/gradle.properties @@ -1,5 +1,5 @@ POM_NAME=FastAdapter Library POM_ARTIFACT_ID=fastadapter-commons POM_PACKAGING=aar -VERSION_NAME=2.1.0 -VERSION_CODE=210 \ No newline at end of file +VERSION_NAME=3.0.0.alpha-SNAPSHOT +VERSION_CODE=3000 \ No newline at end of file