@@ -18,6 +18,7 @@ import Animated, {
1818
1919import Divider from '@/components/divider' ;
2020import Toast from '@/components/toast' ;
21+ import { COURSE_HEADER_HEIGHT , TIME_WIDTH } from '@/constants/SCHEDULE' ;
2122
2223import { commonColors } from '@/styles/common' ;
2324import globalEventBus from '@/utils/eventBus' ;
@@ -63,9 +64,6 @@ const TimetableScrollView = (
6364 const prevTranslateX = useSharedValue ( 0 ) ;
6465 const startX = useSharedValue ( 0 ) ;
6566 const startY = useSharedValue ( 0 ) ;
66- // FIX_ME 此处为两个 sticky 交界处,会覆盖,很丑,目前方式为计算重叠块大小,用一个块覆盖
67- const cornerWidth = useSharedValue ( 0 ) ;
68- const cornerHeight = useSharedValue ( 0 ) ;
6967 // 下拉刷新背景高度
7068 const backHeight = useSharedValue ( 0 ) ;
7169 const isAtTop = useSharedValue ( false ) ;
@@ -330,22 +328,22 @@ const TimetableScrollView = (
330328 // Animated style for content margins
331329 const contentMarginStyle = useAnimatedStyle ( ( ) => {
332330 return {
333- marginLeft : cornerWidth . value ,
331+ marginLeft : TIME_WIDTH ,
334332 } ;
335333 } , [ ] ) ;
336334
337335 // Animated style for corner dimensions
338336 const defaultCornerStyle = useAnimatedStyle ( ( ) => {
339337 return {
340- height : cornerHeight . value ,
341- width : cornerWidth . value ,
338+ height : COURSE_HEADER_HEIGHT ,
339+ width : TIME_WIDTH ,
342340 } ;
343341 } , [ ] ) ;
344342
345343 // Animated style for sticky top margin
346344 const stickyTopMarginStyle = useAnimatedStyle ( ( ) => {
347345 return {
348- marginLeft : cornerWidth . value ,
346+ marginLeft : TIME_WIDTH ,
349347 } ;
350348 } , [ ] ) ;
351349 // For the sticky top, we only want horizontal scrolling, not vertical
@@ -419,9 +417,6 @@ const TimetableScrollView = (
419417 stickyTopMarginStyle ,
420418 animatedOnlyX ,
421419 ] }
422- onLayout = { layout => {
423- cornerHeight . value = layout . nativeEvent . layout . height ;
424- } }
425420 >
426421 { stickyTop }
427422 </ Animated . View >
@@ -446,9 +441,6 @@ const TimetableScrollView = (
446441 >
447442 { /* stickyLeft */ }
448443 < Animated . View
449- onLayout = { layout => {
450- cornerWidth . value = layout . nativeEvent . layout . width ;
451- } }
452444 style = { [
453445 styles . stickyLeft ,
454446 { height : containerSize . height } ,
0 commit comments