Skip to content

Commit

Permalink
Fix Refreshing on ListView when using a Header Background
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Banes committed Dec 19, 2012
1 parent 3553b4a commit 1669f28
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ void onRefreshing(final boolean doScroll) {
}

// Hide our original Loading View
origLoadingView.setVisibility(View.INVISIBLE);
origLoadingView.reset();
origLoadingView.hideAllViews();

// Make sure the opposite end is hidden too
oppositeListViewLoadingView.setVisibility(View.GONE);
Expand Down Expand Up @@ -169,7 +170,7 @@ void onReset() {
if (listViewLoadingLayout.getVisibility() == View.VISIBLE) {

// Set our Original View to Visible
originalLoadingLayout.setVisibility(View.VISIBLE);
originalLoadingLayout.showInvisibleViews();

// Hide the ListView Header/Footer
listViewLoadingLayout.setVisibility(View.GONE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,36 @@ public final void adjustWidthUsingRightPadding(final int width) {
getPaddingBottom());
}

public final void hideAllViews() {
if (View.VISIBLE == mHeaderText.getVisibility()) {
mHeaderText.setVisibility(View.INVISIBLE);
}
if (View.VISIBLE == mHeaderProgress.getVisibility()) {
mHeaderProgress.setVisibility(View.INVISIBLE);
}
if (View.VISIBLE == mHeaderImage.getVisibility()) {
mHeaderImage.setVisibility(View.INVISIBLE);
}
if (View.VISIBLE == mSubHeaderText.getVisibility()) {
mSubHeaderText.setVisibility(View.INVISIBLE);
}
}

public final void showInvisibleViews() {
if (View.INVISIBLE == mHeaderText.getVisibility()) {
mHeaderText.setVisibility(View.VISIBLE);
}
if (View.INVISIBLE == mHeaderProgress.getVisibility()) {
mHeaderProgress.setVisibility(View.VISIBLE);
}
if (View.INVISIBLE == mHeaderImage.getVisibility()) {
mHeaderImage.setVisibility(View.VISIBLE);
}
if (View.INVISIBLE == mSubHeaderText.getVisibility()) {
mSubHeaderText.setVisibility(View.VISIBLE);
}
}

public final void onPull(float scaleOfLayout) {
if (!mUseIntrinsicAnimation) {
onPullImpl(scaleOfLayout);
Expand Down

0 comments on commit 1669f28

Please sign in to comment.