![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,856
Karma: 10700629
Join Date: May 2016
Location: Canada
Device: Onyx Nova
|
Screen navigation in Android Koreader
I'm running Koreader on a Nook GL3. It runs very well.
However, the way screen navigation is configured appears to be different on Android than on the Kindle/Kobo version. On a kindle, I edited the default.lua file to customize navigation. However, the default.lua file does not appear to exist on the Android version. Instead there is a file called settings.reader.lua. In the Kindle default.lua file, I edited these lines specifically: DTAP_ZONE_MENU = {x = 1/8, y = 0, w = 3/4, h = 1/8} DTAP_ZONE_CONFIG = {x = 1/8, y = 7/8, w = 3/4, h = 1/8} DTAP_ZONE_MINIBAR = {x = 0, y = 31/32, w = 1, h = 1/32} DTAP_ZONE_FORWARD = {x = 1/4, y = 0, w = 3/4, h = 1} DTAP_ZONE_BACKWARD = {x = 0, y = 0, w = 1/4, h = 1} I particularly altered how the menus and the page forward work. I cannot find anything like these lines in the Android settings.reader.lua that refer to menu tap and page forward tap control. Can someone tell me how it works on Android? Is there another file? |
![]() |
![]() |
![]() |
#2 |
cosiñeiro
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,398
Karma: 2451781
Join Date: Apr 2014
Device: BQ Cervantes 4
|
Lua files are stored on application private data path under
Code:
/data/data Code:
/data/user/x In short: create a new file called Code:
defaults.persistent.lua |
![]() |
![]() |
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,856
Karma: 10700629
Join Date: May 2016
Location: Canada
Device: Onyx Nova
|
Ah, so it's exactly the same on Android, I just have to create the file and amend it. That's great news. I feared the screen nav options had been totally overhauled for the Android version, and I just got the Unix version exactly as I like it. I'll test everything and post my versions for other to use once it's done. Many thanks.
|
![]() |
![]() |
![]() |
#4 | |
Connoisseur
![]() ![]() Posts: 64
Karma: 144
Join Date: Aug 2019
Device: Tolino Vision HD4, BOOX Poke2
|
Quote:
Simply at first try to load it from koreader folder (or koreader/android ?), and if not found, use the default one from /data/data/org.koreader.launcher/files/frontend/device/android/discionaries.lua ... This would make experimenting with 3rd party dictionary apps much more easy Thanks, Norbert |
|
![]() |
![]() |
![]() |
#5 | |
cosiñeiro
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,398
Karma: 2451781
Join Date: Apr 2014
Device: BQ Cervantes 4
|
Quote:
![]() IMO the list of dicts is not something worth custom settings. It takes less than 1 millisecond to check if each app of the list is installed and enabled, and that check is only performed once during the lifetime of the application. Your best bet is to request specific dict apps or rebuild KO yourself with the changes you need. The current implementation, albeit very basic, should be able to open most of 3rd party applications. Some of them need custom intents and they need a modification in https://github.com/koreader/android-...IntentUtils.kt and thus require a rebuild to work. Feel free to open a new ticket on the issue tracker if you wish. It might be possible to override the dict list without rebuilding somehow, but I have no idea. Aaand, if you manage to get a new dict working with KO please give us feedback so we can add it to the list bundled with the application and other users can benefit too. Thanks! |
|
![]() |
![]() |
![]() |
#6 | |
Connoisseur
![]() ![]() Posts: 64
Karma: 144
Join Date: Aug 2019
Device: Tolino Vision HD4, BOOX Poke2
|
Quote:
{ "Aard2", "Aard2", false, "itkach.aard2", "aard2" }, ... { "HandyLexEsSk", "Lingea Handylex Plus (ES-SK)", false, "com.lingea.handylex.spskh2", "send" }, { "HandyLexEnSk", "Lingea Handylex Plus (EN-SK)", false, "com.lingea.handylex.enskh2", "send" }, { "HandyLexGeSk", "Lingea Handylex Plus (GE-SK)", false, "com.lingea.handylex.geskh2", "send" }, These are dictonaries from the Czech company Lingea and work fine, the only problem is that they do not have one app with one namespace where you later load some dictonary data like apparently all the free dic apps, they have a separate app for each language combination - above I had to add 3 lines for slovak-spanisch, english and german, so this is also the reason why I haven't already posted it as I would have needed to add several dozens of lines for all of their lang combinations ... and I have the same experience with the german PONS dictionaries ... The only way as how to resolve this would be apparently to filter out dynamically all apps with the sent intent or so and let the user select ... If I would have some experience with LUA, I would have tried it but at the moment this would be too much work for me ... therefore I thought that perhaps moving dictonaries.lua to koreader folder would be a good step into the right direction for those like me (:-) |
|
![]() |
![]() |
![]() |
#7 |
cosiñeiro
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,398
Karma: 2451781
Join Date: Apr 2014
Device: BQ Cervantes 4
|
Oo!
For these kind of apps you could use Code:
{ "GenericSend", "Choose app (send)", false, "org.whatever", "picker-send" }, The same for picker-search and picker-text for other kind of intents. |
![]() |
![]() |
![]() |
#8 |
Connoisseur
![]() ![]() Posts: 64
Karma: 144
Join Date: Aug 2019
Device: Tolino Vision HD4, BOOX Poke2
|
@Pazos,
This looks good, I was experimenting with the namespace "org.whatever" and see that I have to enter there there the full namespace of one of my dict apps (like com.lingea.handylex.spskh2) but then as I select a word and go for translation it offers anyway all apps with the send intent ... not only that application ... perfect Then on first translation I haver to select the dict from the list, and If I choose always, it stays selected ... the only drawback is that once I do not want it anymore, I have to go to Android settings and remove the def. settings from the dict app ![]() EDIT: I tried this type of line by misusing the namespace fo koreader as it is apparently only used here to make the line selectable in the dict selection dialogue: { "GenericSend", "Choose Dict App (on first translate action)", false, "org.koreader.launcher", "picker-send" }, and it works fine - wouldn't it be a nice candidate for PR ? I can build a version locally, install it on my Smartphone and test again with following dict apps: PONS, RAE, LEO, LINGEA, and perhaps I can shortly purchase also something from Langenscheid and try also that ... if you are interested in Last edited by Norbi24; 12-02-2019 at 04:03 AM. |
![]() |
![]() |
![]() |
#9 | |
cosiñeiro
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,398
Karma: 2451781
Join Date: Apr 2014
Device: BQ Cervantes 4
|
Quote:
Of course it is a good candidate for a PR but we need some kind of naming convention and I'm not sure which to use. Anyways with the new backend behaviour generic intents can be triggered with the following "dicts" in the dict list: Code:
{ "Send", "Generic send", false, nil, "send" }, { "Search", "Generic search", false, nil, "search" }, { "Text", "Generic text processing", false, nil, "text" }, |
|
![]() |
![]() |
![]() |
#10 |
Connoisseur
![]() ![]() Posts: 64
Karma: 144
Join Date: Aug 2019
Device: Tolino Vision HD4, BOOX Poke2
|
Ok, so if namespace is nil, you would execute the "picker-x", clear.
I am playing still with the older syntax as I do not have your PR and it looks that the generic-send would work with the the most of my dictionaries: PONS, LINGEA,LEO, COLORDICT, DICT.CC, ABBY LINGVO, GoogleTranslate (in fact everything I have except for RAE), probably also Langenscheid and DUDEN would, but their cheepest vocabulary costs 15.9E and at the moment I do not want to buy them ... generic-search only lists ColorDict nothing more. generic-text only GoogleTranslate and app having "a" in the icon (do not know anymore what it is, appears to be able to load some Collins dictionaries) I personally would vote for adding a line for the first option into dictionaries.lua and give it a display name like: "Choose Available Dictionary on First Translate" this could be intuitive, as if then user selects a word to translate he would ge a list of his dicts ... |
![]() |
![]() |
![]() |
#11 | |
cosiñeiro
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,398
Karma: 2451781
Join Date: Apr 2014
Device: BQ Cervantes 4
|
Quote:
I agree with you in including the option to show the app picker and let the use choose, but "Choose Available Dictionary on First Translate" is innacurate as we just start an activity that can handle plain text. It could be whatsapp, gmail, sms or any other app, not just dictionaries. It also implies that the option is just shown once and that's only true if the user checks "use always". The name should be related to the original "intention" of the intent. Something like "share text with another application". As everything is related to dict lookups and 3rd party apps we can dismiss "text/lookup" and "(with another) application" and just use "share", "send" and "process". I'm open to suggestions. I will open a new issue on github and ping you there ![]() |
|
![]() |
![]() |
![]() |
#12 | |
Connoisseur
![]() ![]() Posts: 64
Karma: 144
Join Date: Aug 2019
Device: Tolino Vision HD4, BOOX Poke2
|
Quote:
I bet that even experienced programmers without Android experience would have problems. Imagine user clicks on Dictionary settings to setup a dictonary, and would see the option "share text with another application": or even three options "share", "send" and "process", what would he think ? Therefore I tried to formulate something which would at least roughly describe, what is to be expected But this is only my opinion, I'd wait what you guys do with the git issue ![]() |
|
![]() |
![]() |
![]() |
#13 |
cosiñeiro
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,398
Karma: 2451781
Join Date: Apr 2014
Device: BQ Cervantes 4
|
@Norbi24: because I'm still thinking about the naming I ended up implementing your initial suggestion in https://github.com/koreader/koreader/pull/5664. It took me two minutes. That's less work than thinking about a proper name
![]() I hope you'll find it nice ![]() |
![]() |
![]() |
![]() |
#14 |
Connoisseur
![]() ![]() Posts: 64
Karma: 144
Join Date: Aug 2019
Device: Tolino Vision HD4, BOOX Poke2
|
![]() I have just pulled you PR for this directories.lua overload, compiled and it works great ! Then I tried also to pull your PR for generic format of the line with nil but that still doesn't work (but admitably I perhaps did something wrong as it is in the subproject luajit-launcher ... I pulled it there to a new branch, then checked it out .. nor sure if this is a right way I will wait until it gets commited into the master and then try again, I am pretty new with git (:-( |
![]() |
![]() |
![]() |
#15 |
cosiñeiro
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,398
Karma: 2451781
Join Date: Apr 2014
Device: BQ Cervantes 4
|
@Norbi24: it should work on latest nightly. Feel free to add a couple of examples to https://github.com/koreader/koreader...ips-and-tricks under a new section customize dictionary apps
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
KOreader on Android | Ken Maltby | KOReader | 518 | 01-22-2025 12:36 PM |
Koreader zoom and navigation | DanCa | KOReader | 5 | 12-14-2020 03:25 PM |
DX(G) Primitive fpt server android and Koreader | HoanPiTa | Kindle Developer's Corner | 2 | 07-21-2019 11:54 AM |
KoReader on android background image | mystika1 | KOReader | 1 | 02-09-2019 05:30 AM |
Folder navigation and/or customisable sleep screen and/or reading stats | chlorine | Which one should I buy? | 10 | 10-16-2017 01:50 PM |