Skip to content

Commit

Permalink
bump 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bradmartin committed Dec 21, 2016
1 parent b988f20 commit e48ec15
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 38 deletions.
9 changes: 8 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,11 @@ demo/
*.log
*.map
*.ts
!*.d.ts
.vs
.vs/
screens/
*.png
!index.d.ts
*.map
tsconfig.json
*.log
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,7 @@ From your command prompt/termial go to your app's root folder and execute:


## Attributes
**rippleColor : string** *optional* - sets the ripple color.
**rippleColor : string** *optional* - sets the ripple color.

### Contributors
- Morten Sjøgren @ https://github.com/m-abs **Thanks for iOS support**
2 changes: 1 addition & 1 deletion demo/app/main-page.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Page
xmlns="http://schemas.nativescript.org/tns.xsd"
xmlns:RL="nativescript-ripple" loaded="pageLoaded">
<ActionBar title="Ripples for Every Android" backgroundColor="#3489db" color="#fff" />
<ActionBar title="Ripples for Every One" backgroundColor="#3489db" color="#fff" />
<ScrollView>
<StackLayout>

Expand Down
8 changes: 4 additions & 4 deletions demo/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"nativescript": {
"id": "org.nativescript.demo",
"tns-ios": {
"version": "2.4.0"
},
"tns-android": {
"version": "2.4.1"
},
"tns-ios": {
"version": "2.4.0"
}
},
"dependencies": {
Expand All @@ -21,4 +21,4 @@
"nativescript-dev-typescript": "^0.3.2",
"typescript": "^2.0.10"
}
}
}
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "nativescript-ripple",
"version": "1.0.1",
"version": "1.1.0",
"description": "NativeScript plugin to add Material Design ripple effects to any layout.",
"main": "ripple.js",
"main": "ripple",
"typings:": "ripple.d.ts",
"nativescript": {
"platforms": {
Expand All @@ -12,7 +12,7 @@
},
"scripts": {
"build": "tsc",
"demo.ios": "npm run preparedemo && cd demo && tns emulate ios",
"demo.ios": "npm run preparedemo && cd demo && tns emulate ios",
"demo.android": "npm run preparedemo && cd demo && tns run android",
"preparedemo": "npm run build && cd demo && tns plugin remove nativescript-ripple && tns plugin add .. && tns install",
"setup": "cd demo && npm install && cd .. && npm run build && cd demo && tns plugin add .. && cd .."
Expand All @@ -35,6 +35,10 @@
"name": "Brad Martin",
"email": "[email protected]"
},
"contributors": [{
"name": "Morten Sjøgren",
"url": "https://github.com/m-abs"
}],
"bugs": {
"url": "https://github.com/bradmartin/nativescript-ripple/issues"
},
Expand All @@ -47,4 +51,4 @@
"devDependencies": {
"typescript": "^2.0.10"
}
}
}
1 change: 0 additions & 1 deletion ripple-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* https://twitter.com/BradWayneMartin
* https://github.com/bradmartin
* http://bradmartin.net
* Open Source Lib : https://github.com/balysv/material-ripple
*************************************************************************************/

import { DependencyObservable, PropertyChangeData, Property, PropertyMetadataSettings } from "ui/core/dependency-observable";
Expand Down
3 changes: 1 addition & 2 deletions ripple.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
* https://twitter.com/BradWayneMartin
* https://github.com/bradmartin
* http://bradmartin.net
* Open Source Lib : https://github.com/balysv/material-ripple
* Open Source Lib for Android : https://github.com/balysv/material-ripple
*************************************************************************************/

import * as common from './ripple-common';

import { Color } from "color";

declare var android: any;
Expand Down
33 changes: 12 additions & 21 deletions ripple.d.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,21 @@
import { Property } from "ui/core/dependency-observable";
import { ContentView } from "ui/content-view";

/**
* Contains the Ripple class, which represents the ripple effect.
* Represents the Ripple layout.
*/
export class Ripple extends ContentView {

declare module "nativescript-ripple" {
import { Property } from "ui/core/dependency-observable";
import { ContentView } from "ui/content-view";
public static rippleColorProperty: Property;

/**
* Represents the Ripple layout.
* Gets the native [android widget](com.balysv.materialripple.MaterialRippleLayout) that represents the user interface for this component. Valid only when running on Android OS.
*/
export class Ripple extends ContentView {

public static rippleColorProperty: Property;


/**
* Gets the native [android widget](com.balysv.materialripple.MaterialRippleLayout) that represents the user interface for this component. Valid only when running on Android OS.
*/
android: any /* com.balysv.materialripple.MaterialRippleLayout */;
android: any /* com.balysv.materialripple.MaterialRippleLayout */;


/**
* Gets or sets the ripple color.
*/
rippleColor: string;

}
/**
* Gets or sets the ripple color.
*/
rippleColor: string;

}
6 changes: 3 additions & 3 deletions ripple.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* https://twitter.com/BradWayneMartin
* https://github.com/bradmartin
* http://bradmartin.net
* Open Source Lib : https://github.com/balysv/material-ripple
*************************************************************************************/

import * as common from './ripple-common';
Expand All @@ -19,6 +18,7 @@ declare var UIView: any;
declare var UIViewAnimationOptionCurveEaseOut: any;

export class Ripple extends common.Ripple {

performRipple(x: number, y: number) {
if (!(this.content instanceof View)) {
return;
Expand All @@ -32,10 +32,10 @@ export class Ripple extends common.Ripple {
const radius = Math.min(Math.min(size.height, size.width) / scale * 0.8, 60);
const ripple = UIView.alloc().initWithFrame(CGRectMake(0, 0, radius, radius));
ripple.layer.cornerRadius = radius * 0.5;
ripple.backgroundColor = (this.content.backgroundColor || new Color('#000000')).ios;
ripple.backgroundColor = (this.content.backgroundColor || new Color('#000000')).ios;
ripple.alpha = 1.0;
nativeView.insertSubviewAtIndex(ripple, 0);
ripple.center = CGPointMake(x || 0, y || 0);
ripple.center = CGPointMake(x || 0, y || 0);

UIView.animateWithDurationDelayOptionsAnimationsCompletion(0.6, 0, UIViewAnimationOptionCurveEaseOut, () => {
ripple.transform = CGAffineTransformMakeScale(scale, scale);
Expand Down

0 comments on commit e48ec15

Please sign in to comment.