Skip to content

Commit a93eb1f

Browse files
Initial iOS commit
1 parent b0a4963 commit a93eb1f

File tree

11 files changed

+190
-31
lines changed

11 files changed

+190
-31
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="__PACKAGE__"
4+
android:versionCode="1"
5+
android:versionName="1.0">
6+
7+
<supports-screens
8+
android:smallScreens="true"
9+
android:normalScreens="true"
10+
android:largeScreens="true"
11+
android:xlargeScreens="true"/>
12+
13+
<uses-sdk
14+
android:minSdkVersion="17"
15+
android:targetSdkVersion="__APILEVEL__"/>
16+
17+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
18+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
19+
<uses-permission android:name="android.permission.INTERNET"/>
20+
21+
<application
22+
android:name="com.tns.NativeScriptApplication"
23+
android:allowBackup="true"
24+
android:icon="@drawable/icon"
25+
android:label="@string/app_name"
26+
android:theme="@style/AppTheme" >
27+
<activity
28+
android:name="com.tns.NativeScriptActivity"
29+
android:label="@string/title_activity_kimera"
30+
android:configChanges="keyboardHidden|orientation|screenSize">
31+
32+
<intent-filter>
33+
<action android:name="android.intent.action.MAIN" />
34+
35+
<category android:name="android.intent.category.LAUNCHER" />
36+
</intent-filter>
37+
</activity>
38+
<activity android:name="com.tns.ErrorReportActivity"/>
39+
</application>
40+
</manifest>

demo/app/App_Resources/iOS/Info.plist

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleDisplayName</key>
8+
<string>${PRODUCT_NAME}</string>
9+
<key>CFBundleExecutable</key>
10+
<string>${EXECUTABLE_NAME}</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>${PRODUCT_NAME}</string>
15+
<key>CFBundlePackageType</key>
16+
<string>APPL</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleSignature</key>
20+
<string>????</string>
21+
<key>CFBundleVersion</key>
22+
<string>1.0</string>
23+
<key>LSRequiresIPhoneOS</key>
24+
<true/>
25+
<key>UILaunchStoryboardName</key>
26+
<string>LaunchScreen</string>
27+
<key>UIRequiredDeviceCapabilities</key>
28+
<array>
29+
<string>armv7</string>
30+
</array>
31+
<key>UISupportedInterfaceOrientations</key>
32+
<array>
33+
<string>UIInterfaceOrientationPortrait</string>
34+
<string>UIInterfaceOrientationLandscapeLeft</string>
35+
<string>UIInterfaceOrientationLandscapeRight</string>
36+
</array>
37+
<key>UISupportedInterfaceOrientations~ipad</key>
38+
<array>
39+
<string>UIInterfaceOrientationPortrait</string>
40+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
41+
<string>UIInterfaceOrientationLandscapeLeft</string>
42+
<string>UIInterfaceOrientationLandscapeRight</string>
43+
</array>
44+
</dict>
45+
</plist>
127 Bytes
Loading

demo/app/app.css

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ button {
1515
horizontal-align: center;
1616
}
1717

18-
.fab-button {
19-
height: 70;
20-
margin: 15;
21-
horizontal-align: right;
22-
vertical-align: bottom;
18+
.fab-button {
19+
height: 70;
20+
margin: 15;
21+
horizontal-align: right;
22+
vertical-align: bottom;
23+
color: red;
2324
}

demo/app/main-page.js

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,34 @@ var observable = require("data/observable");
33
var platformModule = require("platform");
44
var color = require("color");
55

6-
var users = [
7-
{ name: 'Billy Bob' },
8-
{ name: 'Tweeder' },
9-
{ name: 'Mox' },
10-
{ name: 'Coach' },
11-
{ name: 'Lance' },
12-
{ name: 'Johnson' },
13-
{ name: 'William' },
14-
{ name: 'Franklin' },
15-
{ name: 'Napoleon' },
16-
];
6+
var users = [
7+
{ name: 'Billy Bob' },
8+
{ name: 'Tweeder' },
9+
{ name: 'Mox' },
10+
{ name: 'Coach' },
11+
{ name: 'Lance' },
12+
{ name: 'Johnson' },
13+
{ name: 'William' },
14+
{ name: 'Franklin' },
15+
{ name: 'Napoleon' },
16+
];
1717
var viewModel = new observable.Observable({
1818
users: users
1919
});
2020

2121
function pageLoaded(args) {
2222
var page = args.object;
23-
// Change statusbar color on Lollipop
24-
if (platformModule.device.sdkVersion >= "21") {
25-
var window = app.android.startActivity.getWindow();
26-
window.setStatusBarColor(new color.Color("#303F9F").android);
23+
if(app.android){
24+
// Change statusbar color on Lollipop
25+
if (platformModule.device.sdkVersion >= "21") {
26+
var window = app.android.startActivity.getWindow();
27+
window.setStatusBarColor(new color.Color("#303F9F").android);
28+
}
2729
}
2830
page.bindingContext = viewModel;
31+
32+
var button = page.getViewById("fabButton");
33+
debugger;
34+
page.ios.view.addSubview(button.ios);
2935
}
3036
exports.pageLoaded = pageLoaded;

demo/app/main-page.xml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
<label text="{{ name }}" textWrap="true" fontSize="18" margin="20" />
1010
</list-view.itemTemplate>
1111
</list-view>
12-
<android row="1">
13-
<FAB:fab tap="fabTap"
14-
row="1"
15-
icon="res://ic_add_white"
16-
backColor="#ff4081"
17-
rippleColor="#f1f1f1"
18-
class="fab-button" />
19-
</android>
12+
<FAB:fab
13+
id="fabButton"
14+
tap="fabTap"
15+
row="1"
16+
icon="res://ic_add_white"
17+
backColor="#ff4081"
18+
rippleColor="#f1f1f1"
19+
class="fab-button" />
20+
2021
</grid-layout>
2122
</Page>

demo/app/package.json

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,34 @@
1-
{"name":"tns-template-hello-world","main":"app.js","version":"1.5.1","author":{"name":"Telerik","email":"[email protected]"},"description":"Nativescript hello-world project template","license":"Apache-2.0","keywords":["telerik","mobile","nativescript","{N}","tns","appbuilder","template"],"repository":{"type":"git","url":"git://github.com/NativeScript/template-hello-world.git"},"bugs":{"url":"https://github.com/NativeScript/template-hello-world/issues"},"homepage":"https://github.com/NativeScript/template-hello-world","android":{"v8Flags":"--expose_gc"},"readme":"ERROR: No README data found!","_id":"[email protected]","_from":"[email protected]"}
1+
{
2+
"name":"tns-template-hello-world",
3+
"main":"app.js",
4+
"version":"1.5.1",
5+
"author":{
6+
"name":"Telerik",
7+
8+
},
9+
"description":"Nativescript hello-world project template",
10+
"license":"Apache-2.0",
11+
"keywords":[
12+
"telerik",
13+
"mobile",
14+
"nativescript",
15+
"{N}",
16+
"tns",
17+
"appbuilder",
18+
"template"
19+
],
20+
"repository":{
21+
"type":"git",
22+
"url":"git://github.com/NativeScript/template-hello-world.git"
23+
},
24+
"bugs":{
25+
"url":"https://github.com/NativeScript/template-hello-world/issues"
26+
},
27+
"homepage":"https://github.com/NativeScript/template-hello-world",
28+
"android":{
29+
"v8Flags":"--expose_gc"
30+
},
31+
"readme":"ERROR: No README data found!",
32+
33+
34+
}

demo/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
"nativescript": {
33
"id": "org.nativescript.floatingactionbutton",
44
"tns-android": {
5-
"version": "1.5.1"
5+
"version": "1.6.0"
6+
},
7+
"tns-ios": {
8+
"version": "1.6.0"
69
}
710
},
811
"dependencies": {

fab.ios.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
var common = require("./fab-common");
2+
var ImageSource = require("image-source");
3+
4+
require("utils/module-merge").merge(common, module.exports);
5+
6+
var FloatingActionButton = (function (_super) {
7+
8+
global.__extends(FloatingActionButton, _super);
9+
10+
function FloatingActionButton() {
11+
_super.apply(this, arguments);
12+
debugger;
13+
var button = MNFloatingActionButton.alloc().init();
14+
15+
}
16+
17+
Object.defineProperty(FloatingActionButton.prototype, "ios", {
18+
get: function () {
19+
return this._ios;
20+
}
21+
});
22+
23+
return FloatingActionButton;
24+
25+
})(common.Fab);
26+
27+
exports.Fab = FloatingActionButton;

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"main": "fab.js",
66
"nativescript": {
77
"platforms": {
8-
"android": "1.5.0"
8+
"android": "1.5.0",
9+
"ios": "1.5.0"
910
}
1011
},
1112
"repository": {
@@ -19,6 +20,7 @@
1920
"FAB",
2021
"floating-action-button",
2122
"android",
23+
"ios",
2224
"bradmartin",
2325
"Thorum"
2426
],

0 commit comments

Comments
 (0)