Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

top+bottom margins ignored in scroll view #326

Open
teleshoes opened this issue Feb 19, 2022 · 13 comments · May be fixed by #342
Open

top+bottom margins ignored in scroll view #326

teleshoes opened this issue Feb 19, 2022 · 13 comments · May be fixed by #342

Comments

@teleshoes
Copy link

top+bottom margin works in page-view-mode only. the values have no effect in scroll-view-mode.
left+right margins work in both page-view and scroll-view.

@teleshoes
Copy link
Author

use cases:

  1. i set bottom margin = 150px to not paint words underneath the android nav bar <| o [] (pops up annoyingly on waydroid)
  2. its also comfortable to hold my phone in such a way that my thumb covers the bottom 100px of my phone, especially in auto-scroll mode
  3. separate issue, but this would ALSO provide a decent workaround for the problem of tts-readaloud toolbar covering the bottom 400px of the screen

@teleshoes
Copy link
Author

i would also REALLY love to have the topbar with the clock+battery displayed in scroll-view-mode..

@teleshoes
Copy link
Author

@plotn do you have any idea how this could be done? does knownreader by any chance have this feature?

@plotn
Copy link
Contributor

plotn commented Mar 8, 2022

@teleshoes, the scroll mode is seldom used (by community), as far as I know (but some people like). I even did (in KR) the ability "not to switch (internally) in scroll mode while TTS is active". Anyway, you can open issue in KR's repo - I will see if it could be done "not so expensive", but I dont promise the speed
(And I have plans to redesign TTS toolbar too, but it is also a big work (I want to make it similar to "common" toolbar).
Nowadays I am working to support external USB / SD card in modern androids, then to evolve offline dics (Lingvo DSL, StarDict, MDict), integrate Calibre Library and so on... )

PS: regardless all issues in KR repo are in russian you can freely create your own in english, of course.

@teleshoes
Copy link
Author

teleshoes commented Mar 8, 2022

ok, im trying that out right now, thanks! i assumed that TTS wouldnt work in page mode

edit: hooray! works great. only problem is that it is more reluctant to turn a page than it is to scroll a little, so the current sentence goes off the end of the page every time instead of half the time. i gotta look into the impl of moveSelection()

@plotn
Copy link
Contributor

plotn commented Mar 8, 2022

I've caught your idea, but, be ready - it quite comlex "underneath" )

@teleshoes
Copy link
Author

teleshoes commented Mar 8, 2022

yea, i still see more words of the current selection in scroll-mode, even with the horrible tts toolbar covering 400px of my screen and the android nav-panel refusing to disappear in TTS mode.

my next idea is that i can tweak onSelectionCommand() to do SetPos() if the current selection enters the part of the screen that the toolbar covers

EDIT: yea, this worked great:

    int h = m_pageRects[0].height() - m_pageMargins.top
            - m_pageMargins.bottom - getPageHeaderHeight() - 400;

@teleshoes
Copy link
Author

it SEEMS like it should be easy to add top+bottom margins to scroll-mode, but i havent been able to do it, and the ui-related code in crengine is scary..

@plotn
Copy link
Contributor

plotn commented Mar 8, 2022

Why ever you need to see the text, while you are listening to it?
In KR you can set transparent tts panel and transparent buttons onto it, thus almost everything become visible, maybe it is enough for you?

@teleshoes
Copy link
Author

TTS mispronounces many words, especially foreign loan words and proper nouns, and it doesnt pause properly for parentheticals/etc, and the voice gets the wrong inflection for sentences when the usage may be ambiguous. i use TTS somewhere between a regular audiobook and an enhanced auto-scroll.

sometimes i am listening to TTS mostly like an audiobook, and only glance at the screen when the robot lady mangles a name (for example, while working or taking a walk).
other times, i am mostly reading along, and look away shortly when i need to (for example, to rinse the shampoo out of my hair).

either way, its useful to be able to alternate seamlessly between eyes and ears.

====
i set the bgcolor of the TTS toolbar and all buttons to alpha=0 in coolreader already, but the sliders and buttons still block a word or two. also, now the words make it hard to see the toolbar sliders.
in my opinion, it is simply bad design to have a transparent/translucent toolbar overlay over words. the alpha channel just makes both UIs worse.

=> the TTS toolbar should be MUCH smaller, with an optional additional toolbar with volume+speed, and it should be opaque, and it should subtract from the screen height.

better yet, the toolbar could have a button to hide it completely. tapping anywhere, instead of ending TTS, would pause TTS, and show the toolbar.

@plotn
Copy link
Contributor

plotn commented Mar 9, 2022

I finally have such idea:

  1. Clicking outside TTS toolbar will not stop reading;
  2. While reading the first two buttons on the toolbar (if visible) and in the menu (usually center tap) will become "show reading toolbar", "stop tts reading".
    I think this will be enough.

@teleshoes
Copy link
Author

if i understood you, that sounds strictly worse than simply showing the toolbar on tap-anywhere

A) if you want to stop (or pause), you STILL need to click twice
B) if you want to change volume/etc, you need to click THREE times instead of only twice

there is no workflow that will have FEWER clicks in your model.

@plotn
Copy link
Contributor

plotn commented Mar 9, 2022

Okay, need more time to think.

what if:

  1. Click outside TTS panel will hide/show the panel, but not stop the reading;
  2. Click on "stop" - will stop completly, hiding tts panel.

???

@teleshoes teleshoes linked a pull request Aug 31, 2022 that will close this issue
Repository owner deleted a comment from plotn Apr 24, 2023
Repository owner deleted a comment from plotn Apr 24, 2023
Repository owner deleted a comment from teleshoes Apr 24, 2023
Repository owner deleted a comment from plotn Apr 24, 2023
Repository owner deleted a comment from teleshoes Apr 24, 2023
Repository owner deleted a comment from plotn Apr 24, 2023
Repository owner deleted a comment from plotn Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants