From d119bb4552811fbab57655b356d2bbb269287197 Mon Sep 17 00:00:00 2001 From: r1di <33724815+r1di@users.noreply.github.com> Date: Sun, 23 Jun 2024 17:31:53 +0200 Subject: [PATCH 1/3] Volume scrolling fix the scrolling by volume button right now scrolls 100% of the screen, which hides text when scrolled so, the commit is just changing the the scrolling to 50%. --- src/screens/reader/ReaderScreen.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/screens/reader/ReaderScreen.tsx b/src/screens/reader/ReaderScreen.tsx index ad77a638a..f655046d1 100644 --- a/src/screens/reader/ReaderScreen.tsx +++ b/src/screens/reader/ReaderScreen.tsx @@ -132,15 +132,12 @@ export const ChapterContent = ({ VolumeButtonListener.preventDefault(); emmiter.current.addListener('VolumeUp', () => { webViewRef.current?.injectJavaScript(`(()=>{ - window.scrollBy({top:${-Dimensions.get('window') - .height},behavior:'smooth',}) + window.scrollBy({top: -${Dimensions.get('window').height / 2}, behavior: 'smooth'}) })()`); }); emmiter.current.addListener('VolumeDown', () => { webViewRef.current?.injectJavaScript(`(()=>{ - window.scrollBy({top:${ - Dimensions.get('window').height - },behavior:'smooth',}) + window.scrollBy({top: ${Dimensions.get('window').height / 2}, behavior: 'smooth'}) })()`); }); }; From 717cf0a44f598233ab72c37271ac7654aae8736b Mon Sep 17 00:00:00 2001 From: Ridi Date: Sun, 23 Jun 2024 17:46:50 +0200 Subject: [PATCH 2/3] typo --- src/screens/reader/ReaderScreen.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/screens/reader/ReaderScreen.tsx b/src/screens/reader/ReaderScreen.tsx index f655046d1..c5307d5a3 100644 --- a/src/screens/reader/ReaderScreen.tsx +++ b/src/screens/reader/ReaderScreen.tsx @@ -132,12 +132,16 @@ export const ChapterContent = ({ VolumeButtonListener.preventDefault(); emmiter.current.addListener('VolumeUp', () => { webViewRef.current?.injectJavaScript(`(()=>{ - window.scrollBy({top: -${Dimensions.get('window').height / 2}, behavior: 'smooth'}) + window.scrollBy({top: -${ + Dimensions.get('window').height / 2 + }, behavior: 'smooth'}) })()`); }); emmiter.current.addListener('VolumeDown', () => { webViewRef.current?.injectJavaScript(`(()=>{ - window.scrollBy({top: ${Dimensions.get('window').height / 2}, behavior: 'smooth'}) + window.scrollBy({top: ${ + Dimensions.get('window').height / 2 + }, behavior: 'smooth'}) })()`); }); }; From 57209a0dfb61e7a5fe77b144a6c6a3789f808cea Mon Sep 17 00:00:00 2001 From: Ridi Date: Mon, 24 Jun 2024 15:39:08 +0200 Subject: [PATCH 3/3] 50% to 75% scroll --- src/screens/reader/ReaderScreen.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/screens/reader/ReaderScreen.tsx b/src/screens/reader/ReaderScreen.tsx index c5307d5a3..5114ba897 100644 --- a/src/screens/reader/ReaderScreen.tsx +++ b/src/screens/reader/ReaderScreen.tsx @@ -133,14 +133,14 @@ export const ChapterContent = ({ emmiter.current.addListener('VolumeUp', () => { webViewRef.current?.injectJavaScript(`(()=>{ window.scrollBy({top: -${ - Dimensions.get('window').height / 2 + Dimensions.get('window').height * 0.75 }, behavior: 'smooth'}) })()`); }); emmiter.current.addListener('VolumeDown', () => { webViewRef.current?.injectJavaScript(`(()=>{ window.scrollBy({top: ${ - Dimensions.get('window').height / 2 + Dimensions.get('window').height * 0.75 }, behavior: 'smooth'}) })()`); });