Skip to content

Commit

Permalink
Merge pull request google#864 from iankchristie/logovisibilityfix
Browse files Browse the repository at this point in the history
Set background image invisible when not in use
  • Loading branch information
cco3 authored Nov 30, 2016
2 parents c0a9c6d + 8065269 commit 79eac72
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ public void run() {
Log.d(TAG, "running first scan timeout");
if (!mGroupIdQueue.isEmpty()) {
emptyGroupIdQueue();
mSwipeRefreshWidget.setRefreshing(false);
mScanningAnimationDrawable.stop();
setRefreshWidgetInvisible();
}
}
};
Expand All @@ -112,8 +111,7 @@ public void run() {
Log.d(TAG, "running second scan timeout");
emptyGroupIdQueue();
mSecondScanComplete = true;
mSwipeRefreshWidget.setRefreshing(false);
mScanningAnimationDrawable.stop();
setRefreshWidgetInvisible();
if (mNearbyDeviceAdapter.getCount() == 0) {
int tintColor = ContextCompat.getColor(getActivity(), R.color.physical_web_logo);
mScanningAnimationDrawable.setColorFilter(tintColor, PorterDuff.Mode.SRC_IN);
Expand Down Expand Up @@ -335,8 +333,7 @@ private void stopScanningDisplay() {
mHandler.removeCallbacks(mThirdScanTimeout);

// Change the display appropriately
mSwipeRefreshWidget.setRefreshing(false);
mScanningAnimationDrawable.stop();
setRefreshWidgetInvisible();
}

private void startScanningDisplay(long scanStartTime, boolean hasResults) {
Expand All @@ -351,8 +348,7 @@ private void startScanningDisplay(long scanStartTime, boolean hasResults) {
mScanningAnimationTextView.setText(R.string.empty_nearby_beacons_list_text);
mScanningAnimationDrawable.start();
} else {
mSwipeRefreshWidget.setRefreshing(false);
mScanningAnimationDrawable.stop();
setRefreshWidgetInvisible();
}

// Schedule the timeouts
Expand Down Expand Up @@ -401,6 +397,12 @@ private static boolean isFolderItem(PwPair item) {
return item.getUrlDevice() == null && item.getPwsResult().getSiteUrl() == null;
}

private void setRefreshWidgetInvisible() {
mSwipeRefreshWidget.setRefreshing(false);
mScanningAnimationDrawable.stop();
mScanningAnimationTextView.setVisibility(View.INVISIBLE);
}

// Adapter for holding beacons found through scanning.
private class NearbyBeaconsAdapter extends BaseAdapter {
private List<PwPair> mPwPairs;
Expand Down Expand Up @@ -593,5 +595,5 @@ public void clear() {
notifyDataSetChanged();
}
}
}

}

0 comments on commit 79eac72

Please sign in to comment.