nextcloud-talk-android/app
Marcel Hibbe fee6630b9c avoid ArrayIndexOutOfBoundsException when swiping to reply.
This does not fix the root cause. So probably position should not be -1 here.
However if it is -1, this commit avoids the following exception and swiping to reply simply won't work.

Exception java.lang.ArrayIndexOutOfBoundsException: length=163; index=-1
  at java.util.ArrayList.get (ArrayList.java:439)
  at com.nextcloud.talk.chat.ChatActivity$setupSwipeToReply$messageSwipeController$1.showReplyUI (ChatActivity.kt:1144)
  at com.nextcloud.talk.ui.recyclerview.MessageSwipeCallback.setTouchListener$lambda$0 (MessageSwipeCallback.kt:137)
  at com.nextcloud.talk.ui.recyclerview.MessageSwipeCallback.$r8$lambda$hYMm2zsKL8yVqo4e364Wb8cWEW8
  at com.nextcloud.talk.ui.recyclerview.MessageSwipeCallback$$ExternalSyntheticLambda0.onTouch
  at android.view.View.dispatchTouchEvent (View.java:15046)
  at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3115)
  at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2788)
  at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3121)
  at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2802)
  at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3121)
  at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2802)
  at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3121)
  at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2802)
  at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3121)
  at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2802)
  at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3121)
  at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2802)
  at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3121)
  at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2802)
  at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3121)
  at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2802)
  at com.android.internal.policy.DecorView.superDispatchTouchEvent (DecorView.java:500)
  at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent (PhoneWindow.java:1912)
  at android.app.Activity.dispatchTouchEvent (Activity.java:4299)
  at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent (WindowCallbackWrapper.java:70)
  at com.android.internal.policy.DecorView.dispatchTouchEvent (DecorView.java:458)
  at android.view.View.dispatchPointerEvent (View.java:15309)
  at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent (ViewRootImpl.java:6778)
  at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess (ViewRootImpl.java:6578)
  at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:6034)
  at android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:6091)
  at android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:6057)
  at android.view.ViewRootImpl$AsyncInputStage.forward (ViewRootImpl.java:6222)
  at android.view.ViewRootImpl$InputStage.apply (ViewRootImpl.java:6065)
  at android.view.ViewRootImpl$AsyncInputStage.apply (ViewRootImpl.java:6279)
  at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:6038)
  at android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:6091)
  at android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:6057)
  at android.view.ViewRootImpl$InputStage.apply (ViewRootImpl.java:6065)
  at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:6038)
  at android.view.ViewRootImpl.deliverInputEvent (ViewRootImpl.java:9206)
  at android.view.ViewRootImpl.doProcessInputEvents (ViewRootImpl.java:9157)
  at android.view.ViewRootImpl.enqueueInputEvent (ViewRootImpl.java:9126)
  at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent (ViewRootImpl.java:9329)
  at android.view.InputEventReceiver.dispatchInputEvent (InputEventReceiver.java:267)
  at android.os.MessageQueue.nativePollOnce
  at android.os.MessageQueue.next (MessageQueue.java:335)
  at android.os.Looper.loopOnce (Looper.java:161)
  at android.os.Looper.loop (Looper.java:288)
  at android.app.ActivityThread.main (ActivityThread.java:7918)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:548)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:936)

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2023-07-07 12:58:09 +02:00
..
schemas/com.nextcloud.talk.data.source.local.TalkDatabase Room db schema v8 2022-07-01 08:59:12 +02:00
src avoid ArrayIndexOutOfBoundsException when swiping to reply. 2023-07-07 12:58:09 +02:00
build.gradle Build(deps): Bump com.google.android.exoplayer:exoplayer 2023-07-06 15:31:34 +02:00
lint.xml Get rid of BaseController, ButterknifeController, and ButterKnife 2022-08-18 17:19:08 +02:00
proguard-rules.pro Initial import 2017-10-23 12:40:38 +02:00