]> git.ktnx.net Git - mobile-ledger.git/commitdiff
CurrencySelectorModel: proper initialization of currencies list
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 15 Aug 2020 12:02:32 +0000 (12:02 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 15 Aug 2020 12:48:13 +0000 (12:48 +0000)
app/src/main/java/net/ktnx/mobileledger/ui/CurrencySelectorModel.java

index 89b787922730f575d298fe32551ab5b124d872dc..4b346cdf7759d16ceb4b7e3bea18f3cd51ab8d2e 100644 (file)
@@ -24,6 +24,7 @@ import androidx.lifecycle.ViewModel;
 
 import net.ktnx.mobileledger.model.Currency;
 
+import java.util.ArrayList;
 import java.util.List;
 
 public class CurrencySelectorModel extends ViewModel {
@@ -31,7 +32,7 @@ public class CurrencySelectorModel extends ViewModel {
     private final MutableLiveData<Boolean> positionAndPaddingVisible = new MutableLiveData<>(true);
     private OnCurrencySelectedListener selectionListener;
     public CurrencySelectorModel() {
-        this.currencies = new MutableLiveData<>();
+        this.currencies = new MutableLiveData<>(new ArrayList<>());
     }
     public void showPositionAndPadding() {
         positionAndPaddingVisible.postValue(true);