Skip to content

Commit

Permalink
修复已知bug。
Browse files Browse the repository at this point in the history
  • Loading branch information
liangrenyan@greencd.cn committed Aug 12, 2018
1 parent d884ed7 commit 6eafb5c
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public int getGroupPositionForPosition(int position) {
* @return 子项下标 childPosition
*/
public int getChildPositionForPosition(int groupPosition, int position) {
if (groupPosition < mStructures.size()) {
if (groupPosition >= 0 && groupPosition < mStructures.size()) {
int itemCount = countGroupRangeItem(0, groupPosition + 1);
GroupStructure structure = mStructures.get(groupPosition);
int p = structure.getChildrenCount() - (itemCount - position)
Expand All @@ -288,7 +288,7 @@ public int getChildPositionForPosition(int groupPosition, int position) {
* @return 下标
*/
public int getPositionForGroupHeader(int groupPosition) {
if (groupPosition < mStructures.size()) {
if (groupPosition >= 0 && groupPosition < mStructures.size()) {
GroupStructure structure = mStructures.get(groupPosition);
if (!structure.hasHeader()) {
return -1;
Expand All @@ -305,7 +305,7 @@ public int getPositionForGroupHeader(int groupPosition) {
* @return 下标
*/
public int getPositionForGroupFooter(int groupPosition) {
if (groupPosition < mStructures.size()) {
if (groupPosition >= 0 && groupPosition < mStructures.size()) {
GroupStructure structure = mStructures.get(groupPosition);
if (!structure.hasFooter()) {
return -1;
Expand All @@ -323,7 +323,7 @@ public int getPositionForGroupFooter(int groupPosition) {
* @return 下标
*/
public int getPositionForChild(int groupPosition, int childPosition) {
if (groupPosition < mStructures.size()) {
if (groupPosition >= 0 && groupPosition < mStructures.size()) {
GroupStructure structure = mStructures.get(groupPosition);
if (structure.getChildrenCount() > childPosition) {
int itemCount = countGroupRangeItem(0, groupPosition);
Expand All @@ -341,7 +341,7 @@ public int getPositionForChild(int groupPosition, int childPosition) {
*/
public int countGroupItem(int groupPosition) {
int itemCount = 0;
if (groupPosition < mStructures.size()) {
if (groupPosition >= 0 && groupPosition < mStructures.size()) {
GroupStructure structure = mStructures.get(groupPosition);
if (structure.hasHeader()) {
itemCount += 1;
Expand Down Expand Up @@ -555,7 +555,7 @@ public void changeChildren(int groupPosition) {
* @param groupPosition
*/
public void notifyChildrenChanged(int groupPosition) {
if (groupPosition < mStructures.size()) {
if (groupPosition >= 0 && groupPosition < mStructures.size()) {
int index = getPositionForChild(groupPosition, 0);
if (index >= 0) {
GroupStructure structure = mStructures.get(groupPosition);
Expand Down Expand Up @@ -826,7 +826,7 @@ public void insertRangeGroup(int groupPosition, int count) {
*/
public void notifyGroupRangeInserted(int groupPosition, int count) {
ArrayList<GroupStructure> list = new ArrayList<>();
for (int i = groupPosition; i < count; i++) {
for (int i = 0; i < count; i++) {
GroupStructure structure = new GroupStructure(hasHeader(i),
hasFooter(i), getChildrenCount(i));
list.add(structure);
Expand Down

0 comments on commit 6eafb5c

Please sign in to comment.