Floating Action Button Library for Android ver. 1.1.0
Watch Demo Video about new features
- Added Ripple Effect - issue #2: ripple effect. Disabled by default.
See README.md for more info - Added Shadow Responsive Effect - issue #11: Question - Pressed State. Enabled by default.
See README.md for more info - Added possibility to move the Action Button - issue #9: Move button up and down.
See README.md for more info - Action Button now has a dependency on an external ViewMover library.
If it is used already in the project it must be excluded as a transitive dependency - Changed the Action Button default values:
- Button default color for NORMAL state changed from Color.LTGRAY to #FF9B9B9B
- Button default color for PRESSED state changed from Color.DKGRAY to #FF696969
- Shadow default color changed from #757575 to #42000000 according to Material Design Guidelines
- Shadow default radius changed from 2.0f to 8.0f (in density-independent pixels)
- Shadow default X-axis offset changed from 1.0f to 0.0f (in density-independent pixels)
- Shadow default Y-axis offset changed from 1.5f to 8.0f (in density-independent pixels)
- New public methods, classes and attributes:
- Methods:
- setSize(float) - sets the size of the Action Button (in density-independent pixels).
Changing the default size of the button breaks the rules of Material Design.
Setting the button size explicitly means, that button types with its default sizes are completely ignored. Do not use this method, unless you know what you are doing - getSize() - returns the size of the Action Button in real pixels (the same as getButtonSize(), which is now marked as deprecated).
- move(MovingParams) - moves the Action Button to the specified position obtained from MovingParams object
- moveRight(float) - moves the Action Button right to a specified distance (in density-independent pixels)
- moveDown(float) - moves the Action Button down to a specified distance (in density-independent pixels)
- moveLeft(float) - moves the Action Button left to a specified distance (in density-independent pixels)
- moveUp(float) - moves the Action Button up to a specified distance (in density-independent pixels)
- isRippleEffectEnabled() - checks whether Action Button Ripple Effect enabled
- setRippleEffectEnabled(boolean) - toggles the Ripple Effect state
- getButtonColorRipple() - returns the Action Button Ripple Effect color
- setButtonColorRipple(int) - sets the Action Button Ripple Effect color
- isShadowResponsiveEffectEnabled() - returns whether Shadow Responsive Effect enabled
- setShadowResponsiveEffectEnabled(boolean) - sets the Shadow Responsive Effect
- getTouchPoint() - returns the Action Button touch point
- setSize(float) - sets the size of the Action Button (in density-independent pixels).
- XML attributes:
- size - dimension, declares the button size (the same as setSize(float))
- BIG - enum (value 2), declares the Action Button BIG type, which has the size of 72.0dp (the same as setType(ActionButton.Type.BIG))
- rippleEffect_enabled - boolean, enables the Action Button Ripple Effect (the same as setRippleEffectEnabled(boolean))
- button_colorRipple - color, declares the Action Button Ripple Effect color (the same as setButtonColorRipple(int))
- shadowResponsiveEffect_enabled - boolean, enables the Action Button Shadow Responsive Effect (the same as setShadowResponsiveEffectEnabled(boolean))
- Classes:
- added new Action Button type - ActionButton.Type.BIG, which has a size of _72_ density-independent pixels. Also added a correspondent value BIG to type XML attribute
(Pull request #16: Added BIG size, 72dp size for fab buttons, Fix MOVE feedback, update gitignore by Aracem) - TouchPoint - an entity class, which contains the information about X- and Y-axis coordinates of the touch point (can't be instantiated).
- added new Action Button type - ActionButton.Type.BIG, which has a size of _72_ density-independent pixels. Also added a correspondent value BIG to type XML attribute
- Methods:
- Attention! Deprecated methods:
- getButtonSize() renamed to getSize(). You can still use getButtonSize() method, however it is marked as deprecated and will be removed in version 2.0.0.
- Added checking of the X and Y touch points coordinates
- If the touch X and Y coordinates are not inside the main button circle, the button won't react on click
- If the button state is PRESSED and touch point moves outside the main circle the button state changes to NORMAL
(Pull request #14: Update ActionButton.java by uriel-frankel)