The place to discuss anything and everything about running your LiveCode on Android
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
cusingerBUSCw5N
- Posts: 339
- Joined: Wed Jul 11, 2012 9:24 pm
Post
by cusingerBUSCw5N » Tue Jan 22, 2013 9:32 pm
I have weird problem going on with my buttons on Android.
My buttons are basic text with a background and a dropshadow. They are fine in Windows and on IOS. But when I put them on an Android - IF the button text isn't wide....it creates a box with a different color - sometimes on one side - sometimes on both.
It happens when it goes through code setting the button width such as:
set the width of button "xyz" to tstackwidth*0.88.
I have remade the buttons - no difference. If I add more text to the button label, it goes away. If I reduce the text in the button label, the boxes get bigger.
Very annoying. Is there any way to get rid of the boxes? Thanks

-
Simon
- VIP Livecode Opensource Backer

- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
Post
by Simon » Tue Jan 22, 2013 10:08 pm
I'm pretty sure you have set that red color in one of the stacks properties.
You'll have to use the inspector and look around, it could be in the stack/card/group/button (others?).
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
cusingerBUSCw5N
- Posts: 339
- Joined: Wed Jul 11, 2012 9:24 pm
Post
by cusingerBUSCw5N » Tue Jan 22, 2013 10:14 pm
I just set the background color to pink
set the backgroundcolor of button "local_help_button2" to "pink"
and it now has two lovely light purple boxes in a pink button (on Android only).
-
Simon
- VIP Livecode Opensource Backer

- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
Post
by Simon » Tue Jan 22, 2013 10:29 pm
but I created a new button - new name...same thing happened.
As I said it could be anywhere... not just the button. Could be the background of the group the button is in or it's card or.. or.. or
As you are resizing the objects, gaps may form that allow you to see behind the object.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
cusingerBUSCw5N
- Posts: 339
- Joined: Wed Jul 11, 2012 9:24 pm
Post
by cusingerBUSCw5N » Tue Jan 22, 2013 11:23 pm
OK. I don't know why but this is fixing my problem:
Somehow it is the location of the button that triggers this problem. If I move the button a little bit down, it doesn't create the extra boxes. So, I changed the code from
set the top of button "local_help_button2" to the bottom of button "contacts" +tverticalspace
to
set the top of button "local_help_button2" to the bottom of button "contacts" +tverticalspace*1.1
and voila...no more boxes.
(I don't think it was a parameter that I set because there's nothing except backgroundcolor - which I tried changing without any help on the unwanted boxes. I don't think it's hidden fields because I made all the hidden fields visible to make sure they weren't the cause... My explanation above makes no logical sense...but for some reason corrected the problem. It also explains why creating a new button and putting it in the same place didn't work. In the past, I have had some unwanted boxes in the top right corner of Androids as well - so I think there are certain places that trigger this weird issue.)
-
jacque
- VIP Livecode Opensource Backer

- Posts: 7393
- Joined: Sat Apr 08, 2006 8:31 pm
-
Contact:
Post
by jacque » Wed Jan 23, 2013 12:46 am
What version of Android? I had a similar problem in 2.2 but it went away in 2.3. It didn't happen with buttons, but the rectangles were similar.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
-
cusingerBUSCw5N
- Posts: 339
- Joined: Wed Jul 11, 2012 9:24 pm
Post
by cusingerBUSCw5N » Sun Jan 27, 2013 3:22 am
These stupid boxes of unwanted color are going to drive me nuts.
I just added some fields with background color - and on the Android, there are boxes of unwanted color wherever there is an empty space - - i.e., if the text is:
John Brown went
to the cafe to have hot chocolate and cookies.
the box will appear next to went - because there is a large space.
And if I make the field wider than the text, the boxes will appear as well.
Plus...if there is any movement (I was experimenting with moving fields) - the boxes are all over the place when it's moving.
It seems they don't appear if the background of the box is white or gray.
I am using Android 4.1.1
-
Simon
- VIP Livecode Opensource Backer

- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
Post
by Simon » Sun Jan 27, 2013 4:04 am
Any chance you can post a small stack the displays the problem?
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
jacque
- VIP Livecode Opensource Backer

- Posts: 7393
- Joined: Sat Apr 08, 2006 8:31 pm
-
Contact:
Post
by jacque » Sun Jan 27, 2013 4:31 am
Are you using acceleratedRendering? If so, try setting the compositorType to "software". That was the problem with my app in Android 2.2. It's still a bug, but that may be a workaround for now.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
-
cusingerBUSCw5N
- Posts: 339
- Joined: Wed Jul 11, 2012 9:24 pm
Post
by cusingerBUSCw5N » Mon Jan 28, 2013 7:24 am
Aha! I created a small stack and didn't have the problem. So I ripped apart my app and found the culprit:
Code: Select all
if the platform is "iphone" then
set the compositorType of this stack to "opengl"
else
set the compositorType of this stack to "software"
end if
(put in my stack script)
I added this when I was trying to get the finger scrolling to work better on the mobile devices. If I remove it, the weird boxes go away. So do I have to choose between bad scrolling and weird boxes? I was specifically working on scrolling for the Android - and was told I needed to check the box Layer Mode to scrolling and add this code.

-
cusingerBUSCw5N
- Posts: 339
- Joined: Wed Jul 11, 2012 9:24 pm
Post
by cusingerBUSCw5N » Mon Jan 28, 2013 7:34 am
Here's a zipped stack showing the exact problem - with the bad code in it. You can see when you open it up (on an Android) the field background color is all messed up. Then when you click the button and see things moving, it's a real mess - because the background isn't white. When the background is white, then only the boxes are flashing diffferent colors.
-
Attachments
-
- box_problem.zip
- (2.4 KiB) Downloaded 289 times
-
jacque
- VIP Livecode Opensource Backer

- Posts: 7393
- Joined: Sat Apr 08, 2006 8:31 pm
-
Contact:
Post
by jacque » Mon Jan 28, 2013 7:20 pm
I didn't actually install and look at your test stack, but I think you can remove the handler without any problem. If you wrote the original code back when acceleratedRendering was first introduced, you needed to set all its properties in script. But with the latest version of LiveCode default properties are set automatically, and you only need to set them if the defaults don't work. Since removing the handler works okay, that means the defaults are also okay. As long as acceleratedRendering is true, you should still get the benefits of smooth scrolling.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
-
cusingerBUSCw5N
- Posts: 339
- Joined: Wed Jul 11, 2012 9:24 pm
Post
by cusingerBUSCw5N » Tue Jan 29, 2013 2:35 am
Thanks. I didn't even know about acceleratedrendering....
So I have added this to my stack script:
set the acceleratedRendering of this stack to true
I am hoping to have wonderful scrolling AND color!

-
cusingerBUSCw5N
- Posts: 339
- Joined: Wed Jul 11, 2012 9:24 pm
Post
by cusingerBUSCw5N » Tue Jan 29, 2013 3:21 am
Nope....put my happy face on too soon.
Code: Select all
set the acceleratedRendering of this stack to true
Causes my app not to open in Android. Goes through the entire open script - but then stops - and doesn't open anything. Take out the code and it works.
So...we're back to choosing between scrolling and colors?