Allow full list loading in selection activity
This commit is contained in:
parent
c09fa8ca6f
commit
fcb288e0ed
@ -72,7 +72,7 @@ public class CurrencySelectionActivity extends AppCompatActivity implements Sear
|
|||||||
|
|
||||||
ArrayList<Currency> currencyArrayList = new ArrayList<>();
|
ArrayList<Currency> 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)));
|
currencyArrayList.add(new Currency(currencyNames.get(i), currencySymbols.get(i)));
|
||||||
}
|
}
|
||||||
|
@ -79,16 +79,14 @@ public class CurrencyListAdapter extends ArrayAdapter<Currency> {
|
|||||||
suggestions.clear();
|
suggestions.clear();
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int found = 0;
|
|
||||||
String temp = constraint.toString().toLowerCase();
|
String temp = constraint.toString().toLowerCase();
|
||||||
|
|
||||||
while(i < tempCurrency.size() && found < 50)
|
while(i < tempCurrency.size())
|
||||||
{
|
{
|
||||||
Currency currency = tempCurrency.get(i);
|
Currency currency = tempCurrency.get(i);
|
||||||
if (currency.getName().toLowerCase().startsWith(temp)
|
if (currency.getName().toLowerCase().startsWith(temp)
|
||||||
|| currency.getSymbol().toLowerCase().startsWith(temp)) {
|
|| currency.getSymbol().toLowerCase().startsWith(temp)) {
|
||||||
suggestions.add(currency);
|
suggestions.add(currency);
|
||||||
found++;
|
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user