Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/late-rockets-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@react-native-documents/picker": patch
---

fix(android): remove deprecated activity getters
2 changes: 1 addition & 1 deletion .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Install dependencies
run: yarn install --immutable
- name: Install pods
run: RCT_NEW_ARCH_ENABLED=0 npx pod-install
run: RCT_NEW_ARCH_ENABLED=0 RCT_USE_PREBUILT_RNCORE=1 RCT_USE_RN_DEP=1 npx pod-install
working-directory: example/ios
- name: Build ios example app on old architecture
run: xcodebuild -scheme ReactTestApp -workspace document-picker-example.xcworkspace ONLY_ACTIVE_ARCH=NO -sdk iphonesimulator -configuration Debug
Expand Down
34 changes: 4 additions & 30 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ PODS:
- ReactCommon/turbomodule/core
- ReactNativeDependencies
- Yoga
- react-native-document-viewer (1.0.1):
- react-native-document-viewer (1.0.2):
- hermes-engine
- RCTRequired
- RCTTypeSafety
Expand All @@ -1328,28 +1328,6 @@ PODS:
- Yoga
- react-native-segmented-control (2.5.7):
- React-Core
- react-native-uitextview (2.1.0-rc.0):
- hermes-engine
- RCTRequired
- RCTTypeSafety
- React-Core
- React-Core-prebuilt
- React-debug
- React-Fabric
- React-featureflags
- React-graphics
- React-ImageManager
- React-jsi
- React-NativeModulesApple
- React-RCTFabric
- React-renderercss
- React-rendererdebug
- React-utils
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- ReactNativeDependencies
- Yoga
- React-NativeModulesApple (0.81.1):
- hermes-engine
- React-callinvoker
Expand Down Expand Up @@ -1724,7 +1702,7 @@ PODS:
- ReactCommon/turbomodule/core
- ReactNativeDependencies
- Yoga
- ReactTestApp-DevSupport (4.4.9):
- ReactTestApp-DevSupport (4.4.10):
- React-Core
- React-jsi
- ReactTestApp-Resources (1.0.0-dev)
Expand Down Expand Up @@ -1792,7 +1770,6 @@ DEPENDENCIES:
- react-native-document-picker (from `../../packages/document-picker`)
- react-native-document-viewer (from `../../packages/document-viewer`)
- "react-native-segmented-control (from `../../node_modules/@react-native-segmented-control/segmented-control`)"
- react-native-uitextview (from `../../node_modules/react-native-uitextview`)
- React-NativeModulesApple (from `../../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`)
- React-oscompat (from `../../node_modules/react-native/ReactCommon/oscompat`)
- React-perflogger (from `../../node_modules/react-native/ReactCommon/reactperflogger`)
Expand Down Expand Up @@ -1908,8 +1885,6 @@ EXTERNAL SOURCES:
:path: "../../packages/document-viewer"
react-native-segmented-control:
:path: "../../node_modules/@react-native-segmented-control/segmented-control"
react-native-uitextview:
:path: "../../node_modules/react-native-uitextview"
React-NativeModulesApple:
:path: "../../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios"
React-oscompat:
Expand Down Expand Up @@ -2020,9 +1995,8 @@ SPEC CHECKSUMS:
React-Mapbuffer: bc36232966c55d5b1cbef3b84cb97c4317fa4403
React-microtasksnativemodule: cbabfedcf6c2984e59d07f9ab553f3d277599b1b
react-native-document-picker: e06c0a5836adabd1b58e4f956bb3b5b58d7766e2
react-native-document-viewer: aab4b9b37bebfe95f10679085666ec6fe424fa38
react-native-document-viewer: 49cf47192ee7e15f4ad25f8fdaef6b4f1ab0cc9c
react-native-segmented-control: bf6e0032726727498e18dd437ae88afcdbc18e99
react-native-uitextview: d24acf59b5d64c9f0ddcd86d23629655460c1f3f
React-NativeModulesApple: 055e2d1417c663e7a26fc0847609f503e626e9e1
React-oscompat: 8f2893713639e12c7558750a9f7de3f08ac255b0
React-perflogger: 34b632f94b15e1068f7997e5a68b40a55162ad13
Expand Down Expand Up @@ -2055,7 +2029,7 @@ SPEC CHECKSUMS:
ReactCommon: 3579ef7cd884fbb5218bed929f25b7b212299700
ReactNativeDependencies: 9444683ddc7eaa98d2289224ce730a7632b705ff
ReactNativeHost: 7f059fda99bc0ba0187c19bfe91866c7692d90df
ReactTestApp-DevSupport: f62a6d484c9aff112862cec102aa1b526f7714aa
ReactTestApp-DevSupport: 9b7bbba5e8fed998e763809171d9906a1375f9d3
ReactTestApp-Resources: 1bd9ff10e4c24f2ad87101a32023721ae923bccf
RNCAsyncStorage: 3a4f5e2777dae1688b781a487923a08569e27fe4
Yoga: 18b87f28df0aee34fa7370518a35aa8107ba47b9
Expand Down
3 changes: 1 addition & 2 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"@react-native-segmented-control/segmented-control": "^2.5.7",
"invariant": "^2.2.4",
"react": "19.1.0",
"react-native": "^0.81.1",
"react-native-uitextview": "^2.1.0-rc.0"
"react-native": "^0.81.1"
}
}
16 changes: 2 additions & 14 deletions example/src/components/SelectableText.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
import React from 'react'
import { UITextView } from 'react-native-uitextview'
import { Platform, TextInput, Text } from 'react-native'
// note this is not stable yet

export type SelectableTextProps = {
value: string | Record<string, any>
accessibilityLabel: string
}
const style = { color: 'black' } as const

const SelectableTextPaper = ({ value, accessibilityLabel }: SelectableTextProps) => {
const toRender = typeof value === 'string' ? value : JSON.stringify(value, null, 2)
return (
<UITextView style={style} accessibilityLabel={accessibilityLabel} selectable uiTextView>
{toRender}
</UITextView>
)
}

const SelectableTextFabric = ({ value, accessibilityLabel }: SelectableTextProps) => {
const toRender = typeof value === 'string' ? value : JSON.stringify(value, null, 2)
return Platform.OS === 'ios' ? (
Expand All @@ -35,6 +24,5 @@ const SelectableTextFabric = ({ value, accessibilityLabel }: SelectableTextProps
</Text>
)
}
// @ts-ignore
const isFabricEnabled = global.nativeFabricUIManager !== null
export const SelectableText = isFabricEnabled ? SelectableTextFabric : SelectableTextPaper
// maybe use different implementation for old architecture
export const SelectableText = SelectableTextFabric
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@changesets/cli": "^2.29.6",
"@commitlint/cli": "^18.6.1",
"@commitlint/config-conventional": "^18.6.3",
"@evilmartians/lefthook": "^1.10.10",
"@evilmartians/lefthook": "^1.13.0",
"@jest/globals": "^29.7.0",
"@manypkg/cli": "^0.21.4",
"@react-native/eslint-config": "^0.81.1",
Expand All @@ -57,8 +57,8 @@
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.3",
"jest": "^29.7.0",
"pod-install": "1.0.1",
"prettier": "^3.4.2",
"pod-install": "1.0.7",
"prettier": "^3.6.2",
"typescript": "^5.7.3"
},
"packageManager": "[email protected]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,8 @@ class RNDocumentPickerModule(reactContext: ReactApplicationContext) :

@ReactMethod
override fun pick(opts: ReadableMap, promise: Promise) {
val currentActivity = currentActivity
val currentActivity = reactApplicationContext.currentActivity ?: return rejectWithNullActivity(promise)

if (currentActivity == null) {
rejectWithNullActivity(promise)
return
}
if (!promiseWrapper.trySetPromiseRejectingIncoming(promise, "pick")) {
return
}
Expand Down Expand Up @@ -145,11 +141,8 @@ class RNDocumentPickerModule(reactContext: ReactApplicationContext) :

@ReactMethod
override fun pickDirectory(opts: ReadableMap, promise: Promise) {
val currentActivity = currentActivity
if (currentActivity == null) {
rejectWithNullActivity(promise)
return
}
val currentActivity = reactApplicationContext.currentActivity ?: return rejectWithNullActivity(promise)

if (!promiseWrapper.trySetPromiseRejectingIncoming(promise, "pickDirectory")) {
return
}
Expand Down
Loading
Loading