Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge next to master #817

Merged
merged 34 commits into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e6bfc6e
feat(iOS): change Fabric implementation to UIScrollView (#672)
krozniata Jan 17, 2023
0af8914
chore: add GH actions (#680)
troZee Jan 17, 2023
bdf7de4
feat(iOS): rewrite old arch to use UIScrollView (#681)
okwasniewski Jan 25, 2023
5926edf
chore: update release script
Jan 25, 2023
54c113d
Release 7.0.0-rc.0
Jan 25, 2023
f4f5dc2
wip
intergalacticspacehighway Mar 28, 2023
8301861
wip
intergalacticspacehighway Mar 28, 2023
63ba5b8
fabric example
intergalacticspacehighway Mar 28, 2023
aee272c
nit: comment
intergalacticspacehighway Mar 28, 2023
5c350fc
make init consistent
intergalacticspacehighway Mar 28, 2023
a3e4dd9
Merge pull request #712 from intergalacticspacehighway/fix/v-7-naviga…
okwasniewski Mar 29, 2023
6c57bd3
fix: multiple updates of frame and contentSize
okwasniewski Apr 2, 2023
dae80ab
Merge pull request #714 from callstack/feat/@okwasniewski/fix-updates
okwasniewski Apr 4, 2023
e8d56fa
feat: add button to quickly switch layout direction
okwasniewski Apr 5, 2023
cb2f01d
Merge pull request #718 from callstack/feat/@okwasniewski/locale-next
okwasniewski Apr 6, 2023
077d026
sync with master (#756)
troZee Aug 31, 2023
2e37b48
chore: upgrade RN (paper example)
krozniata Oct 11, 2023
a209b73
chore: upgrade rn & fix issues (fabric example)
krozniata Oct 11, 2023
06b8381
chore: bump versions in package.json
krozniata Oct 11, 2023
728579c
chore: fix eslint issue
krozniata Oct 11, 2023
def62d9
chore: exclude example from tsc
krozniata Oct 11, 2023
1138d97
Merge pull request #775 from callstack/chore/upgrade-rn
krozniata Oct 13, 2023
9a55282
feat(next): remove fabric example
krozniata Oct 13, 2023
9c0796a
chore: update README
krozniata Oct 13, 2023
3ea6dae
Merge pull request #778 from callstack/feat/remove-fabricexample
krozniata Oct 16, 2023
08486ba
fix broken overdrag on notch (#787)
ku8ar Nov 17, 2023
c8cc208
feat(iOS): Add a `useLegacy` flag to switch between the old/new iOS i…
igorbej Dec 21, 2023
384d261
Release 7.0.0-rc.1
Dec 21, 2023
d6ccbad
fix(ios): fix freezing when navigating to same index (#804)
krozniata Mar 29, 2024
75bc1e3
Release 7.0.0-rc.2
Mar 29, 2024
1518c40
Merge branch 'master' into next
Mar 29, 2024
9f0be55
fix iOS issue
Mar 29, 2024
13fa1cb
Change Legacy basic example into the next basic example
Mar 31, 2024
e173926
revert documentatation
Mar 31, 2024
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
2 changes: 2 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ on:
pull_request:
branches:
- master
- next
paths:
- '.github/workflows/android.yml'
- 'android/**'
- 'example/android/**'
push:
branches:
- master
- next

concurrency:
group: ${{ github.ref }}-android
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ on:
pull_request:
branches:
- master
- next
paths:
- '.github/workflows/ios.yml'
- 'ios/**'
- 'example/ios/**'
push:
branches:
- master
- next

concurrency:
group: ${{ github.ref }}-ios
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ on:
pull_request:
branches:
- master
- next
push:
branches:
- master
- next

concurrency:
group: ${{ github.ref }}-js
Expand Down
7 changes: 1 addition & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ npm-debug.log
yarn-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
android/app/libs
android/keystores/debug.keystore

# Expo
.expo/*

Expand All @@ -76,3 +70,4 @@ lefthook.yml
# testing
/coverage
.cxx
example/ios/PagerViewExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ For advanced usage please take a look into our [example project](https://github.
| `pageMargin: number` | Blank space to be shown between pages | both |
| `keyboardDismissMode: ('none' / 'on-drag')` | Determines whether the keyboard gets dismissed in response to a drag | both |
| `orientation: Orientation` | Set `horizontal` or `vertical` scrolling orientation (it does **not** work dynamically) | both |
| `overScrollMode: OverScrollMode` | Used to override default value of overScroll mode. Can be `auto`, `always` or `never`. Defaults to `auto` | Android |
| `overScrollMode: OverScrollMode` | Used to override default value of overScroll mode. Can be `auto`, `always` or `never`. Defaults to `auto` | Android |
| `offscreenPageLimit: number` | Set the number of pages that should be retained to either side of the currently visible page(s). Pages beyond this limit will be recreated from the adapter when needed. Defaults to RecyclerView's caching strategy. The given value must either be larger than 0. | Android |
| `overdrag: boolean` | Allows for overscrolling after reaching the end or very beginning or pages. Defaults to `false` | iOS |
| `layoutDirection: ('ltr' / 'rtl' / 'locale')` | Specifies layout direction. Use `ltr` or `rtl` to set explicitly or `locale` to deduce from the default language script of a locale. Defaults to `locale` | both |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.reactnativepagerview

import com.facebook.react.uimanager.ViewGroupManager
import android.widget.FrameLayout
import com.facebook.react.module.annotations.ReactModule
import com.facebook.react.uimanager.ThemedReactContext

// Note: The LEGACY_ variant is an iOS-only feature and the related Android files
// are only included because of and relevant to auxiliary processes, like Codegen.
@ReactModule(name = LEGACY_PagerViewViewManagerImpl.NAME)
class LEGACY_PagerViewViewManager : ViewGroupManager<FrameLayout>() {
override fun getName() = LEGACY_PagerViewViewManagerImpl.NAME

override fun createViewInstance(context: ThemedReactContext): FrameLayout {
throw Error("LEGACY_RNCViewPager is an iOS-only feature")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ class PagerViewViewManager : ViewGroupManager<NestedScrollableHost>(), RNCViewPa
return
}

@ReactProp(name = "useLegacy")
override fun setUseLegacy(view: NestedScrollableHost?, value: Boolean) {
return
}

fun goTo(root: NestedScrollableHost?, selectedPage: Int, scrollWithAnimation: Boolean) {
if (root == null) {
return
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.reactnativepagerview

// Note: The LEGACY_ variant is an iOS-only feature and the related Android files
// are only included because of and relevant to auxiliary processes, like Codegen.
object LEGACY_PagerViewViewManagerImpl {
const val NAME = "LEGACY_RNCViewPager"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ class PagerViewPackage : ReactPackage {
}

override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
return listOf(PagerViewViewManager())
return listOf(PagerViewViewManager(), LEGACY_PagerViewViewManager())
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.reactnativepagerview

import com.facebook.react.uimanager.ViewGroupManager
import android.widget.FrameLayout
import com.facebook.react.module.annotations.ReactModule
import com.facebook.react.uimanager.ThemedReactContext

// Note: The LEGACY_ variant is an iOS-only feature and the related Android files
// are only included because of and relevant to auxiliary processes, like Codegen.
@ReactModule(name = LEGACY_PagerViewViewManagerImpl.NAME)
class LEGACY_PagerViewViewManager : ViewGroupManager<FrameLayout>() {
override fun getName() = LEGACY_PagerViewViewManagerImpl.NAME

override fun createViewInstance(context: ThemedReactContext): FrameLayout {
throw Error("LEGACY_RNCViewPager is an iOS-only feature")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#pragma once

#include "RNCViewPagerShadowNode.h"
#include <react/renderer/core/ConcreteComponentDescriptor.h>

namespace facebook {
namespace react {

using RNCViewPagerComponentDescriptor = ConcreteComponentDescriptor<RNCViewPagerShadowNode>;

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include "RNCViewPagerShadowNode.h"

#include <react/debug/react_native_assert.h>
#include <react/renderer/core/LayoutMetrics.h>

namespace facebook {
namespace react {

const char RNCViewPagerComponentName[] = "RNCViewPager";

void RNCViewPagerShadowNode::updateStateIfNeeded() {
ensureUnsealed();

auto contentBoundingRect = Rect{};
for (const auto &childNode : getLayoutableChildNodes()) {
contentBoundingRect.unionInPlace(childNode->getLayoutMetrics().frame);
}

auto state = getStateData();

if (state.contentBoundingRect != contentBoundingRect) {
state.contentBoundingRect = contentBoundingRect;
setStateData(std::move(state));
}
}

#pragma mark - LayoutableShadowNode

void RNCViewPagerShadowNode::layout(LayoutContext layoutContext) {
ConcreteViewShadowNode::layout(layoutContext);
updateStateIfNeeded();
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#pragma once

#include <react/renderer/components/RNCViewPager/EventEmitters.h>
#include <react/renderer/components/RNCViewPager/Props.h>
#include <react/renderer/components/RNCViewPager/RNCViewPagerState.h>
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
#include <react/renderer/core/LayoutContext.h>

namespace facebook {
namespace react {

extern const char RNCViewPagerComponentName[];

class RNCViewPagerShadowNode final : public ConcreteViewShadowNode<
RNCViewPagerComponentName,
RNCViewPagerProps,
RNCViewPagerEventEmitter,
RNCViewPagerState> {
public:
using ConcreteViewShadowNode::ConcreteViewShadowNode;

#pragma mark - LayoutableShadowNode

void layout(LayoutContext layoutContext) override;

private:
void updateStateIfNeeded();
};

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "RNCViewPagerState.h"

namespace facebook {
namespace react {

Size RNCViewPagerState::getContentSize() const {
return contentBoundingRect.size;
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#pragma once

#include <react/renderer/graphics/Geometry.h>

namespace facebook {
namespace react {

class RNCViewPagerState final {
public:
Point contentOffset;
Rect contentBoundingRect;

Size getContentSize() const;

};

}
}
1 change: 1 addition & 0 deletions example/.node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package com.pagerviewexample;

import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
import com.facebook.react.defaults.DefaultReactActivityDelegate;


import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
Expand Down
5 changes: 4 additions & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ buildscript {
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"
}

repositories {
google()
mavenCentral()
maven { url 'https://www.jitpack.io' }
}

dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
}
}
}
19 changes: 19 additions & 0 deletions example/ios/PagerViewExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION,
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand Down Expand Up @@ -597,6 +598,13 @@
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-Wl",
"-ld_classic",
" ",
"-Wl -ld_classic ",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
};
Expand Down Expand Up @@ -638,6 +646,10 @@
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION,
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
Expand All @@ -662,6 +674,13 @@
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-Wl",
"-ld_classic",
" ",
"-Wl -ld_classic ",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
Expand Down
7 changes: 4 additions & 3 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,8 @@ PODS:
- React-jsinspector (0.72.6)
- React-logger (0.72.6):
- glog
- react-native-pager-view (6.2.1):
- react-native-pager-view (6.3.0):
- RCT-Folly (= 2021.07.22.00)
- React-Core
- react-native-safe-area-context (4.5.2):
- RCT-Folly
Expand Down Expand Up @@ -754,7 +755,7 @@ SPEC CHECKSUMS:
React-jsiexecutor: 3bf18ff7cb03cd8dfdce08fbbc0d15058c1d71ae
React-jsinspector: 194e32c6aab382d88713ad3dd0025c5f5c4ee072
React-logger: cebf22b6cf43434e471dc561e5911b40ac01d289
react-native-pager-view: d211379f61895b6349bd7e571b44a26d005c2975
react-native-pager-view: 40d9ec4a63ed74f8aa2f1e1bba7c1e0b4080d8a6
react-native-safe-area-context: 1d596539b05a78f2b346e954e7c577f6f9be7544
React-NativeModulesApple: 02e35e9a51e10c6422f04f5e4076a7c02243fff2
React-perflogger: e3596db7e753f51766bceadc061936ef1472edc3
Expand Down Expand Up @@ -784,4 +785,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 4c96e1cc59fd0774de51faf6e28ddf171307d5ed

COCOAPODS: 1.11.3
COCOAPODS: 1.12.1
9 changes: 0 additions & 9 deletions example/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,6 @@ const config = {
return acc;
}, {}),
},

transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
},
};

module.exports = mergeConfig(getDefaultConfig(__dirname), config);
Loading
Loading