GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 添加headerview后 使用ExpandableItem 在 item未满一屏幕情况下 adapter.expandAll 方法无效 子项无法展开 · Issue #1564 · CymChad/BaseRecyclerViewAdapterHelper

添加headerview后 使用ExpandableItem 在 item未满一屏幕情况下 adapter.expandAll 方法无效 子项无法展开 #1564

New issue
Copy link
New issue
Copy link
Closed
Closed
添加headerview后 使用ExpandableItem 在 item未满一屏幕情况下 adapter.expandAll 方法无效 子项无法展开#1564
Copy link

Description

@fuguiniao
fuguiniao
opened on Sep 18, 2017
Issue body actions

添加headerview后 使用ExpandableItem 在 item未满一屏幕情况下 adapter.expandAll 方法无效 子项无法展开,去掉headerview后正常

在demo ExpandableUseActivity中添加headerview后:

adapter.setHeaderView(new ImageView(this));
mRecyclerView.setAdapter(adapter);
// important! setLayoutManager should be called after setAdapter
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
adapter.expandAll();

报错:
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=12; index=-1
at java.util.ArrayList.get(ArrayList.java:310)
at com.chad.library.adapter.base.BaseQuickAdapter.getItem(BaseQuickAdapter.java:526)
at com.chad.library.adapter.base.BaseQuickAdapter.getExpandableItem(BaseQuickAdapter.java:1701)
at com.chad.library.adapter.base.BaseQuickAdapter.expandAll(BaseQuickAdapter.java:1564)
at com.chad.library.adapter.base.BaseQuickAdapter.expandAll(BaseQuickAdapter.java:1605)
at com.chad.baserecyclerviewadapterhelper.ExpandableUseActivity.onCreate(ExpandableUseActivity.java:47)

Activity

  1. fuguiniao
    changed the title [-]添加headerview后 adapter.expandAll()报错[/-] [+]添加headerview后 使用ExpandableItem 在 item未满一屏幕情况下 adapter.expandAll 方法无效 子项无法展开[/+] on Sep 18, 2017
  2. CymChad commented on Sep 19, 2017

    @CymChad
    CymChad
    on Sep 19, 2017
    Owner
    More actions

    收到,我这边看看

  3. CymChad
    added a commit that references this issue on Sep 19, 2017

    fixbug #1564

    9376211
  4. CymChad commented on Sep 19, 2017

    @CymChad
    CymChad
    on Sep 19, 2017
    Owner
    More actions

    compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.30'

    Reacted by fuguiniao, 小宇宙 and xianwei
  5. CymChad
    closed this as completedon Sep 19, 2017
  6. fuguiniao commented on Sep 19, 2017

    @fuguiniao
    fuguiniao
    on Sep 19, 2017
    Author
    More actions

    可以了 最新版本没问题了 谢谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402792 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.