native button widget background color

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

link76
Posts: 99
Joined: Fri Nov 04, 2011 1:52 pm

native button widget background color

Post by link76 » Sat Mar 09, 2019 7:35 am

Hello,

from the tools palette I inserted the android native button widget, how can I change the background color?

in the propety inspector it is possible to change only the color of the text.

thank you

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

Re: native button widget background color

Post by bogs » Sat Mar 09, 2019 11:36 am

hello link76,

Are you talking about this?
Selection_001.png
Switch the button background color...
Image

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

Re: native button widget background color

Post by Klaus » Sat Mar 09, 2019 12:49 pm

That is the "Switch Button" widget, bogs! 8)
Try harder!

@link76,

looks like this is not possible.
If the inspector for a widget does not provide this you are out of luck.

But I think this is desired behaviour, if you colorize that one, then it
would propbably not be a "native Android button" anymore.

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

Re: native button widget background color

Post by bogs » Sat Mar 09, 2019 12:56 pm

Klaus wrote:
Sat Mar 09, 2019 12:49 pm
That is the "Switch Button" widget, bogs! 8)
Try harder!
Ah so! it is the only widget button shown in 8.1.2, I figured it was what they were referring to :oops:
Image

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

Re: native button widget background color

Post by Klaus » Sat Mar 09, 2019 1:03 pm

We are not talking about caveman painting, Sir! :D

link76
Posts: 99
Joined: Fri Nov 04, 2011 1:52 pm

Re: native button widget background color

Post by link76 » Sat Mar 09, 2019 1:22 pm

Klaus wrote:
Sat Mar 09, 2019 12:49 pm
That is the "Switch Button" widget, bogs! 8)
Try harder!

@link76,

looks like this is not possible.
If the inspector for a widget does not provide this you are out of luck.

But I think this is desired behaviour, if you colorize that one, then it
would propbably not be a "native Android button" anymore.
Thank you,

I asked, because using the standard button, which allows you to color it, in a mobile environment when I touch the button there seem to be more touches

The native button performs a single correct touch.

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

Re: native button widget background color

Post by bogs » Sat Mar 09, 2019 2:23 pm

Klaus wrote:
Sat Mar 09, 2019 1:03 pm
We are not talking about caveman painting, Sir! :D
It is rather hard to tell in this cave...
Selection_001.png
Early 'Protolethzaic' period interface design...
Image

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

Re: native button widget background color

Post by richmond62 » Sat Mar 09, 2019 3:13 pm

Screenshot 2019-03-09 at 16.07.01.png
Screenshot 2019-03-09 at 16.07.01.png (6.24 KiB) Viewed 7560 times
-
Boh-Boh-Bom!

HOWEVER . . .

While I can change the textColor, I cannot change:

the textFont or the textSize, or mess around with anything else via the properties palette,
or via scripting:
-
Screenshot 2019-03-09 at 16.12.58.png
-
Which is "a shame". 8)
-
Oh, and while I'm here: some of my best friends are cavemen, Klaus,
so watch it with the non-PC, Neanderthalist language. :D
-
bloke.jpg
bloke.jpg (5.54 KiB) Viewed 7560 times

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

Re: native button widget background color

Post by richmond62 » Sat Mar 09, 2019 3:23 pm

You can, if you are getting really desperate, layer the widget over a coloured
rectangular object and set the ink of the widget to blendMultiply, this means,
however, that you had better leave your textColor at the default black:
-
Screenshot 2019-03-09 at 16.20.37.png

link76
Posts: 99
Joined: Fri Nov 04, 2011 1:52 pm

Re: native button widget background color

Post by link76 » Sat Mar 09, 2019 3:38 pm

richmond62 wrote:
Sat Mar 09, 2019 3:13 pm
Screenshot 2019-03-09 at 16.07.01.png
-
Boh-Boh-Bom!

HOWEVER . . .

While I can change the textColor, I cannot change:

the textFont or the textSize, or mess around with anything else via the properties palette,
or via scripting:
-
Screenshot 2019-03-09 at 16.12.58.png
-
Which is "a shame". 8)
-
Oh, and while I'm here: some of my best friends are cavemen, Klaus,
so watch it with the non-PC, Neanderthalist language. :D
-
bloke.jpg
I tried but it does not work, the background color is not set.

Code: Select all

on mouseup
   set the backGroundColor of widget "test" to "red"
end mouseup

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

Re: native button widget background color

Post by richmond62 » Sat Mar 09, 2019 4:38 pm

I explained that setting the backGroundColor did not work.

However, what I did do is send you a screenShot of a widget Android button
on top of a rectangular graphic and the Ink/blendLevel of the widget set so
that the underlying rectangular graphic was visible.
-
Screenshot 2019-03-09 at 17.37.01.png
-
Download the stack and play with it: that really will make things clear. :D
Attachments
cruddy Android btn fix.livecode.zip
Here's the stack.
(893 Bytes) Downloaded 199 times

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7229
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: native button widget background color

Post by jacque » Sat Mar 09, 2019 6:13 pm

The Android native button doesn't conform to the current Material design theme so I make my own using a roundrect graphic with a 2 degree corner radius. You can color this however you like. While there's no UI for adding a label, you can do it from the message box or by script with "set the label of graphic x to <text string>".

Note that Material uses flat text buttons with no borders or fill for most things. Only important actions use color filled buttons, and those should be used sparingly. Basically colored buttons are used the same way default buttons are in dialogs.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

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

Re: native button widget background color

Post by richmond62 » Sun Mar 10, 2019 2:53 pm

Stick with jacque, even if for the simple reason that this:
-
Screenshot 2019-03-10 at 15.50.37.png
-
is horrible. And the "standard button is awful as well:
-
Screenshot 2019-03-10 at 15.56.26.png
Screenshot 2019-03-10 at 15.56.26.png (13.33 KiB) Viewed 7429 times
-
and this "Android Native Button" widget does not show its text in a build:
-
Screenshot 2019-03-10 at 16.00.51.png
Screenshot 2019-03-10 at 16.00.51.png (16 KiB) Viewed 7429 times

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7229
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: native button widget background color

Post by jacque » Sun Mar 10, 2019 6:32 pm

this "Android Native Button" widget does not show its text in a build:
It does on Android, the native iOS and Android buttons call the OS to create the button, much like native scrollers do. My objection to the Android native button is that it isn't Material design, it's skeuomorphic, which makes the app look dated. The old 3D style went out some years ago.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

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

Re: native button widget background color

Post by bogs » Sun Mar 10, 2019 7:09 pm

jacque wrote:
Sun Mar 10, 2019 6:32 pm
The old 3D style went out some years ago.
Which means your probably 2 years away from its return, like bell bottoms and platform shoes and tie dye t-shirts :twisted:
Image

Post Reply

Return to “Android Deployment”