This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<GridLayout id="outmost" margin="10" backgroundColor="orangered" tap="onTap"> | |
<GridLayout id="middle" margin="50" backgroundColor="lightgray" tap="onTap"> | |
<StackLayout id="inner" margin="50" backgroundColor="blue" tap="onTap" isPassThroughParentEnabled="true"> | |
<Button text="Active Button" id="button-active" tap="onTap" backgroundColor="whitesmoke" margin="20" height="100"/> | |
<Button isUserInteractionEnabled="false" text="DISABLED Button" id="button-disabled" tap="onTap" backgroundColor="gray" margin="20" height="100"/> | |
</StackLayout> | |
</GridLayout> | |
</GridLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function onTap(args: EventData) { | |
console.log(`>>>>>>>>>>> onTap invoked from: ${args.object}`); | |
const view: View = args.object as View; | |
animate(view); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<GridLayout id="outmost" margin="10" backgroundColor="orangered" tap="onTap" > | |
<GridLayout id="middle" margin="50" backgroundColor="lightgray" tap="onTap"> | |
<GridLayout id="inner" margin="50" backgroundColor="blue" tap="onTap"> <!-- The StackLayout will propagete the tap gesture to its parents --> | |
<Button text="Button" id="my-button" width="100" height="200" tap="onTap" backgroundColor="whitesmoke" /> <!-- The Button has its own tap logic and won't propagate the tap event --> | |
</GridLayout> | |
</GridLayout> | |
</GridLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tns run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"useLegacyWorkflow": false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tns run --hmr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deleteFile() { | |
storage.deleteFile({ | |
// optional, can also be passed during init() as 'storageBucket' param so we can cache it | |
bucket: APPSPOT_BUCKET_URL, | |
// the full path of an existing file in your Firebase storage | |
remoteFullPath: 'uploads/images/firebase-storage.png' | |
}).then(() => { | |
console.log("File deleted from Firebase Storage."); | |
}).catch(error => { | |
console.log("File deletion Error: " + error); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getDownloadUrl() { | |
storage.getDownloadUrl({ | |
// optional, can also be passed during init() as 'storageBucket' param so we can cache it | |
bucket: APPSPOT_BUCKET_URL, | |
// the full path of an existing file in your Firebase storage | |
remoteFullPath: 'uploads/images/happy-homer-meme.png' | |
}).then(downloadURL => { | |
console.log("Download URL: " + downloadURL); | |
}).catch(error => { | |
console.log("Error: " + error); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
downloadFile() { | |
let downloadPath: string; | |
let logoPath: string; | |
let fileName: string = "happy-homer-meme.png"; | |
if (isAndroid) { | |
// use tns-platform-declarations to access the native Android & iOS APIs | |
downloadPath = android.os.Environment.getExternalStoragePublicDirectory(android.os.Environment.DIRECTORY_DOWNLOADS).toString(); | |
} else if (isIOS) { | |
downloadPath = knownFolders.documents().path; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { storage } from "nativescript-plugin-firebase"; | |
import { File, knownFolders, path } from "tns-core-modules/file-system"; | |
import { APPSPOT_BUCKET_URL } from "./shared/link"; // e.g. gs://firebase-storage-demo.appspot.com | |
uploadFile() { | |
const appPath = knownFolders.currentApp().path; | |
// The path to the file we want to upload (this one is in `app/images` and is called `happy-homer-meme.png`) | |
const logoPath = appPath + "/images/happy-homer-meme.png"; | |
// Upload the file with the options below: |
NewerOlder