]> git.ktnx.net Git - mobile-ledger.git/commitdiff
fix currency selector without parameters (position/gap)
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 6 May 2021 19:43:22 +0000 (22:43 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 6 May 2021 19:43:22 +0000 (22:43 +0300)
app/src/main/java/net/ktnx/mobileledger/ui/CurrencySelectorFragment.java

index bcd62d99fc95225fb7114f24f2cf1a174ebaa475..759cd90e78451d01887dbb488cb1910d2967ace0 100644 (file)
@@ -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();