-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make loading less states less obvious
- Loading branch information
Showing
21 changed files
with
125 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { BottomTabBarButtonProps } from "@react-navigation/bottom-tabs"; | ||
import { PlatformPressable } from "@react-navigation/elements"; | ||
import * as Haptics from "expo-haptics"; | ||
|
||
export function HapticTab(props: BottomTabBarButtonProps) { | ||
return ( | ||
<PlatformPressable | ||
{...props} | ||
onPressIn={(ev) => { | ||
if (process.env.EXPO_OS !== "web") { | ||
// Add a soft haptic feedback when pressing down on the tabs. | ||
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light); | ||
} | ||
props.onPressIn?.(ev); | ||
}} | ||
/> | ||
); | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
diff --git a/node_modules/react-native-webview/apple/RNCWebViewImpl.m b/node_modules/react-native-webview/apple/RNCWebViewImpl.m | ||
index ed3a81a..7d361e7 100644 | ||
--- a/node_modules/react-native-webview/apple/RNCWebViewImpl.m | ||
+++ b/node_modules/react-native-webview/apple/RNCWebViewImpl.m | ||
@@ -474,9 +474,12 @@ - (WKWebViewConfiguration *)setUpWkWebViewConfig | ||
return wkWebViewConfig; | ||
} | ||
|
||
-- (void)didMoveToWindow | ||
+- (void)initializeWebView | ||
{ | ||
- if (self.window != nil && _webView == nil) { | ||
+ @synchronized (self) { | ||
+ if (_webView != nil) { | ||
+ return; | ||
+ } | ||
WKWebViewConfiguration *wkWebViewConfig = [self setUpWkWebViewConfig]; | ||
_webView = [[RNCWKWebView alloc] initWithFrame:self.bounds configuration: wkWebViewConfig]; | ||
[self setBackgroundColor: _savedBackgroundColor]; | ||
@@ -529,6 +532,23 @@ - (void)didMoveToWindow | ||
[self setKeyboardDisplayRequiresUserAction: _savedKeyboardDisplayRequiresUserAction]; | ||
[self visitSource]; | ||
} | ||
+} | ||
+ | ||
+// react-native-mac os does not support didMoveToSuperView | ||
+#if !TARGET_OS_OSX | ||
+- (void)didMoveToSuperview | ||
+{ | ||
+ if (self.superview != nil && _webView == nil) { | ||
+ [self initializeWebView]; | ||
+ } | ||
+} | ||
+#endif // !TARGET_OS_OSX | ||
+ | ||
+- (void)didMoveToWindow | ||
+{ | ||
+ if (self.window != nil && _webView == nil) { | ||
+ [self initializeWebView]; | ||
+ } | ||
#if !TARGET_OS_OSX | ||
// Allow this object to recognize gestures | ||
if (self.menuItems != nil) { |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters