Skip to content

Commit 74ea197

Browse files
author
Shell Software
committed
# fixed issue #27: Icon is outside the circle
1 parent d3e2e1f commit 74ea197

File tree

5 files changed

+18
-24
lines changed

5 files changed

+18
-24
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# 1.1.1
2+
3+
1. Fixed [**issue #27**: Icon is outside the circle](https://github.com/shell-software/fab/issues/27):
4+
5+
A call to **Canvas.restore()** without calling the **Canvas.save()** first resulted in the unpredictable behaviour.
6+
Added call to **Canvas.save()** before **Canvas.restore()** in the **RippleEffectDrawer** class
7+
18
# 1.1.0
29

310
Watch [Demo Video about new features](https://www.youtube.com/watch?v=7GHAcX2myh8)

README.md

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The Library requires **Android SDK version 9 (Gingerbread)** and higher.
1818

1919
```java
2020
dependencies {
21-
compile 'com.github.shell-software:fab:1.1.0'
21+
compile 'com.github.shell-software:fab:1.1.1'
2222
}
2323
```
2424

@@ -29,9 +29,14 @@ If any of these libraries are already used in the project they must be excluded
2929

3030
[**Full ChangeLog**](https://github.com/shell-software/fab/blob/master/CHANGELOG.md)
3131

32-
### 1.1.0 - *current*
32+
### 1.1.1 - *current*
3333

34-
# 1.1.0
34+
1. Fixed [**issue #27**: Icon is outside the circle](https://github.com/shell-software/fab/issues/27):
35+
36+
A call to **Canvas.restore()** without calling the **Canvas.save()** first resulted in the unpredictable behaviour.
37+
Added call to **Canvas.save()** before **Canvas.restore()** in the **RippleEffectDrawer** class
38+
39+
### 1.0.5 - *previous*
3540

3641
Watch [Demo Video about new features](https://www.youtube.com/watch?v=7GHAcX2myh8)
3742

@@ -101,25 +106,6 @@ If it is used already in the project it must be excluded as a transitive depende
101106
* If the button state is **PRESSED** and touch point moves outside the main circle the button state changes to **NORMAL**
102107
([Pull request #14: *Update ActionButton.java*](https://github.com/shell-software/fab/pull/14) by [**uriel-frankel**](https://github.com/uriel-frankel))
103108

104-
105-
### 1.0.5 - *previous*
106-
107-
1. Fixed [**issue #12**: Lollipop elevation disable shadow](https://github.com/shell-software/fab/issues/12):
108-
109-
The fix enables elevation on devices with **API 21 Lollipop** and higher. Now if elevation is set and the device *API* meets requirements (has *API 21 Lollipop* and higher) elevation will be drawn instead of the default shadow.
110-
In this case configuration of any of the default shadow's parameters will be ignored.
111-
Previously elevation was not drawn for such devices if set.
112-
113-
A fix was applied to:
114-
115-
* **hasShadow()** method: now if **Action Button** has elevation enabled (for *API 21 Lollipop* and higher) the shadow won't be drawn at all
116-
* **calculateCenterX()** method: **getWidth()** method replaced by **getMeasuredWidth()** to calculate *X-axis* coordinate
117-
* **calculateCenterY()** method: **getHeight()** method replaced by **getMeasuredHeight()** is used to calculate *Y-axis* coordinate
118-
119-
New methods added:
120-
121-
* **drawElevation()**: protected void method, which is called by **onDraw(Canvas)** to draw the elevation for *API 21 Lollipop* devices and higher
122-
123109
### Features in the next versions:
124110

125111
* **2.0.0**:

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ext {
2222
ANDROID_BUILD_TOOLS_VERSION = '22.0.1'
2323
ANDROID_MIN_SDK_VERSION = 9
2424
ANDROID_TARGET_SDK_VERSION = 21
25-
ANDROID_VERSION_CODE = 8
25+
ANDROID_VERSION_CODE = 9
2626

2727
}
2828

fab/src/main/java/com/software/shell/fab/RippleEffectDrawer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ void draw(Canvas canvas) {
136136
* @param canvas canvas, which the Ripple Effect is drawing on
137137
*/
138138
private void drawRipple(Canvas canvas) {
139+
canvas.save();
139140
canvas.clipPath(getCircleClipPath(), Region.Op.INTERSECT);
140141
TouchPoint point = getActionButton().getTouchPoint();
141142
canvas.drawCircle(point.getLastX(), point.getLastY(), currentRadius, getPreparedPaint());

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#
1818

1919
POM_GROUP_ID=com.github.shell-software
20-
POM_VERSION=2.0.0-SNAPSHOT
20+
POM_VERSION=1.1.1
2121

2222
POM_DESCRIPTION=Floating Action Button Library for Android
2323
POM_URL=https://github.com/shell-software/fab

0 commit comments

Comments
 (0)