-
-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[android] fixes issue where last added favorite wasn't displaying. ot…
…her refresh issues remain.
- Loading branch information
Showing
4 changed files
with
21 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -209,20 +209,12 @@ public int getOffset() { | |
@Override | ||
public int getCount() { | ||
if (mDataList != null) { | ||
return mDataList.size(); | ||
int size = mDataList.size(); | ||
return size == 0 ? 0 : size + getOffset(); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
gubatron
Author
Collaborator
|
||
} | ||
return super.getCount(); | ||
} | ||
|
||
/** | ||
* The view count, including a header element if present for this adapter. | ||
* | ||
* @return | ||
*/ | ||
public int getViewCount() { | ||
return getCount() + getOffset(); | ||
} | ||
|
||
/** | ||
* @param position - The ACTUAL position in the model container. If you're using an offset based on a list view that has a header element at 0, you must subtract to the position you might have. | ||
* @return The element at the indexed position in the model container (not the view). null if position is out of bounds. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How is this working? getCount is the same as getViewCount?