com.nextcloud.android.common.sample E FATAL EXCEPTION: main
Process: com.nextcloud.android.common.sample, PID: 4254
java.lang.IndexOutOfBoundsException: setSpan (15 ... 2) has end before start
at android.text.SpannableStringInternal.checkRange(SpannableStringInternal.java:485)
at android.text.SpannableStringInternal.setSpan(SpannableStringInternal.java:199)
at android.text.SpannableStringInternal.setSpan(SpannableStringInternal.java:186)
at android.text.SpannableString.setSpan(SpannableString.java:60)
at com.nextcloud.android.common.ui.theme.utils.AndroidViewThemeUtils.spanText(AndroidViewThemeUtils.kt:584)
at com.nextcloud.android.common.ui.theme.utils.AndroidViewThemeUtils.highlightText(AndroidViewThemeUtils.kt:562)
at com.nextcloud.android.common.ui.theme.utils.AndroidViewThemeUtils.access$highlightText(AndroidViewThemeUtils.kt:75)
at com.nextcloud.android.common.ui.theme.utils.AndroidViewThemeUtils$highlightText$1.invoke(AndroidViewThemeUtils.kt:548)
at com.nextcloud.android.common.ui.theme.utils.AndroidViewThemeUtils$highlightText$1.invoke(AndroidViewThemeUtils.kt:547)
at com.nextcloud.android.common.ui.theme.ViewThemeUtilsBase.withScheme(ViewThemeUtilsBase.kt:49)
at com.nextcloud.android.common.ui.theme.utils.AndroidViewThemeUtils.highlightText(AndroidViewThemeUtils.kt:547)
at com.nextcloud.android.common.ui.theme.utils.AndroidViewThemeUtils.highlightText$default(AndroidViewThemeUtils.kt:541)
at com.nextcloud.android.common.sample.MainActivity.applyTheme(MainActivity.kt:87)
at com.nextcloud.android.common.sample.MainActivity.access$applyTheme(MainActivity.kt:34)
at com.nextcloud.android.common.sample.MainActivity$onCreate$2.invoke(MainActivity.kt:59)
at com.nextcloud.android.common.sample.MainActivity$onCreate$2.invoke(MainActivity.kt:59)
at com.nextcloud.android.common.sample.MainActivity$sam$androidx_lifecycle_Observer$0.onChanged(Unknown Source:2)
at androidx.lifecycle.LiveData.considerNotify(LiveData.java:133)
at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:151)
at androidx.lifecycle.LiveData.setValue(LiveData.java:309)
at androidx.lifecycle.MutableLiveData.setValue(MutableLiveData.java:50)
at com.nextcloud.android.common.sample.MainActivity.onCreate$lambda$0(MainActivity.kt:49)
at com.nextcloud.android.common.sample.MainActivity.$r8$lambda$ev6Kxy-ymus-tRcdeQloM960R20(Unknown Source:0)
at com.nextcloud.android.common.sample.MainActivity$$ExternalSyntheticLambda0.onClick(Unknown Source:4)
at android.view.View.performClick(View.java:7506)
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1211)
at android.view.View.performClickInternal(View.java:7483)
at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
at android.view.View$PerformClick.run(View.java:29334)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7872)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Conditions
heLLo
L
)Reproduce
145-highlight-text
Stacktrace
Refs: https://github.com/nextcloud/notes-android/issues/1833