diff --git a/.github/workflows/android-instrumentation-tests.yml b/.github/workflows/android-instrumentation-tests.yml index c791b6ce0ca38d..c3ed677d67f515 100644 --- a/.github/workflows/android-instrumentation-tests.yml +++ b/.github/workflows/android-instrumentation-tests.yml @@ -10,6 +10,7 @@ on: - fastlane/** # - packages/**/android/** - packages/expo-eas-client/android/** + - packages/expo-file-system/android/** - packages/expo-json-utils/android/** - packages/expo-manifests/android/** - packages/expo-notifications/android/** @@ -28,6 +29,7 @@ on: - fastlane/** # - packages/**/android/** - packages/expo-eas-client/android/** + - packages/expo-file-system/android/** - packages/expo-json-utils/android/** - packages/expo-manifests/android/** - packages/expo-notifications/android/** diff --git a/apps/native-component-list/src/screens/FileSystemScreen.tsx b/apps/native-component-list/src/screens/FileSystemScreen.tsx index 74911cd85373f2..5fc426bf5d2630 100644 --- a/apps/native-component-list/src/screens/FileSystemScreen.tsx +++ b/apps/native-component-list/src/screens/FileSystemScreen.tsx @@ -1,73 +1,754 @@ -import { Paths, File } from 'expo-file-system'; +import Checkbox from 'expo-checkbox'; +import * as Contacts from 'expo-contacts'; +import * as DocumentPicker from 'expo-document-picker'; +import { File, Directory, Paths, FileMode } from 'expo-file-system'; +import type { FileHandle } from 'expo-file-system'; import * as IntentLauncher from 'expo-intent-launcher'; -import { Button, ScrollView, StyleSheet, View, Text } from 'react-native'; +import * as MediaLibrary from 'expo-media-library'; +import React, { useEffect, useRef, useState } from 'react'; +import { + Alert, + Platform, + ScrollView, + StyleSheet, + Text, + TouchableOpacity, + View, +} from 'react-native'; import HeadingText from '../components/HeadingText'; +import ListButton from '../components/ListButton'; +import MonoText from '../components/MonoText'; +import SimpleActionDemo from '../components/SimpleActionDemo'; + FileSystemScreen.navigationOptions = { title: 'FileSystem', }; +function truncate(str: string, maxLen = 200): string { + if (str.length <= maxLen) return str; + return str.substring(0, maxLen) + `... (${str.length} chars total)`; +} + export default function FileSystemScreen() { + const [currentFile, setCurrentFile] = useState(null); + const [safDirectory, setSafDirectory] = useState(null); + + function withCurrentFile(fn: (file: File) => Promise) { + return async () => { + if (!currentFile) { + throw new Error('No file selected. Pick or create a file first.'); + } + return fn(currentFile); + }; + } + return ( - .contentUri property -