customizing the answer dialogue box

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

paulalsmith1000
Posts: 58
Joined: Sat Jun 15, 2019 10:09 am

customizing the answer dialogue box

Post by paulalsmith1000 » Sun Sep 08, 2019 8:31 pm

Evening Everyone

Just a quick question, does anyone know how to customize the background and/or text colour of the the answer dialogue box.

I searched around for a while and found variations on this:-

on preOpenStack
set the backgroundColor of this stack to black
if the environment is "standalone application" then set the backgroundColor of stack "Answer Dialog" to 231,231,231
set the loc of this stack to the screenLoc
end preOpenStack

It works fine on the desktop, but doesn't on android?

Kind regards

Paul

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: customizing the answer dialogue box

Post by Klaus » Sun Sep 08, 2019 10:00 pm

Hi Paul,

the ASK and ASNWER diakogs are just stacks, but only on desktop system Mac/Win/Linux!

On the mobile platforms iOS and Android, these dialogs are supplied from the underlying OS
and you cannot modify them.


Best

Klaus

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: customizing the answer dialogue box

Post by jmburnod » Sun Sep 08, 2019 11:24 pm

Hi Paul,
When i need a custom dialog I use a group which works for OS X and iOS :D
Best regards
Jean-Marc
https://alternatic.ch

paulalsmith1000
Posts: 58
Joined: Sat Jun 15, 2019 10:09 am

Re: customizing the answer dialogue box

Post by paulalsmith1000 » Sat Sep 21, 2019 7:09 pm

Hi Jean-Marc and Klaus

Many thanks for your replies.

I googled around and found that I could use sub-stacks instead of the dialogue boxes so that I could customize their appearance, which has worked a treat.

But unsurprisingly I have hit a slight snag - the only thing I can't seem to do is fix/loc the size of these stacks.

I used this site (https://sites.google.com/a/pgcps.org/li ... s_palettes) to set up the substacks. I can resize them happily on the desktop (ubuntu) so they look like dialogue boxes (as in the link above) however, when I deploy the app to my android phone they are all full-screen.

Any ideas would be much appreciated.

Kind regards

Paul

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: customizing the answer dialogue box

Post by richmond62 » Sat Sep 21, 2019 7:57 pm

I'm not sure I understand why your faux dialogue boxes are going full-screen on Android, but
my best bet would be to have this sort of code in the openStack script of your dialogue:

Code: Select all

on openStack
	set the width of this stack to 100
	set the height of this stack to 30
end openStack
Certainly worth a try. 8)

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: customizing the answer dialogue box

Post by bogs » Sat Sep 21, 2019 8:09 pm

Mind you, I don't do ... well, anything with mobile devices :D but, since this is a stack your putting in your app to simulate a dialog, is it possible you have the rest of the app set to ...what is it, full screen or some such?

*IF* your app is set to whatever amounts to full screen, and doesn't know the sub stacks are not supposed to be full screen, that might cause the issue your describing. I am pretty sure Lc would be using something like the android api for dialog boxes itself, so likely the dialogs you get will show up like an android dialog {this is a complete guess on my part!!}.
The Dialog class is the base class for dialogs, but you should avoid instantiating Dialog directly. Instead, use one of the following subclasses:

AlertDialog
A dialog that can show a title, up to three buttons, a list of selectable items, or a custom layout.
DatePickerDialog or TimePickerDialog
A dialog with a pre-defined UI that allows the user to select a date or time.
I'm curious, though, as to why you would have to design a dialog? Is it doing something really non standard?
Image

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: customizing the answer dialogue box

Post by jmburnod » Sat Sep 21, 2019 10:57 pm

Hi Bogs,
I'm curious, though, as to why you would have to design a dialog? Is it doing something really non standard?
I used one group as ask/answer dialog if I need to choose a line of a list or several menus, checkboxes or radio buttons or...
Best regards
Jean-Marc
https://alternatic.ch

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: customizing the answer dialogue box

Post by richmond62 » Sun Sep 22, 2019 10:02 am

Evening Everyone
-
DODG.jpg
DODG.jpg (13.89 KiB) Viewed 7452 times
-
I'm curious, though, as to why you would have to design a dialog? Is it doing something really non standard?
Well, it could be, or it might be . . .

Or, just maybe, you want them to look a bit different from the standard dialogues
and more in keeping with the aesthetic of your program:
-
Quit.jpg
-
Delete.jpg
-
AND the real problem is why Devawriter Pro did NOT save the omkara at the start of the first line of Sri Isopanisad. :roll:
-
SERIOUSLY . . . the two "dialogue stacks" in my screenshots from Devawriter Pro are NOT stacks at all;
they are 'just' layered images . . .

Each "dialogue stack" consists of one pictorial image (the "stack") and a "YES" image and a "NO" image.

this guarantees you have 100% control over what they look like and ensures nothing outwith
your control distorts or resizes them. 8)

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: customizing the answer dialogue box

Post by [-hh] » Sun Sep 22, 2019 11:06 am

@paul
AlertBuilder may give you some ideas:
http://livecodeshare.runrev.com/stack/804/

It creates a draggable windowshaped dialog which disappears after a given time (with countDown).
shiftLock happens

paulalsmith1000
Posts: 58
Joined: Sat Jun 15, 2019 10:09 am

Re: customizing the answer dialogue box

Post by paulalsmith1000 » Sun Sep 22, 2019 1:12 pm

Hi Bogs

The reason is because I wanted the dialog boxes to match the colour scheme of the rest of the app, but I understand this isn't possible?

If it was that would be perfect.

Kind regards

Paul

PS I wil try your suggestions, many thanks

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: customizing the answer dialogue box

Post by richmond62 » Sun Sep 22, 2019 1:18 pm

but I understand this isn't possible
Utter Nonsense!

Go back and read my posting about how I faked dialogue boxes for my
Devawriter Pro app, and if you've still go questions come back: I'm "here" and I'm ready to help. :D

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: customizing the answer dialogue box

Post by bogs » Sun Sep 22, 2019 2:22 pm

I'd agree that sounds like nonsense, but not the way Richmond was thinking :wink:

Of course, I don't play with mobile, maybe it doesn't work this way there, but you *might* try something like this ~
answerDialogBackgroundColor.png
Any color you like, as long as it is GREEN!
Mind you, this is pretty brute force~ish, if you do use this command in the IDE it will make *all* the dialogs green :P Be safer than I am, and store the original bg color first, although I think just setting the same to "" restores it.

In your case, of course you wouldn't use a name for the color, use 'to the bgcolor of {your stack your trying to match}' instead.
Image

Newbie4
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 327
Joined: Sun Apr 15, 2012 1:17 am
Location: USA
Contact:

Re: customizing the answer dialogue box

Post by Newbie4 » Sun Sep 22, 2019 3:10 pm

Have you tried using html in some fashion? I don’t know if this will work with the way you are doing it but it is worth a try.
See “html tricks” - https://sites.google.com/a/pgcps.org/li ... euser/html
Cyril Pruszko
https://sites.google.com/a/pgcps.org/livecode/
https://sites.google.com/a/setonhs.org/app-and-game-workshop/home
https://learntolivecode.com/

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: customizing the answer dialogue box

Post by richmond62 » Sun Sep 22, 2019 3:49 pm

Screenshot 2019-09-22 at 17.47.31.png
-
Screenshot 2019-09-22 at 17.47.36.png
Attachments
Fone.livecode.zip
Here's the stack.
(146.8 KiB) Downloaded 206 times

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: customizing the answer dialogue box

Post by bogs » Sun Sep 22, 2019 3:57 pm

I should add, before it is mis-construed, I have not a thing against custom dialogs and I do make a LOT of them myself. I also want to point out that Richmond's way is certainly do-able as well, which I never had any doubt of :wink:

I was just wondering why you can't set up the default dialog to be.....well, almost anything you want it to be is all. Look at it as a curiosity question from someone that doesn't do anything on the mobile end of things :twisted:
Image

Post Reply

Return to “Android Deployment”