Skip to content

Commit 2f0b323

Browse files
Animations, test Icons, Readme
1 parent c5c6820 commit 2f0b323

14 files changed

+92
-31
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ exports.fabTap = function(args) {
7171
| rippleColor| X | | Ripple color on lollipop devices, it will fill the FAB on pre-lollipop devices | None
7272
| hideOnSwipeOfView| X | X | Directs the fab to animate itself in and out on scroll | Pass it the name of the view to monitor for a scroll event example: hideOnSwipeOfView="userListView"
7373
| hideAnimationDuration| X | X | How many milliseconds it takes for the button to hide. | Default if not set: 300ms
74+
| swipeAnimation| X | X | slideDown, slideUp, slideLeft, slideRight, scale | Default is slideDown
7475

7576
## NativeScript Compatibility
7677

@@ -81,6 +82,13 @@ exports.fabTap = function(args) {
8182

8283
## iOS Notes
8384
- We're using [MNFloatingActionButton](http://cocoapods.org/pods/MNFloatingActionButton) by [Matt Nydam](https://github.com/mattnydam)
85+
- Width\Height are requried properties
86+
- icon is a required property, if left as empty string default will be shown
87+
88+
## Release Notes ##
89+
### 2.2.0 ###
90+
* Scale iOS images to 1/2 height
91+
* swipeAnimation property added to define animations for the FAB
8492

8593
### Contributors
8694

598 Bytes
Loading
1.15 KB
Loading
927 Bytes
Loading

demo/app/App_Resources/iOS/help.png

1.09 KB
Loading
2.48 KB
Loading
3.47 KB
Loading

demo/app/app.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,20 @@ button {
1515
horizontal-align: center;
1616
}
1717

18-
.fab-button {
18+
.fab-button-bottom {
1919
height: 50;
2020
width: 50;
2121
margin: 15;
2222
horizontal-align: right;
2323
vertical-align: bottom;
2424
color: #FFF;
2525
background-color: #ff4081;
26+
}
27+
28+
.options{
29+
background-color: #f0f0f0;
30+
}
31+
32+
.options Button{
33+
font-size: 14;
2634
}

demo/app/main-page.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ var observable = require("data/observable");
33
var observableArrayModule = require("data/observable-array");
44
var platformModule = require("platform");
55
var color = require("color");
6+
var fab;
67

78
var users = [
89
{ name: 'Billy Bob' },
@@ -36,9 +37,14 @@ function pageLoaded(args) {
3637
}
3738
}
3839
page.bindingContext = viewModel;
40+
fab = page.getViewById("fabButton");
3941
}
4042
exports.pageLoaded = pageLoaded;
4143

4244
exports.fabTap = function(args){
4345
viewModel.users.unshift({ name: "Gary"});
46+
}
47+
48+
exports.onAnimateUp = function(args){
49+
fab.swipeAnimation = "slideUp";
4450
}

demo/app/main-page.xml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,20 @@
33
<Page.actionBar>
44
<ActionBar title="Native FAB" backgroundColor="#3F51B5" color="#fff" />
55
</Page.actionBar>
6-
<grid-layout rows="auto, *">
7-
<list-view id="userList" row="1" items="{{ users }}">
6+
<grid-layout rows="*">
7+
<list-view id="userList" row="0" items="{{ users }}">
88
<list-view.itemTemplate>
99
<label text="{{ name }}" textWrap="true" fontSize="15" margin="20" />
1010
</list-view.itemTemplate>
1111
</list-view>
1212
<FAB:fab
1313
id="fabButton"
14-
row="1"
14+
row="0"
1515
icon="res://ic_add_white"
1616
tap="fabTap"
1717
rippleColor="#ffffff"
18-
class="fab-button"
19-
hideOnSwipeOfView="userList" />
18+
class="fab-button-bottom"
19+
hideOnSwipeOfView="userList"
20+
swipeAnimation="scale" /> <!-- slideDown, slideUp, slideRight, slideLeft, scale -->
2021
</grid-layout>
2122
</Page>

0 commit comments

Comments
 (0)