From fcb288e0ed51b1a71a0d479848bd4b9c21a000d0 Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Sun, 27 May 2018 00:29:28 +0200 Subject: [PATCH] Allow full list loading in selection activity --- .../com/nauk/moodl/Activities/CurrencySelectionActivity.java | 2 +- .../com/nauk/moodl/LayoutManagers/CurrencyListAdapter.java | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/nauk/moodl/Activities/CurrencySelectionActivity.java b/app/src/main/java/com/nauk/moodl/Activities/CurrencySelectionActivity.java index da96324..a302e41 100644 --- a/app/src/main/java/com/nauk/moodl/Activities/CurrencySelectionActivity.java +++ b/app/src/main/java/com/nauk/moodl/Activities/CurrencySelectionActivity.java @@ -72,7 +72,7 @@ public class CurrencySelectionActivity extends AppCompatActivity implements Sear ArrayList currencyArrayList = new ArrayList<>(); - for(int i = 0; i < currencyNames.size(); i++) + for(int i = currencyNames.size() - 1; i > 0; i--) { currencyArrayList.add(new Currency(currencyNames.get(i), currencySymbols.get(i))); } diff --git a/app/src/main/java/com/nauk/moodl/LayoutManagers/CurrencyListAdapter.java b/app/src/main/java/com/nauk/moodl/LayoutManagers/CurrencyListAdapter.java index 1ba7287..c37a411 100644 --- a/app/src/main/java/com/nauk/moodl/LayoutManagers/CurrencyListAdapter.java +++ b/app/src/main/java/com/nauk/moodl/LayoutManagers/CurrencyListAdapter.java @@ -79,16 +79,14 @@ public class CurrencyListAdapter extends ArrayAdapter { suggestions.clear(); int i = 0; - int found = 0; String temp = constraint.toString().toLowerCase(); - while(i < tempCurrency.size() && found < 50) + while(i < tempCurrency.size()) { Currency currency = tempCurrency.get(i); if (currency.getName().toLowerCase().startsWith(temp) || currency.getSymbol().toLowerCase().startsWith(temp)) { suggestions.add(currency); - found++; } i++; }