-
Notifications
You must be signed in to change notification settings - Fork 1.5k
chore: enable edge to edge on android #7157
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
base: develop
Are you sure you want to change the base?
Changes from all commits
44efbf8
b0cecb1
7b24a58
1f3bb17
2489311
f91620b
86af316
4aa8a96
c6a2b16
282dba7
2248682
792526d
22dbdda
e03a879
ebb240b
8429fdd
e92e037
0db5c91
aa55241
5c96ced
6bc691b
c0f3f45
b7c1a13
c1d8c7e
1cd99f6
6aeedcd
867761b
ed2e07c
5073b79
b9430fe
cb4ff64
b1791a6
c02e058
5102acb
56e37d4
8c55719
759655e
2cb4ef8
d5b9a29
1e47a38
5b6e290
3d8ae42
a5d357d
34ad7f7
c02e0f5
af5c0ab
83b4c4e
478a309
db37a21
db91c47
1000c4e
f864184
47e7246
247b91c
311a2d7
81713ca
7e64fa3
8a59eae
fa1ede2
550d31a
a5b7e25
5ab5c7b
309c04f
f3a6cf4
15c13e3
38688eb
5578c79
9959cbe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,6 @@ import { | |
| findNodeHandle, | ||
| Keyboard, | ||
| type LayoutChangeEvent, | ||
| Platform, | ||
| useWindowDimensions, | ||
| type View | ||
| } from 'react-native'; | ||
|
|
@@ -34,10 +33,6 @@ const ActionSheet = memo( | |
| const [contentHeight, setContentHeight] = useState(0); | ||
| const onCloseSnapshotRef = useRef<TActionSheetOptions['onClose']>(undefined); | ||
|
|
||
| // TrueSheet detects the bottom inset for Android 16 and iOS | ||
| // To avoid content hiding behind navigation bar on older Android versions | ||
| const isNewAndroid = isAndroid && Number(Platform.Version) >= 36; | ||
| const bottom = isIOS || isNewAndroid ? 0 : windowHeight * 0.03; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. truesheet handles the bottom insets by it's own when we have edgeToEdge enabled, so it's safe to remove it |
||
| const itemHeight = 48 * fontScale; | ||
|
|
||
| const handleContentLayout = ({ nativeEvent: { layout } }: LayoutChangeEvent) => { | ||
|
|
@@ -107,7 +102,6 @@ const ActionSheet = memo( | |
|
|
||
| const { detents, maxHeight, scrollEnabled } = useActionSheetDetents({ | ||
| windowHeight, | ||
| bottomInset: bottom, | ||
| itemHeight, | ||
| optionsLength: data?.options?.length || 0, | ||
| snaps: effectiveSnaps, | ||
|
|
@@ -118,7 +112,7 @@ const ActionSheet = memo( | |
|
|
||
| const hasOptions = !!data?.options?.length; | ||
| const hasSnaps = !!effectiveSnaps?.length; | ||
| const disableContentPanning = data?.enableContentPanningGesture === false || (!scrollEnabled && isAndroid); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This part of the code was added for sheets with a small number of options. Without it, tapping or scrolling the sheet causes its height to shrink. Screen.Recording.2026-06-25.at.3.24.22.AM.mov |
||
| const disableContentPanning = data?.enableContentPanningGesture === false; | ||
|
Rohit3523 marked this conversation as resolved.
|
||
| const isScrollable = hasOptions || (hasSnaps && !disableContentPanning); | ||
|
|
||
| const contentMinHeight = | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| import { memo, type ReactElement } from 'react'; | ||
| import { FlatList } from 'react-native'; | ||
| import { useSafeAreaInsets } from 'react-native-safe-area-context'; | ||
|
|
||
| import { type ICustomEmojis, type IEmoji } from '../../definitions/IEmoji'; | ||
| import scrollPersistTaps from '../../lib/methods/helpers/scrollPersistTaps'; | ||
|
|
@@ -55,15 +54,14 @@ const EmojiCategory = ({ | |
| bottomSheet = false | ||
| }: IEmojiCategoryProps): ReactElement | null => { | ||
| const items = useEmojis(category); | ||
| const { bottom } = useSafeAreaInsets(); | ||
|
|
||
| if (!parentWidth) { | ||
| return null; | ||
| } | ||
|
|
||
| const numColumns = Math.trunc(parentWidth / EMOJI_BUTTON_SIZE); | ||
| const marginHorizontal = (parentWidth % EMOJI_BUTTON_SIZE) / 2; | ||
| const contentPaddingBottom = bottomSheet ? Math.max(0, MIN_BOTTOM_SHEET_BREATHING_ROOM - bottom) : undefined; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Screen.Recording.2026-06-25.at.3.32.21.AM.mov |
||
| const contentPaddingBottom = bottomSheet ? Math.max(0, MIN_BOTTOM_SHEET_BREATHING_ROOM) : undefined; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed bottom because it was making emoji hiding behind nav bar
Rohit3523 marked this conversation as resolved.
|
||
|
|
||
| const renderItem = ({ item }: { item: IEmoji }) => <PressableEmoji emoji={item} onPress={onEmojiSelected} />; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,6 +1,7 @@ | ||||||
| import { type ReactElement } from 'react'; | ||||||
| import { type ScrollViewProps, StyleSheet, View } from 'react-native'; | ||||||
| import { KeyboardAwareScrollView } from 'react-native-keyboard-controller'; | ||||||
| import { useSafeAreaInsets } from 'react-native-safe-area-context'; | ||||||
|
|
||||||
| import sharedStyles from '../views/Styles'; | ||||||
| import scrollPersistTaps from '../lib/methods/helpers/scrollPersistTaps'; | ||||||
|
|
@@ -17,7 +18,7 @@ interface IFormContainer extends ScrollViewProps { | |||||
|
|
||||||
| const styles = StyleSheet.create({ | ||||||
| scrollView: { | ||||||
| minHeight: '100%' | ||||||
| flexGrow: 1 | ||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replaced
|
||||||
| } | ||||||
| }); | ||||||
|
|
||||||
|
|
@@ -27,19 +28,20 @@ export const FormContainerInner = ({ | |||||
| }: { | ||||||
| children: (ReactElement | null)[]; | ||||||
| accessibilityLabel?: string; | ||||||
| }) => ( | ||||||
| }): ReactElement => ( | ||||||
|
diegolmello marked this conversation as resolved.
|
||||||
| <View accessibilityLabel={accessibilityLabel} style={[sharedStyles.container, isTablet && sharedStyles.tabletScreenContent]}> | ||||||
| {children} | ||||||
| </View> | ||||||
| ); | ||||||
|
|
||||||
| const FormContainer = ({ children, testID, showAppVersion = true, ...props }: IFormContainer) => { | ||||||
| const FormContainer = ({ children, testID, showAppVersion = true, ...props }: IFormContainer): ReactElement => { | ||||||
|
diegolmello marked this conversation as resolved.
|
||||||
| const { colors } = useTheme(); | ||||||
| const { bottom } = useSafeAreaInsets(); | ||||||
|
|
||||||
| return ( | ||||||
| <KeyboardAwareScrollView | ||||||
| style={[sharedStyles.container, { backgroundColor: colors.surfaceRoom }]} | ||||||
| contentContainerStyle={[sharedStyles.containerScrollView, styles.scrollView]} | ||||||
| contentContainerStyle={[sharedStyles.containerScrollView, styles.scrollView, { paddingBottom: Math.max(24, bottom) }]} | ||||||
| bottomOffset={20} | ||||||
| {...scrollPersistTaps} | ||||||
| {...props}> | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes the navigation bar transparent. Setting it to true makes the navigation bar partially transparent, resulting in a color mismatch.