Status Update
Comments
si...@google.com <si...@google.com>
si...@google.com <si...@google.com> #2
Please provide sample project or apk to reproduce the issue. Also mention the steps to be followed for reproducing the issue with the given sample project or apk.
Frequency
How frequently does this issue occur? (e.g 100% of the time, 10% of the time)
Expected output
What do you expect to occur?
Current output
What do you see instead?
logcat output
See
mo...@gmail.com <mo...@gmail.com> #3
This bug happens also after clearing the selection using clearSelection() method
Frequency:
100% without clearing the selection.
50% after clearing the selection (calling clearSelection()).
Expected output:
The selection starts again in case the user deselect all items.
Current output:
Exception, ANR
logcat output:
FATAL EXCEPTION: main
Process: me.guendouz.recyclerview_item_selection, PID: 27856
java.lang.IllegalStateException
at android.support.v4.util.Preconditions.checkState(Preconditions.java:130)
at android.support.v4.util.Preconditions.checkState(Preconditions.java:142)
at androidx.recyclerview.selection.GestureSelectionHelper.start(GestureSelectionHelper.java:76)
at androidx.recyclerview.selection.SelectionTracker$Builder$4.run(SelectionTracker.java:742)
at androidx.recyclerview.selection.TouchInputHandler.onLongPress(TouchInputHandler.java:136)
at androidx.recyclerview.selection.GestureRouter.onLongPress(GestureRouter.java:95)
at android.view.GestureDetector.dispatchLongPress(GestureDetector.java:778)
at android.view.GestureDetector.-wrap0(Unknown Source:0)
at android.view.GestureDetector$GestureHandler.handleMessage(GestureDetector.java:293)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
si...@google.com <si...@google.com> #4
ne...@gmail.com <ne...@gmail.com> #5
ne...@gmail.com <ne...@gmail.com> #6
do...@gmail.com <do...@gmail.com> #7
Any update about issue?
[Deleted User] <[Deleted User]> #8
is...@google.com <is...@google.com>
vi...@google.com <vi...@google.com> #9
ya...@gmail.com <ya...@gmail.com> #10
1. Start selection
2. Select some items
3. Deselect items
4. Try to start selection from new item (those that were not selected previously)
5. Exception
ya...@gmail.com <ya...@gmail.com> #11
ku...@gmail.com <ku...@gmail.com> #12
dp...@gmail.com <dp...@gmail.com> #13
vu...@gmail.com <vu...@gmail.com> #14
ze...@gmail.com <ze...@gmail.com> #15
ni...@gmail.com <ni...@gmail.com> #16
di...@gmail.com <di...@gmail.com> #17
020-10-09 18:17:58.719 9007-9007/io.test E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.IllegalArgumentException
at androidx.core.util.Preconditions.checkArgument(Preconditions.java:38)
at androidx.recyclerview.selection.DefaultSelectionTracker.anchorRange(DefaultSelectionTracker.java:288)
at androidx.recyclerview.selection.MotionInputHandler.selectItem(MotionInputHandler.java:60)
at androidx.recyclerview.selection.TouchInputHandler.onLongPress(TouchInputHandler.java:164)
at androidx.recyclerview.selection.GestureRouter.onLongPress(GestureRouter.java:97)
at android.view.GestureDetector.dispatchLongPress(GestureDetector.java:779)
at android.view.GestureDetector.access$200(GestureDetector.java:40)
at android.view.GestureDetector$GestureHandler.handleMessage(GestureDetector.java:293)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
It seems the second check doesn't work
DefaultSelectionTracker.anchorRange(DefaultSelectionTracker.java:288)
@Override
public void anchorRange(int position) {
checkArgument(position != RecyclerView.NO_POSITION);
checkArgument(mSelection.contains(mKeyProvider.getKey(position))); --> this seems to be null
mRange = new Range(position, mRangeCallbacks);
}
sh...@gmail.com <sh...@gmail.com> #18
This issue actually not resolved. Our crash analytics we are getting lots this issue java.lang.IllegalArgumentException: null at androidx.core.util.Preconditions.checkArgument(Preconditions.java:36) at androidx.recyclerview.selection.DefaultSelectionTracker.anchorRange(DefaultSelectionTracker.java:288) at androidx.recyclerview.selection.MotionInputHandler.selectItem(MotionInputHandler.java:60) at androidx.recyclerview.selection.TouchInputHandler.onLongPress(TouchInputHandler.java:164) at androidx.recyclerview.selection.GestureRouter.onLongPress(GestureRouter.java:97) at android.view.GestureDetector.dispatchLongPress(GestureDetector.java:868) at android.view.GestureDetector.access$300(GestureDetector.java:51) at android.view.GestureDetector$GestureHandler.handleMessage(GestureDetector.java:314) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7417) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)
Specially this line checkArgument(mSelection.contains(mKeyProvider.getKey(position))); --> this seems to be null
Description
Version used: 28.0.0-alpha1
Theme used: Theme.AppCompat.Light.DarkActionBar
Devices/Android versions reproduced on: Emulator/ API26
This bug can be produced by this way:
1- Start selection
2- Select som items
3- DeSelect all items
4- Try to start selection from new
5- Exception ...
Hi, I just started using the recyclerview-selection new library for demo purposes, I discovered that when the multiple selection is used (withSelectionPredicate(SelectionPredicates.<String>createSelectAnything()) it works fine for the first time when all items are deselected but if we start selecting items from new (after deselecting all items) it generates an exception of type java.lang.IllegalStateException in the GestureSelectionHelper class at line 76.
This exception is due to failing in checking the state of mStarted in:
void start() {
checkState(!mStarted);
...
}
Which must be false. But, its value is true (because there was a first selection):
void start() {
checkState(!mStarted);
....
mStarted = true;
...
}
- Relevant code to trigger the issue.
mSelectionTracker = new SelectionTracker.Builder<>(
"string-items-selection",
mRecyclerView,
new StringItemKeyProvider(1, ITEMS),
new StringItemDetailsLookup(mRecyclerView),
StorageStrategy.createStringStorage()
).withSelectionPredicate(SelectionPredicates.<String>createSelectAnything())
.build();
- A screenrecord or screenshots showing the issue (if UI related).