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">
<com.getbase.floatingactionbutton.FloatingActionButton
android:id="@+id/fab_upload"
Bundle args = new Bundle();
args.putBoolean(OCFileListFragment.ARG_JUST_FOLDERS, true);
args.putBoolean(OCFileListFragment.ARG_ALLOW_CONTEXTUAL_ACTIONS, false);
+ args.putBoolean(OCFileListFragment.ARG_HIDE_FAB, true);
listOfFiles.setArguments(args);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.add(R.id.fragment_container, listOfFiles, TAG_LIST_OF_FOLDERS);
public final static String ARG_JUST_FOLDERS = MY_PACKAGE + ".JUST_FOLDERS";
public final static String ARG_ALLOW_CONTEXTUAL_ACTIONS = MY_PACKAGE + ".ALLOW_CONTEXTUAL";
+ public final static String ARG_HIDE_FAB = MY_PACKAGE + ".HIDE_FAB";
private static final String KEY_FILE = MY_PACKAGE + ".extra.FILE";
private static final String KEY_FAB_EVER_CLICKED = "FAB_EVER_CLICKED";
setListAdapter(mAdapter);
registerLongClickListener();
- 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();
+ 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();
+ }
}
}