From d446296a0a2bd86fc1a4e5de3bed9289dc042396 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Thu, 6 May 2021 22:43:22 +0300 Subject: [PATCH] fix currency selector without parameters (position/gap) --- .../ktnx/mobileledger/ui/CurrencySelectorFragment.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/CurrencySelectorFragment.java b/app/src/main/java/net/ktnx/mobileledger/ui/CurrencySelectorFragment.java index bcd62d99..759cd90e 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/CurrencySelectorFragment.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/CurrencySelectorFragment.java @@ -197,8 +197,13 @@ public class CurrencySelectorFragment extends AppCompatDialogFragment visible ? View.VISIBLE : View.GONE)); - if ((savedInstanceState != null) ? savedInstanceState.getBoolean(ARG_SHOW_PARAMS, - DEFAULT_SHOW_PARAMS) : DEFAULT_SHOW_PARAMS) + final boolean showParams; + if (getArguments() == null) + showParams = DEFAULT_SHOW_PARAMS; + else + showParams = getArguments().getBoolean(ARG_SHOW_PARAMS, DEFAULT_SHOW_PARAMS); + + if (showParams) model.showPositionAndPadding(); else model.hidePositionAndPadding(); -- 2.39.5