From: Damyan Ivanov Date: Sun, 5 May 2019 15:22:49 +0000 (+0300) Subject: notify the profile list adapter when a profile is changed X-Git-Tag: v0.10.0~10 X-Git-Url: https://git.ktnx.net/?p=mobile-ledger.git;a=commitdiff_plain;h=8e388085aade7f5a1ef616e61bf5b026dfe94411 notify the profile list adapter when a profile is changed was broken after migration of the profile list to LiveData --- diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailFragment.java b/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailFragment.java index c0944f9a..b51ddbb5 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailFragment.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailFragment.java @@ -146,6 +146,10 @@ public class ProfileDetailFragment extends Fragment implements HueRingDialog.Hue final ArrayList 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