Bluesky app fork with some witchin' additions 馃挮
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at cope-settings-sync 168 lines 6.8 kB view raw
1diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.h b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.h 2index 914a2494a..0deac55f2 100644 3--- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.h 4+++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.h 5@@ -19,6 +19,8 @@ NS_ASSUME_NONNULL_BEGIN 6 */ 7 @interface RCTPullToRefreshViewComponentView : RCTViewComponentView <RCTCustomPullToRefreshViewProtocol> 8 9+- (void)beginRefreshingProgrammatically; 10+ 11 @end 12 13 NS_ASSUME_NONNULL_END 14diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm 15index 1494fd225..df643f5c8 100644 16--- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm 17+++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm 18@@ -1038,6 +1038,11 @@ static inline UIViewAnimationOptions animationOptionsWithCurve(UIViewAnimationCu 19 } 20 } 21 22++ (BOOL)shouldBeRecycled 23+{ 24+ return NO; 25+} 26+ 27 @end 28 29 Class<RCTComponentViewProtocol> RCTScrollViewCls(void) 30diff --git a/React/Views/RefreshControl/RCTRefreshControl.h b/React/Views/RefreshControl/RCTRefreshControl.h 31index e9b330fa7..ec5f58c88 100644 32--- a/React/Views/RefreshControl/RCTRefreshControl.h 33+++ b/React/Views/RefreshControl/RCTRefreshControl.h 34@@ -15,5 +15,8 @@ 35 @property (nonatomic, copy) NSString *title; 36 @property (nonatomic, copy) RCTDirectEventBlock onRefresh; 37 @property (nonatomic, weak) UIScrollView *scrollView; 38+@property (nonatomic, copy) UIColor *customTintColor; 39+ 40+- (void)forwarderBeginRefreshing; 41 42 @end 43diff --git a/React/Views/RefreshControl/RCTRefreshControl.m b/React/Views/RefreshControl/RCTRefreshControl.m 44index 53bfd0470..ff1b1ed5e 100644 45--- a/React/Views/RefreshControl/RCTRefreshControl.m 46+++ b/React/Views/RefreshControl/RCTRefreshControl.m 47@@ -23,6 +23,7 @@ 48 UIColor *_titleColor; 49 CGFloat _progressViewOffset; 50 BOOL _hasMovedToWindow; 51+ UIColor *_customTintColor; 52 } 53 54 - (instancetype)init 55@@ -58,6 +59,12 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder) 56 _isInitialRender = false; 57 } 58 59+- (void)didMoveToSuperview 60+{ 61+ [super didMoveToSuperview]; 62+ [self setTintColor:_customTintColor]; 63+} 64+ 65 - (void)didMoveToWindow 66 { 67 [super didMoveToWindow]; 68@@ -221,4 +228,50 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder) 69 } 70 } 71 72+// Fix for https://github.com/facebook/react-native/issues/43388 73+// A bug in iOS 17.4 causes the haptic to not play when refreshing if the tintColor 74+// is set before the refresh control gets added to the scrollview. We'll call this 75+// function whenever the superview changes. We'll also call it if the value of customTintColor 76+// changes. 77+- (void)setTintColor:(UIColor *)tintColor 78+{ 79+ if ([self.superview isKindOfClass:[UIScrollView class]] && self.tintColor != tintColor) { 80+ [super setTintColor:tintColor]; 81+ } 82+} 83+ 84+// This method is used by Bluesky's ExpoScrollForwarder. This allows other React Native 85+// libraries to perform a refresh of a scrollview and access the refresh control's onRefresh 86+// function. 87+- (void)forwarderBeginRefreshing 88+{ 89+ _refreshingProgrammatically = NO; 90+ 91+ [self sizeToFit]; 92+ 93+ if (!self.scrollView) { 94+ return; 95+ } 96+ 97+ UIScrollView *scrollView = (UIScrollView *)self.scrollView; 98+ 99+ [UIView animateWithDuration:0.3 100+ delay:0 101+ options:UIViewAnimationOptionBeginFromCurrentState 102+ animations:^(void) { 103+ // Whenever we call this method, the scrollview will always be at a position of 104+ // -130 or less. Scrolling back to -65 simulates the default behavior of RCTRefreshControl 105+ [scrollView setContentOffset:CGPointMake(0, -65)]; 106+ } 107+ completion:^(__unused BOOL finished) { 108+ [super beginRefreshing]; 109+ [self setCurrentRefreshingState:super.refreshing]; 110+ 111+ if (self->_onRefresh) { 112+ self->_onRefresh(nil); 113+ } 114+ } 115+ ]; 116+} 117+ 118 @end 119diff --git a/React/Views/RefreshControl/RCTRefreshControlManager.m b/React/Views/RefreshControl/RCTRefreshControlManager.m 120index 40aaf9c51..1c60164b6 100644 121--- a/React/Views/RefreshControl/RCTRefreshControlManager.m 122+++ b/React/Views/RefreshControl/RCTRefreshControlManager.m 123@@ -22,11 +22,12 @@ RCT_EXPORT_MODULE() 124 125 RCT_EXPORT_VIEW_PROPERTY(onRefresh, RCTDirectEventBlock) 126 RCT_EXPORT_VIEW_PROPERTY(refreshing, BOOL) 127-RCT_EXPORT_VIEW_PROPERTY(tintColor, UIColor) 128 RCT_EXPORT_VIEW_PROPERTY(title, NSString) 129 RCT_EXPORT_VIEW_PROPERTY(titleColor, UIColor) 130 RCT_EXPORT_VIEW_PROPERTY(progressViewOffset, CGFloat) 131 132+RCT_REMAP_VIEW_PROPERTY(tintColor, customTintColor, UIColor) 133+ 134 RCT_EXPORT_METHOD(setNativeRefreshing : (nonnull NSNumber *)viewTag toRefreshing : (BOOL)refreshing) 135 { 136 [self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) { 137diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.kt b/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.kt 138index 8b6571698..27c97bfeb 100644 139--- a/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.kt 140+++ b/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.kt 141@@ -313,8 +313,9 @@ public open class JavaTimerManager( 142 // We also capture the idleCallbackRunnable to tentatively fix: 143 // https://github.com/facebook/react-native/issues/44842 144 currentIdleCallbackRunnable?.cancel() 145- currentIdleCallbackRunnable = IdleCallbackRunnable(frameTimeNanos) 146- reactApplicationContext.runOnJSQueueThread(currentIdleCallbackRunnable) 147+ val idleCallbackRunnable = IdleCallbackRunnable(frameTimeNanos) 148+ currentIdleCallbackRunnable = idleCallbackRunnable 149+ reactApplicationContext.runOnJSQueueThread(idleCallbackRunnable) 150 reactChoreographer.postFrameCallback(ReactChoreographer.CallbackType.IDLE_EVENT, this) 151 } 152 } 153diff --git a/third-party-podspecs/fmt.podspec b/third-party-podspecs/fmt.podspec 154index 2f38990e2..9b02e481e 100644 155--- a/third-party-podspecs/fmt.podspec 156+++ b/third-party-podspecs/fmt.podspec 157@@ -26,4 +26,11 @@ Pod::Spec.new do |spec| 158 spec.public_header_files = "include/fmt/*.h" 159 spec.header_mappings_dir = "include" 160 spec.source_files = ["include/fmt/*.h", "src/format.cc"] 161+ 162+ # TODO: Remove after upgrading React Native past 0.83.x 163+ # Fix fmt 11.0.2 consteval build error with Xcode 26.4 (facebook/react-native#55601) 164+ # Fixed in RN 0.84+ which bumps fmt to a compatible version. 165+ spec.prepare_command = <<~SCRIPT 166+ perl -i -pe 's/^# define FMT_USE_CONSTEVAL 1$/# define FMT_USE_CONSTEVAL 0/' include/fmt/base.h 167+ SCRIPT 168 end