Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > KOReader

Notices

Reply
 
Thread Tools Search this Thread
Old 03-05-2024, 07:22 AM   #1
Maimun Ahmed
Mr. Developer
Maimun Ahmed began at the beginning.
 
Posts: 24
Karma: 10
Join Date: Feb 2024
Device: Kindle Voyage
Exclamation KOReader: Please Help Me Find The Code Associated With This Wonderful Animation

Hi wonderful guys over mobileread, I recently started tinkering the source code of KOReader on my machine and I came accross this beautiful loading animation (I really like the animation of the three dots at the bottom of the screen.)

Is anyone aware which script of KOReader's source code is triggering this. I captured that animation while running KOReader on android. The gif is attached below:
Click image for larger version

Name:	Screenrecorder-2024-03-02-08-53-47-5170-ezgif.com-video-to-gif-converter.gif
Views:	102
Size:	80.3 KB
ID:	206716
Maimun Ahmed is offline   Reply With Quote
Old 03-05-2024, 08:15 AM   #2
pazos
cosiñeiro
pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.
 
Posts: 1,289
Karma: 2200073
Join Date: Apr 2014
Device: BQ Cervantes 4
That's a standard android dialog without a frame.

It is in https://github.com/koreader/android-...s.kt#L160-L187

Used while uncompressing APK assets in device's storage. You should see the dots animation once per version.

You can't repurpose the dialog for anything non-android.
pazos is offline   Reply With Quote
Old 03-05-2024, 09:54 PM   #3
Maimun Ahmed
Mr. Developer
Maimun Ahmed began at the beginning.
 
Posts: 24
Karma: 10
Join Date: Feb 2024
Device: Kindle Voyage
Quote:
Originally Posted by pazos View Post
That's a standard android dialog without a frame.

It is in https://github.com/koreader/android-...s.kt#L160-L187

Used while uncompressing APK assets in device's storage. You should see the dots animation once per version.

You can't repurpose the dialog for anything non-android.
Thank you pazos for the answer. The code seems to be a kotlin script. I just wished to create a similar animation using lua that can be embedded in KOReader's source code (like the standard progress bar in frontend/ui/widget.
Maimun Ahmed is offline   Reply With Quote
Old 03-07-2024, 03:23 PM   #4
pazos
cosiñeiro
pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.
 
Posts: 1,289
Karma: 2200073
Join Date: Apr 2014
Device: BQ Cervantes 4
Quote:
Originally Posted by Maimun Ahmed View Post
Thank you pazos for the answer. The code seems to be a kotlin script. I just wished to create a similar animation using lua that can be embedded in KOReader's source code (like the standard progress bar in frontend/ui/widget.
Hi, if this is something you want for yourself, even without a real purpose, I think you can build something quickly using the emulator. We ship a widget test utility in https://github.com/koreader/koreader...s/wbuilder.lua, so you can play with your widget without launching a full blown KOReader instance.

If you want to build something that does some background job while displaying the animation that's harder.

A lua state/vm is mostly single threaded. The best you can do is some sort of cooperative multitasking, in the form of lua coroutines
pazos is offline   Reply With Quote
Old 03-12-2024, 12:00 AM   #5
Maimun Ahmed
Mr. Developer
Maimun Ahmed began at the beginning.
 
Posts: 24
Karma: 10
Join Date: Feb 2024
Device: Kindle Voyage
Quote:
Originally Posted by pazos View Post
Hi, if this is something you want for yourself, even without a real purpose, I think you can build something quickly using the emulator. We ship a widget test utility in https://github.com/koreader/koreader...s/wbuilder.lua, so you can play with your widget without launching a full blown KOReader instance.

If you want to build something that does some background job while displaying the animation that's harder.

A lua state/vm is mostly single threaded. The best you can do is some sort of cooperative multitasking, in the form of lua coroutines
Maybe I am wrong but then, how is the read timer counting down in the background while we continue to use the ui.
Maimun Ahmed is offline   Reply With Quote
Old 03-12-2024, 09:00 AM   #6
pazos
cosiñeiro
pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.
 
Posts: 1,289
Karma: 2200073
Join Date: Apr 2014
Device: BQ Cervantes 4
Quote:
Originally Posted by Maimun Ahmed View Post
Maybe I am wrong but then, how is the read timer counting down in the background while we continue to use the ui.
Yes, you're totally wrong here.

You're confusing the hability to schedule tasks to run in the future with multithreading. They are not the same.

Any tasks scheduled with any of the UIManager facilities (see doc in https://koreader.rocks/doc/modules/ui.uimanager.html) will be executed sequentially on the UIThread, so if one of such tasks takes hours to complete the UI will be blocked for that time too.
pazos is offline   Reply With Quote
Old 03-12-2024, 11:19 AM   #7
Maimun Ahmed
Mr. Developer
Maimun Ahmed began at the beginning.
 
Posts: 24
Karma: 10
Join Date: Feb 2024
Device: Kindle Voyage
Quote:
Originally Posted by pazos View Post
Yes, you're totally wrong here.

You're confusing the hability to schedule tasks to run in the future with multithreading. They are not the same.

Any tasks scheduled with any of the UIManager facilities (see doc in https://koreader.rocks/doc/modules/ui.uimanager.html) will be executed sequentially on the UIThread, so if one of such tasks takes hours to complete the UI will be blocked for that time too.
Thanks for correcting me. I didn't go deep through the docs at first. But after reading through it, I was able to understand everything very clearly. Thanks for your time and attaching the link to docs.
Maimun Ahmed is offline   Reply With Quote
Reply

Tags
developer, ereader, koreader, source code

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can KOReader read any html5, javascript and css code? avnermoshkovitz KOReader 1 07-12-2021 06:55 AM
Find OTA code on reboot qualipso Kindle Developer's Corner 2 04-11-2021 05:44 AM
Display Code and animation curiousgeorge ePub 5 08-09-2012 10:30 AM
Find Dialog and XHTML Code View jondolar Sigil 0 10-18-2011 10:16 AM
PRS-600 Where can I find the Linux source code? Xaphiosis Sony Reader 8 04-17-2010 11:13 AM


All times are GMT -4. The time now is 04:54 PM.


MobileRead.com is a privately owned, operated and funded community.