From 99a8d4ca9f0f56ceacf69cdc8b171ac27628658c Mon Sep 17 00:00:00 2001 From: Clayton Wilson Date: Sat, 28 Nov 2020 21:14:57 -0500 Subject: [PATCH] Finished pull-to-refresh on list activity --- .../java/com/example/listify/ListPage.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Listify/app/src/main/java/com/example/listify/ListPage.java b/Listify/app/src/main/java/com/example/listify/ListPage.java index fd6c3fe..1cfeb24 100644 --- a/Listify/app/src/main/java/com/example/listify/ListPage.java +++ b/Listify/app/src/main/java/com/example/listify/ListPage.java @@ -205,19 +205,20 @@ public class ListPage extends AppCompatActivity implements Requestor.Receiver { @Override public void acceptDelivery(Object delivered) { // Clear out old values + pNames.clear(); + pStores.clear(); + pPrices.clear(); + pQuantity.clear(); + pImages.clear(); + totalPriceByStore.clear(); + storeID2Name.clear(); + storeHeaderIndex.clear(); + pListItemPair.clear(); + totalPrice = 0; + runOnUiThread(new Runnable() { @Override public void run() { - pNames.clear(); - pStores.clear(); - pPrices.clear(); - pQuantity.clear(); - pImages.clear(); - totalPriceByStore.clear(); - storeID2Name.clear(); - storeHeaderIndex.clear(); - pListItemPair.clear(); - totalPrice = 0; tvTotalPrice.setText(String.format("$%.2f", totalPrice)); } });