From: Andy Scherzinger Date: Tue, 27 Oct 2015 12:39:50 +0000 (+0100) Subject: hide FAB in copy/move folder chooser X-Git-Tag: beta-20151202~3^2~22 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/a5022ce01d3a6eabf797ed16e53a0a55c44d07a6?ds=inline;hp=--cc hide FAB in copy/move folder chooser --- a5022ce01d3a6eabf797ed16e53a0a55c44d07a6 diff --git a/res/layout/list_fragment.xml b/res/layout/list_fragment.xml index a4791b4f..ac28fcf2 100644 --- a/res/layout/list_fragment.xml +++ b/res/layout/list_fragment.xml @@ -97,7 +97,8 @@ fab:fab_labelStyle="@style/menu_labels_style" android:layout_marginBottom="@dimen/standard_margin" android:layout_marginRight="@dimen/standard_margin" - android:layout_marginEnd="@dimen/standard_margin"> + android:layout_marginEnd="@dimen/standard_margin" + android:visibility="gone"> 0) { - miniFabClicked = true; - } - - // add labels to the min FABs when none of them has ever been clicked on - if(!miniFabClicked) { - setFabLabels(); + boolean hideFab = (args != null) && args.getBoolean(ARG_HIDE_FAB, false); + if (hideFab) { + setFabEnabled(false); } else { - removeFabLabels(); + setFabEnabled(true); + registerFabListeners(); + + // detect if a mini FAB has ever been clicked + final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity()); + if(prefs.getLong(KEY_FAB_EVER_CLICKED, 0) > 0) { + miniFabClicked = true; + } + + // add labels to the min FABs when none of them has ever been clicked on + if(!miniFabClicked) { + setFabLabels(); + } else { + removeFabLabels(); + } } }