X-Git-Url: https://git.ktnx.net/?p=mobile-ledger-staging.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fui%2Fprofiles%2FProfileDetailModel.java;h=5de553481684c8a78c12a3edd2a8e182b4e0acad;hp=4cbbfe3d6fda715fa69b0668995aa51f0b61df97;hb=bb789332571609eeb1bef6e39b7ad359227d1045;hpb=28049f2a891665fd03f19617292236cb50ab4622 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 4cbbfe3d..5de55348 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 @@ -24,7 +24,7 @@ import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModel; -import net.ktnx.mobileledger.async.SendTransactionTask; +import net.ktnx.mobileledger.json.API; import net.ktnx.mobileledger.model.Currency; import net.ktnx.mobileledger.model.HledgerVersion; import net.ktnx.mobileledger.model.MobileLedgerProfile; @@ -53,8 +53,7 @@ public class ProfileDetailModel extends ViewModel { private final MutableLiveData showCommodityByDefault = new MutableLiveData<>(false); private final MutableLiveData showCommentsByDefault = new MutableLiveData<>(true); private final MutableLiveData useAuthentication = new MutableLiveData<>(false); - private final MutableLiveData apiVersion = - new MutableLiveData<>(SendTransactionTask.API.auto); + private final MutableLiveData apiVersion = new MutableLiveData<>(API.auto); private final MutableLiveData url = new MutableLiveData<>(null); private final MutableLiveData authUserName = new MutableLiveData<>(null); private final MutableLiveData authPassword = new MutableLiveData<>(null); @@ -137,14 +136,14 @@ public class ProfileDetailModel extends ViewModel { void observeUseAuthentication(LifecycleOwner lfo, Observer o) { useAuthentication.observe(lfo, o); } - SendTransactionTask.API getApiVersion() { + API getApiVersion() { return apiVersion.getValue(); } - void setApiVersion(SendTransactionTask.API newValue) { + void setApiVersion(API newValue) { if (newValue != apiVersion.getValue()) apiVersion.setValue(newValue); } - void observeApiVersion(LifecycleOwner lfo, Observer o) { + void observeApiVersion(LifecycleOwner lfo, Observer o) { apiVersion.observe(lfo, o); } HledgerVersion getDetectedVersion() { return detectedVersion.getValue(); } @@ -254,7 +253,7 @@ public class ProfileDetailModel extends ViewModel { showCommentsByDefault.setValue(true); showCommodityByDefault.setValue(false); setFutureDates(MobileLedgerProfile.FutureDates.None); - setApiVersion(SendTransactionTask.API.auto); + setApiVersion(API.auto); useAuthentication.setValue(false); authUserName.setValue(""); authPassword.setValue("");