| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,6 +27,17 @@ | |||
| 27 | 27 | android:theme="@style/AppTheme" | |
| 28 | 28 | android:usesCleartextTraffic="true" > | |
| 29 | 29 | <meta-data android:name="debugLayouts" android:value="true" /> | |
| 30 | + | ||
| 31 | + <provider | ||
| 32 | + android:name="android.support.v4.content.FileProvider" | ||
| 33 | + android:authorities="org.nativescript.apps.provider" | ||
| 34 | + android:exported="false" | ||
| 35 | + android:grantUriPermissions="true"> | ||
| 36 | + <meta-data | ||
| 37 | + android:name="android.support.FILE_PROVIDER_PATHS" | ||
| 38 | + android:resource="@xml/provider_paths"/> | ||
| 39 | + </provider> | ||
| 40 | + | ||
| 30 | 41 | <activity | |
| 31 | 42 | android:name="com.tns.NativeScriptActivity" | |
| 32 | 43 | android:label="@string/title_activity_kimera" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,4 @@ | |||
| 1 | + <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | + <paths xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| 3 | + <external-path name="external_files" path="."/> | ||
| 4 | + </paths> | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,17 @@ | |||
| 1 | + import { EventData } from "tns-core-modules/data/observable"; | ||
| 2 | + import { SubMainPageViewModel } from "../sub-main-page-view-model"; | ||
| 3 | + import { WrapLayout } from "tns-core-modules/ui/layouts/wrap-layout"; | ||
| 4 | + import { Page } from "tns-core-modules/ui/page"; | ||
| 5 | + | ||
| 6 | + export function pageLoaded(args: EventData) { | ||
| 7 | + const page = <Page>args.object; | ||
| 8 | + const wrapLayout = <WrapLayout>page.getViewById("wrapLayoutWithExamples"); | ||
| 9 | + page.bindingContext = new SubMainPageViewModel(wrapLayout, loadExamples()); | ||
| 10 | + } | ||
| 11 | + | ||
| 12 | + export function loadExamples() { | ||
| 13 | + const examples = new Map<string, string>(); | ||
| 14 | + examples.set("open-file", "intent/open-file"); | ||
| 15 | + | ||
| 16 | + return examples; | ||
| 17 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,6 @@ | |||
| 1 | + <?xml version="1.0" encoding="UTF-8" ?> | ||
| 2 | + <Page loaded="pageLoaded"> | ||
| 3 | + <ScrollView orientation="vertical" row="1"> | ||
| 4 | + <WrapLayout id="wrapLayoutWithExamples"/> | ||
| 5 | + </ScrollView> | ||
| 6 | + </Page> | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,15 @@ | |||
| 1 | + import { isIOS, isAndroid } from "tns-core-modules/platform"; | ||
| 2 | + import * as fs from "tns-core-modules/file-system/file-system"; | ||
| 3 | + import * as utils from "tns-core-modules/utils/utils"; | ||
| 4 | + | ||
| 5 | + export function openFile() { | ||
| 6 | + let directory; | ||
| 7 | + if (isIOS) { | ||
| 8 | + directory = fs.knownFolders.ios.downloads(); | ||
| 9 | + } else if (isAndroid) { | ||
| 10 | + directory = android.os.Environment.getExternalStorageDirectory().getAbsolutePath().toString(); | ||
| 11 | + } | ||
| 12 | + | ||
| 13 | + const filePath = fs.path.join(directory, "Test_File_Open.txt"); | ||
| 14 | + utils.openFile(filePath); | ||
| 15 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,5 @@ | |||
| 1 | + <Page navigatingTo="navigatingTo"> | ||
| 2 | + <GridLayout id="root"> | ||
| 3 | + <Button text="Open File" tap="openFile" height="40"></Button> | ||
| 4 | + </GridLayout> | ||
| 5 | + </Page> | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,6 +36,7 @@ export function pageLoaded(args: EventData) { | |||
| 36 | 36 | examples.set("progress-bar", "progress-bar/main-page"); | |
| 37 | 37 | examples.set("date-picker", "date-picker/date-picker"); | |
| 38 | 38 | examples.set("nested-frames", "nested-frames/main-page"); | |
| 39 | + examples.set("intent", "intent/main-page"); | ||
| 39 | 40 | page.bindingContext = new MainPageViewModel(wrapLayout, examples); | |
| 40 | 41 | ||
| 41 | 42 | const parent = page.getViewById("parentLayout"); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,6 +27,7 @@ | |||
| 27 | 27 | android:label="@string/app_name" | |
| 28 | 28 | android:largeHeap="true" | |
| 29 | 29 | android:theme="@style/AppTheme" > | |
| 30 | + | ||
| 30 | 31 | <activity | |
| 31 | 32 | android:name="com.tns.NativeScriptActivity" | |
| 32 | 33 | android:label="@string/title_activity_kimera" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,7 @@ let executeTests = true; | |||
| 7 | 7 | trace.enable(); | |
| 8 | 8 | trace.addCategories(trace.categories.Test + "," + trace.categories.Error); | |
| 9 | 9 | ||
| 10 | - // When debugging | ||
| 10 | + // // When debugging | ||
| 11 | 11 | // trace.setCategories(trace.categories.concat( | |
| 12 | 12 | // trace.categories.Test, | |
| 13 | 13 | // trace.categories.Navigation, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments