From 6be2c106704f8b378ec3febaa3ad65bce7d3aad9 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Wed, 13 May 2020 22:10:33 +0300 Subject: [PATCH] profile details: put posting params in a layout so that they can be hidden easier --- .../ui/profiles/ProfileDetailFragment.java | 7 +- app/src/main/res/layout/profile_detail.xml | 107 ++++++++++-------- app/src/main/res/values/strings.xml | 1 + 3 files changed, 61 insertions(+), 54 deletions(-) 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 -- 2.39.2