ExpandableRecyclerView icon indicating copy to clipboard operation
ExpandableRecyclerView copied to clipboard

如何删除单条?

Open smallgirl opened this issue 3 years ago • 1 comments

  
        Handler().postDelayed(Runnable {
            val count = adapter.itemCount
            adapter.data.removeAt(0)
            adapter.notifyGroupRemove(0)
            adapter.notifyGroupRangeRemove(IntRange(0,count))

        },3000)
{
  "zone": [
    {
      "id": "bj",
      "name": "北京",
      "city": true,
      "sort": 1
    },
    {
      "id": "sh",
      "name": "上海",
      "city": true,
      "sort": 2
    }
  ],
  "university": [

    {
      "id": 133,
      "name": "复旦大学",
      "short": "复旦",
      "zone": "sh",
      "order": 2,
      "famous": true
    },
    {
      "id": 134,
      "name": "同济大学",
      "short": "同济",
      "zone": "sh",
      "order": 3
    },
    {
      "id": 135,
      "name": "华东师范大学",
      "short": "华师",
      "zone": "sh",
      "order": 4
    },
    {
      "id": 136,
      "name": "华东理工大学",
      "short": "华理",
      "zone": "sh",
      "order": 5
    },
    {
      "id": 137,
      "name": "上海外国语大学",
      "short": "上外",
      "zone": "sh",
      "order": 11
    },
    {
      "id": 138,
      "name": "东华大学",
      "short": "东华",
      "zone": "sh",
      "order": 7
    }
  ]
}

连续点击折叠展开会闪退

smallgirl avatar May 11 '21 04:05 smallgirl

抱歉,notifyGroup 或者notifyChild 相关的api,不建议使用,因为没有经过完整的测试。

image

可以直接全部刷新,使用notifyDataSetChanged

最近在找工作,暂时没有精力修改,抱歉抱歉。 14B0B268

Xigong93 avatar May 12 '21 02:05 Xigong93