Skip to content

Commit a7d3b29

Browse files
committed
plugin updates
1 parent 4b48060 commit a7d3b29

20 files changed

+414
-90
lines changed

.gitignore

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,5 +212,31 @@ demo/lib/*
212212

213213
src/*.js
214214
/*.js
215+
demo/app/*.js
215216
demo/node_modules/
216-
node_modules/
217+
node_modules/
218+
219+
.vscode
220+
.idea
221+
.DS_Store
222+
*.js
223+
*.js.map
224+
*.log
225+
src/*.d.ts
226+
!src/index.d.ts
227+
!src/references.d.ts
228+
!src/scripts/*.js
229+
!seed-tests/*.js
230+
seed-tests/seed-copy/**/*.*
231+
seed-tests/seed-copy-new-git-repo/**/*.*
232+
!demo/karma.conf.js
233+
!demo/app/tests/*.js
234+
demo/*.d.ts
235+
!demo/references.d.ts
236+
demo/lib
237+
demo/platforms
238+
node_modules
239+
publish/src
240+
publish/package
241+
demo/report/report.html
242+
demo/report/stats.json

.travis.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
branches:
2+
only:
3+
- master
4+
matrix:
5+
include:
6+
- stage: "Lint"
7+
language: node_js
8+
os: linux
9+
node_js: "6"
10+
script: cd src && npm run ci.tslint && cd ../demo && npm run ci.tslint
11+
- stage: "Build and Test"
12+
env:
13+
- BuildAndroid="25"
14+
language: android
15+
os: linux
16+
jdk: oraclejdk8
17+
before_install: nvm install stable
18+
script:
19+
- cd src && npm i && npm run tsc && cd ../demo
20+
- travis_wait travis_retry tns build android
21+
- os: osx
22+
env:
23+
- BuildiOS="10.3"
24+
- Xcode="8.3"
25+
osx_image: xcode8.3
26+
language: node_js
27+
node_js: "6"
28+
jdk: oraclejdk8
29+
script:
30+
- cd src && npm i && npm run tsc && cd ../demo
31+
- travis_wait travis_retry tns build ios
32+
- os: linux
33+
language: android
34+
env:
35+
- TestVersion="latest"
36+
jdk: oraclejdk8
37+
before_install:
38+
- nvm install stable
39+
before_script:
40+
- cd seed-tests && npm i
41+
- echo no | android create avd --force -n test -t android-21 -b armeabi-v7a
42+
- emulator -avd test -no-audio -no-window &
43+
- android-wait-for-emulator
44+
script: travis_wait travis_retry npm run test.android
45+
dist: precise
46+
- os: osx
47+
env:
48+
- TestVersion="latest"
49+
language: node_js
50+
node_js: "6"
51+
jdk: oraclejdk8
52+
osx_image: xcode8.3
53+
before_script:
54+
- cd seed-tests && npm i
55+
script: travis_wait travis_retry npm run test.ios
56+
57+
android:
58+
components:
59+
- tools
60+
- platform-tools
61+
- build-tools-25.0.2
62+
- android-25
63+
- extra-android-m2repository
64+
- sys-img-armeabi-v7a-android-21
65+
66+
install:
67+
- npm install -g nativescript
68+
- tns usage-reporting disable
69+
- tns error-reporting disable
70+

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT) - do whatever you want with this - just don't be a bitch about it.
2+
3+
nativescript-floatingactionbutton
4+
Copyright (c) 2017, Brad Martin
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy of
7+
this software and associated documentation files (the "Software"), to deal in
8+
the Software without restriction, including without limitation the rights to
9+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10+
the Software, and to permit persons to whom the Software is furnished to do so,
11+
subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

demo/app/app.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import * as app from "tns-core-modules/application";
2+
app.start({ moduleName: "main-page" });

demo/app/main-page.ts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import * as app from "tns-core-modules/application";
2+
import * as observable from "tns-core-modules/data/observable";
3+
import * as observableArrayModule from "tns-core-modules/data/observable-array";
4+
import * as platformModule from "tns-core-modules/platform";
5+
import * as frameModule from "tns-core-modules/ui/frame";
6+
import * as color from "tns-core-modules/color";
7+
8+
const users = [
9+
{ name: "Billy Bob" },
10+
{ name: "Tweeder" },
11+
{ name: "Mox" },
12+
{ name: "Coach" },
13+
{ name: "Lance" },
14+
{ name: "Johnson" },
15+
{ name: "William" },
16+
{ name: "Franklin" },
17+
{ name: "Billy Bob" },
18+
{ name: "Tweeder" },
19+
{ name: "Mox" },
20+
{ name: "Coach" },
21+
{ name: "Lance" },
22+
{ name: "Johnson" },
23+
{ name: "William" },
24+
{ name: "Franklin" }
25+
];
26+
var viewModel = observable.fromObject({
27+
users: new observableArrayModule.ObservableArray(users)
28+
});
29+
30+
export function pageLoaded(args) {
31+
const page = args.object;
32+
if (platformModule.isAndroid) {
33+
// Change statusbar color on Lollipop
34+
if (platformModule.device.sdkVersion >= "21") {
35+
const window = app.android.startActivity.getWindow();
36+
window.setStatusBarColor(new color.Color("#303F9F").android);
37+
}
38+
}
39+
page.bindingContext = viewModel;
40+
}
41+
// exports.pageLoaded = pageLoaded;
42+
43+
export function fabTap(args) {
44+
(viewModel as any).users.unshift({ name: "Gary" });
45+
}
46+
47+
export function goMultiFab(args) {
48+
frameModule.topmost().navigate("multifab");
49+
}

demo/app/multifab.css

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
11
.fab-button {
2-
height: 50;
3-
width: 50;
4-
margin: 15;
5-
color: #FFF;
6-
background-color: #ff4081;
2+
height: 50;
3+
width: 50;
4+
margin: 15;
5+
color: #fff;
6+
background-color: #ff4081;
77
}
88

9-
.top-left{
10-
horizontal-align: left;
11-
vertical-align: top;
9+
.top-left {
10+
background-color: red;
11+
horizontal-align: left;
12+
vertical-align: top;
1213
}
1314

14-
.top-right{
15-
horizontal-align: right;
16-
vertical-align: top;
15+
.top-right {
16+
background-color: #336699;
17+
horizontal-align: right;
18+
vertical-align: top;
1719
}
1820

19-
.bottom-left{
20-
horizontal-align: left;
21-
vertical-align: bottom;
21+
.bottom-left {
22+
background-color: #fff000;
23+
horizontal-align: left;
24+
vertical-align: bottom;
2225
}
2326

24-
.bottom-right{
25-
horizontal-align: right;
26-
vertical-align: bottom;
27+
.bottom-right {
28+
horizontal-align: right;
29+
vertical-align: bottom;
2730
}
2831

29-
.center{
30-
horizontal-align: center;
31-
vertical-align: center;
32-
}
32+
.center {
33+
horizontal-align: center;
34+
vertical-align: center;
35+
}

demo/app/multifab.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import * as app from "tns-core-modules/application";
2+
import * as observable from "tns-core-modules/data/observable";
3+
import * as observableArrayModule from "tns-core-modules/data/observable-array";
4+
import * as platformModule from "tns-core-modules/platform";
5+
import * as color from "tns-core-modules/color";
6+
import * as frame from "tns-core-modules/ui/frame";
7+
8+
export function pageLoaded(args) {
9+
const page = args.object;
10+
if (platformModule.isAndroid) {
11+
// Change statusbar color on Lollipop
12+
if (platformModule.device.sdkVersion >= "21") {
13+
const window = app.android.startActivity.getWindow();
14+
window.setStatusBarColor(new color.Color("#303F9F").android);
15+
}
16+
}
17+
}
18+
// exports.pageLoaded = pageLoaded;
19+
20+
export function fabTap(args) {
21+
alert("tap");
22+
frame.topmost().goBack();
23+
}
24+
25+
export function animate(args) {
26+
args.object.animate({
27+
duration: 500,
28+
target: args.object,
29+
opacity: 0,
30+
translate: { x: 100, y: 200 }
31+
});
32+
}

demo/app/vendor-platform.android.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
require("application");
2+
if (!global["__snapshot"]) {
3+
/*
4+
In case snapshot generation is enabled these modules will get into the bundle but will not be required/evaluated.
5+
The snapshot webpack plugin will add them to the tns-java-classes.js bundle file. This way, they will be evaluated on app start as early as possible.
6+
*/
7+
require("ui/frame");
8+
require("ui/frame/activity");
9+
}

demo/app/vendor-platform.ios.ts

Whitespace-only changes.

demo/app/vendor.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
require("./vendor-platform");
2+
3+
require("bundle-entry-points");

0 commit comments

Comments
 (0)