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
64 changes: 0 additions & 64 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,67 +57,6 @@ jobs:
- name: Build package
run: yarn prepare

build-android:
runs-on: ubuntu-latest

env:
TURBO_CACHE_DIR: .turbo/android

steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

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

- name: Generate nitrogen code
run: yarn nitrogen

- name: Cache turborepo for Android
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-turborepo-android-

- name: Check turborepo cache for Android
run: |
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:android').cache.status")

if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_cache_hit=1" >> $GITHUB_ENV
fi

- name: Install JDK
if: env.turbo_cache_hit != 1
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
distribution: 'zulu'
java-version: '17'

- name: Finalize Android SDK
if: env.turbo_cache_hit != 1
run: |
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"

- name: Cache Gradle
if: env.turbo_cache_hit != 1
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: |
~/.gradle/wrapper
~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Build example for Android
env:
JAVA_OPTS: "-XX:MaxHeapSize=6g"
run: |
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"

build-ios:
runs-on: macos-latest

Expand All @@ -134,9 +73,6 @@ jobs:
- name: Setup
uses: ./.github/actions/setup

- name: Generate nitrogen code
run: yarn nitrogen

- name: Cache turborepo for iOS
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
Expand Down
33 changes: 1 addition & 32 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,7 @@ yarn

> Since the project relies on Yarn workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development without manually migrating.

This project uses Nitro Modules. If you're not familiar with how Nitro works, make sure to check the [Nitro Modules Docs](https://nitro.margelo.com/).

You need to run [Nitrogen](https://nitro.margelo.com/docs/nitrogen) to generate the boilerplate code required for this project. The example app will not build without this step.

Run **Nitrogen** in following cases:

- When you make changes to any `*.nitro.ts` files.
- When running the project for the first time (since the generated files are not committed to the repository).

To invoke **Nitrogen**, use the following command:

```sh
yarn nitrogen
```

This command also reapplies the required Fabric unmount patch to:

```sh
nitrogen/generated/ios/c++/views/HybridRNScrollEdgeBarComponent.mm
```

Do not run `nitrogen` directly unless you also rerun:

```sh
yarn nitrogen:patch
```

To verify that the generated iOS component still contains the required Fabric lifecycle hooks, run:

```sh
yarn nitrogen:verify
```
This project currently uses plain React Native Fabric codegen for the iOS implementation.

The [example app](/example/) demonstrates usage of the library. You need to run it to test any changes you make.

Expand Down
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# react-native-scroll-edge-bar

`react-native-scroll-edge-bar` is a Nitro-based React Native view for attaching custom top and bottom bars to a scroll view on iOS.
`react-native-scroll-edge-bar` is a Fabric-based React Native view for attaching custom top and bottom bars to a scroll view on iOS.

It currently targets the iOS 26 `safeAreaBar` APIs and is implemented only on iOS. Android scaffolding exists in the repo, but there is no Android feature implementation yet.
It currently targets the iOS 26 `safeAreaBar` APIs and is implemented only on iOS.

## Current Scope

- iOS implementation: present
- Android implementation: not implemented
- Fabric / New Architecture: required
- Native dependency: `react-native-nitro-modules`
- Native dependency: none beyond standard React Native Fabric/codegen on iOS

## Public API

Expand All @@ -35,16 +35,16 @@ Available components:
- Extra offset to push the top bar below an external header.
- `bottomBarOffset?: number`
- Extra offset to lift the bottom bar above an external tab bar.
- Standard Nitro/RN view props such as `style`
- Standard RN view props such as `style`

### `ScrollEdgeBar.TopBar` props

- Standard Nitro/RN view props such as `style`
- Standard RN view props such as `style`
- `children`

### `ScrollEdgeBar.BottomBar` props

- Standard Nitro/RN view props such as `style`
- Standard RN view props such as `style`
- `children`

## Usage
Expand Down Expand Up @@ -98,7 +98,7 @@ If your navigation header or tab bar is external to the scroll-edge-bar containe
## Installation

```sh
npm install react-native-scroll-edge-bar react-native-nitro-modules
npm install react-native-scroll-edge-bar
```

Then install iOS pods in your app:
Expand All @@ -121,15 +121,14 @@ The example app in `example/` currently demonstrates:

- iOS-only in practice
- relies on view discovery and reparenting in Fabric, which is more fragile than a pure UIKit setup
- generated Nitrogen iOS component files currently contain manual logic; regenerating Nitrogen can overwrite those changes
- the implementation is currently tuned around iOS 26 APIs

## Repo Notes

Relevant files:

- API surface: `src/index.tsx`
- Nitro types: `src/RNScrollEdgeBar.nitro.ts`
- Fabric specs: `src/fabric/*.ts`
- iOS implementation: `ios/HybridScrollEdgeBar.swift`
- example app: `example/src/App.tsx`

Expand Down
13 changes: 6 additions & 7 deletions ScrollEdgeBar.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ Pod::Spec.new do |s|
s.source = { :git => "https://github.com/jensvansteen/react-native-scroll-edge-bar.git", :tag => "#{s.version}" }

s.source_files = [
"common/cpp/**/*.{cpp,h}",
"ios/**/*.{swift}",
"ios/**/*.{m,mm}",
"cpp/**/*.{hpp,cpp}",
]
s.project_header_files = "common/cpp/**/*.h"
s.pod_target_xcconfig = {
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/common/cpp\""
}

s.dependency 'React-jsi'
s.dependency 'React-callinvoker'

load 'nitrogen/generated/ios/RNScrollEdgeBar+autolinking.rb'
add_nitrogen_files(s)

s.dependency 'React-Core'
install_modules_dependencies(s)
end
24 changes: 0 additions & 24 deletions android/CMakeLists.txt

This file was deleted.

118 changes: 0 additions & 118 deletions android/build.gradle

This file was deleted.

2 changes: 0 additions & 2 deletions android/src/main/AndroidManifest.xml

This file was deleted.

6 changes: 0 additions & 6 deletions android/src/main/cpp/cpp-adapter.cpp

This file was deleted.

This file was deleted.

Loading
Loading