-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Material FAB with speed dial implementation #1100
Changes from all commits
45fbdea
713bf3f
c2422ee
e0bacfa
78e4ff5
4c9fd72
b1dd299
e8c64eb
d7ff626
4ecf325
be421ce
3d7985b
8d23bdc
d4ce0d9
ff994f8
be34f62
816e5d7
fb02257
f7d9438
69d420b
5e9bf59
c88c0fd
8bf7c22
2bbc427
c222cc3
6161d21
d7f0ba9
68e9b89
1d332cc
4917b43
7a782f1
02c584d
41a9db6
b6b830e
5d23792
4137072
6c83af4
e4d936e
7e82baa
4327cf5
8d038e8
f34a9dd
0117123
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be updated to target 23, if possible EDIT, no, forget that. This comes from the original library, right? Let's keep it untouched. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, exactly. That is why I left it untouched. Still hope Google will provide a speed dial fab at some point... :) |
||
|
||
<application /> | ||
|
||
</manifest> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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*(); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is way bigger. What was the problem? The FAB hiding the message? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is done so that the List scrolls beyond the fab else it would hover above the last list item and for example that fact that the last item is shared via link could not be seen in the list, see screenshot with the 1121dp height: With the height of 112 the fab is perfectly aligned in the footer with 16dp to the right, top and bottom 😃 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
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" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I - love - YOU There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😍 happy to help! |
||
android:layout_marginBottom="56dp" | ||
/> | ||
|
||
</LinearLayout> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to use the Android Design Support Library to add de Floating Action Button, in other to not add more third-party dependecies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem with the design support lib is that it does not support the speed dial but just simple FABs. That is why I added the third party lib. Else we would have to write our own implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.. So we could for example also move on to this lib: https://github.com/yavski/fab-speed-dial which needs the 23.1.1 lib (might be back-portable if even necessary) because it implements the speed dial with the Support Lib FAB implementation. But as I said before we would need to use some lib for the speed dial or someone would have to implement it within this app.
So how about I integrate the needed lilb classes into our third party code folder? Would that be feasable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Speed dial, understood. That's a good reason to keep the dependencies as they are right now.
The point of using FAB from Support Lib was reducing the number of dependency providers, but should not be with the cost of losing functionality.
I wouldn't the classes in 'third_party', keep the dependency in Gradle should be prefered when possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sweet, tan we can keep the lib for now. Whenever a speeddial implementation would be available within googles support lib like "design" I would than refactor it and remove the third party lib... continuous improvement so to say 😃