add XMR to receive spinners (again) (#640)

This commit is contained in:
m2049r 2019-11-19 22:56:28 +01:00 committed by GitHub
parent 1209295a8c
commit 286a04b5ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 0 deletions

View File

@ -44,6 +44,9 @@ import com.m2049r.xmrwallet.service.exchange.api.ExchangeCallback;
import com.m2049r.xmrwallet.service.exchange.api.ExchangeRate;
import com.m2049r.xmrwallet.util.Helper;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import timber.log.Timber;
@ -147,6 +150,15 @@ public class ExchangeView extends LinearLayout {
inflater.inflate(R.layout.view_exchange, this);
}
void setCurrencyAdapter(Spinner spinner) {
List<String> currencies = new ArrayList<>();
currencies.add(Helper.BASE_CRYPTO);
currencies.addAll(Arrays.asList(getResources().getStringArray(R.array.currency)));
ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_item, currencies);
spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(spinnerAdapter);
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
@ -161,6 +173,9 @@ public class ExchangeView extends LinearLayout {
evExchange = findViewById(R.id.evExchange);
pbExchange = findViewById(R.id.pbExchange);
setCurrencyAdapter(sCurrencyA);
setCurrencyAdapter(sCurrencyB);
// make progress circle gray
pbExchange.getIndeterminateDrawable().
setColorFilter(getResources().getColor(R.color.trafficGray),