File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727 android:theme=" @style/AppTheme"
2828 android:usesCleartextTraffic=" true" >
2929 <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+
3041 <activity
3142 android:name=" com.tns.NativeScriptActivity"
3243 android:label=" @string/title_activity_kimera"
Original file line number Diff line number Diff line change 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 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 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 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 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) {
3636 examples . set ( "progress-bar" , "progress-bar/main-page" ) ;
3737 examples . set ( "date-picker" , "date-picker/date-picker" ) ;
3838 examples . set ( "nested-frames" , "nested-frames/main-page" ) ;
39+ examples . set ( "intent" , "intent/main-page" ) ;
3940 page . bindingContext = new MainPageViewModel ( wrapLayout , examples ) ;
4041
4142 const parent = page . getViewById ( "parentLayout" ) ;
Original file line number Diff line number Diff line change 2727 android:label=" @string/app_name"
2828 android:largeHeap=" true"
2929 android:theme=" @style/AppTheme" >
30+
3031 <activity
3132 android:name=" com.tns.NativeScriptActivity"
3233 android:label=" @string/title_activity_kimera"
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ let executeTests = true;
77trace . enable ( ) ;
88trace . addCategories ( trace . categories . Test + "," + trace . categories . Error ) ;
99
10- // When debugging
10+ // // When debugging
1111// trace.setCategories(trace.categories.concat(
1212// trace.categories.Test,
1313// trace.categories.Navigation,
You can’t perform that action at this time.
0 commit comments