Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,12 @@ public View getPinnedHeader() {

@Override
public void updatePinnedHeader(View headerView, int firstVisibleGroupPos) {
Group firstVisibleGroup = (Group) adapter.getGroup(firstVisibleGroupPos);
TextView textView = (TextView) headerView.findViewById(R.id.group);
textView.setText(firstVisibleGroup.getTitle());
if (adapter.getGroupCount() > 0) { // 防止列表在无数据的情况崩溃
Group firstVisibleGroup = (Group) adapter.getGroup(firstVisibleGroupPos);
TextView textView = (TextView) headerView.findViewById(R.id.group);
textView.setText(firstVisibleGroup.getTitle());
}

}

@Override
Expand All @@ -286,6 +289,8 @@ public boolean giveUpTouchEvent(MotionEvent event) {
View view = expandableListView.getChildAt(0);
if (view != null && view.getTop() >= 0) {
return true;
} else if (adapter.getGroupCount == 0) { //保证列表没有数据的情况下,头部隐藏后还能继续下拉显示出来
return true;
}
}
return false;
Expand Down