X-Git-Url: https://git.ktnx.net/?p=mobile-ledger.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fui%2Fprofiles%2FProfilesRecyclerViewAdapter.java;fp=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fui%2Fprofiles%2FProfilesRecyclerViewAdapter.java;h=b2b5cb7fe18f9ee86867b041ad134c1625c6270e;hp=974c979322f79ff0e2f7c74aab3dc07e8cd93d2f;hb=0ce370cea3c5c980b6eeb14acf965188ae951f51;hpb=55ec17266ef8c6955fe1a29a44986497456762f1 diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfilesRecyclerViewAdapter.java b/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfilesRecyclerViewAdapter.java index 974c9793..b2b5cb7f 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfilesRecyclerViewAdapter.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfilesRecyclerViewAdapter.java @@ -136,7 +136,7 @@ public class ProfilesRecyclerViewAdapter if (profile == null) throw new IllegalStateException("Profile row without associated profile"); debug("profiles", "Setting profile to " + profile.getName()); - if (Data.profile.getValue() != profile ) + if (Data.getProfile() != profile) Data.drawerOpen.setValue(false); Data.setCurrentProfile(profile); } @@ -177,9 +177,9 @@ public class ProfilesRecyclerViewAdapter final ArrayList profiles = Data.profiles.getValue(); if (profiles == null) throw new AssertionError(); final MobileLedgerProfile profile = profiles.get(position); - final MobileLedgerProfile currentProfile = Data.profile.getValue(); + final MobileLedgerProfile currentProfile = Data.getProfile(); debug("profiles", String.format(Locale.ENGLISH, "pos %d: %s, current: %s", position, - profile.getUuid(), (currentProfile == null) ? "" : currentProfile.getUuid())); + profile.getUuid(), currentProfile.getUuid())); holder.itemView.setTag(profile); int hue = profile.getThemeHue(); @@ -192,7 +192,7 @@ public class ProfilesRecyclerViewAdapter holder.mEditButton.setOnClickListener(mOnClickListener); - final boolean sameProfile = (currentProfile != null) && currentProfile.equals(profile); + final boolean sameProfile = currentProfile.equals(profile); holder.itemView .setBackground(sameProfile ? new ColorDrawable(Colors.tableRowDarkBG) : null); if (editingProfiles.getValue()) {