11import React , { useState , useEffect , useRef , useMemo , useCallback } from 'react' ;
2- import { View , Text , ScrollView , StyleSheet , Pressable , Alert , ActivityIndicator , TouchableOpacity , RefreshControl , Animated , Keyboard } from 'react-native' ;
2+ import { View , Text , ScrollView , StyleSheet , Pressable , Alert , ActivityIndicator , TouchableOpacity , RefreshControl , Animated , Keyboard , useWindowDimensions } from 'react-native' ;
33import AsyncStorage from '@react-native-async-storage/async-storage' ;
44import * as Haptics from 'expo-haptics' ;
55import { useFocusEffect } from '@react-navigation/native' ;
@@ -58,6 +58,7 @@ export default function NotesListScreen({ navigation, route, renderHeader, scrol
5858 const theme = useTheme ( ) ;
5959 const api = useApiService ( ) ;
6060 const { folderId, viewType, searchQuery } = route ?. params || { } ;
61+ const { height : windowHeight } = useWindowDimensions ( ) ;
6162
6263 const [ notes , setNotes ] = useState < Note [ ] > ( [ ] ) ;
6364 const [ subfolders , setSubfolders ] = useState < Folder [ ] > ( [ ] ) ;
@@ -336,7 +337,10 @@ export default function NotesListScreen({ navigation, route, renderHeader, scrol
336337 < ScrollView
337338 ref = { scrollViewRef }
338339 style = { styles . scrollView }
340+ contentContainerStyle = { [ styles . scrollViewContent , { minHeight : windowHeight } ] }
339341 showsVerticalScrollIndicator = { false }
342+ alwaysBounceVertical = { true }
343+ bounces = { true }
340344 onScroll = { Animated . event (
341345 [ { nativeEvent : { contentOffset : { y : scrollY } } } ] ,
342346 { useNativeDriver : false }
@@ -352,7 +356,7 @@ export default function NotesListScreen({ navigation, route, renderHeader, scrol
352356 }
353357 >
354358 { ! loading && (
355- < >
359+ < Pressable style = { { flex : 1 } } onPress = { ( ) => { } } >
356360 { /* Header from parent */ }
357361 { renderHeader && renderHeader ( ) }
358362
@@ -595,7 +599,10 @@ export default function NotesListScreen({ navigation, route, renderHeader, scrol
595599 </ View >
596600 ) }
597601 </ View >
598- </ >
602+
603+ { /* Spacer to ensure content fills screen */ }
604+ < View style = { { flex : 1 , minHeight : 100 } } />
605+ </ Pressable >
599606 ) }
600607 </ ScrollView >
601608 ) }
@@ -702,6 +709,9 @@ const styles = StyleSheet.create({
702709 paddingHorizontal : 0 ,
703710 paddingTop : 0 ,
704711 } ,
712+ scrollViewContent : {
713+ flexGrow : 1 ,
714+ } ,
705715 noteCardContainer : {
706716 marginBottom : NOTE_CARD . SPACING ,
707717 paddingHorizontal : 16 ,
0 commit comments