feat: improve pull-up-to-next by add transition animation (#3832)

* feat: add  replaceControllerView method for enhanced navigation

* refactor: simplify screen options merging in WrappedScreenItem component

* feat: improve pull-up threshold handling in usePullUpToNext hook

* feat: enhance navigation by replacing controller view with animation in EntryDetailScreen
This commit is contained in:
Whitewater
2025-05-28 11:24:29 +08:00
committed by GitHub
parent 8e3503f96a
commit a86ef8acdd
5 changed files with 56 additions and 18 deletions
@@ -73,13 +73,15 @@ export const usePullUpToNext = ({
if (!dragging.current) return
const overOffset = e.contentOffset.y - e.contentSize.height + e.layoutMeasurement.height
// Ratio used to determine when to deactivate the pulling threshold
const thresholdRatio = 0.95
if (overOffset > progressViewOffset) {
if (!isOverThreshold.current && onRefresh) {
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Heavy)
}
isOverThreshold.current = true
setRefreshing(true)
} else {
} else if (overOffset < progressViewOffset * thresholdRatio) {
if (isOverThreshold.current && onRefresh) {
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Soft)
}