the button does not respond when keboard is Activated

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
zhanghuanqian
Posts: 20
Joined: Sat Jan 24, 2015 2:27 pm

the button does not respond when keboard is Activated

Post by zhanghuanqian »

dear sir:
my app worked perfect except that after i input something into TextEntry field with keyboard Activated , the button "Submit" does not respond when i press it. what can i deal with this issue?
environments:
lc community 7.0.1 rc4+win7
standalone settings:minimum android version:3.1
sumsung mobile:android4.2.2

thanks!
MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: the button does not respond when keboard is Activated

Post by MaxV »

Do you use a native android text field?
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
zhanghuanqian
Posts: 20
Joined: Sat Jan 24, 2015 2:27 pm

Re: the button does not respond when keboard is Activated

Post by zhanghuanqian »

how can i create a native field? i create the field which is on the "Tools" panel near the "Label:",the tooltip named "TextEntry Field".
i search a result here: lessons*runrev*com/m/4069/l/29112-how-do-i-use-native-text-controls-on-mobile
but i cannot understand it.
Like this:
1.create a ractangle,named InputRect
2.create a input via
mobileControlCreate "input", "testinput"
mobileControlSet "testinput", "rect", the rect of graphic "InputRect"
mobileControlSet "testinput", "visible", true

and what other codes should i have?
thanks
zhanghuanqian
Posts: 20
Joined: Sat Jan 24, 2015 2:27 pm

Re: the button does not respond when keboard is Activated

Post by zhanghuanqian »

by the way,the issue take place that all the controls on the card moved up automatically when keyboard is shown and Activated, then the button does not respond which is near field.
the fig is below:
20150127212910.jpg
MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: the button does not respond when keboard is Activated

Post by MaxV »

A native Android control is generated by Android and not by Livecode, it responds better to Android.
It's just like an external object over your livecode app, but it works great on Android.
Please read mobileControCreate and mobileControlSet in the dictionary.
Every field where the user has to type should be a native field in Android.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
zhanghuanqian
Posts: 20
Joined: Sat Jan 24, 2015 2:27 pm

Re: the button does not respond when keboard is Activated

Post by zhanghuanqian »

thank you,MaxV.i will try later!
Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: the button does not respond when keboard is Activated

Post by Simon »

Hi zhanghuanqian,
all the controls on the card moved up automatically when keyboard is shown
If you turn off accelerated rendering this will stop, but then you will have to position the controls via code because the keyboard may cover the active field.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
zhanghuanqian
Posts: 20
Joined: Sat Jan 24, 2015 2:27 pm

Re: the button does not respond when keboard is Activated

Post by zhanghuanqian »

oh...
i have used the code: set the acceleratedRendering of this stack to true

but i have tryed to deal keyboardactivated message with almost all approachs:
1.http://forums.livecode.com/viewtopic.ph ... ard#p43233
2.http://forums.livecode.com/viewtopic.ph ... ht#p114468
3.http:\\lessons*runrev*com/m/847/l/136724-move-a-native-mobile-text-input-control-so-it-is-not-covered-by-keyboard
and i fail.

what can i do? how can i get the height of keyboard? by the property of working screenRects?

thanks!
MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: the button does not respond when keboard is Activated

Post by MaxV »

Looking to your picture, I assume that there are 2 fields (named "V(A)" and "longtext"), so I would add:

Code: Select all

On OpenCard
if the environment is "mobile" then
mobileControlCreate "input","V(A)"
mobileControlCreate "multiline","longtext"
mobileControlSET "V(A)","visible",true
mobileControlSET "longtext","visible",true
mobileControlSET "V(A)","rect",(the rect of field "V(A)")
mobileControlSET "longtext","rect",(the rect of field "longtext)
mobileControlSET "V(A)","keyboardType","numeric"
end if
End OpenCard

on CloseCard
if the environment is "mobile" then
mobileControlDelete "V(A)"
mobileControlDelete "longtext"
end if
end Closecard
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
zhanghuanqian
Posts: 20
Joined: Sat Jan 24, 2015 2:27 pm

Re: the button does not respond when keboard is Activated

Post by zhanghuanqian »

thanks everyone!
and how can i get the height of keyboard?

and the property:acceleratedRendering has a bug? when it set and move all controll(s) up and then can't press button.
Post Reply