X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fui%2Fprofiles%2FProfileDetailFragment.java;h=f6323d5134571b2443d2c6e5700b28faec202e30;hb=05c2c408dabdda9e042744c5f4e4f126a7fb30d1;hp=aba3b0f2c4f9b9829a996b8bfca9a988046f10f1;hpb=8ee42b51c43efbd0ff6fa0fec257132d4421f53d;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 aba3b0f2..f6323d51 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,17 +256,23 @@ 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))); + Switch showCommentsByDefault = context.findViewById(R.id.profile_show_comments); + model.observeShowCommentsByDefault(viewLifecycleOwner, isChecked -> { + showCommentsByDefault.setChecked(isChecked); + }); + showCommentsByDefault.setOnCheckedChangeListener( + ((buttonView, isChecked) -> model.setShowCommentsByDefault(isChecked))); + defaultCommodity = context.findViewById(R.id.default_commodity_text); futureDatesLayout = context.findViewById(R.id.future_dates_layout);