-
-
Notifications
You must be signed in to change notification settings - Fork 492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] FastAdapter V3 #294
[WIP] FastAdapter V3 #294
Conversation
How about to add this issue to roadmap? #285 |
@@ -133,7 +133,7 @@ public void filter(CharSequence constraint) { | |||
* @param sortNow specifies if we use the provided comparator to sort now | |||
* @return this | |||
*/ | |||
public ItemAdapter<Item> withComparator(Comparator<Item> comparator, boolean sortNow) { | |||
private ItemAdapter<Item> withComparator(Comparator<Item> comparator, boolean sortNow) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should not be private
@@ -466,7 +466,7 @@ public void remapMappedTypes() { | |||
* 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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one should also be public (as you are allowed to provide your own ItemFilter
@@ -35,28 +34,28 @@ public RecyclerViewCacheUtil withCacheSize(int cacheSize) { | |||
public void apply(RecyclerView recyclerView, Iterable<Item> items) { | |||
if (items != null) { | |||
//we pre-create the views for our cache | |||
HashMap<Integer, Stack<RecyclerView.ViewHolder>> cache = new HashMap<>(); | |||
SparseArray<Stack<RecyclerView.ViewHolder>> cache = new SparseArray<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"SparseArrays map integers to Objects. Unlike a normal array of Objects, there can be gaps in the indices. It is intended to be more memory efficient than using a HashMap to map Integers to Objects, both because it avoids auto-boxing keys and its data structure doesn't rely on an extra entry object for each mapping." https://developer.android.com/reference/android/util/SparseArray.html
mFastItemAdapter.items().setNewList(userItems); | ||
mFastItemAdapter.items().getAdapterItems().clear(); | ||
mFastItemAdapter.items().getAdapterItems().addAll(realmSampleUserItems); | ||
mFastItemAdapter.items().mapPossibleTypes(realmSampleUserItems); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not the best solution currently
* only allocate ClickListenerHelper if needed
* 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
[V3] Remove view holder factory
* update to support libs 25.3.1 * gradle 3.4.1
…lper == null. create one
* set alpha v3 version name and code
# Conflicts: # app/build.gradle # app/src/main/java/com/mikepenz/fastadapter/app/CustomApplication.java # app/src/main/java/com/mikepenz/fastadapter/app/RealmActivity.java # app/src/main/java/com/mikepenz/fastadapter/app/items/SwipeableItem.java # build.gradle # gradle/wrapper/gradle-wrapper.properties # library-core/build.gradle # library-core/gradle.properties # library-core/src/main/java/com/mikepenz/fastadapter/adapters/GenericItemAdapter.java # library-extensions-firebase/gradle.properties # library-extensions-realm/build.gradle # library-extensions-realm/gradle.properties # library-extensions/build.gradle # library-extensions/gradle.properties # library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/RangeSelectorHelper.java # library/build.gradle # library/gradle.properties
Should a new project using FastAdapter use the snapshots from v3, or is it unstable? |
@eygraber I suggest of using v2.5.x right now. A few cleanup and bigger API changes were already done. So It's better to keep with the 2.x branch until we get to a more feature rich state of v3 |
Checkout #443 to see the new changes. The benchmarks will be migrated to the new version after release. |
Roadmap:
Todo
Current method count (run
./gradlew assembleDebug
)