From c2a32d05a92c5caf4ad0bae018efa38113a12d3f Mon Sep 17 00:00:00 2001 From: Jose Berardo Cunha Date: Sun, 31 Dec 2017 16:38:03 +1100 Subject: [PATCH] version bump 2.1.0 --- README.md | 19 ++++++++++++++++++- src/package-lock.json | 2 +- src/package.json | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 17bcf69..32a947a 100644 --- a/README.md +++ b/README.md @@ -146,7 +146,7 @@ class MyComponent { } ``` -## Notes about version 2.0 +## Notes about version +2 Here are the list of improvements on version 2.0: 1. BugFix: Integer directive not rendering on iOS. @@ -165,9 +165,26 @@ Here are the list of improvements on version 2.0: documentation](https://developer.android.com/training/material/shadows-clipping.html) it's not the only part. Then, `translationZ` will add extra distance to the surface and it's mainly used for animations. +1. **2.1.X** Override Android default StateListAnimator as explained below +### Override Android default StateListAnimator + +Android buttons are split into three categories: +floating, raised and flat. Different from labels and other ui elements, +each button category has its own state animator. +So, when buttons as tapped, Android does affect their elevation (and z translation) in a way that Angular is not notified. At the end of tap animation, buttons get back to +resting defaults (i.e. raised button's `elevation` at 2dp and `translationZ` at 0) overriding +the shadow stablished by this plugin. + +Since version 2.1.0, this plugin replaces the default `StateListAnimator` with one +that gets back to the values you provide for `elevation` and `translationZ`. + +Feel free to fill an issue if you want the flexibility of defining your own +`StateListAnimator`. The motivation so far was simply put this plugin to work with +buttons without changing the original state once they are clicked. ## Changelog +- 2.1.0 Decouple shadow logic / Override default StateListAnimator - 2.0.1 Fix error on old Android devices (< Lollipop) - 2.0.0 Density Independent Pixels / TranslationZ - 1.1.3 Minor issues diff --git a/src/package-lock.json b/src/package-lock.json index 38d8c6e..2c75fdb 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -1,6 +1,6 @@ { "name": "nativescript-ng-shadow", - "version": "2.0.1", + "version": "2.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/package.json b/src/package.json index 7fc5126..18ef504 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "nativescript-ng-shadow", - "version": "2.0.1", + "version": "2.1.0", "description": "Angular directive to apply shadows to native elements according to the elevation level guidelines of material design specification", "main": "ng-shadow", "typings": "ng-shadow.d.ts",