Skip to content

Instantly share code, notes, and snippets.

View S-Maxime's full-sized avatar
🐛

SENECHAL Maxime S-Maxime

🐛
  • Nice - France
View GitHub Profile
<template>
<Page class="page">
<ActionBar class="action-bar">
<Label class="action-bar-title" text="Home"></Label>
</ActionBar>
<StackLayout>
<Button text="Record" @tap="doRecord" />
<Button text="Test Play" @tap="doPlay" />
</StackLayout>
<template>
<Page class="page">
<ActionBar class="action-bar">
<Label class="action-bar-title" text="Records"></Label>
</ActionBar>
<StackLayout>
<Label v-if="sounds.length === 0" text="You haven't recorded any sounds yet." />
<ListView v-for="sound in sounds">
<template>
<Page class="page">
<ActionBar class="action-bar">
<Label class="action-bar-title" text="Records"></Label>
</ActionBar>
<StackLayout>
<Label v-if="sounds.length === 0" text="You haven't recorded any sounds yet." />
<ListView v-for="sound in sounds" @itemTap="playSound">
<template>
<Page class="page">
<ActionBar class="action-bar">
<Label class="action-bar-title" text="Records"></Label>
</ActionBar>
<StackLayout>
<Label v-if="sounds.length === 0" text="You haven't recorded any sounds yet." />
<ListView for="sound in sounds" @itemTap="playSound">
<template>
<Page class="page">
<ActionBar class="action-bar">
<Label class="action-bar-title" text="Geolocation Demo"></Label>
</ActionBar>
<StackLayout>
<Button text="Show location" @tap="enableLocationServices"
:visibility="currentGeoLocation.latitude ? 'collapsed' : 'visible'"/>
<StackLayout :visibility="currentGeoLocation.latitude ? 'visible' : 'collapsed'">
<template>
<Page loaded="pageLoaded">
<ActionBar title="NFC Test"/>
<Label text="Hello world !"></Label>
<StackLayout>
<Button text="NFC available?" @tap="doCheckAvailable" />
<Button text="NFC enabled?" @tap="doCheckEnabled" />
<Button text="set Tag" @tap="doStartTagListener" />
<Button text="NDEF Listener" @tap="doStartNDefListener" />
<template>
<Page loaded="pageLoaded">
<ActionBar title="NFC"/>
<StackLayout>
<Button text="NFC available?" @tap="doCheckAvailable" />
<Button text="NFC enabled?" @tap="doCheckEnabled" />
<Button text="NDEF Listener" @tap="doStartNDefListener" />
<Label :text="lastTagDiscovered" textWrap="true" />
<Label :text="lastNdefDiscovered" textWrap="true" />
<template>
<Page>
<ActionBar title="Bluetooth 👌"/>
<FlexboxLayout flexDirection="column">
<Image src="https://play.nativescript.org/dist/assets/img/NativeScript_logo.png" height="90" margin="30 0"/>
<Label :text="enabled"/>
<Button text="is Bluetooth On ?" @tap="isBluetoothOn"/>
<Button text="enable Bluetooth" @tap="enableBluetooth"/>
<Button text="start Scan" @tap="startScan"/>
<Button text="connected" @tap="connected"/>
const bleno = require("@abandonware/bleno");
const CALCULATOR_SERVICE_UUID = "00010000-89BD-43C8-9231-40F6E305F96D";
const ARGUMENT_1_UUID = "00010001-89BD-43C8-9231-40F6E305F96D";
const ARGUMENT_2_UUID = "00010002-89BD-43C8-9231-40F6E305F96D";
const RESULT_UUID = "00010010-89BD-43C8-9231-40F6E305F96D";
class ArgumentCharacteristic extends bleno.Characteristic {
constructor(uuid, name) {
super({
<template>
<Page actionBarHidden="true">
<GridLayout columns="*" rows="50, *">
<GridLayout row="0" columns="*, *, auto" rows="*" id="actionBar">
<Label col="0" row="0" text="Back"></Label>
<Label col="1" row="0" text="qqq" class="title"></Label>
<FlexboxLayout col="2" row="0" id="options">
<Label text="+" @tap="addSong" />
<Label text="->" id="playbtn" @tap="play" />
<Label text="---" />