Skip to content

Commit

Permalink
# fixed issue #27: Icon is outside the circle
Browse files Browse the repository at this point in the history
  • Loading branch information
Shell Software committed May 26, 2015
1 parent d3e2e1f commit 74ea197
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 24 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 1.1.1

1. Fixed [**issue #27**: Icon is outside the circle](https://github.com/shell-software/fab/issues/27):

A call to **Canvas.restore()** without calling the **Canvas.save()** first resulted in the unpredictable behaviour.
Added call to **Canvas.save()** before **Canvas.restore()** in the **RippleEffectDrawer** class

# 1.1.0

Watch [Demo Video about new features](https://www.youtube.com/watch?v=7GHAcX2myh8)
Expand Down
30 changes: 8 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The Library requires **Android SDK version 9 (Gingerbread)** and higher.

```java
dependencies {
compile 'com.github.shell-software:fab:1.1.0'
compile 'com.github.shell-software:fab:1.1.1'
}
```

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

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

### 1.1.0 - *current*
### 1.1.1 - *current*

# 1.1.0
1. Fixed [**issue #27**: Icon is outside the circle](https://github.com/shell-software/fab/issues/27):

A call to **Canvas.restore()** without calling the **Canvas.save()** first resulted in the unpredictable behaviour.
Added call to **Canvas.save()** before **Canvas.restore()** in the **RippleEffectDrawer** class

### 1.0.5 - *previous*

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

Expand Down Expand Up @@ -101,25 +106,6 @@ If it is used already in the project it must be excluded as a transitive depende
* 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*](https://github.com/shell-software/fab/pull/14) by [**uriel-frankel**](https://github.com/uriel-frankel))


### 1.0.5 - *previous*

1. Fixed [**issue #12**: Lollipop elevation disable shadow](https://github.com/shell-software/fab/issues/12):

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.
In this case configuration of any of the default shadow's parameters will be ignored.
Previously elevation was not drawn for such devices if set.

A fix was applied to:

* **hasShadow()** method: now if **Action Button** has elevation enabled (for *API 21 Lollipop* and higher) the shadow won't be drawn at all
* **calculateCenterX()** method: **getWidth()** method replaced by **getMeasuredWidth()** to calculate *X-axis* coordinate
* **calculateCenterY()** method: **getHeight()** method replaced by **getMeasuredHeight()** is used to calculate *Y-axis* coordinate

New methods added:

* **drawElevation()**: protected void method, which is called by **onDraw(Canvas)** to draw the elevation for *API 21 Lollipop* devices and higher

### Features in the next versions:

* **2.0.0**:
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ext {
ANDROID_BUILD_TOOLS_VERSION = '22.0.1'
ANDROID_MIN_SDK_VERSION = 9
ANDROID_TARGET_SDK_VERSION = 21
ANDROID_VERSION_CODE = 8
ANDROID_VERSION_CODE = 9

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ void draw(Canvas canvas) {
* @param canvas canvas, which the Ripple Effect is drawing on
*/
private void drawRipple(Canvas canvas) {
canvas.save();
canvas.clipPath(getCircleClipPath(), Region.Op.INTERSECT);
TouchPoint point = getActionButton().getTouchPoint();
canvas.drawCircle(point.getLastX(), point.getLastY(), currentRadius, getPreparedPaint());
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#

POM_GROUP_ID=com.github.shell-software
POM_VERSION=2.0.0-SNAPSHOT
POM_VERSION=1.1.1

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

0 comments on commit 74ea197

Please sign in to comment.