mikepenz/FastAdapter

Expandable + filtering - crash and problems

開放

#885 建立於 2020年4月16日

 (3 則留言) (0 個反應) (1 位負責人)Kotlin (490 個分叉)batch import
enhancementhelp wanted

倉庫指標

星標
 (3,879 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

General problem In general, if you use expandable items and filtering together, you always lose the expandable state during filtering. This is really a problem if you want to filter and suddenly the expanded item containing the item that you want to filter out is gone because it's parent is collapsed. Additionally expanding an item while the filter is active does not respect the current active filter either it seems, I see that always all children of an item are expanded regardless of the current filter.

Crash A side effect of this behaviour is following crash if you collapse/expand items after filtering your views.

If desired, I can give you an example code with a little library that I'm rewritting currently in kotlin which is not far yet but can reproduce this issue easily.

Exception

kotlin.TypeCastException: null cannot be cast to non-null type kotlin.collections.List<Item>
    at com.mikepenz.fastadapter.adapters.ItemFilter.publishResults(ItemFilter.kt:104)
    at android.widget.Filter$ResultsHandler.handleMessage(Filter.java:282)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:214)
    at android.app.ActivityThread.main(ActivityThread.java:6986)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445)

Details

  • [ ] Used library version: 5.0.0

貢獻者指南