customizing the answer dialogue box

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

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
paulalsmith1000
Posts: 26
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: 11112
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: 2364
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

paulalsmith1000
Posts: 26
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: 3480
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: 3711
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: 2364
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

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 3480
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 9 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:

Post Reply

Return to “Android Deployment”