-
Notifications
You must be signed in to change notification settings - Fork 85
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
refactor MainActivity, backport android_native_glue changes from r22 #257
Conversation
@pazos I'm building it, I'll let you know what happens. Anything I should pay attention to in particular? EDIT: I build it using docker successfully! :) |
A screenshot of the light dialog would be great. Other than that just check that nothing crashes :) |
There was some problem with mupdf, it seems I need to clean build (it happened on emulator too), I'll test it in ~1h |
@pazos: I will check it, but I will need until Friday, because I have more work due to Corona :-( |
6c2a2ca
to
27da05c
Compare
Last commit on this branch contains changes into the We were reacting to diff --git a/frontend/device/android/device.lua b/frontend/device/android/device.lua
index c5530ffd..e9d93488 100644
--- a/frontend/device/android/device.lua
+++ b/frontend/device/android/device.lua
@@ -135,9 +135,14 @@ function Device:init()
if ev.code == C.APP_CMD_SAVE_STATE then
return "SaveState"
elseif ev.code == C.APP_CMD_GAINED_FOCUS
- or ev.code == C.APP_CMD_INIT_WINDOW
- or ev.code == C.APP_CMD_WINDOW_REDRAW_NEEDED then
+ or ev.code == C.APP_CMD_INIT_WINDOW then
this.device.screen:_updateWindow()
+ elseif ev.code == C.APP_CMD_WINDOW_REDRAW_NEEDED then
+ logger.dbg("APP_CMD_WINDOW_REDRAW_NEEDED")
+ elseif ev.code == C.APP_CMD_WINDOW_RESIZED then
+ logger.dbg("APP_CMD_WINDOW_RESIZED")
+ elseif ev.code == C.APP_CMD_CONTENT_RECT_CHANGED then
+ logger.dbg("APP_CMD_CONTENT_RECT_CHANGED")
elseif ev.code == C.APP_CMD_CONFIG_CHANGED then
-- orientation and size changes
if android.screen.width ~= android.getScreenWidth() The rest of changes shouldn't affect KO behaviour, but it is cool to log them anyways. |
03791ea
to
bd2d55d
Compare
@pazos: This PR seems to work. I have noticed no problem. |
Thank you for testing!. Some questions: Did you applied #257 (comment)? If not I assume you didn't find any difference on the behaviour (ie: when returning to the activity, when closing the frontlight dialog ...) Does the frontlight dialog looks any different?. It shouldn't if the firmware is older than Lollipop. But if it looks the same and works the same is a big win (and what's expected based on what I saw on old emulators) |
On 4.4.2 (Tolino) I did not notice any difference. |
…tform/ndk/+/1180321 some APP_CMDs callbacks were never triggered: APP_CMD_WINDOW_RESIZED / APP_CMD_WINDOW_REDRAW_NEEDED / APP_CMD_CONTENT_RECT_CHANGED See android/ndk#1139
98f8bee
to
efe9b8c
Compare
efe9b8c
to
a920c2f
Compare
@Frenzie: still waiting your review :) |
I think he's still in the "just moved" frenzy (ha!), and may not yet have a stable landline ;). |
I can wait. Is just that I have another pile or changes to submit and don't want to push on top of this, yet. |
I have a stable line, but no time. But I'll check if it's short.
…On Saturday, October 31, 2020, Martín Fernández ***@***.***> wrote:
I think he's still in the "just moved" frenzy (ha!), and may not yet have
a stable landline ;).
I can wait. Is just that I have another pile or changes to submit and
don't want to push on top of this, yet.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#257 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABRQBKXOI7A3BGKI5WNF43SNRDYDANCNFSM4SVDDL2A>
.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fairly straightforward; didn't have time to check in the Android docs for some of the new (at least to us) calls/constants of which I don't know exactly what they're doing though.
val hasLargeHeap = (applicationInfo.flags and ApplicationInfo.FLAG_LARGE_HEAP != 0) | ||
val isDebuggable = (applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE != 0) | ||
val isSystemApp = (applicationInfo.flags and ApplicationInfo.FLAG_SYSTEM == 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are these for exactly? :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build flags. Used for logging mainly. They're all booleans.
hasLargeHeap can be removed, because it was added to log the size of the dalvik VM heap when we disabled largeHeap app property. Nobody reported a crash due to a not enough dalvik heap size.
Probably there's nothing very new. Just a few minor changes:
The size of the APK grows about 800kb because of the new required library "androidx.appcompat:appcompat". That's probably the last app size grow that's caused by android dependencies. |
bdc4c53
to
f79335c
Compare
refactored runtime permissions, almost API30 ready. simplified MainApp Added: manage battery optimizations (API23+) Fixed: code styling issues Changed: non-mandatory permission dialogs are available from lua Changed: non e-ink devices don't use a SurfaceView Changed: theme is now material design on compatible android versions (API21+) Changed: disabled animations while switching tasks Removed: useless logs in AssetsUtils, unused manifest properties
f79335c
to
639bdb2
Compare
- Lcd devices won't use the SurfaceView, just the good old native content/window (except AndroidTv and ChromeOS) - All android dialogs will be presented with Material Design on recent devices. - Added an option to device settings to manage application battery optimization. - Permissions that require the user to go to a settings page will be presented with a native android dialog. - bump android-luajit-launcher - Changes under the hood: koreader/android-luajit-launcher#257
cf: #253 (comment)
It doesn't involve massive changes in the code but uses modern "material design" dialogs if possible.
Pinging both @Galunid and @zwim: can you test that everything still works fine on your epd devices?
@zwim: lights still work?, epd updates fires fine?
@Galunid: does it build on docker container?, do you see the new light dialog with material style?, Is it legible?
This change is