瀏覽代碼

Merge pull request #1100 from owncloud/material_fab

Material FAB with speed dial implementation
David A. Velasco 9 年之前
父節點
當前提交
b2c81d3b08
共有 58 個文件被更改,包括 601 次插入50 次删除
  1. 2 0
      SETUP.md
  2. 5 1
      THIRD_PARTY.txt
  3. 1 0
      build.gradle
  4. 9 0
      libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/.classpath
  5. 14 0
      libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/AndroidManifest.xml
  6. 55 0
      libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/R.txt
  7. 14 0
      libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/aapt/AndroidManifest.xml
  8. 二進制
      libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/annotations.zip
  9. 92 0
      libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/build.xml
  10. 二進制
      libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/jars/classes.jar
  11. 二進制
      libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/libs/classes.jar
  12. 5 0
      libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/proguard.txt
  13. 15 0
      libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/project.properties
  14. 二進制
      libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/res/drawable-hdpi-v4/fab_bg_mini.png
  15. 二進制
      libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/res/drawable-hdpi-v4/fab_bg_normal.png
  16. 二進制
      libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/res/drawable-mdpi-v4/fab_bg_mini.png
  17. 二進制
      libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/res/drawable-mdpi-v4/fab_bg_normal.png
  18. 二進制
      libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/res/drawable-xhdpi-v4/fab_bg_mini.png
  19. 二進制
      libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/res/drawable-xhdpi-v4/fab_bg_normal.png
  20. 二進制
      libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/res/drawable-xxhdpi-v4/fab_bg_mini.png
  21. 二進制
      libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/res/drawable-xxhdpi-v4/fab_bg_normal.png
  22. 二進制
      libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/res/drawable-xxxhdpi-v4/fab_bg_mini.png
  23. 二進制
      libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/res/drawable-xxxhdpi-v4/fab_bg_normal.png
  24. 22 0
      libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/res/values/values.xml
  25. 2 0
      libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/src/.readme
  26. 1 0
      project.properties
  27. 二進制
      res/drawable-hdpi-v9/ic_action_download.png
  28. 二進制
      res/drawable-hdpi-v9/ic_action_refresh.png
  29. 二進制
      res/drawable-hdpi-v9/ic_action_settings.png
  30. 二進制
      res/drawable-hdpi/ic_checkbox_blank_outline.png
  31. 二進制
      res/drawable-hdpi/ic_checkbox_marked.png
  32. 二進制
      res/drawable-hdpi/ic_import.png
  33. 二進制
      res/drawable-mdpi-v9/ic_action_download.png
  34. 二進制
      res/drawable-mdpi-v9/ic_action_refresh.png
  35. 二進制
      res/drawable-mdpi-v9/ic_action_settings.png
  36. 二進制
      res/drawable-mdpi/ic_checkbox_blank_outline.png
  37. 二進制
      res/drawable-mdpi/ic_checkbox_marked.png
  38. 二進制
      res/drawable-mdpi/ic_import.png
  39. 二進制
      res/drawable-xhdpi/ic_import.png
  40. 二進制
      res/drawable-xxhdpi/ic_import.png
  41. 二進制
      res/drawable-xxhdpi/ic_sort_variant.png
  42. 11 0
      res/drawable/fab_label_background.xml
  43. 0 1
      res/layout-land/account_setup.xml
  44. 3 2
      res/layout/list_footer.xml
  45. 57 5
      res/layout/list_fragment.xml
  46. 5 12
      res/menu/main_menu.xml
  47. 9 2
      res/values/colors.xml
  48. 9 1
      res/values/styles.xml
  49. 1 0
      setup_env.bat
  50. 1 0
      setup_env.sh
  51. 31 22
      src/com/owncloud/android/ui/activity/FileDisplayActivity.java
  52. 1 1
      src/com/owncloud/android/ui/activity/FolderPickerActivity.java
  53. 14 0
      src/com/owncloud/android/ui/activity/UploadFilesActivity.java
  54. 0 1
      src/com/owncloud/android/ui/activity/Uploader.java
  55. 42 0
      src/com/owncloud/android/ui/fragment/ExtendedListFragment.java
  56. 1 1
      src/com/owncloud/android/ui/fragment/LocalFileListFragment.java
  57. 178 0
      src/com/owncloud/android/ui/fragment/OCFileListFragment.java
  58. 1 1
      tests/project.properties

+ 2 - 0
SETUP.md

@@ -91,6 +91,7 @@ The generated APK file is saved in android/build/outputs/apk as android-debug.ap
   - owncloud-android 
   - android-support-appcompat-v7-exploded-aar
   - android-support-design-exploded-aar
+  - com-getbase-floatingactionbutton-1-10-0-exploded-aar
   - owncloud-android-workaround-accounts (optional)
   - ownCloud Android Library
   - ownCloud Sample Client (optional)
@@ -104,6 +105,7 @@ The generated APK file is saved in android/build/outputs/apk as android-debug.ap
   - ownCloud Android Library
   - android-support-appcompat-v7-exploded-aar
   - android-support-design-exploded-aar
+  - com-getbase-floatingactionbutton-1-10-0-exploded-aar
   - owncloud-android
 * If any error on those projects persists, check the project properties. In the 'Android' section, API Level should be
   - ownCloud Android Library	-> API level 19

+ 5 - 1
THIRD_PARTY.txt

@@ -59,4 +59,8 @@ The third party software included and used by this project is:
    modifications com.ortiz.touch.ExtendedViewPager and com.ortiz.touch.TouchImageView classes. 
    See https://github.com/MikeOrtiz/TouchImageView
  
- 
+ * floatingactionbutton 1.10.1.
+   Copyright (c) 2014 Jerzy Chalupski
+   Licensed under Apache License, Version 2.0.
+   placed at libs/com-getbase-floatingactionbutton-1-10-0-exploded-aar has been exploded by ownCloud Inc.
+   See https://github.com/futuresimple/android-floating-action-button 

+ 1 - 0
build.gradle

@@ -25,6 +25,7 @@ dependencies {
     compile 'com.android.support:design:23.1.1'
     compile 'com.jakewharton:disklrucache:2.0.2'
     compile 'com.android.support:appcompat-v7:23.1.1'
+    compile 'com.getbase:floatingactionbutton:1.10.1'
 }
 
 android {

+ 9 - 0
libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/.classpath

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="gen"/>
+	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
+	<classpathentry kind="output" path="bin/classes"/>
+</classpath>

+ 14 - 0
libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/AndroidManifest.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest
+    package="com.getbase.floatingactionbutton"
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:versionCode="15"
+    android:versionName="1.10.1" >
+
+    <uses-sdk
+        android:minSdkVersion="14"
+        android:targetSdkVersion="22" />
+
+    <application />
+
+</manifest>

+ 55 - 0
libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/R.txt

@@ -0,0 +1,55 @@
+int attr fab_addButtonColorNormal 0x7f010009
+int attr fab_addButtonColorPressed 0x7f010008
+int attr fab_addButtonPlusIconColor 0x7f01000b
+int attr fab_addButtonSize 0x7f01000a
+int attr fab_addButtonStrokeVisible 0x7f01000c
+int attr fab_colorDisabled 0x7f010002
+int attr fab_colorNormal 0x7f010003
+int attr fab_colorPressed 0x7f010001
+int attr fab_expandDirection 0x7f01000f
+int attr fab_icon 0x7f010004
+int attr fab_labelStyle 0x7f01000d
+int attr fab_labelsPosition 0x7f01000e
+int attr fab_plusIconColor 0x7f010000
+int attr fab_size 0x7f010005
+int attr fab_stroke_visible 0x7f010007
+int attr fab_title 0x7f010006
+int dimen fab_actions_spacing 0x7f030000
+int dimen fab_icon_size 0x7f030001
+int dimen fab_labels_margin 0x7f030002
+int dimen fab_plus_icon_size 0x7f030003
+int dimen fab_plus_icon_stroke 0x7f030004
+int dimen fab_shadow_offset 0x7f030005
+int dimen fab_shadow_radius 0x7f030006
+int dimen fab_size_mini 0x7f030007
+int dimen fab_size_normal 0x7f030008
+int dimen fab_stroke_width 0x7f030009
+int drawable fab_bg_mini 0x7f020000
+int drawable fab_bg_normal 0x7f020001
+int id down 0x7f040006
+int id fab_expand_menu_button 0x7f040000
+int id fab_label 0x7f040001
+int id left 0x7f040004
+int id mini 0x7f040002
+int id normal 0x7f040003
+int id right 0x7f040005
+int id up 0x7f040007
+int[] styleable AddFloatingActionButton { 0x7f010000 }
+int styleable AddFloatingActionButton_fab_plusIconColor 0
+int[] styleable FloatingActionButton { 0x7f010001, 0x7f010002, 0x7f010003, 0x7f010004, 0x7f010005, 0x7f010006, 0x7f010007 }
+int styleable FloatingActionButton_fab_colorDisabled 1
+int styleable FloatingActionButton_fab_colorNormal 2
+int styleable FloatingActionButton_fab_colorPressed 0
+int styleable FloatingActionButton_fab_icon 3
+int styleable FloatingActionButton_fab_size 4
+int styleable FloatingActionButton_fab_stroke_visible 6
+int styleable FloatingActionButton_fab_title 5
+int[] styleable FloatingActionsMenu { 0x7f010008, 0x7f010009, 0x7f01000a, 0x7f01000b, 0x7f01000c, 0x7f01000d, 0x7f01000e, 0x7f01000f }
+int styleable FloatingActionsMenu_fab_addButtonColorNormal 1
+int styleable FloatingActionsMenu_fab_addButtonColorPressed 0
+int styleable FloatingActionsMenu_fab_addButtonPlusIconColor 3
+int styleable FloatingActionsMenu_fab_addButtonSize 2
+int styleable FloatingActionsMenu_fab_addButtonStrokeVisible 4
+int styleable FloatingActionsMenu_fab_expandDirection 7
+int styleable FloatingActionsMenu_fab_labelStyle 5
+int styleable FloatingActionsMenu_fab_labelsPosition 6

+ 14 - 0
libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/aapt/AndroidManifest.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest
+    package="com.getbase.floatingactionbutton"
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:versionCode="15"
+    android:versionName="1.10.1" >
+
+    <uses-sdk
+        android:minSdkVersion="14"
+        android:targetSdkVersion="22" />
+
+    <application />
+
+</manifest>

二進制
libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/annotations.zip


+ 92 - 0
libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/build.xml

@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="com-getbase-floatingactionbutton-1-10-0-exploded-aar" default="help">
+
+    <!-- The local.properties file is created and updated by the 'android' tool.
+         It contains the path to the SDK. It should *NOT* be checked into
+         Version Control Systems. -->
+    <property file="local.properties" />
+
+    <!-- The ant.properties file can be created by you. It is only edited by the
+         'android' tool to add properties to it.
+         This is the place to change some Ant specific build properties.
+         Here are some properties you may want to change/update:
+
+         source.dir
+             The name of the source directory. Default is 'src'.
+         out.dir
+             The name of the output directory. Default is 'bin'.
+
+         For other overridable properties, look at the beginning of the rules
+         files in the SDK, at tools/ant/build.xml
+
+         Properties related to the SDK location or the project target should
+         be updated using the 'android' tool with the 'update' action.
+
+         This file is an integral part of the build system for your
+         application and should be checked into Version Control Systems.
+
+         -->
+    <property file="ant.properties" />
+
+    <!-- if sdk.dir was not set from one of the property file, then
+         get it from the ANDROID_HOME env var.
+         This must be done before we load project.properties since
+         the proguard config can use sdk.dir -->
+    <property environment="env" />
+    <condition property="sdk.dir" value="${env.ANDROID_HOME}">
+        <isset property="env.ANDROID_HOME" />
+    </condition>
+
+    <!-- The project.properties file is created and updated by the 'android'
+         tool, as well as ADT.
+
+         This contains project specific properties such as project target, and library
+         dependencies. Lower level build properties are stored in ant.properties
+         (or in .classpath for Eclipse projects).
+
+         This file is an integral part of the build system for your
+         application and should be checked into Version Control Systems. -->
+    <loadproperties srcFile="project.properties" />
+
+    <!-- quick check on sdk.dir -->
+    <fail
+            message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
+            unless="sdk.dir"
+    />
+
+    <!--
+        Import per project custom build rules if present at the root of the project.
+        This is the place to put custom intermediary targets such as:
+            -pre-build
+            -pre-compile
+            -post-compile (This is typically used for code obfuscation.
+                           Compiled code location: ${out.classes.absolute.dir}
+                           If this is not done in place, override ${out.dex.input.absolute.dir})
+            -post-package
+            -post-build
+            -pre-clean
+    -->
+    <import file="custom_rules.xml" optional="true" />
+
+    <!-- Import the actual build file.
+
+         To customize existing targets, there are two options:
+         - Customize only one target:
+             - copy/paste the target into this file, *before* the
+               <import> task.
+             - customize it to your needs.
+         - Customize the whole content of build.xml
+             - copy/paste the content of the rules files (minus the top node)
+               into this file, replacing the <import> task.
+             - customize to your needs.
+
+         ***********************
+         ****** IMPORTANT ******
+         ***********************
+         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
+         in order to avoid having your file be overridden by tools such as "android update project"
+    -->
+    <!-- version-tag: 1 -->
+    <import file="${sdk.dir}/tools/ant/build.xml" />
+
+</project>

二進制
libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/jars/classes.jar


二進制
libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/libs/classes.jar


+ 5 - 0
libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/proguard.txt

@@ -0,0 +1,5 @@
+# keep getters/setters in RotatingDrawable so that animations can still work.
+-keepclassmembers class com.getbase.floatingactionbutton.FloatingActionsMenu$RotatingDrawable {
+   void set*(***);
+   *** get*();
+}

+ 15 - 0
libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/project.properties

@@ -0,0 +1,15 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system edit
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+#
+# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
+#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
+
+# Project target.
+target=android-22
+android.library=true

二進制
libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/res/drawable-hdpi-v4/fab_bg_mini.png


二進制
libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/res/drawable-hdpi-v4/fab_bg_normal.png


二進制
libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/res/drawable-mdpi-v4/fab_bg_mini.png


二進制
libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/res/drawable-mdpi-v4/fab_bg_normal.png


二進制
libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/res/drawable-xhdpi-v4/fab_bg_mini.png


二進制
libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/res/drawable-xhdpi-v4/fab_bg_normal.png


二進制
libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/res/drawable-xxhdpi-v4/fab_bg_mini.png


二進制
libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/res/drawable-xxhdpi-v4/fab_bg_normal.png


二進制
libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/res/drawable-xxxhdpi-v4/fab_bg_mini.png


二進制
libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/res/drawable-xxxhdpi-v4/fab_bg_normal.png


+ 22 - 0
libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/res/values/values.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <declare-styleable name="AddFloatingActionButton"><attr format="color" name="fab_plusIconColor"/></declare-styleable>
+    <declare-styleable name="FloatingActionButton"><attr format="color" name="fab_colorPressed"/><attr format="color" name="fab_colorDisabled"/><attr format="color" name="fab_colorNormal"/><attr format="reference" name="fab_icon"/><attr format="enum" name="fab_size"><enum name="normal" value="0"/><enum name="mini" value="1"/></attr><attr format="string" name="fab_title"/><attr format="boolean" name="fab_stroke_visible"/></declare-styleable>
+    <declare-styleable name="FloatingActionsMenu"><attr format="color" name="fab_addButtonColorPressed"/><attr format="color" name="fab_addButtonColorNormal"/><attr format="enum" name="fab_addButtonSize"><enum name="normal" value="0"/><enum name="mini" value="1"/></attr><attr format="color" name="fab_addButtonPlusIconColor"/><attr format="boolean" name="fab_addButtonStrokeVisible"/><attr format="reference" name="fab_labelStyle"/><attr format="enum" name="fab_labelsPosition"><enum name="left" value="0"/><enum name="right" value="1"/></attr><attr format="enum" name="fab_expandDirection"><enum name="up" value="0"/><enum name="down" value="1"/><enum name="left" value="2"/><enum name="right" value="3"/></attr></declare-styleable>
+    <!-- From: file:/Users/chalup/src/android-floating-action-button/library/src/main/res/values/dimens.xml -->
+    <eat-comment/>
+    <dimen name="fab_actions_spacing">16dp</dimen>
+    <dimen name="fab_icon_size">24dp</dimen>
+    <dimen name="fab_labels_margin">8dp</dimen>
+    <dimen name="fab_plus_icon_size">14dp</dimen>
+    <dimen name="fab_plus_icon_stroke">2dp</dimen>
+    <dimen name="fab_shadow_offset">3dp</dimen>
+    <dimen name="fab_shadow_radius">9dp</dimen>
+    <dimen name="fab_size_mini">40dp</dimen>
+    <dimen name="fab_size_normal">56dp</dimen>
+    <dimen name="fab_stroke_width">1dp</dimen>
+    <!-- From: file:/Users/chalup/src/android-floating-action-button/library/src/main/res/values/ids.xml -->
+    <eat-comment/>
+    <item name="fab_expand_menu_button" type="id"/>
+    <item name="fab_label" type="id"/>
+</resources>

+ 2 - 0
libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar/src/.readme

@@ -0,0 +1,2 @@
+This hidden file is there to ensure there is an src folder.
+Once we support binary library this will go away.

+ 1 - 0
project.properties

@@ -12,5 +12,6 @@ target=android-23
 android.library.reference.1=owncloud-android-library
 android.library.reference.2=libs/android-support-appcompat-v7-exploded-aar
 android.library.reference.3=libs/android-support-design-exploded-aar
+android.library.reference.4=libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar
 java.source=7
 java.target=7

二進制
res/drawable-hdpi-v9/ic_action_download.png


二進制
res/drawable-hdpi-v9/ic_action_refresh.png


二進制
res/drawable-hdpi-v9/ic_action_settings.png


二進制
res/drawable-hdpi/ic_checkbox_blank_outline.png


二進制
res/drawable-hdpi/ic_checkbox_marked.png


二進制
res/drawable-hdpi/ic_import.png


二進制
res/drawable-mdpi-v9/ic_action_download.png


二進制
res/drawable-mdpi-v9/ic_action_refresh.png


二進制
res/drawable-mdpi-v9/ic_action_settings.png


二進制
res/drawable-mdpi/ic_checkbox_blank_outline.png


二進制
res/drawable-mdpi/ic_checkbox_marked.png


二進制
res/drawable-mdpi/ic_import.png


二進制
res/drawable-xhdpi/ic_import.png


二進制
res/drawable-xxhdpi/ic_import.png


二進制
res/drawable-xxhdpi/ic_sort_variant.png


+ 11 - 0
res/drawable/fab_label_background.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="@color/black_semi_transparent"/>
+    <padding
+        android:left="@dimen/standard_padding"
+        android:top="4dp"
+        android:right="@dimen/standard_padding"
+        android:bottom="4dp"/>
+    <corners
+        android:radius="2dp"/>
+</shape>

+ 0 - 1
res/layout-land/account_setup.xml

@@ -110,7 +110,6 @@
 					    android:padding="0dp"
 					    android:scaleType="fitCenter"
 					    android:src="@drawable/ic_action_refresh_grey"
-            			android:onClick="onRefreshClick"
 					    android:visibility="gone"
 						android:background="@android:color/transparent"
                         android:contentDescription="@string/auth_refresh_button"

+ 3 - 2
res/layout/list_footer.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="56dp"
+    android:layout_height="112dp"
     android:layout_gravity="center_horizontal"
     android:gravity="center_horizontal"
     android:orientation="vertical"
@@ -14,7 +14,8 @@
         android:padding="@dimen/standard_padding"
         android:layout_gravity="center"
         android:gravity="center"
-        android:textColor="@color/setup_text_hint"
+        android:textColor="@color/secondaryTextColor"
+        android:layout_marginBottom="56dp"
         />
 
 </LinearLayout> 

+ 57 - 5
res/layout/list_fragment.xml

@@ -17,17 +17,21 @@
   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:fab="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
+    xmlns:fab="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:layout_weight="1" >
+    android:layout_height="match_parent">
 
     <android.support.v4.widget.SwipeRefreshLayout
         android:id="@+id/swipe_containing_list"
         android:layout_width="match_parent"
-        android:layout_height="match_parent" 
-        android:layout_weight="1"
+        android:layout_height="match_parent"
         android:footerDividersEnabled="false"
         android:visibility="visible" >
         
@@ -81,4 +85,52 @@
             </ScrollView>
     </android.support.v4.widget.SwipeRefreshLayout>
 
-</FrameLayout>
+</FrameLayout>
+    <com.getbase.floatingactionbutton.FloatingActionsMenu
+        android:id="@+id/fab_main"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentBottom="true"
+        android:layout_alignParentRight="true"
+        android:layout_alignParentEnd="true"
+        fab:fab_addButtonColorNormal="@color/primary_button_background_color"
+        fab:fab_addButtonColorPressed="@color/owncloud_blue"
+        fab:fab_addButtonPlusIconColor="@color/white"
+        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:visibility="gone">
+
+        <com.getbase.floatingactionbutton.FloatingActionButton
+            android:id="@+id/fab_upload"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            fab:fab_size="mini"
+            fab:fab_icon="@drawable/ic_action_upload"
+            fab:fab_colorNormal="@color/primary_button_background_color"
+            fab:fab_colorPressed="@color/owncloud_blue"
+            fab:fab_title=""/>
+
+        <com.getbase.floatingactionbutton.FloatingActionButton
+            android:id="@+id/fab_mkdir"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            fab:fab_size="mini"
+            fab:fab_icon="@drawable/ic_action_create_dir"
+            fab:fab_colorNormal="@color/primary_button_background_color"
+            fab:fab_colorPressed="@color/owncloud_blue"
+            fab:fab_title=""/>
+
+        <com.getbase.floatingactionbutton.FloatingActionButton
+            android:id="@+id/fab_upload_from_app"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            fab:fab_size="mini"
+            fab:fab_icon="@drawable/ic_import"
+            fab:fab_colorNormal="@color/primary_button_background_color"
+            fab:fab_colorPressed="@color/owncloud_blue"
+            fab:fab_title=""/>
+
+    </com.getbase.floatingactionbutton.FloatingActionsMenu>
+</RelativeLayout>

+ 5 - 12
res/menu/main_menu.xml

@@ -20,18 +20,11 @@
 <menu xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto">
 
-    <item
-        android:id="@+id/action_upload"
-        android:icon="@drawable/ic_action_upload"
-        android:orderInCategory="2"
-        app:showAsAction="always"
-        android:title="@string/actionbar_upload"
-        android:contentDescription="@string/actionbar_upload"/>
     <item
         android:id="@+id/action_create_dir"
         android:icon="@drawable/ic_action_create_dir"
-        android:orderInCategory="2"
-        app:showAsAction="always"
+        android:orderInCategory="1"
+        app:showAsAction="never"
         android:title="@string/actionbar_mkdir"
         android:contentDescription="@string/actionbar_mkdir"/>
     <item
@@ -43,14 +36,14 @@
     <item
         android:id="@+id/action_sync_account"
         android:icon="@drawable/ic_action_refresh"
-        android:orderInCategory="2"
+        android:orderInCategory="1"
         app:showAsAction="never"
         android:title="@string/actionbar_sync"
         android:contentDescription="@string/actionbar_sync"/>
 	<item
         android:id="@+id/action_sort"
-        android:icon="@android:drawable/ic_menu_sort_by_size"
-        android:orderInCategory="2"
+        android:icon="@drawable/ic_sort_variant"
+        android:orderInCategory="1"
         app:showAsAction="never"
         android:title="@string/actionbar_sort"
         android:contentDescription="@string/actionbar_sort"/>

+ 9 - 2
res/values/colors.xml

@@ -23,10 +23,14 @@
     <color name="owncloud_blue_accent">#35537A</color>
     <color name="owncloud_blue_bright">#00ddff</color>
 
-    <color name="list_item_lastmod_and_filesize_text">#989898</color>
+    <color name="list_item_lastmod_and_filesize_text">@color/secondaryTextColor</color>
     <color name="black">#000000</color>
     <color name="white">#FFFFFF</color>
-    <color name="textColor">#303030</color>
+    <color name="fab_white">#fafafa</color>
+    <color name="white_pressed">#f1f1f1</color>
+    <color name="half_black">#808080</color>
+    <color name="black_semi_transparent">#B2000000</color>
+    <color name="textColor">@color/black</color>
     <color name="drawerMenuTextColor">#000000</color>
     <color name="list_divider_background">#eee</color>
     <color name="filelist_icon_backgorund">#DDDDDD</color>
@@ -35,6 +39,9 @@
     <color name="login_text_hint_color">#757575</color>
     <color name="secondary_button_color">#D6D7D7</color>
     <color name="transparent">#00000000</color>
+    <color name="secondaryTextColor">#a0a0a0</color>
+    <color name="listItemHighlighted">#f8f8f8</color>
+    <color name="highlightTextColor">#55739a</color>
 
     <!-- Colors -->
     <color name="color_accent">@color/owncloud_blue_accent</color>

+ 9 - 1
res/values/styles.xml

@@ -51,7 +51,9 @@
 		<item name="android:textColorPrimary">@color/primary</item>
 	</style>
 
-	<style name="ownCloud.Dialog" parent="Theme.AppCompat.Light.Dialog" />
+	<style name="ownCloud.Dialog" parent="Theme.AppCompat.Light.Dialog">
+		<item name="colorAccent">@color/color_accent</item>
+	</style>
 
 	<style name="ProgressDialogTheme" parent="ownCloud.Dialog">
 		<item name="colorAccent">@color/color_accent</item>
@@ -105,6 +107,7 @@
 
 	<style name="Theme.ownCloud.Fullscreen" parent="style/Theme.AppCompat">
         <item name="android:windowFullscreen">true</item>
+		<item name="colorAccent">@color/color_accent</item>
     </style>
 	
 	
@@ -127,6 +130,11 @@
 		<item name="buttonBarStyle">@style/Theme.ownCloud.Dialog.ButtonBar</item>
 	</style>
 
+	<style name="menu_labels_style">
+		<item name="android:background">@drawable/fab_label_background</item>
+		<item name="android:textColor">@color/fab_white</item>
+	</style>
+
 	<!-- Button Bar hack due to Lollipop bug:
 		https://code.google.com/p/android/issues/detail?id=78302
 	fix see:

+ 1 - 0
setup_env.bat

@@ -24,6 +24,7 @@ call git submodule update
 
 call android.bat update project -p libs/android-support-appcompat-v7-exploded-aar --target android-23
 call android.bat update project -p libs/android-support-design-exploded-aar --target android-23
+call android.bat update project -p libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar --target android-22
 call android.bat update lib-project -p owncloud-android-library
 call android.bat update project -p .
 call android.bat update project -p oc_jb_workaround

+ 1 - 0
setup_env.sh

@@ -19,6 +19,7 @@ function initForAnt {
 	#Prepare project android-support-appcompat-v7 ; JAR file is not enough, includes resources
 	android update lib-project -p libs/android-support-appcompat-v7-exploded-aar --target android-23
 	android update lib-project -p libs/android-support-design-exploded-aar --target android-23
+	android update lib-project -p libs/com-getbase-floatingactionbutton-1-10-1-exploded-aar --target android-22
 
 	#As default it updates the ant scripts
 	android update lib-project -p owncloud-android-library

+ 31 - 22
src/com/owncloud/android/ui/activity/FileDisplayActivity.java

@@ -46,14 +46,12 @@ import android.os.IBinder;
 import android.preference.PreferenceManager;
 import android.provider.OpenableColumns;
 import android.support.design.widget.Snackbar;
-import android.support.v4.app.ActivityCompat;
 import android.support.v4.app.Fragment;
 import android.support.v4.app.FragmentManager;
 import android.support.v4.app.FragmentTransaction;
 import android.support.v4.content.ContextCompat;
 import android.support.v4.view.GravityCompat;
 import android.support.v7.app.AlertDialog;
-import android.support.v7.app.AppCompatDialog;
 import android.view.Menu;
 import android.view.MenuInflater;
 import android.view.MenuItem;
@@ -88,7 +86,6 @@ import com.owncloud.android.ui.dialog.ConfirmationDialogFragment;
 import com.owncloud.android.ui.dialog.CreateFolderDialogFragment;
 import com.owncloud.android.ui.dialog.SslUntrustedCertDialog;
 import com.owncloud.android.ui.dialog.SslUntrustedCertDialog.OnSslUntrustedCertListener;
-import com.owncloud.android.ui.dialog.UploadSourceDialogFragment;
 import com.owncloud.android.ui.fragment.FileDetailFragment;
 import com.owncloud.android.ui.fragment.FileFragment;
 import com.owncloud.android.ui.fragment.OCFileListFragment;
@@ -144,7 +141,6 @@ public class FileDisplayActivity extends HookActivity
     private boolean mSyncInProgress = false;
 
     private static String DIALOG_UNTRUSTED_CERT = "DIALOG_UNTRUSTED_CERT";
-    private static String DIALOG_CREATE_FOLDER = "DIALOG_CREATE_FOLDER";
     private static String DIALOG_UPLOAD_SOURCE = "DIALOG_UPLOAD_SOURCE";
     private static String DIALOG_CERT_NOT_SAVED = "DIALOG_CERT_NOT_SAVED";
 
@@ -530,8 +526,6 @@ public class FileDisplayActivity extends HookActivity
     @Override
     public boolean onPrepareOptionsMenu(Menu menu) {
         boolean drawerOpen = mDrawerLayout.isDrawerOpen(GravityCompat.START);
-        menu.findItem(R.id.action_upload).setVisible(!drawerOpen);
-        menu.findItem(R.id.action_create_dir).setVisible(!drawerOpen);
         menu.findItem(R.id.action_sort).setVisible(!drawerOpen);
         menu.findItem(R.id.action_sync_account).setVisible(!drawerOpen);
         menu.findItem(R.id.action_switch_view).setVisible(!drawerOpen);
@@ -543,6 +537,7 @@ public class FileDisplayActivity extends HookActivity
     public boolean onCreateOptionsMenu(Menu menu) {
         MenuInflater inflater = getMenuInflater();
         inflater.inflate(R.menu.main_menu, menu);
+        menu.findItem(R.id.action_create_dir).setVisible(false);
         return true;
     }
     
@@ -551,23 +546,10 @@ public class FileDisplayActivity extends HookActivity
     public boolean onOptionsItemSelected(MenuItem item) {
         boolean retval = true;
         switch (item.getItemId()) {
-            case R.id.action_create_dir: {
-                CreateFolderDialogFragment dialog =
-                        CreateFolderDialogFragment.newInstance(getCurrentDir());
-                dialog.show(getSupportFragmentManager(), DIALOG_CREATE_FOLDER);
-                break;
-            }
-
             case R.id.action_sync_account: {
                 startSynchronization();
                 break;
             }
-            case R.id.action_upload: {
-                UploadSourceDialogFragment dialog =
-                        UploadSourceDialogFragment.newInstance(getAccount());
-                dialog.show(getSupportFragmentManager(), DIALOG_UPLOAD_SOURCE);
-                break;
-            }
             case android.R.id.home: {
                 FileFragment second = getSecondFragment();
                 OCFile currentDir = getCurrentDir();
@@ -847,7 +829,26 @@ public class FileDisplayActivity extends HookActivity
 
     @Override
     public void onBackPressed() {
-        if (!isDrawerOpen()){
+        boolean isFabOpen = isFabOpen();
+        boolean isDrawerOpen = isDrawerOpen();
+
+        /*
+         * BackPressed priority/hierarchy:
+         *    1. close drawer if opened
+         *    2. close FAB if open (only if drawer isn't open)
+         *    3. navigate up (only if drawer and FAB aren't open)
+         */
+        if(isDrawerOpen && isFabOpen) {
+            // close drawer first
+            super.onBackPressed();
+        } else if(isDrawerOpen && !isFabOpen) {
+            // close drawer
+            super.onBackPressed();
+        } else if (!isDrawerOpen && isFabOpen) {
+            // close fab
+            getListOfFilesFragment().getFabMain().collapse();
+        } else {
+            // all closed
             OCFileListFragment listOfFiles = getListOfFilesFragment();
             if (mDualPane || getSecondFragment() == null) {
                 OCFile currentDir = getCurrentDir();
@@ -863,8 +864,6 @@ public class FileDisplayActivity extends HookActivity
                 setFile(listOfFiles.getCurrentFile());
             }
             cleanSecondFragment();
-        } else {
-            super.onBackPressed();
         }
     }
 
@@ -943,6 +942,16 @@ public class FileDisplayActivity extends HookActivity
         Log_OC.v(TAG, "onPause() end");
     }
 
+    public boolean isFabOpen() {
+        if(getListOfFilesFragment() != null
+                && getListOfFilesFragment().getFabMain() != null
+                && getListOfFilesFragment().getFabMain().isExpanded()) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
 
     private class SyncBroadcastReceiver extends BroadcastReceiver {
 

+ 1 - 1
src/com/owncloud/android/ui/activity/FolderPickerActivity.java

@@ -154,6 +154,7 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C
         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);
@@ -262,7 +263,6 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C
     public boolean onCreateOptionsMenu(Menu menu) {
         MenuInflater inflater = getMenuInflater();
         inflater.inflate(R.menu.main_menu, menu);
-        menu.findItem(R.id.action_upload).setVisible(false);
         menu.findItem(R.id.action_sort).setVisible(false);
         return true;
     }

+ 14 - 0
src/com/owncloud/android/ui/activity/UploadFilesActivity.java

@@ -21,6 +21,7 @@
 package com.owncloud.android.ui.activity;
 
 import android.accounts.Account;
+import android.app.Activity;
 import android.content.Intent;
 import android.content.SharedPreferences;
 import android.os.AsyncTask;
@@ -153,6 +154,19 @@ public class UploadFilesActivity extends FileActivity implements
         Log_OC.d(TAG, "onCreate() end");
     }
 
+    /**
+     * Helper to launch the UploadFilesActivity for which you would like a result when it finished.
+     * Your onActivityResult() method will be called with the given requestCode.
+     *
+     * @param activity    the activity which should call the upload activity for a result
+     * @param account     the account for which the upload activity is called
+     * @param requestCode If >= 0, this code will be returned in onActivityResult()
+     */
+    public static void startUploadActivityForResult(Activity activity, Account account, int requestCode) {
+        Intent action = new Intent(activity, UploadFilesActivity.class);
+        action.putExtra(EXTRA_ACCOUNT, (account));
+        activity.startActivityForResult(action, requestCode);
+    }
 
     @Override
     public boolean onOptionsItemSelected(MenuItem item) {

+ 0 - 1
src/com/owncloud/android/ui/activity/Uploader.java

@@ -656,7 +656,6 @@ public class Uploader extends FileActivity
     public boolean onCreateOptionsMenu(Menu menu) {
         MenuInflater inflater = getMenuInflater();
         inflater.inflate(R.menu.main_menu, menu);
-        menu.findItem(R.id.action_upload).setVisible(false);
         menu.findItem(R.id.action_sort).setVisible(false);
         menu.findItem(R.id.action_sync_account).setVisible(false);
         return true;

+ 42 - 0
src/com/owncloud/android/ui/fragment/ExtendedListFragment.java

@@ -37,6 +37,8 @@ import android.widget.ListAdapter;
 import android.widget.ListView;
 import android.widget.TextView;
 
+import com.getbase.floatingactionbutton.FloatingActionButton;
+import com.getbase.floatingactionbutton.FloatingActionsMenu;
 import com.owncloud.android.R;
 import com.owncloud.android.lib.common.utils.Log_OC;
 import com.owncloud.android.ui.ExtendedListView;
@@ -64,6 +66,11 @@ public class ExtendedListFragment extends Fragment
     private SwipeRefreshLayout mRefreshGridLayout;
     private SwipeRefreshLayout mRefreshEmptyLayout;
     private TextView mEmptyListMessage;
+
+    private FloatingActionsMenu mFabMain;
+    private FloatingActionButton mFabUpload;
+    private FloatingActionButton mFabMkdir;
+    private FloatingActionButton mFabUploadFromApp;
     
     // Save the state of the scroll in browsing
     private ArrayList<Integer> mIndexes;
@@ -96,6 +103,21 @@ public class ExtendedListFragment extends Fragment
         return mCurrentListView;
     }
 
+    public FloatingActionButton getFabUpload() {
+        return mFabUpload;
+    }
+
+    public FloatingActionButton getFabUploadFromApp() {
+        return mFabUploadFromApp;
+    }
+
+    public FloatingActionButton getFabMkdir() {
+        return mFabMkdir;
+    }
+
+    public FloatingActionsMenu getFabMain() {
+        return mFabMain;
+    }
 
     public void switchToGridView() {
         if ((mCurrentListView == mListView)) {
@@ -178,6 +200,11 @@ public class ExtendedListFragment extends Fragment
 
         mCurrentListView = mListView;   // list as default
 
+        mFabMain = (FloatingActionsMenu) v.findViewById(R.id.fab_main);
+        mFabUpload = (FloatingActionButton) v.findViewById(R.id.fab_upload);
+        mFabMkdir = (FloatingActionButton) v.findViewById(R.id.fab_mkdir);
+        mFabUploadFromApp = (FloatingActionButton) v.findViewById(R.id.fab_upload_from_app);
+
         return v;
     }
 
@@ -326,6 +353,21 @@ public class ExtendedListFragment extends Fragment
         mRefreshEmptyLayout.setEnabled(enabled);
     }
 
+    /**
+     * Sets the 'visibility' state of the FAB contained in the fragment.
+     *
+     * When 'false' is set, FAB visibility is set to View.GONE programatically,
+     *
+     * @param   enabled     Desired visibility for the FAB.
+     */
+    public void setFabEnabled(boolean enabled) {
+        if(enabled) {
+            mFabMain.setVisibility(View.VISIBLE);
+        } else {
+            mFabMain.setVisibility(View.GONE);
+        }
+    }
+
     /**
      * Set message for empty list view
      */

+ 1 - 1
src/com/owncloud/android/ui/fragment/LocalFileListFragment.java

@@ -54,7 +54,6 @@ public class LocalFileListFragment extends ExtendedListFragment {
     /** Adapter to connect the data from the directory with the View object */
     private LocalFileListAdapter mAdapter = null;
 
-    
     /**
      * {@inheritDoc}
      */
@@ -79,6 +78,7 @@ public class LocalFileListFragment extends ExtendedListFragment {
         View v = super.onCreateView(inflater, container, savedInstanceState);
         setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
         setSwipeEnabled(false); // Disable pull-to-refresh
+        setFabEnabled(false); // Disable FAB
         setMessageForEmptyList(getString(R.string.local_file_list_empty));
         Log_OC.i(TAG, "onCreateView() end");
         return v;

+ 178 - 0
src/com/owncloud/android/ui/fragment/OCFileListFragment.java

@@ -26,16 +26,22 @@ import android.app.Activity;
 import android.content.Context;
 import android.content.Intent;
 import android.content.SharedPreferences;
+import android.os.Build;
 import android.os.Bundle;
+import android.preference.PreferenceManager;
 import android.support.v4.widget.SwipeRefreshLayout;
 import android.view.ContextMenu;
+import android.view.LayoutInflater;
 import android.view.Menu;
 import android.view.MenuInflater;
 import android.view.MenuItem;
 import android.view.View;
+import android.view.ViewGroup;
 import android.widget.AdapterView;
 import android.widget.AdapterView.AdapterContextMenuInfo;
 import android.widget.PopupMenu;
+import android.widget.TextView;
+import android.widget.Toast;
 
 import com.owncloud.android.R;
 import com.owncloud.android.authentication.AccountUtils;
@@ -48,8 +54,10 @@ import com.owncloud.android.ui.activity.FileActivity;
 import com.owncloud.android.ui.activity.FileDisplayActivity;
 import com.owncloud.android.ui.activity.FolderPickerActivity;
 import com.owncloud.android.ui.activity.OnEnforceableRefreshListener;
+import com.owncloud.android.ui.activity.UploadFilesActivity;
 import com.owncloud.android.ui.adapter.FileListListAdapter;
 import com.owncloud.android.ui.dialog.ConfirmationDialogFragment;
+import com.owncloud.android.ui.dialog.CreateFolderDialogFragment;
 import com.owncloud.android.ui.dialog.FileActionsDialogFragment;
 import com.owncloud.android.ui.dialog.RemoveFileDialogFragment;
 import com.owncloud.android.ui.dialog.RenameFileDialogFragment;
@@ -75,11 +83,15 @@ public class OCFileListFragment extends ExtendedListFragment
 
     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";
 
     private static final String GRID_IS_PREFERED_PREFERENCE = "gridIsPrefered";
 
+    private static String DIALOG_CREATE_FOLDER = "DIALOG_CREATE_FOLDER";
+
     private FileFragment.ContainerActivity mContainerActivity;
 
     private OCFile mFile = null;
@@ -88,6 +100,7 @@ public class OCFileListFragment extends ExtendedListFragment
 
     private OCFile mTargetFile;
 
+    private boolean miniFabClicked = false;
    
     @Override
     public void onCreate(Bundle savedInstanceState) {
@@ -118,7 +131,19 @@ public class OCFileListFragment extends ExtendedListFragment
         }
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+        Log_OC.i(TAG, "onCreateView() start");
+        View v = super.onCreateView(inflater, container, savedInstanceState);
+
+        Log_OC.i(TAG, "onCreateView() end");
+        return v;
+    }
 
+    
     @Override
     public void onDetach() {
         setOnRefreshListener(null);
@@ -154,8 +179,161 @@ public class OCFileListFragment extends ExtendedListFragment
         setListAdapter(mAdapter);
 
         registerLongClickListener();
+
+        boolean hideFab = (args != null) && args.getBoolean(ARG_HIDE_FAB, false);
+        if (hideFab) {
+            setFabEnabled(false);
+        } else {
+            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();
+            }
+        }
   }
 
+    /**
+     * adds labels to all mini FABs.
+     */
+    private void setFabLabels() {
+        getFabUpload().setTitle(getResources().getString(R.string.actionbar_upload));
+        getFabMkdir().setTitle(getResources().getString(R.string.actionbar_mkdir));
+        getFabUploadFromApp().setTitle(getResources().getString(R.string.actionbar_upload_from_apps));
+    }
+
+    /**
+     * registers all listeners on all mini FABs.
+     */
+    private void registerFabListeners() {
+        registerFabUploadListeners();
+        registerFabMkDirListeners();
+        registerFabUploadFromAppListeners();
+    }
+
+    /**
+     * registers {@link android.view.View.OnClickListener} and {@link android.view.View.OnLongClickListener}
+     * on the Upload mini FAB for the linked action and {@link Toast} showing the underlying action.
+     */
+    private void registerFabUploadListeners() {
+        getFabUpload().setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                UploadFilesActivity.startUploadActivityForResult(getActivity(), ((FileActivity)getActivity())
+                        .getAccount(), FileDisplayActivity.ACTION_SELECT_MULTIPLE_FILES);
+                getFabMain().collapse();
+                recordMiniFabClick();
+            }
+        });
+
+        getFabUpload().setOnLongClickListener(new View.OnLongClickListener() {
+            @Override
+            public boolean onLongClick(View v) {
+                Toast.makeText(getActivity(), R.string.actionbar_upload, Toast.LENGTH_SHORT).show();
+                return true;
+            }
+        });
+    }
+
+    /**
+     * registers {@link android.view.View.OnClickListener} and {@link android.view.View.OnLongClickListener}
+     * on the 'Create Dir' mini FAB for the linked action and {@link Toast} showing the underlying action.
+     */
+    private void registerFabMkDirListeners() {
+        getFabMkdir().setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                CreateFolderDialogFragment dialog =
+                        CreateFolderDialogFragment.newInstance(mFile);
+                dialog.show(getActivity().getSupportFragmentManager(), DIALOG_CREATE_FOLDER);
+                getFabMain().collapse();
+                recordMiniFabClick();
+            }
+        });
+
+        getFabMkdir().setOnLongClickListener(new View.OnLongClickListener() {
+            @Override
+            public boolean onLongClick(View v) {
+                Toast.makeText(getActivity(), R.string.actionbar_mkdir, Toast.LENGTH_SHORT).show();
+                return true;
+            }
+        });
+    }
+
+    /**
+     * registers {@link android.view.View.OnClickListener} and {@link android.view.View.OnLongClickListener}
+     * on the Upload from App mini FAB for the linked action and {@link Toast} showing the underlying action.
+     */
+    private void registerFabUploadFromAppListeners() {
+        getFabUploadFromApp().setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                Intent action = new Intent(Intent.ACTION_GET_CONTENT);
+                action = action.setType("*/*").addCategory(Intent.CATEGORY_OPENABLE);
+                //Intent.EXTRA_ALLOW_MULTIPLE is only supported on api level 18+, Jelly Bean
+                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
+                    action.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
+                }
+                getActivity().startActivityForResult(
+                        Intent.createChooser(action, getString(R.string.upload_chooser_title)),
+                        FileDisplayActivity.ACTION_SELECT_CONTENT_FROM_APPS
+                );
+                getFabMain().collapse();
+                recordMiniFabClick();
+            }
+        });
+
+        getFabUploadFromApp().setOnLongClickListener(new View.OnLongClickListener() {
+            @Override
+            public boolean onLongClick(View v) {
+                Toast.makeText(getActivity(),
+                        R.string.actionbar_upload_from_apps,
+                        Toast.LENGTH_SHORT).show();
+                return true;
+            }
+        });
+    }
+
+    /**
+     * records a click on a mini FAB and thus:
+     * <ol>
+     *     <li>persists the click fact</li>
+     *     <li>removes the mini FAB labels</li>
+     * </ol>
+     */
+    private void recordMiniFabClick() {
+        // only record if it hasn't been done already at some other time
+        if(!miniFabClicked) {
+            final SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getActivity());
+            sp.edit().putLong(KEY_FAB_EVER_CLICKED, 1).commit();
+            miniFabClicked = true;
+        }
+    }
+
+    /**
+     * removes the labels on all known min FABs.
+     */
+    private void removeFabLabels() {
+        getFabUpload().setTitle(null);
+        getFabMkdir().setTitle(null);
+        getFabUploadFromApp().setTitle(null);
+        ((TextView) getFabUpload().getTag(
+                com.getbase.floatingactionbutton.R.id.fab_label)).setVisibility(View.GONE);
+        ((TextView) getFabMkdir().getTag(
+                com.getbase.floatingactionbutton.R.id.fab_label)).setVisibility(View.GONE);
+        ((TextView) getFabUploadFromApp().getTag(
+                com.getbase.floatingactionbutton.R.id.fab_label)).setVisibility(View.GONE);
+    }
+
     private void registerLongClickListener() {
         getListView().setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
             public boolean onItemLongClick(AdapterView<?> arg0, View v,

+ 1 - 1
tests/project.properties

@@ -11,4 +11,4 @@
 #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
 
 # Project target.
-target=android-22
+target=android-23