Skip to content

Commit

Permalink
Fix: Volume scrolling (LNReader#1114)
Browse files Browse the repository at this point in the history
* 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%.

* typo

* 50% to 75% scroll

---------

Co-authored-by: Ridi <ridi.culous.progger@gmail.com>
  • Loading branch information
r1di and Ridi authored Jun 25, 2024
1 parent aa95743 commit 70220a5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/screens/reader/ReaderScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,16 @@ 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 * 0.75
}, 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 * 0.75
}, behavior: 'smooth'})
})()`);
});
};
Expand Down

0 comments on commit 70220a5

Please sign in to comment.