]> git.ktnx.net Git - mobile-ledger.git/commitdiff
notify the profile list adapter when a profile is changed
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 5 May 2019 15:22:49 +0000 (18:22 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 5 May 2019 15:23:10 +0000 (18:23 +0300)
was broken after migration of the profile list to LiveData

app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailFragment.java

index c0944f9a9261bd0aa1355a36fd2b7c9ba570df12..b51ddbb54de6c1cb53e6780a2b7586b7df3df895 100644 (file)
@@ -146,6 +146,10 @@ public class ProfileDetailFragment extends Fragment implements HueRingDialog.Hue
         final ArrayList<MobileLedgerProfile> profiles = Data.profiles.getValue();
         if (profiles == null) throw new AssertionError();
         profiles.set(index, newProfile);
+
+        ProfilesRecyclerViewAdapter prva = ProfilesRecyclerViewAdapter.getInstance();
+        if (prva != null) prva.notifyItemChanged(index);
+
         if (mProfile.equals(Data.profile.getValue())) Data.profile.setValue(newProfile);
     }
     @Override