Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 8065269

Browse files
committed
Set background image invisible when not in use
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.
1 parent c0a9c6d commit 8065269

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

android/PhysicalWeb/app/src/main/java/org/physical_web/physicalweb/NearbyBeaconsFragment.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ public void run() {
9999
Log.d(TAG, "running first scan timeout");
100100
if (!mGroupIdQueue.isEmpty()) {
101101
emptyGroupIdQueue();
102-
mSwipeRefreshWidget.setRefreshing(false);
103-
mScanningAnimationDrawable.stop();
102+
setRefreshWidgetInvisible();
104103
}
105104
}
106105
};
@@ -112,8 +111,7 @@ public void run() {
112111
Log.d(TAG, "running second scan timeout");
113112
emptyGroupIdQueue();
114113
mSecondScanComplete = true;
115-
mSwipeRefreshWidget.setRefreshing(false);
116-
mScanningAnimationDrawable.stop();
114+
setRefreshWidgetInvisible();
117115
if (mNearbyDeviceAdapter.getCount() == 0) {
118116
int tintColor = ContextCompat.getColor(getActivity(), R.color.physical_web_logo);
119117
mScanningAnimationDrawable.setColorFilter(tintColor, PorterDuff.Mode.SRC_IN);
@@ -335,8 +333,7 @@ private void stopScanningDisplay() {
335333
mHandler.removeCallbacks(mThirdScanTimeout);
336334

337335
// Change the display appropriately
338-
mSwipeRefreshWidget.setRefreshing(false);
339-
mScanningAnimationDrawable.stop();
336+
setRefreshWidgetInvisible();
340337
}
341338

342339
private void startScanningDisplay(long scanStartTime, boolean hasResults) {
@@ -351,8 +348,7 @@ private void startScanningDisplay(long scanStartTime, boolean hasResults) {
351348
mScanningAnimationTextView.setText(R.string.empty_nearby_beacons_list_text);
352349
mScanningAnimationDrawable.start();
353350
} else {
354-
mSwipeRefreshWidget.setRefreshing(false);
355-
mScanningAnimationDrawable.stop();
351+
setRefreshWidgetInvisible();
356352
}
357353

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

400+
private void setRefreshWidgetInvisible() {
401+
mSwipeRefreshWidget.setRefreshing(false);
402+
mScanningAnimationDrawable.stop();
403+
mScanningAnimationTextView.setVisibility(View.INVISIBLE);
404+
}
405+
404406
// Adapter for holding beacons found through scanning.
405407
private class NearbyBeaconsAdapter extends BaseAdapter {
406408
private List<PwPair> mPwPairs;
@@ -593,5 +595,5 @@ public void clear() {
593595
notifyDataSetChanged();
594596
}
595597
}
596-
}
597598

599+
}

0 commit comments

Comments
 (0)