X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fui%2Fprofiles%2FProfileDetailFragment.java;h=522de24787b3374e8cbf9d18b79aa79cce2047a0;hb=6be2c106704f8b378ec3febaa3ad65bce7d3aad9;hp=61d0d519f4988c96d3bc649e7e06026eb8a8d82f;hpb=aca020bc5f699663a7389f50d5ea4e034e5d6976;p=mobile-ledger.git 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 61d0d519..522de247 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 @@ -256,13 +256,12 @@ public class ProfileDetailFragment extends Fragment { (buttonView, isChecked) -> model.setShowCommodityByDefault(isChecked)); model.observeShowCommodityByDefault(viewLifecycleOwner, showCommodityByDefault::setChecked); + View postingSubItems = context.findViewById(R.id.posting_sub_items); + Switch postingPermitted = context.findViewById(R.id.profile_permit_posting); model.observePostingPermitted(viewLifecycleOwner, isChecked -> { postingPermitted.setChecked(isChecked); - defaultCommodityLayout.setVisibility(isChecked ? View.VISIBLE : View.GONE); - showCommodityByDefault.setVisibility(isChecked ? View.VISIBLE : View.GONE); - preferredAccountsFilterLayout.setVisibility(isChecked ? View.VISIBLE : View.GONE); - futureDatesLayout.setVisibility(isChecked ? View.VISIBLE : View.GONE); + postingSubItems.setVisibility(isChecked ? View.VISIBLE : View.GONE); }); postingPermitted.setOnCheckedChangeListener( ((buttonView, isChecked) -> model.setPostingPermitted(isChecked))); @@ -321,12 +320,14 @@ public class ProfileDetailFragment extends Fragment { useAuthentication = context.findViewById(R.id.enable_http_auth); useAuthentication.setOnCheckedChangeListener((buttonView, isChecked) -> { model.setUseAuthentication(isChecked); - authParams.setVisibility(isChecked ? View.VISIBLE : View.GONE); if (isChecked) userName.requestFocus(); + }); + model.observeUseAuthentication(viewLifecycleOwner, isChecked -> { + useAuthentication.setChecked(isChecked); + authParams.setVisibility(isChecked ? View.VISIBLE : View.GONE); checkInsecureSchemeWithAuth(); }); - model.observeUseAuthentication(viewLifecycleOwner, useAuthentication::setChecked); userName = context.findViewById(R.id.auth_user_name); model.observeUserName(viewLifecycleOwner, text -> {