Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何删除单条? #32

Open
smallgirl opened this issue May 11, 2021 · 1 comment
Open

如何删除单条? #32

smallgirl opened this issue May 11, 2021 · 1 comment

Comments

@smallgirl
Copy link

  
        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
    }
  ]
}

连续点击折叠展开会闪退

@Xigong93
Copy link
Owner

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

image

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants