From: Damyan Ivanov Date: Wed, 13 May 2020 19:10:33 +0000 (+0300) Subject: profile details: put posting params in a layout so that they can be hidden easier X-Git-Tag: v0.13.0~10 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=6be2c106704f8b378ec3febaa3ad65bce7d3aad9;p=mobile-ledger.git profile details: put posting params in a layout so that they can be hidden easier --- 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..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))); diff --git a/app/src/main/res/layout/profile_detail.xml b/app/src/main/res/layout/profile_detail.xml index f640f3e6..b70d55f0 100644 --- a/app/src/main/res/layout/profile_detail.xml +++ b/app/src/main/res/layout/profile_detail.xml @@ -162,36 +162,42 @@ android:textAppearance="?android:textAppearanceListItem" /> + android:orientation="vertical"> - + android:layout_marginBottom="16dp" + android:clickable="true" + android:focusable="true" + android:orientation="vertical"> - + + + + + - - - + android:layout_marginBottom="16dp" + android:text="@string/currency_input_by_default" + android:textAppearance="?android:textAppearanceListItem" /> - - - - + - + + - - + android:layout_marginBottom="16dp" + android:orientation="vertical"> + + + + No transactions with preferred account found icon Comments + Show comment fields by default