X-Git-Url: https://git.ktnx.net/?p=mobile-ledger.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fui%2Fprofiles%2FProfileDetailModel.java;h=2460b2e0938eb8855e1e9b000679bd819b55daec;hp=a00ec9454b756083d0fe7d8f2df6632ad9c86d7e;hb=709907abf6ae18e4b85ae85f6cf1c558fed99bd3;hpb=cf5745a939dd043b6b144c416fd4e8257b2cac66 diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailModel.java b/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailModel.java index a00ec945..2460b2e0 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailModel.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailModel.java @@ -50,6 +50,7 @@ import static net.ktnx.mobileledger.db.Profile.NO_PROFILE_ID; public class ProfileDetailModel extends ViewModel { private static final String HTTPS_URL_START = "https://"; private final MutableLiveData profileName = new MutableLiveData<>(); + private final MutableLiveData orderNo = new MutableLiveData<>(); private final MutableLiveData postingPermitted = new MutableLiveData<>(true); private final MutableLiveData defaultCommodity = new MutableLiveData<>(null); private final MutableLiveData futureDates = @@ -231,6 +232,7 @@ public class ProfileDetailModel extends ViewModel { if (mProfile != null) { profileId.setValue(mProfile.getId()); profileName.setValue(mProfile.getName()); + orderNo.setValue(mProfile.getOrderNo()); postingPermitted.setValue(mProfile.permitPosting()); showCommentsByDefault.setValue(mProfile.getShowCommentsByDefault()); showCommodityByDefault.setValue(mProfile.getShowCommodityByDefault()); @@ -256,6 +258,7 @@ public class ProfileDetailModel extends ViewModel { } else { profileId.setValue(NO_PROFILE_ID); + orderNo.setValue(-1); profileName.setValue(null); url.setValue(HTTPS_URL_START); postingPermitted.setValue(true); @@ -273,6 +276,7 @@ public class ProfileDetailModel extends ViewModel { void updateProfile(Profile mProfile) { mProfile.setId(profileId.getValue()); mProfile.setName(profileName.getValue()); + mProfile.setOrderNo(orderNo.getValue()); mProfile.setUrl(url.getValue()); mProfile.setPermitPosting(postingPermitted.getValue()); mProfile.setShowCommentsByDefault(showCommentsByDefault.getValue());