Skip to content

Commit

Permalink
Set background image invisible when not in use
Browse files Browse the repository at this point in the history
Fixing bug that occurred when the device was turned. It would
show the background logo before redrawing the listview. This
sets the background textview to invisible after scanning is
completed.
  • Loading branch information
iankchristie committed Nov 30, 2016
1 parent c0a9c6d commit 8065269
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 8065269

Please sign in to comment.