Skip to content

Commit 19b3c62

Browse files
Readme updated
1 parent 257a3c5 commit 19b3c62

File tree

5 files changed

+17
-22
lines changed

5 files changed

+17
-22
lines changed

README.md

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ XML widget to create the Material Design Floating Action Button for Android Nati
88

99
### Screenshot
1010
---------------
11-
![FAB Screenshot](screens/fab.png)
11+
![FAB Android Screenshot](screens/android.png)
12+
![FAB iOS Screenshot](screens/ios.png)
1213

1314
## Usage
1415

@@ -29,7 +30,6 @@ XML widget to create the Material Design Floating Action Button for Android Nati
2930
<FAB:fab tap="fabTap"
3031
row="1"
3132
icon="res://ic_add_white"
32-
backColor="#ff4081"
3333
rippleColor="#f1f1f1"
3434
class="fab-button" />
3535
</grid-layout>
@@ -44,9 +44,9 @@ I recommend the following CSS styles.
4444
.fab-button {
4545
height: 70;
4646
margin: 15;
47+
background-color: #ff4081;
4748
horizontal-align: right; /* Android Only */
4849
vertical-align: bottom; /* Android Only */
49-
background-color: #ff4081; /* iOS Only */
5050
color: #fff; /* iOS Only */
5151
}
5252
```
@@ -56,30 +56,24 @@ I recommend the following CSS styles.
5656
#### JS
5757

5858
```JS
59-
function fabTap(args) {
59+
exports.fabTap = function(args) {
6060
console.log('tapped');
6161
}
62-
exports.fabTap = fabTap;
6362
```
6463

6564
***
6665

6766
## Attributes
68-
**backColor** - optional
69-
70-
Background color of the FAB
71-
72-
### Android Specific Attributes
73-
**icon** - required
74-
75-
Icon to use for the FAB button, supports the same image source options that NativeScript images support.
76-
77-
**rippleColor** - optional
78-
79-
Ripple color on lollipop devices, it will fill the FAB on pre-lollipop devices
80-
67+
| Property | Android | iOS | Description | Note |
68+
|----------|:-------------:|------:|--|--|
69+
| backColor | X | X | Sets the background color of the button | None
70+
| icon | X | | Supports the same image source options that NativeScript images support | Required on android
71+
| rippleColor | X | |Ripple color on lollipop devices, it will fill the FAB on pre-lollipop devices | None
8172

8273

74+
## iOS Notes
75+
Since iOS doesn't have a native FAB, we're using the amazing [KCFloatingActionButton](https://cocoapods.org/pods/KCFloatingActionButton) by [Lee Sun-Hyoup](https://github.com/kciter)
76+
As of this publish, it does not yet support images, however this is an Issue open.
8377

8478
### Contributors
8579

fab.android.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,14 @@ var FloatingActionButtonStyler = (function () {
6060
}
6161
// BACKGROUND COLOR
6262
FloatingActionButtonStyler.setBackgroundColorProperty = function (view, newValue) {
63-
debugger;
6463
var fab = view.android;
6564
fab.setBackgroundTintList(android.content.res.ColorStateList.valueOf(newValue));
6665
};
6766
FloatingActionButtonStyler.resetBackgroundColorProperty = function (view, nativeValue) {
68-
debugger;
6967
var fab = view.android;
7068
fab.setBackgroundTintList(android.content.res.ColorStateList.valueOf(nativeValue));
7169
};
7270
FloatingActionButtonStyler.getNativeBackgroundColorValue = function (view) {
73-
debugger;
7471
var fab = view.android;
7572
return fab.getBackgroundTintList();
7673
};

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nativescript-floatingactionbutton",
3-
"version": "0.1.81",
3+
"version": "0.2.0",
44
"description": "A NativeScript plugin to provide an XML widget to implement the Material Design Floating Action Button in an Android app.",
55
"main": "fab.js",
66
"nativescript": {
@@ -29,6 +29,10 @@
2929
{
3030
"name": "L�zaro Danillo",
3131
"url": "https://github.com/lazaromenezes"
32+
},
33+
{
34+
"name": "Steve McNiven-Scott",
35+
"url": "https://github.com/sitefinitysteve"
3236
}
3337
],
3438
"license": "Apache-2.0",
File renamed without changes.

screens/ios.png

17.7 KB
Loading

0 commit comments

Comments
 (0)