Skip to content

Commit 5375a15

Browse files
chore(runway): cherry-pick fix: cp-7.58.0 Fix swipe gesture navigation in send flow amount page for Android (#21605)
- fix: cp-7.58.0 Fix swipe gesture navigation in send flow amount page for Android (#21518) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> This PR aims to fix Android issue where amount keyboard appears behind the gestures navigation. ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: Fix send flow keyboard to not appear behind gesture navigation in mobile ## **Related issues** Fixes: #21383 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** Android: <img width="689" height="1416" alt="before android" src="https://github.com/user-attachments/assets/5079c87b-a100-4f1a-bd99-4d325a7073b2" /> iOS: <img width="696" height="1384" alt="before ios" src="https://github.com/user-attachments/assets/b116d4e0-11f6-41a4-a16f-8873b59f03b8" /> ### **After** Android: <img width="711" height="1460" alt="after android" src="https://github.com/user-attachments/assets/8cc6bc27-38fe-4656-a681-48785e8be1c6" /> iOS: <img width="696" height="1384" alt="after ios" src="https://github.com/user-attachments/assets/1500b133-db31-4264-b88f-60353b9f3434" /> ## **Pre-merge author checklist** - [X] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [X] I've completed the PR template to the best of my ability - [X] I’ve included tests if applicable - [X] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [X] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adjust send amount screen layout to respect safe areas and avoid Android gesture navigation overlapping the keyboard. > > - **Send Flow - Amount Screen**: > - Replace `ScrollView` with `SafeAreaView` and set platform-specific `edges` to handle safe areas. > - Update `container` style to use `flex: 1` (remove `minHeight: '100%'`). > - Adjust amount keyboard wrapper (`edit-amount-keyboard.styles.ts`): > - Set `paddingBottom` via `Device.isIos() ? 20 : 12`. > - Remove vertical margins and set `marginBottom: 0`. > - **Misc**: > - Import `Device` for platform checks and update related imports. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit cdc6069. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [aa8808c](aa8808c) Co-authored-by: OGPoyraz <[email protected]>
1 parent a000df2 commit 5375a15

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

app/components/Views/confirmations/components/edit-amount-keyboard/edit-amount-keyboard.styles.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { StyleSheet } from 'react-native';
2+
import Device from '../../../../../util/device';
23
import { Theme } from '../../../../../util/theme/models';
34

45
const styleSheet = (params: { theme: Theme }) =>
@@ -11,8 +12,8 @@ const styleSheet = (params: { theme: Theme }) =>
1112
borderTopLeftRadius: 12,
1213
borderTopRightRadius: 12,
1314
padding: 12,
14-
paddingBottom: 16,
15-
marginVertical: 12,
15+
marginBottom: 0,
16+
paddingBottom: Device.isIos() ? 20 : 12,
1617
},
1718
percentageButton: {
1819
borderRadius: 12,

app/components/Views/confirmations/components/send/amount/amount.styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ export const styleSheet = (params: {
4444
},
4545
container: {
4646
backgroundColor: theme.colors.background.default,
47+
flex: 1,
4748
flexDirection: FlexDirection.Column,
4849
justifyContent: JustifyContent.spaceBetween,
49-
minHeight: '100%',
5050
},
5151
currencyTag: {
5252
alignSelf: 'center',

app/components/Views/confirmations/components/send/amount/amount.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import React, { useCallback, useEffect, useMemo, useState } from 'react';
22
import { Nft } from '@metamask/assets-controllers';
3-
import { ScrollView, TouchableOpacity, View } from 'react-native';
3+
import { TouchableOpacity, View } from 'react-native';
44
import { useSelector } from 'react-redux';
5+
import { SafeAreaView } from 'react-native-safe-area-context';
56

67
import { strings } from '../../../../../../../locales/i18n';
78
import Icon, {
@@ -18,6 +19,7 @@ import Text, {
1819
import { selectPrimaryCurrency } from '../../../../../../selectors/settings';
1920
import CollectibleMedia from '../../../../../UI/CollectibleMedia';
2021
import { useStyles } from '../../../../../hooks/useStyles';
22+
import Device from '../../../../../../util/device';
2123
import { AssetType, TokenStandard } from '../../../types/token';
2224
import { formatToFixedDecimals } from '../../../utils/send';
2325
import { useAmountSelectionMetrics } from '../../../hooks/send/metrics/useAmountSelectionMetrics';
@@ -52,6 +54,7 @@ export const Amount = () => {
5254
contentLength: amount.length + assetDisplaySymbol.length,
5355
isNFT,
5456
});
57+
const isIos = Device.isIos();
5558
const { setAmountInputTypeFiat, setAmountInputTypeToken } =
5659
useAmountSelectionMetrics();
5760
useRouteParams();
@@ -105,7 +108,10 @@ export const Amount = () => {
105108
}
106109

107110
return (
108-
<ScrollView contentContainerStyle={styles.container}>
111+
<SafeAreaView
112+
edges={isIos ? ['left', 'right'] : ['left', 'right', 'bottom']}
113+
style={styles.container}
114+
>
109115
<View style={styles.topSection}>
110116
{isNFT && (
111117
<View style={styles.nftImageWrapper}>
@@ -170,6 +176,6 @@ export const Amount = () => {
170176
updateAmount={setAmount}
171177
/>
172178
</View>
173-
</ScrollView>
179+
</SafeAreaView>
174180
);
175181
};

0 commit comments

Comments
 (0)