]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java
account list: queue db updates when an account is expanded/collapsed
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / activity / MainActivity.java
index 3e8e9c569747f42ae25df98af2bf546b3793882a..fbfb9f59383197529ef57b77dcc5b41d244dfe9b 100644 (file)
@@ -38,6 +38,7 @@ import android.widget.Toast;
 import com.google.android.material.floatingactionbutton.FloatingActionButton;
 
 import net.ktnx.mobileledger.R;
+import net.ktnx.mobileledger.async.DbOpQueue;
 import net.ktnx.mobileledger.async.RefreshDescriptionsTask;
 import net.ktnx.mobileledger.async.RetrieveTransactionsTask;
 import net.ktnx.mobileledger.model.Data;
@@ -577,7 +578,9 @@ public class MainActivity extends ProfileThemedActivity {
                 ViewPropertyAnimator animator = arrow.animate();
 
                 acc.toggleExpanded();
-                Data.profile.get().storeAccount(MLDB.getDatabase(), acc);
+                DbOpQueue.add("update accounts set expanded=? where name=? and profile=?",
+                        new Object[]{acc.isExpanded(), acc.getName(), Data.profile.get().getUuid()
+                        });
 
                 if (wasExpanded) {
                     Log.d("accounts", String.format("Collapsing account '%s'", acc.getName()));