Making Android Native Field Not Opaque

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
cdev007
Posts: 11
Joined: Sun Oct 04, 2020 7:41 pm

Making Android Native Field Not Opaque

Post by cdev007 » Wed Dec 02, 2020 9:13 pm

Is there a way to make an Android Native Field not opaque?

cdev007
Posts: 11
Joined: Sun Oct 04, 2020 7:41 pm

Re: Making Android Native Field Not Opaque

Post by cdev007 » Mon Dec 07, 2020 8:28 pm

Is this something that I should post on the suggestions forum since I'm assuming there is no way to do this at the present?

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

Re: Making Android Native Field Not Opaque

Post by richmond62 » Mon Dec 07, 2020 8:41 pm

I would suppose the clever thing to do is to fill in an enhancement request over here:

https://quality.livecode.com/

kdjanz
Posts: 300
Joined: Fri Dec 09, 2011 12:12 pm
Location: Fort Saskatchewan, AB Canada

Re: Making Android Native Field Not Opaque

Post by kdjanz » Mon Dec 07, 2020 8:43 pm

I don’t have an Android device for testing, but could you

Code: Select all

set the background colour ...
of the field to an appropriate hue?

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

Re: Making Android Native Field Not Opaque

Post by richmond62 » Mon Dec 07, 2020 8:57 pm

an appropriate hue
is something different to transparency.

cdev007
Posts: 11
Joined: Sun Oct 04, 2020 7:41 pm

Re: Making Android Native Field Not Opaque

Post by cdev007 » Sat Aug 07, 2021 5:31 pm

richmond62 wrote:
Mon Dec 07, 2020 8:41 pm
I would suppose the clever thing to do is to fill in an enhancement request over here:

After submitting an enhancement request this is the response I got. BTW FYI.




In the effort of creating a mobile control field (in my case with a nice rounded perimeter) that can look and act more or less the same on 3 platforms (oSX,Android,iOS), the fact that on android the native field background is alway opaque make this almost impossible.

This is due to 2 facts:
- if the rect of the android control is less then 38 px Hight, the text is not shown or it is cut out.
- the vertical text alignment on Android is always to the top and cannot be changed

This imply to always have enormous field rects.

Native Android fields in LC are very limited in properties.

Android vertical text alignment and not being able on android to have a non opaque mobile field are a problem

To note also that on Android 9 TV box (where LC standalone runs just fine) the horizontal editing window of a native field is different from the one on a cell phone:

While on the cell phone the editing window cover completely the screen, so mitigating the fact that the field rect is out of size, on a TV box the keyboard appears but the top part of the screen remain the standalone window, so making very visible the enormous field height required by the Android native field.

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

Re: Making Android Native Field Not Opaque

Post by richmond62 » Sat Aug 07, 2021 9:26 pm

While on the cell phone the editing window cover completely the screen, so mitigating the fact that the field rect is out of size, on a TV box the keyboard appears but the top part of the screen remain the standalone window, so making very visible the enormous field height required by the Android native field.
I feel very uncomfortable about that as, as far as I know, LiveCode does not employ someone
with such bad English grammar.

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

Re: Making Android Native Field Not Opaque

Post by jacque » Sun Aug 08, 2021 5:58 pm

This looks like the request, not the reply. What's the bug number?

Edit: Found it. https://quality.livecode.com/show_bug.cgi?id=23026
It's an older bug. The quoted text above is one of the user entries.

If you create a native field the original way using mobileControlCreate you can make the field transparent and apply many more properties than the widget allows.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

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

Re: Making Android Native Field Not Opaque

Post by richmond62 » Mon Aug 09, 2021 10:04 am

apply many more properties than the widget allows
The exact reason why I will always prefer "rolling your own" to using a widget,

trevix
Posts: 929
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: Making Android Native Field Not Opaque

Post by trevix » Wed Sep 20, 2023 5:43 pm

I hope that in the meantime my grammar has improved and it won't bother you too much.

What I consider a bug has been dormant for 2 years now and I'm wondering why no one else has my problem with fields in Android.
In my opinion, in order not to cut the text above or below, in Android it is necessary to use a font size that is way too small compared to the size occupied by the field.
And this applies to both the widget and using mobileControlCreate.

All this mess because at the time we decided to make an app with text input fields with rounded corners, in all platforms.

PS: among other things in Android mobileControlSet sControlID, "alpha" has no effect (although in my case I don't think it would be useful, since in theory it would also make the text transparent).
Trevix
OSX 12.5.1 xCode 13.2 LC 9.6.8 iOs 15> Android 7>

Post Reply

Return to “Android Deployment”