forked from Blendman974/faceclaw
Project setup for iOS version of the app
This commit is contained in:
1 parent
9b70880a5b
commit
61b3bf8b7c
18 files changed
+633
-10
No files matched your search
@@ -0,0 +1,12 @@
|
||||
Page {
|
||||
background-color: #f5f5f2;
|
||||
color: #202820;
|
||||
}
|
||||
|
||||
Button {
|
||||
background-color: #285c45;
|
||||
color: #ffffff;
|
||||
border-radius: 12;
|
||||
padding: 16;
|
||||
font-size: 17;
|
||||
}
|
||||
+2
-8
@@ -4,13 +4,7 @@ You can use this file to perform app-level initialization, but the primary
|
||||
purpose of the file is to pass control to the app’s first module.
|
||||
*/
|
||||
|
||||
import { Application } from '@nativescript/core'
|
||||
import { registerShareIntentHandler } from './native/share-intents'
|
||||
import { installNativeUserAgent } from './util/http'
|
||||
|
||||
installNativeUserAgent()
|
||||
registerShareIntentHandler()
|
||||
|
||||
Application.run({ moduleName: 'app-root' })
|
||||
// NativeScript resolves the matching .android.ts or .ios.ts implementation.
|
||||
import './bootstrap'
|
||||
|
||||
// Don't place any code after the application has been started
|
||||
@@ -0,0 +1,8 @@
|
||||
import { Application } from '@nativescript/core'
|
||||
import { registerShareIntentHandler } from './native/share-intents'
|
||||
import { installNativeUserAgent } from './util/http'
|
||||
|
||||
installNativeUserAgent()
|
||||
registerShareIntentHandler()
|
||||
|
||||
Application.run({ moduleName: 'app-root' })
|
||||
@@ -0,0 +1,47 @@
|
||||
import { Application, Button, Device, Label, Page, ScrollView, StackLayout } from '@nativescript/core'
|
||||
import { bytesToHex, hexToBytes } from './util/hex-util'
|
||||
|
||||
// Milestone 1: exercise native UI, TypeScript, and an existing shared utility
|
||||
// without loading the Android services used by the full glasses application.
|
||||
Application.run({
|
||||
create: () => {
|
||||
const page = new Page()
|
||||
page.actionBarHidden = true
|
||||
const scroll = new ScrollView()
|
||||
const content = new StackLayout()
|
||||
content.padding = 28
|
||||
content.verticalAlignment = 'middle'
|
||||
|
||||
const label = (text: string, fontSize = 17) => {
|
||||
const view = new Label()
|
||||
view.text = text
|
||||
view.fontSize = fontSize
|
||||
view.textWrap = true
|
||||
view.marginBottom = 20
|
||||
content.addChild(view)
|
||||
return view
|
||||
}
|
||||
|
||||
label('Faceclaw', 36)
|
||||
label('iOS port · First launch', 24)
|
||||
label(`NativeScript is running on ${Device.model} (iOS ${Device.osVersion}).`)
|
||||
label('Glasses pairing and the Android features are still to be ported.')
|
||||
const status = label('Tap below to test native input and shared TypeScript code.')
|
||||
const button = new Button()
|
||||
button.text = 'Run shared-code check'
|
||||
button.accessibilityIdentifier = 'shared-code-check'
|
||||
let checks = 0
|
||||
button.on('tap', () => {
|
||||
const result = bytesToHex(hexToBytes('46 61 63 65 63 6c 61 77'))
|
||||
const passed = result === '46616365636C6177'
|
||||
checks += 1
|
||||
status.text = `${passed ? 'Passed' : 'Failed'} · Check ${checks}\nShared hex utilities returned ${result}.`
|
||||
console.log(`[ios-bootstrap] Shared-code check ${checks}: ${passed ? 'PASS' : 'FAIL'} (${result})`)
|
||||
})
|
||||
content.addChild(button)
|
||||
scroll.content = content
|
||||
page.content = scroll
|
||||
page.on('loaded', () => console.log('[ios-bootstrap] Faceclaw launch screen loaded'))
|
||||
return page
|
||||
},
|
||||
})
|
||||
Reference in new issue
Block a user