RE: Android Keyboard Activation Issue

2017-01-13 Thread Livecode XAC via use-livecode
Rich,

I agree.  I think the syntax is there,  mobileControlDo  "focus"

it just doesn't do anything on Android, but it works fine on iOS.

Found the following in LiveCode QualityCenter.
   11468   Reported Nov-2103Reported by Monte
   11180   Reported Sept-2013   Marked as duplicate of 11468
   18520   Reported Sept-2016   Marked as duplicate of 11468

Looks like this issue is well known, just nothing has been done with it.  
Creates a real problem providing a quaility user experience.

Is there any way to mark it so it gets looked at?
Dan

-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf
Of Richard Gaskin via use-livecode
Sent: Friday, January 13, 2017 1:16 PM
To: use-livecode@lists.runrev.com
Cc: Richard Gaskin
Subject: Re: Android Keyboard Activation Issue

Livecode XAC wrote:

 > Right now I'm creating the control when the user touches on the  > text
box and then delete the control when they enter the return.
 > This provides a highlight of the field that is being entered,  > but has
the double click issue.

Regardless how the field is created, it seems we have no means of explicitly
giving focus to a mobile-native field programmatically.

If that's correct it would seem adding that would be a reasonable priority.

If that's incorrect I'd welcome learning what the syntax is.

A good deal of good UX depends on this sort of graceful guidance for the
user, which we can find in many competing apps.

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  
  ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Android Keyboard Activation Issue

2017-01-13 Thread Richard Gaskin via use-livecode

Livecode XAC wrote:

> Right now I'm creating the control when the user touches on the
> text box and then delete the control when they enter the return.
> This provides a highlight of the field that is being entered,
> but has the double click issue.

Regardless how the field is created, it seems we have no means of 
explicitly giving focus to a mobile-native field programmatically.


If that's correct it would seem adding that would be a reasonable priority.

If that's incorrect I'd welcome learning what the syntax is.

A good deal of good UX depends on this sort of graceful guidance for the 
user, which we can find in many competing apps.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


RE: Android Keyboard Activation Issue

2017-01-13 Thread Livecode XAC via use-livecode
Dave and Andrew,

Thank you for your input and insights.   Right now I'm creating the control
when the user touches on the text box and then delete the control when they
enter the return.   This provides a highlight of the field that is being
entered, but has the double click issue.   The original challenge that I had
with doing that was when the user scrolls the screen the Native control
would stay where it was created and the screen below would move, so the
Native Control wouldn't follow the display scroll, but I know they have made
some fixes, so I should give it a try again.

Are you doing a Native Scroller as well as a Native Text box at the same
time.

I will give it a try to create all the native controls on card open and see
if this resolves the issue.

I will let you know what I find.
Dan

-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf
Of Dave Kilroy via use-livecode
Sent: Friday, January 13, 2017 5:48 AM
To: use-revolut...@lists.runrev.com
Cc: Dave Kilroy
Subject: RE: Android Keyboard Activation Issue

Hmm - Dan both Andrew and I appear to create native inputs on opening the
card so that when the user touches the native control it's ready to go. You
appear to create the native control at the same time the user touches the
underneath field? (or maybe you have a round-rect graphic or similar that
the user clicks on?).

Do you get the same need for a double-touch if a user comes back to a native
control a second time (i.e. when it has already been created)? Perhaps
experiment with creating the native control first and then use it once it's
been fully instantiated?

BTW my wording earlier when I was talking about having an issue on Android
with "the keyboard sliding out" was sloppy - I was trying to say the issue
was around getting the keyboard to slide out of the way i.e. at the end of
the editing process...

Good luck!

Dave

PS: do you have any LiveCode fields on the card with traversalOn set to true
that may be 'holding on' to focus  and thus requiring the double-touch?



-
"The first 90% of the task takes 90% of the time, and the last 10% takes the
other 90% of the time."
Peter M. Brigham
--
View this message in context:
http://runtime-revolution.278305.n4.nabble.com/Android-Keyboard-Activation-I
ssue-tp4711601p4711631.html
Sent from the Revolution - User mailing list archive at Nabble.com.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Android Keyboard Activation Issue

2017-01-13 Thread Richard Gaskin via use-livecode

Livecode XAC wrote:

> mobileControlDo pName, "focus" -- pName is the passed
> name of the control
>
> This doesn't do anything in Android.

Either that's a bug or there must be some other reliable means of 
focusing a mobile-native field.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


RE: Android Keyboard Activation Issue

2017-01-13 Thread Dave Kilroy via use-livecode
Hmm - Dan both Andrew and I appear to create native inputs on opening the
card so that when the user touches the native control it's ready to go. You
appear to create the native control at the same time the user touches the
underneath field? (or maybe you have a round-rect graphic or similar that
the user clicks on?).

Do you get the same need for a double-touch if a user comes back to a native
control a second time (i.e. when it has already been created)? Perhaps
experiment with creating the native control first and then use it once it's
been fully instantiated?

BTW my wording earlier when I was talking about having an issue on Android
with "the keyboard sliding out" was sloppy - I was trying to say the issue
was around getting the keyboard to slide out of the way i.e. at the end of
the editing process...

Good luck!

Dave

PS: do you have any LiveCode fields on the card with traversalOn set to true
that may be 'holding on' to focus  and thus requiring the double-touch?



-
"The first 90% of the task takes 90% of the time, and the last 10% takes the 
other 90% of the time."
Peter M. Brigham 
--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Android-Keyboard-Activation-Issue-tp4711601p4711631.html
Sent from the Revolution - User mailing list archive at Nabble.com.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


RE: Android Keyboard Activation Issue

2017-01-12 Thread Andrew Bell via use-livecode
Not sure why yours would be working different. I abbreviated much of  
my card script for list purposes, but I actually create 2  
mobileControl objects that appear right after each other on the card  
using nearly identical code: inputCreateTSM and inputCreateEmail are  
both called from preOpenScript. inputCreateTSM has the focus as it  
appears first visually.


I also seem to have some legacy code (commented out) for  
"onInputFocus" that I likely got from here but don't know how it (or  
if) it even does anything:  
http://lessons.livecode.com/m/4069/l/29112-how-do-i-use-native-text-controls-on-mobile


on inputFocus
# set the focus to the native text input
mobileControlDo "TSMinput", "focus"
end inputFocus

--Andrew Bell


--

Message: 9
Date: Thu, 12 Jan 2017 11:41:07 -0600
From: "Livecode XAC" <lc-develo...@xpertassist.com>
To: "'How to use LiveCode'" <use-livecode@lists.runrev.com>
Subject: RE: Android Keyboard Activation Issue
Message-ID: <03CD51D6F3F24623868445DE2D2AF03D@NetCentral>
Content-Type: text/plain;   charset="us-ascii"

Andrew,

I'm doing the same type of thing, but because I have multiple input fields
on the card, I send the inputCreateTSM when the user selects the field.

Here is the function that I'm using to create the Native Control when the
field is selected.


on inputCreatorWide pName, pFld, pContent, pKeyboardType, pAutoCap,
pAutoCorrect, pReturn, pDataDetect

   if environment() is not "mobile" then exit inputCreatorWide

   put the uOS of this stack into tOsType

   if tOsType = "android" then
  get inputCleanUp()
   end if

   if pFld contains "stack" then   -- removed the stack part of the field
identifier
  put wordOffset("stack",pFld) into tWord
  put word 1 to (tWord -2) of pFld into pFld
   end if

   get setInputFieldName( pFld )  -- Save the active Input Field

   get moveToVisibleArea( pFld )-- Make sure the field is within the
visible area of the display.

   put the rect of pFld into tSize
   put the height of pFld into tHeight
   put the width of pFld into tWidth

   if tOsType = "android" then
  set the itemdel to ","
  add (tHeight/2) to item 4 of tSize -- Increase the field size
  if tWidth < 50 then
 add (100 - tWidth) to item 3 of tSize
  end if
   end if

   mobileControlCreate "input", pName
   mobileControlSet pName, "rect", tSize -- standard for all controls
   mobileControlSet pName, "visible", "True"  -- standard for all controls
   mobileControlSet pName, "text", pContent

   if tOsType = "ios" then
  mobileControlSet pName, "alpha", "255"
  mobileControlSet pName, "backgroundColor", "240,248,255,255"
   end if

   -- Font Size
   if tHeight >60 then
 mobileControlSet pName, "fontSize", 20
  else if tHeight > 50 AND tHeight <= 60 then
 mobileControlSet pName, "fontSize", 21
  else if tHeight > 40 AND tHeight <= 50 then
 mobileControlSet pName, "fontSize", 17
  else
 mobileControlSet pName, "fontSize", 14
  end if

   mobileControlSet pName, "textAlign", "left"

   if pKeyboardType is not Empty then
  if tOsType = "ios" AND pKeyboardType = "number" OR pKeyboardType =
"numeric" then
 mobileControlSet pName, "keyboardType", "numeric"
  else
 mobileControlSet pName, "keyboardType", pKeyboardType
  end if
   else
  mobileControlSet pName, "keyboardType", "default"
   end if

   if pReturn is not Empty then
  mobileControlSet pName, "returnKeyType", pReturn
   else
  mobileControlSet pName, "returnKeyType", "default"
   end if

   if pAutoCap is not Empty then
  mobileControlSet pName, "autoCapitalizationType", pAutoCap
   else
  mobileControlSet pName, "autoCapitalizationType", "none"
   end if

   if pAutoCorrect is not Empty then
  mobileControlSet pName, "autoCorrectionType", pAutoCorrect
   else
  mobileControlSet pName, "autoCorrectionType", "default"
   end if

   -- Set the field parameters for iOS

   if tOsType = "ios" then
  mobileControlSet pName, "font", "arial"
  mobileControlSet pName, "autoFit", true
  mobileControlSet pName, "minimumFontSize", "14"
  mobileControlSet pName, "autoClear", false
  mobileControlSet pName, "borderStyle", "line"
  mobileControlSet pName, "manageReturnKey", false
  mobileControlSet pName, "keyboardStyle", &qu

RE: Android Keyboard Activation Issue

2017-01-12 Thread Livecode XAC via use-livecode
Dave,

Thank you for your response.  I'm not using multi-line text box, so that is
not an issue.

I'm currently using this command in the OpenCard to activate the field:
send "touchStart" to fld "ExerValue" on this card in 100 milliseconds 

This creates the native text input box, but doesn't bring up the keyboard.
The color of the text box changes to the color defined in the native text
box, but when you touch it a second time Android puts a orange highlight on
the text box and brings up the keyboard.  So it goes from the field not
being focused to having focus.

I also added the on keyboardDeactivated handler to the card, but that didn't
resolve the issue.

I also tried put the following in the Native Text Box Create handler.
   if tOsType = "android" then
  send "touchStart" to me in 300 milliseconds
   end if

This just resulted in the field blinking on and off and the keyboard never
coming up.  I think it was creating the Native control handler over and
over.  I need a way to send focus to the Native Control.  I have the
following at the end of my create function.

  mobileControlDo pName, "focus" -- pName is the passed name of
the control

This doesn't do anything in Android.

Any other suggestions??

Thanks
Dan


   


-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf
Of Dave Kilroy via use-livecode
Sent: Thursday, January 12, 2017 12:21 PM
To: use-revolut...@lists.runrev.com
Cc: Dave Kilroy
Subject: Re: Android Keyboard Activation Issue

Hi Dan - is your native control multi-line? If so the dictionary says
mobileControlDo multi-line text input specific actions are for iOS only.

I use a 'send' command to create native controls in the openCard handler in
500ms which works in iOS and Android. When I have more than on native input
on a card I make use of: inputFocus, mobileControlTarget, inputBeginEditing
etc.

Also I've had a problem with getting the keyboard to slide out on Android
without an extra tap so I use the following in the keyboardDeactivated
message

 if isAndroid() then
  focus on fld "fldInput1"
  focus on nothing
 end if

So it just may be that if you check exactly where the focus is before the
keyboard appears that you can cut out your extra tap...



-
"The first 90% of the task takes 90% of the time, and the last 10% takes the
other 90% of the time."
Peter M. Brigham
--
View this message in context:
http://runtime-revolution.278305.n4.nabble.com/Android-Keyboard-Activation-I
ssue-tp4711601p4711612.html
Sent from the Revolution - User mailing list archive at Nabble.com.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Android Keyboard Activation Issue

2017-01-12 Thread Dave Kilroy via use-livecode
Hi Dan - is your native control multi-line? If so the dictionary says
mobileControlDo multi-line text input specific actions are for iOS only.

I use a 'send' command to create native controls in the openCard handler in
500ms which works in iOS and Android. When I have more than on native input
on a card I make use of: inputFocus, mobileControlTarget, inputBeginEditing
etc.

Also I've had a problem with getting the keyboard to slide out on Android
without an extra tap so I use the following in the keyboardDeactivated
message

 if isAndroid() then
  focus on fld "fldInput1"
  focus on nothing
 end if

So it just may be that if you check exactly where the focus is before the
keyboard appears that you can cut out your extra tap...



-
"The first 90% of the task takes 90% of the time, and the last 10% takes the 
other 90% of the time."
Peter M. Brigham 
--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Android-Keyboard-Activation-Issue-tp4711601p4711612.html
Sent from the Revolution - User mailing list archive at Nabble.com.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


RE: Android Keyboard Activation Issue

2017-01-12 Thread Livecode XAC via use-livecode
Andrew,

I'm doing the same type of thing, but because I have multiple input fields
on the card, I send the inputCreateTSM when the user selects the field.

Here is the function that I'm using to create the Native Control when the
field is selected.


on inputCreatorWide pName, pFld, pContent, pKeyboardType, pAutoCap,
pAutoCorrect, pReturn, pDataDetect
   
   if environment() is not "mobile" then exit inputCreatorWide
   
   put the uOS of this stack into tOsType
   
   if tOsType = "android" then
  get inputCleanUp()
   end if
  
   if pFld contains "stack" then   -- removed the stack part of the field
identifier
  put wordOffset("stack",pFld) into tWord
  put word 1 to (tWord -2) of pFld into pFld
   end if
   
   get setInputFieldName( pFld )  -- Save the active Input Field
   
   get moveToVisibleArea( pFld )-- Make sure the field is within the
visible area of the display.

   put the rect of pFld into tSize   
   put the height of pFld into tHeight
   put the width of pFld into tWidth
   
   if tOsType = "android" then
  set the itemdel to ","
  add (tHeight/2) to item 4 of tSize -- Increase the field size
  if tWidth < 50 then
 add (100 - tWidth) to item 3 of tSize
  end if
   end if
   
   mobileControlCreate "input", pName
   mobileControlSet pName, "rect", tSize -- standard for all controls
   mobileControlSet pName, "visible", "True"  -- standard for all controls
   mobileControlSet pName, "text", pContent
   
   if tOsType = "ios" then
  mobileControlSet pName, "alpha", "255"
  mobileControlSet pName, "backgroundColor", "240,248,255,255"
   end if
   
   -- Font Size
   if tHeight >60 then
 mobileControlSet pName, "fontSize", 20
  else if tHeight > 50 AND tHeight <= 60 then
 mobileControlSet pName, "fontSize", 21
  else if tHeight > 40 AND tHeight <= 50 then
 mobileControlSet pName, "fontSize", 17
  else
 mobileControlSet pName, "fontSize", 14
  end if
   
   mobileControlSet pName, "textAlign", "left"
   
   if pKeyboardType is not Empty then 
  if tOsType = "ios" AND pKeyboardType = "number" OR pKeyboardType =
"numeric" then
 mobileControlSet pName, "keyboardType", "numeric"
  else
 mobileControlSet pName, "keyboardType", pKeyboardType
  end if 
   else
  mobileControlSet pName, "keyboardType", "default"
   end if
   
   if pReturn is not Empty then 
  mobileControlSet pName, "returnKeyType", pReturn
   else
  mobileControlSet pName, "returnKeyType", "default"
   end if
   
   if pAutoCap is not Empty then 
  mobileControlSet pName, "autoCapitalizationType", pAutoCap
   else
  mobileControlSet pName, "autoCapitalizationType", "none"
   end if
   
   if pAutoCorrect is not Empty then 
  mobileControlSet pName, "autoCorrectionType", pAutoCorrect
   else
  mobileControlSet pName, "autoCorrectionType", "default"
   end if
  
   -- Set the field parameters for iOS
   
   if tOsType = "ios" then
  mobileControlSet pName, "font", "arial"
  mobileControlSet pName, "autoFit", true
  mobileControlSet pName, "minimumFontSize", "14"
  mobileControlSet pName, "autoClear", false
  mobileControlSet pName, "borderStyle", "line"
  mobileControlSet pName, "manageReturnKey", false
  mobileControlSet pName, "keyboardStyle", "default"
  mobileControlSet pName, "clearButtonMode", "unless editing"
   end if
  
   -- Focus on the Control
   mobileControlDo pName, "focus"     -- actually focus on the field
so the keyboard pops up
   
end inputCreatorWide


Mine is more complex, but for some reason it will not bring up the Keyboard
on Android, but does on iOS.
Is the same behavior you are seeing?

Thanks for the response
Dan

-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf
Of Andrew Bell via use-livecode
Sent: Thursday, January 12, 2017 10:48 AM
To: use-livecode@lists.runrev.com
Cc: and...@midwestcoastmedia.com
Subject: Re: Android Keyboard Activation Issue

Here is a card script I'm currently using that seems to work in an
iOS/Android app I have now:

on preOpenCard
   inputCreateTsm
end preOpenCard

on inputCreateTSM
put the rect of graphic "tsmRectangle" into tThisRect
# do some math to visually accommodate a roundedRect with innerShadow
add 15 to item 1 of tThisRect

Re: Android Keyboard Activation Issue

2017-01-12 Thread Andrew Bell via use-livecode
Here is a card script I'm currently using that seems to work in an  
iOS/Android app I have now:


on preOpenCard
  inputCreateTsm
end preOpenCard

on inputCreateTSM
   put the rect of graphic "tsmRectangle" into tThisRect
   # do some math to visually accommodate a roundedRect with innerShadow
   add 15 to item 1 of tThisRect
   subtract 10 from item 3 of tThisRect
   mobileControlCreate "input", "TSMinput"
   mobileControlSet "TSMinput", "rect", tThisRect
   mobileControlSet "TSMinput", "text", line 1 of gCurrentPrefs
   mobileControlSet "TSMinput", "keyboardType", "number"
   mobileControlSet "TSMinput", "fontSize", 21
   mobileControlSet "TSMinput", "fontName", "Roboto Light" -- iOS only
   mobileControlSet "TSMinput", "textAlign", "center"
   mobileControlSet "TSMinput", "visible", true
   # make sure the field has focus, which activates the keyboard
   mobileControlDo "TSMinput", "focus"
end inputCreateTSM


on closeCard
   # delete the native text input
   mobileControlDelete "TSMinput"
end closeCard




Date: Thu, 12 Jan 2017 03:44:19 +
From: "Daniel Pierce" <dpie...@xpertassist.com>
To: "'Daniel Pierce via use-livecode'" <use-livecode@lists.runrev.com>
Subject: Android Keyboard Activation Issue
Message-ID:

<0101015990c6b871-5fd4abdc-5e55-49b8-9a80-9c172ffe6fee-000...@us-west-2.amazonses.com>

Content-Type: text/plain;   charset="us-ascii"

List,

I have developed a cross platform mobile app for iOS and Android using
LiveCode and it is working OK, but I continue to get a common complaint from
Android users that when they select a field the keyboard does not activate
like on other apps.

This is not an issue on iOS because a when you create the Native Text Box,
you can send the command mobileControlDo  "focus" and the keyboard is
activated with a single touch to the text entry field.

Android doesn't support this capability so the users needs to touch the
field to activate the Native Text Box and then touch it again to bring up
the keyboard.

Has anyone found a way to bring up the virtual keyboard when the Native Text
Box has been created

Thanks for your advice.
Dan




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Android Keyboard Activation Issue

2017-01-11 Thread Daniel Pierce via use-livecode
List,
 
I have developed a cross platform mobile app for iOS and Android using
LiveCode and it is working OK, but I continue to get a common complaint from
Android users that when they select a field the keyboard does not activate
like on other apps.   
 
This is not an issue on iOS because a when you create the Native Text Box,
you can send the command mobileControlDo  "focus" and the keyboard is
activated with a single touch to the text entry field.
 
Android doesn't support this capability so the users needs to touch the
field to activate the Native Text Box and then touch it again to bring up
the keyboard.
 
Has anyone found a way to bring up the virtual keyboard when the Native Text
Box has been created
 
Thanks for your advice.
Dan
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode