]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfilesRecyclerViewAdapter.java
asynchronous profile initialisation
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / profiles / ProfilesRecyclerViewAdapter.java
index 21984333500a80d4733e684a7f7bd284967eac86..e7346b1b0487a4d4d09fea3ee474047f43592efa 100644 (file)
@@ -39,6 +39,7 @@ import androidx.recyclerview.widget.RecyclerView;
 import net.ktnx.mobileledger.R;
 import net.ktnx.mobileledger.model.Data;
 import net.ktnx.mobileledger.model.MobileLedgerProfile;
+import net.ktnx.mobileledger.ui.activity.MainActivity;
 import net.ktnx.mobileledger.utils.Colors;
 
 import java.lang.ref.WeakReference;
@@ -148,8 +149,10 @@ public class ProfilesRecyclerViewAdapter
         if (profile == null)
             throw new IllegalStateException("Profile row without associated profile");
         debug("profiles", "Setting profile to " + profile.getName());
-        if (Data.getProfile() != profile)
+        if (Data.getProfile() != profile) {
             Data.drawerOpen.setValue(false);
+            ((MainActivity) v.getContext()).storeProfilePref(profile);
+        }
         Data.setCurrentProfile(profile);
     }
     @NonNull