Skip to content

Commit 6d45d5a

Browse files
committed
tweaking keyboard offset control
1 parent cf15273 commit 6d45d5a

File tree

3 files changed

+35
-22
lines changed

3 files changed

+35
-22
lines changed

app/client/mobile/src/conversation/ConversationSmall.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ export function ConversationSmall({close, openDetails}: {close: () => void; open
312312
<ActivityIndicator />
313313
</View>
314314
)}
315-
<View style={styles.canvas}>
315+
<Surface style={styles.canvas} mode="flat" elevation={2}>
316316
<Surface style={{...styles.frame, borderColor: theme.colors.outlineVariant}} mode="flat" elevation={0}>
317317
<Animated.View style={[{}, {height: scale}]}>
318318
{state.assets.length > 0 && <View style={styles.assetSpacer} />}
@@ -437,9 +437,9 @@ export function ConversationSmall({close, openDetails}: {close: () => void; open
437437
/>
438438
</View>
439439
</Surface>
440-
</View>
440+
</Surface>
441441
{ focused && (
442-
<View style={{...styles.keyboardSpacer, height: state.keyboardOffset + keyboardHeight - (Platform.OS === 'ios' ? 96 : 80)}} />
442+
<Surface style={{...styles.keyboardSpacer, height: state.keyboardOffset + keyboardHeight - (Platform.OS === 'ios' ? 96 : 80)}} mode="flat" elevation={2} />
443443
)}
444444
</SafeAreaView>
445445
</Surface>

app/client/mobile/src/settings/Settings.styled.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,4 +679,15 @@ export const styles = StyleSheet.create({
679679
navSkip: {
680680
backgroundColor: 'transparent',
681681
},
682+
splitLabel: {
683+
display: 'flex',
684+
flexDirection: 'row',
685+
justifyContent: 'space-between',
686+
alignItems: 'center',
687+
width: '100%',
688+
paddingRight: 24,
689+
},
690+
labelValue: {
691+
fontSize: 14,
692+
},
682693
});

app/client/mobile/src/settings/SettingsSmall.tsx

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -818,25 +818,6 @@ export function SettingsSmall({setupNav}: {setupNav: {back: () => void; next: ()
818818
</Surface>
819819
</View>
820820
)}
821-
822-
{!setupNav && (
823-
<Text variant="headlineSmall" style={styles.sectionLabel}>
824-
{state.strings.layout}
825-
</Text>
826-
)}
827-
{!setupNav && (
828-
<View style={styles.navWrapper}>
829-
<Surface elevation={0} mode="flat" style={styles.navData}>
830-
<View style={styles.navFont}>
831-
<TextInput style={styles.navInput} mode="outlined" outlineStyle={styles.navInputBorder} placeholder={state.strings.keyboardOffset} />
832-
<View style={styles.navPress} />
833-
</View>
834-
<View style={styles.slider}>
835-
<Slider minimumValue={-128} maximumValue={128} minimumTrackTintColor={theme.colors.primary} value={state.keyboardOffset} onSlidingComplete={val => actions.setKeyboardOffset(val)} />
836-
</View>
837-
</Surface>
838-
</View>
839-
)}
840821
{!setupNav && (
841822
<Text variant="headlineSmall" style={styles.sectionLabel}>
842823
{state.strings.blocked}
@@ -880,6 +861,27 @@ export function SettingsSmall({setupNav}: {setupNav: {back: () => void; next: ()
880861
</Surface>
881862
</View>
882863
)}
864+
{!setupNav && (
865+
<Text variant="headlineSmall" style={styles.sectionLabel}>
866+
{state.strings.layout}
867+
</Text>
868+
)}
869+
{!setupNav && (
870+
<View style={styles.navWrapper}>
871+
<Surface elevation={0} mode="flat" style={styles.navData}>
872+
<View style={styles.navFont}>
873+
<View style={styles.splitLabel}>
874+
<TextInput style={styles.navInput} mode="outlined" outlineStyle={styles.navInputBorder} placeholder={state.strings.keyboardOffset} />
875+
<Text style={{...styles.labelValue, color: theme.colors.tertiary}}>{ Math.floor(state.keyboardOffset) * 4 }px</Text>
876+
</View>
877+
<View style={styles.navPress} />
878+
</View>
879+
<View style={styles.slider}>
880+
<Slider minimumValue={-128} maximumValue={128} minimumTrackTintColor={theme.colors.primary} value={state.keyboardOffset} onSlidingComplete={val => actions.setKeyboardOffset(val)} />
881+
</View>
882+
</Surface>
883+
</View>
884+
)}
883885
{!setupNav && (
884886
<Text variant="headlineSmall" style={styles.sectionLabel}>
885887
{state.strings.support}

0 commit comments

Comments
 (0)