@momo-kits/foundation 0.92.6-rc.21 → 0.92.6-rc.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -46,8 +46,6 @@ type Options = {
|
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
const DEFAULT_MAX_TAB_ITEM_WIDTH = 125;
|
|
49
|
-
const DEFAULT_TABBAR_HEIGHT = 49;
|
|
50
|
-
const COMPACT_TABBAR_HEIGHT = 32;
|
|
51
49
|
|
|
52
50
|
const shouldUseHorizontalLabels = ({
|
|
53
51
|
state,
|
|
@@ -87,38 +85,6 @@ const shouldUseHorizontalLabels = ({
|
|
|
87
85
|
const getPaddingBottom = (insets: EdgeInsets) =>
|
|
88
86
|
Math.max(insets.bottom - Platform.select({ios: 4, default: 0}), 0);
|
|
89
87
|
|
|
90
|
-
export const getTabBarHeight = ({
|
|
91
|
-
dimensions,
|
|
92
|
-
insets,
|
|
93
|
-
style,
|
|
94
|
-
...rest
|
|
95
|
-
}: Options & {
|
|
96
|
-
insets: EdgeInsets;
|
|
97
|
-
style: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
|
|
98
|
-
}) => {
|
|
99
|
-
// @ts-ignore
|
|
100
|
-
const customHeight = StyleSheet.flatten(style)?.height;
|
|
101
|
-
|
|
102
|
-
if (typeof customHeight === 'number') {
|
|
103
|
-
return customHeight;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const isLandscape = dimensions.width > dimensions.height;
|
|
107
|
-
const horizontalLabels = shouldUseHorizontalLabels({dimensions, ...rest});
|
|
108
|
-
const paddingBottom = getPaddingBottom(insets);
|
|
109
|
-
|
|
110
|
-
if (
|
|
111
|
-
Platform.OS === 'ios' &&
|
|
112
|
-
!Platform.isPad &&
|
|
113
|
-
isLandscape &&
|
|
114
|
-
horizontalLabels
|
|
115
|
-
) {
|
|
116
|
-
return COMPACT_TABBAR_HEIGHT + paddingBottom;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
return DEFAULT_TABBAR_HEIGHT + paddingBottom;
|
|
120
|
-
};
|
|
121
|
-
|
|
122
88
|
export default function BottomTabBar({
|
|
123
89
|
state,
|
|
124
90
|
navigation,
|
|
@@ -409,7 +375,7 @@ export default function BottomTabBar({
|
|
|
409
375
|
position: isTabBarHidden ? 'absolute' : (null as any),
|
|
410
376
|
},
|
|
411
377
|
{
|
|
412
|
-
paddingBottom: paddingBottom
|
|
378
|
+
paddingBottom: paddingBottom,
|
|
413
379
|
paddingHorizontal: Math.max(insets.left, insets.right),
|
|
414
380
|
},
|
|
415
381
|
style,
|
|
@@ -464,7 +430,6 @@ const styles = StyleSheet.create({
|
|
|
464
430
|
justifyContent: 'center',
|
|
465
431
|
height: 48,
|
|
466
432
|
width: 48,
|
|
467
|
-
|
|
468
433
|
borderRadius: 100,
|
|
469
434
|
top: -12,
|
|
470
435
|
},
|
package/Layout/Screen.tsx
CHANGED
|
@@ -89,6 +89,10 @@ export interface ScreenProps extends ViewProps {
|
|
|
89
89
|
*/
|
|
90
90
|
floatingButtonProps?: Omit<FloatingButtonProps, 'animatedValue' | 'bottom'>;
|
|
91
91
|
|
|
92
|
+
/**
|
|
93
|
+
* optional animated value
|
|
94
|
+
*/
|
|
95
|
+
animatedValue?: Animated.Value;
|
|
92
96
|
/**
|
|
93
97
|
* Optional. If `true`, the screen content is using grid layout by span.
|
|
94
98
|
*/
|
|
@@ -111,10 +115,13 @@ const Screen = forwardRef(
|
|
|
111
115
|
headerType = 'default',
|
|
112
116
|
floatingButtonProps,
|
|
113
117
|
useGridLayout = true,
|
|
118
|
+
animatedValue: animated,
|
|
114
119
|
}: ScreenProps,
|
|
115
120
|
ref,
|
|
116
121
|
) => {
|
|
117
|
-
const animatedValue = useRef<Animated.Value>(
|
|
122
|
+
const animatedValue = useRef<Animated.Value>(
|
|
123
|
+
animated ?? new Animated.Value(0),
|
|
124
|
+
);
|
|
118
125
|
const {theme} = useContext(ApplicationContext);
|
|
119
126
|
const insets = useSafeAreaInsets();
|
|
120
127
|
const heightHeader = useHeaderHeight();
|
|
@@ -236,6 +243,7 @@ const Screen = forwardRef(
|
|
|
236
243
|
{
|
|
237
244
|
useNativeDriver: true,
|
|
238
245
|
listener: (e: NativeSyntheticEvent<NativeScrollEvent>) => {
|
|
246
|
+
scrollViewProps?.onScroll?.(e);
|
|
239
247
|
if (animatedHeader?.type == 'surface') {
|
|
240
248
|
const offsetY = e.nativeEvent.contentOffset.y;
|
|
241
249
|
let color = Colors.black_01;
|