We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2415 - Message Boxes aren't implemented on Android
Summary: Message Boxes aren't implemented on Android
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: x86 Other
: P2 normal
Assignee: Gabriel Jacobo
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-23 00:51 UTC by Ryan C. Gordon
Modified: 2014-09-13 09:15 UTC (History)
2 users (show)

See Also:


Attachments
patch for messagebox on Android (12.49 KB, patch)
2014-02-24 00:02 UTC, Philipp Wiesemann
Details | Diff
patch for messagebox on Android (first fix) (12.99 KB, patch)
2014-02-25 21:09 UTC, Philipp Wiesemann
Details | Diff
patch for messagebox on Android (third version) (14.17 KB, patch)
2014-09-12 20:36 UTC, Philipp Wiesemann
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan C. Gordon 2014-02-23 00:51:02 UTC
As noted here...

    http://lists.libsdl.org/pipermail/sdl-libsdl.org/2014-February/093338.html

...we don't have message boxes on Android at all. What would fixing this take? Surely there's some system-supplied popup thing?

--ryan.
Comment 1 Philipp Wiesemann 2014-02-24 00:02:55 UTC
Created attachment 1578 [details]
patch for messagebox on Android

I attached a patch for an incomplete implementation of the messagebox parts.

It was not tested on lots of devices yet and features a very fragile workaround to block the calling SDL thread while the dialog is handled on Android's UI thread. Although it works for testmessage.c I assume there are lot of situations were it may fail (standby, device rotation and other changes). Also not all flags and colors are implemented.

On the other hand most uses of the messagebox are to show an error on start and fragility (or working at all) may not matter there.
Comment 2 Gabriel Jacobo 2014-02-24 12:54:57 UTC
Thanks Philipp, I'll give this a try and let you know if I manage to break it.
Comment 3 Philipp Wiesemann 2014-02-25 21:09:21 UTC
Created attachment 1580 [details]
patch for messagebox on Android (first fix)

I updated the patch because of a JNI reference leak and dialogs not being canceled correctly.
Comment 4 Philipp Wiesemann 2014-09-12 20:36:05 UTC
Created attachment 1867 [details]
patch for messagebox on Android (third version)

I attached a new version of the patch because the old did not apply without conflicts. Also the button flags are now implemented.
Comment 5 Sam Lantinga 2014-09-13 09:15:40 UTC
Looks good, thanks!
https://hg.libsdl.org/SDL/rev/6cd8e6b54f4d