native input rect rendering margin?

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
slowmaker
Posts: 47
Joined: Fri Feb 08, 2019 1:53 pm

native input rect rendering margin?

Post by slowmaker » Wed Feb 19, 2020 10:31 pm

When creating an android native input control with mobileControlCreate, it doesn't seem to quite match a graphic rectangle created with the same rect. If you color the graphic you can see more clearly that the native input control is smaller, both width and height.

I tinkered around with a few different dimension sets; the difference seems to be constant, not proportional. Tried fooling around with 'the effective rect', turning border on and off in the rectangle, and so forth (in other stacks, not the basic one attached). No change, there always seems to be that little difference in the size of the input vs the size of the graphic rectangle.

Note that the self-reported rectangles of the input and the graphic do match; checking that was part of the 'and so forth' mentioned above.

Anybody else commented on this somewhere?

Below is what I did to get to this point:

I downloaded the sample stack here from the lesson on responding to the keyboardActivated/Deactivated messages.

Diffs between the original (referenced above) and the attached stack:
  • I changed
    • the rectangle color to red
    • the coordinates so the objects would all be visible on my smaller android screen
  • also, in the standalone settings I changed
    • the signing to 'for development only'
    • the build folder
    • the target from iOS to android
Edit: added screenshot:
Screenshot_20200219-155330.png
Screenshot_20200219-155330.png (8.86 KiB) Viewed 4431 times
Attachments
Move_Keyboard_Example.livecode.zip
modified as noted
(1.45 KiB) Downloaded 182 times
The important thing is not to stop questioning. Curiosity has its own reason for existence. - Albert Einstein (LIFE Magazine (1955 may 2), p64)

slowmaker
Posts: 47
Joined: Fri Feb 08, 2019 1:53 pm

Re: native input rect rendering margin?

Post by slowmaker » Thu Feb 20, 2020 8:18 pm

attached a stack giving an alternate way to see the issue:

stack graphic rectangles side by side with stacked inputs.
the assigned rectangles for the graphics are the same as the rectangles for the inputs, except for the horizontal translation.
The *rendered* rectangles are visibly different; the graphics stack with no gaps, as expected. The inputs leave a consistent gap.

The gap is both bottom and sides, although the side gap is easier to see in the original post's demo.

Also filed bug report 22585; I'm guessing since nobody has commented then that at least means I haven't missed some glaringly obvious piece of documentation about that margin/padding being expected.
Attachments
androidNativeInputRectDemo.livecode.zip
(1.92 KiB) Downloaded 195 times
The important thing is not to stop questioning. Curiosity has its own reason for existence. - Albert Einstein (LIFE Magazine (1955 may 2), p64)

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

Re: native input rect rendering margin?

Post by bogs » Thu Feb 20, 2020 10:17 pm

slowmaker wrote:
Thu Feb 20, 2020 8:18 pm
I'm guessing since nobody has commented then that at least means I haven't missed some glaringly obvious piece of documentation about that margin/padding being expected.
Not necessarily, you did only open this topic yesterday. While I saw it yesterday, and answer quite a lot as time provides, I know less than nothing about mobile peculiarities, so my answering this topic would mean less than nothing.

Others who answer here have different and sometimes quite hectic schedules, or don't hit the forum every day or even every few days. No specific comment in a day long period is hardly surprising. If it went a week or more, then I might assume it is as you said.
Image

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

Re: native input rect rendering margin?

Post by jacque » Sat Feb 22, 2020 9:10 pm

This looks like either the margins property or the linesize property, but in either case it shouldn't change the rect of the graphic. What commands do you use to set the size of the native button? Or are you using the property inspector?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

slowmaker
Posts: 47
Joined: Fri Feb 08, 2019 1:53 pm

Re: native input rect rendering margin?

Post by slowmaker » Sun Feb 23, 2020 12:07 am

jacque wrote:
Sat Feb 22, 2020 9:10 pm
... in either case it shouldn't change the rect of the graphic.
There may be a misunderstanding here on this point; I didn't meant to imply that the rect of the graphic is changed. It is not.
The graphic is just there, assigned the same rect as the input control, so the rendered input control can be seen not covering the area expected.
i.e. the red graphic just helps make the uncovered areas shine through clearly when the input control fails to render throughout its assigned rect.

The code generating the input control is like this:

Code: Select all

local sinputId

on opencard
   if environment() = "mobile" then
      mobileControlCreate "input"
      put the result into sinputID
      mobileControlSet sinputID, "rect", "16,308,400,498"
      mobileControlSet sinputID, "visible", "true"
      mobileControlSet sinputID, "opaque", "true"
   end if
end opencard
The margin and linesize properties sound like decent possibilities; I'll give that a try when I get a chance.

The bug report was confirmed yesterday, so I'm guessing even if the margin property can fix it, then somebody on the team must figure it should have defaulted to zero (and I would agree).
The important thing is not to stop questioning. Curiosity has its own reason for existence. - Albert Einstein (LIFE Magazine (1955 may 2), p64)

Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

Re: native input rect rendering margin?

Post by Monox18 » Wed Dec 30, 2020 12:18 am

Were you able to solve the problem? I also saw the bug 22585 you reported and there doesn't seem to be any reply from LC team.

I just started playing around with Android Native Input Widget (from the tools palette, not by script). Also having the same problem when setting the rectangle there's an offset and it doesn't match the assigned rectangle.
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

slowmaker
Posts: 47
Joined: Fri Feb 08, 2019 1:53 pm

Re: native input rect rendering margin?

Post by slowmaker » Wed Dec 30, 2020 11:55 pm

The team did reply, in the sense that they changed the status of the bug to "confirmed". But that's it. As of LC 9.6.1, the bug is still there.

I'm guessing it is rare for anyone to align inputs in such a way as to notice this, so it will probably stay extremely low priority for a long while.
The important thing is not to stop questioning. Curiosity has its own reason for existence. - Albert Einstein (LIFE Magazine (1955 may 2), p64)

Post Reply

Return to “Android Deployment”