mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2026-03-10 18:55:03 +00:00
Simplified a section of code for total price by store (used HashMap to access header section)
This commit is contained in:
@@ -100,11 +100,7 @@ public class ListPage extends AppCompatActivity {
|
||||
pListItemPair.add(entry);
|
||||
}
|
||||
else {
|
||||
int index = 0;
|
||||
|
||||
while(index < pNames.size() && !pNames.get(index).equals("Kroger")) {
|
||||
index++;
|
||||
}
|
||||
int index = storeHeaderIndex.get("Kroger");
|
||||
|
||||
totalPriceByStore.put("Kroger", totalPriceByStore.get("Kroger") + (item.getPrice().doubleValue() * entry.getQuantity()));
|
||||
pPrices.set(index, totalPriceByStore.get("Kroger").toString());
|
||||
|
||||
Reference in New Issue
Block a user