Skip to content

Commit d198158

Browse files
authored
feat: New Arc support (#106)
* feat: upgrade example to expo 52 * fix(new-arch): fix touchable * fix(example): disable expo-autolinking in prebuild * fix: move width updates to JS * fix: scrollview handle * chore: deps * chore: deps * chore: git rid of expo example * chore: android build * fix(android): container size change * fix(ios): update size event * chore: remove flunky ci * chore: fix version * feat: update example * docs: add edgeToEdge guide
1 parent 65d3316 commit d198158

File tree

102 files changed

+15588
-11696
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+15588
-11696
lines changed

.github/actions/setup/action.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,13 @@ runs:
55
using: composite
66
steps:
77
- name: Setup Node.js
8-
uses: actions/setup-node@v4
8+
uses: actions/setup-node@v3
99
with:
1010
node-version-file: .nvmrc
1111

12-
- name: Enable Corepack
13-
run: corepack enable
14-
shell: bash
15-
1612
- name: Cache dependencies
1713
id: yarn-cache
18-
uses: actions/cache@v4
14+
uses: actions/cache@v3
1915
with:
2016
path: |
2117
**/node_modules

.github/workflows/ci.yml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@ on:
66
pull_request:
77
branches:
88
- main
9+
merge_group:
10+
types:
11+
- checks_requested
912

1013
jobs:
1114
lint:
1215
runs-on: ubuntu-latest
1316
steps:
1417
- name: Checkout
15-
uses: actions/checkout@v4
18+
uses: actions/checkout@v3
1619

1720
- name: Setup
1821
uses: ./.github/actions/setup
@@ -27,31 +30,19 @@ jobs:
2730
runs-on: ubuntu-latest
2831
steps:
2932
- name: Checkout
30-
uses: actions/checkout@v4
33+
uses: actions/checkout@v3
3134

3235
- name: Setup
3336
uses: ./.github/actions/setup
3437

3538
- name: Run unit tests
3639
run: yarn test --maxWorkers=2 --coverage
3740

38-
verify:
39-
runs-on: ubuntu-latest
40-
steps:
41-
- name: Checkout
42-
uses: actions/checkout@v4
43-
44-
- name: Setup
45-
uses: ./.github/actions/setup
46-
47-
- name: Run expo doctor
48-
run: yarn example doctor
49-
5041
build-library:
5142
runs-on: ubuntu-latest
5243
steps:
5344
- name: Checkout
54-
uses: actions/checkout@v4
45+
uses: actions/checkout@v3
5546

5647
- name: Setup
5748
uses: ./.github/actions/setup

.gitignore

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,15 @@ android/keystores/debug.keystore
7272
# Expo
7373
.expo/
7474

75+
# Turborepo
76+
.turbo/
77+
7578
# generated by bob
7679
lib/
7780

78-
# Example
79-
example/ios
80-
example/android
81+
# React Native Codegen
82+
ios/generated
83+
android/generated
84+
85+
# Docs
8186
.vercel

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Lines changed: 541 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Lines changed: 28 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/releases/yarn-3.6.1.cjs

Lines changed: 874 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
nmHoistingLimits: workspaces
2-
31
nodeLinker: node-modules
2+
nmHoistingLimits: workspaces
43

54
plugins:
6-
spec: "@yarnpkg/plugin-workspace-tools"
5+
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
6+
spec: "@yarnpkg/plugin-interactive-tools"
7+
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
8+
spec: "@yarnpkg/plugin-workspace-tools"
9+
10+
yarnPath: .yarn/releases/yarn-3.6.1.cjs

CONTRIBUTING.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,18 @@ The [example app](/example/) demonstrates usage of the library. You need to run
2323

2424
It is configured to use the local version of the library, so any changes you make to the library's source code will be reflected in the example app. Changes to the library's JavaScript code will be reflected in the example app without a rebuild, but native code changes will require a rebuild of the example app.
2525

26-
If you want to use Android Studio or XCode to edit the native code, you can open the `example/android` or `example/ios` directories respectively in those editors. To edit the Objective-C or Swift files, open `example/ios/TrueSheetExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > TrueSheet`.
26+
If you want to use Android Studio or XCode to edit the native code, you can open the `example/android` or `example/ios` directories respectively in those editors. To edit the Objective-C or Swift files, open `example/ios/TrueSheetExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-true-sheet`.
2727

2828
To edit the Java or Kotlin files, open `example/android` in Android studio and find the source files at `react-native-true-sheet` under `Android`.
2929

3030
You can use various commands from the root directory to work with the project.
3131

3232
To start the packager:
3333

34+
```sh
35+
yarn example start
36+
```
37+
3438
To run the example app on Android:
3539

3640
```sh
@@ -43,7 +47,7 @@ To run the example app on iOS:
4347
yarn example ios
4448
```
4549

46-
Make sure your code passes TypeScript and ESLint. Run the following to verify:
50+
Make sure your code passes TypeScript and ESLint. Run the following to verify and fix:
4751

4852
```sh
4953
yarn tidy

android/build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ buildscript {
1414
}
1515
}
1616

17+
def reactNativeArchitectures() {
18+
def value = rootProject.getProperties().get("reactNativeArchitectures")
19+
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
20+
}
21+
1722
def isNewArchitectureEnabled() {
1823
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
1924
}
@@ -90,6 +95,6 @@ dependencies {
9095
//noinspection GradleDynamicVersion
9196
implementation "com.facebook.react:react-native:+"
9297
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
93-
implementation "com.google.android.material:material:1.11.0"
98+
implementation 'com.google.android.material:material:1.12.0'
9499
}
95100

android/src/main/java/com/lodev09/truesheet/TrueSheetDialog.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,7 @@ class TrueSheetDialog(private val reactContext: ThemedReactContext, private val
7676
maxScreenHeight = Utils.screenHeight(reactContext, edgeToEdge)
7777
}
7878

79-
override fun getEdgeToEdgeEnabled(): Boolean {
80-
return edgeToEdge || super.getEdgeToEdgeEnabled()
81-
}
79+
override fun getEdgeToEdgeEnabled(): Boolean = edgeToEdge || super.getEdgeToEdgeEnabled()
8280

8381
override fun onStart() {
8482
super.onStart()
@@ -259,8 +257,8 @@ class TrueSheetDialog(private val reactContext: ThemedReactContext, private val
259257
})
260258
}
261259

262-
fun setOnSizeChangeListener(listener: RootSheetView.OnSizeChangeListener) {
263-
rootSheetView.setOnSizeChangeListener(listener)
260+
fun setOnSizeChangeListener(listener: (w: Int, h: Int) -> Unit) {
261+
rootSheetView.sizeChangeListener = listener
264262
}
265263

266264
/**

0 commit comments

Comments
 (0)