]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/model/Data.java
drop functionality for limiting account tree display to selected accounts
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / model / Data.java
index 243cb36138dd580e751c2ca31b6ed19688239f27..4a79095a1e95b3d28f915f507b435854daf5c71c 100644 (file)
@@ -21,6 +21,8 @@ import android.database.Cursor;
 import android.database.sqlite.SQLiteDatabase;
 import android.os.AsyncTask;
 
+import androidx.lifecycle.MutableLiveData;
+
 import net.ktnx.mobileledger.App;
 import net.ktnx.mobileledger.async.RetrieveTransactionsTask;
 import net.ktnx.mobileledger.ui.activity.MainActivity;
@@ -29,7 +31,6 @@ import net.ktnx.mobileledger.utils.Locker;
 import net.ktnx.mobileledger.utils.Logger;
 import net.ktnx.mobileledger.utils.MLDB;
 import net.ktnx.mobileledger.utils.ObservableList;
-import net.ktnx.mobileledger.utils.ObservableValue;
 
 import java.lang.ref.WeakReference;
 import java.util.ArrayList;
@@ -38,8 +39,6 @@ import java.util.List;
 import java.util.Locale;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import androidx.lifecycle.MutableLiveData;
-
 import static net.ktnx.mobileledger.utils.Logger.debug;
 
 public final class Data {
@@ -51,7 +50,6 @@ public final class Data {
     public static MutableLiveData<MobileLedgerProfile> profile = new MutableLiveData<>();
     public static MutableLiveData<ArrayList<MobileLedgerProfile>> profiles =
             new MutableLiveData<>(null);
-    public static ObservableValue<Boolean> optShowOnlyStarred = new ObservableValue<>();
     public static MutableLiveData<String> accountFilter = new MutableLiveData<>();
     private static AtomicInteger backgroundTaskCount = new AtomicInteger(0);
     private static Locker profilesLocker = new Locker();
@@ -78,7 +76,7 @@ public final class Data {
     public static int getProfileIndex(MobileLedgerProfile profile) {
         try (LockHolder ignored = profilesLocker.lockForReading()) {
             List<MobileLedgerProfile> prList = profiles.getValue();
-            assert prList != null;
+            if (prList == null) throw new AssertionError();
             for (int i = 0; i < prList.size(); i++) {
                 MobileLedgerProfile p = prList.get(i);
                 if (p.equals(profile)) return i;
@@ -91,7 +89,7 @@ public final class Data {
     public static int getProfileIndex(String profileUUID) {
         try (LockHolder ignored = profilesLocker.lockForReading()) {
             List<MobileLedgerProfile> prList = profiles.getValue();
-            assert prList != null;
+            if (prList == null) throw new AssertionError();
             for (int i = 0; i < prList.size(); i++) {
                 MobileLedgerProfile p = prList.get(i);
                 if (p.getUuid().equals(profileUUID)) return i;