From wiki.ginstr.com
Jump to: navigation, search
Line 292: Line 292:
  
 
===gn:maxLines===
 
===gn:maxLines===
| title="Description" | Sets maximum lines for <code>[http://developer.android.com/reference/android/widget/EditText.html EditText]</code>
+
Sets maximum lines for <code>[http://developer.android.com/reference/android/widget/EditText.html EditText]</code>
  
 
''(Integer)'' values i.e. = <code>1</code>, <code>2</code>, <code>4</code>, ...
 
''(Integer)'' values i.e. = <code>1</code>, <code>2</code>, <code>4</code>, ...
  
 
===gn:noServiceOnUpdate===
 
===gn:noServiceOnUpdate===
| title="Description" | Prevents content update if <code>[http://developer.android.com/reference/android/widget/EditText.html EditText]</code> contains some data
+
Prevents content update if <code>[http://developer.android.com/reference/android/widget/EditText.html EditText]</code> contains some data
  
 
values = <code>none</code>
 
values = <code>none</code>
Line 304: Line 304:
 
If present prevents user from focusing widget and entering data
 
If present prevents user from focusing widget and entering data
  
values = <code>none</code>
+
Values = <code>none</code>
  
 
===gn:nfcRequired===
 
===gn:nfcRequired===
Line 333: Line 333:
 
! scope="col" | Description
 
! scope="col" | Description
 
|-
 
|-
| title="Value" | <code>true</code>=
+
| title="Value" | <code>true</code>
 
| title="Description" | Displays widget. (NFC) click in control is necessary for NFC to work on this field
 
| title="Description" | Displays widget. (NFC) click in control is necessary for NFC to work on this field
 
|-
 
|-
Line 351: Line 351:
 
Reading will be ignored and will only work if NFC with same id is read twice in a row within time defined by <code>[[#gn:nfcReadingsInterval]]</code>. If set to <code>false</code> then different id tags will produce same behaviour
 
Reading will be ignored and will only work if NFC with same id is read twice in a row within time defined by <code>[[#gn:nfcReadingsInterval]]</code>. If set to <code>false</code> then different id tags will produce same behaviour
  
(Boolean) values = <code>true</code>, <code>false</code>
+
''(Boolean)'' values = <code>true</code>, <code>false</code>
  
 
===gn:nfcReadingGetAdditionalInfo===
 
===gn:nfcReadingGetAdditionalInfo===
Line 360: Line 360:
  
 
''(String)'' value = <code>embedded</code>
 
''(String)'' value = <code>embedded</code>
 +
 +
===android:background===
 +
Sets the background image for the element
 +
 +
''(String)'' value = <code>@drawable/nameOfResource</code>,
 +
::i.e. <code>@drawable/imageOne</code> the image resource has to be set inside of drawable folder (read more [[Ginstr_app#Drawable|here]])
 +
 +
===gn:inputType===
 +
Defines the input mode for the keyboard which appears on the screen. For example setting the input type to <code>number</code> will display a numeric keyboard when user taps on this <code>[[GnEditText]]</code>.
 +
 +
Input types and combinations supported:
 +
 +
{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
 +
|-
 +
! scope="col" | Input Type
 +
! scope="col" | Description
 +
|-
 +
| title="Input Type" | <code>TYPE_CLASS_NUMBER</code>
 +
| title="Description" | allows “0123456789” characters to be entered
 +
|-
 +
| title="Input Type" | <code>TYPE_CLASS_NUMBER|TYPE_NUMBER_FLAG_SIGNED|TYPE_NUMBER_FLAG_DECIMAL</code>
 +
| title="Description" | allows "0123456789.,-" to be entered
 +
|-
 +
| title="Input Type" | <code>TYPE_CLASS_NUMBER|TYPE_NUMBER_FLAG_SIGNED</code>
 +
| title="Description" | allows "0123456789-" to be entered
 +
|-
 +
| title="Input Type" | <code>TYPE_NUMBER_FLAG_DECIMAL</code>
 +
| title="Description" | allows "0123456789.," to be entered
 +
|-
 +
| title="Input Type" | <code>TYPE_CLASS_PHONE</code>
 +
| title="Description" | allows “0123456789+” and opens numerical keyboard
 +
|}
 +
 +
===android:textColorHint===
 +
Used to change the hint color when <code>[[#gn:s_hint]]</code> is set
 +
 +
===gn:useEntry===
 +
This attribute is only used when <code>[[#gn:s_sourceType]]</code> is set to <code>serial</code>. If this attribute is set the widget will display a button and entry field where a user can type “IMEI” and retrieve serial. If the field is omitted then only the entry field is displayed and the value is retrieve automatically for the current device
 +
 +
===gn:nfcIntSequence===
 +
Defines internal sequence of processing NFC scans when more then one NFC widget on screen is receiving NFC scan event. This is an alternative to chain mode NFC scanning
 +
 +
===gn:isMasked===
 +
When set the content of <code>[http://developer.android.com/reference/android/widget/EditText.html EditText]</code> gets masked with password artefacts
 +
 +
''(Boolean)'' values = <code>true</code>, <code>false</code>
 +
 +
===gn:decimalFormat===
 +
If <code>[[GnEditText]]</code> is target of calculation, set this attribute to change format of result. By default format is set to <code>0.00</code> which will show calculation result as i.e. <code>2.13</code>, <code>121.67</code>,…
 +
Please check format available on this [http://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html link] (under heading “Special Pattern Characters”).
 +
 +
===gn:paddingLeft===
 +
If set, padding provides ability to define internal space between text and left outer edge of the control.
 +
 +
Use of measuring unit with value is obligatory
 +
 +
''(String)'' value = <code>12dp</code>, <code>1dp</code>, etc...
 +
 +
===gn:paddingRight===
 +
If set, padding provides ability to define internal space between text and right outer edge of the control.
 +
 +
Use of measuring unit with value is obligatory
 +
 +
''(String)'' value = <code>12dp</code>, <code>1dp</code>, etc...
 +
 +
===gn:paddingBottom===
 +
If set, padding provides ability to define internal space between text and bottom outer edge of the control.
 +
 +
Use of measuring unit with value is obligatory
 +
 +
''(String)'' value = <code>12dp</code>, <code>1dp</code>, etc...
 +
 +
===gn:paddingTop===
 +
If set, padding provides ability to define internal space between text and top outer edge of the control.
 +
 +
Use of measuring unit with value is obligatory
 +
 +
''(String)'' value = <code>12dp</code>, <code>1dp</code>, etc...
 +
 +
===gn:nfcActionLostFocus===
 +
If attribute is set to <code>true</code> it will trigger <code>[[gn:act_setOnNfc]]</code> when focus on <code>[[GnEditText]]</code> is lost
 +
 +
''(Boolean)'' values = <code>true</code>, <code>false</code>
 +
 +
===gn:s_customLayoutXml===
 +
If set it should point  to an XML file in '''“control”''' folder of ginstr app
 +
 +
''(String)'' : <code>someXmlLayoutName.xml</code>
 +
 +
More details in [[#Alternative layout]]
 +
 +
===gn:trimDecimalPlaces===
 +
If attribute is <code>true</code>, decimal value will be trimmed from widget when data is gathered from it
 +
 +
''(Boolean)'' value : <code>true</code>
 +
 +
===gn:actionSetOnFocusLost===
 +
In order to activate on focus lost attribute triggering this attribute has to be set to <code>true</code>
 +
 +
''(Boolean)'' value : <code>true</code>
 +
 +
===gn:setOnFocusLost===
 +
Action set which executes once focus is lost on <code>[[GnEditText]]</code>
 +
 +
===gn:autoLoadTimestamp===
 +
Prevents autoloading timestamp when widget with <code>gn:s_sourceType=”time”</code> is loaded on screen
 +
 +
''(Boolean)'' value : <code>false</code>
 +
 +
===gn:data_type===
 +
Defines datatype of widget
 +
 +
===gn:typingTimeInterval===
 +
Represents  number of seconds after <code>[[gn:act_setOnTypingEnd]]</code> will be executed
 +
 +
===gn:autoLoadLocation===
 +
When set to <code>false</code>and widget is set to type <code>"GPS"</code> it disables auto loading of GPS location when screen is loaded. In this case GPS information will have to be loaded from database or <code>[[gn:act_reloadAutofilledWidgets]]</code> will have to be called to resolve current location
 +
 +
===gn:autoAdjustHeight===
 +
When set changes behaviour of input field. When input field has no content it is stretched to show entire hint text. As soon as text is entered into field height of field shrinks to size of inputted text,
 +
 +
''(Boolean)'' value : <code>true</code>
 +
 +
===gn:gpsPrecision===
 +
Used in combination with <code>[[#gn:s_sourceType]]="gps"</code> and <code>if [[#gn:gpsPrecision]] = “true”</code> to ensure that only real gps data will be used
 +
|}
 +
 +
==Alternative layout==
 +
Alternative layout can be set into control folder. It can have any name and end with .xml and it has to have XML structure.
 +
 +
It has to contain two widgets with following ids:
 +
;<code>[http://developer.android.com/reference/android/widget/EditText.html EditText]</code> <code>@+id/enEditText</code> : this represents input field for data
 +
<code>[http://developer.android.com/reference/android/widget/Button.html Button]</code> <code>@+id/enEditTextButton</code> : this button is visible in certain configurations like when widget has <code>gn:s_sourceType="qr"</code>
 +
The rest of the widgets and attributes in this XML structure can be defined as it’s needed, there is no constraints.
 +
 +
==NFC scan modes==
 +
This option is only available on <code>GnEditText</code> when the widget has the mode set to “NFC”. NFC scan modes that are only relevant when there is more than one widget on screen that has <code>gn:s_sourceType=“nfc“</code>.
 +
 +
There are two modes of scanning available:
 +
 +
#[[#Chain mode NFC scanning|Chain mode NFC scanning]]
 +
#[[#Focus mode NFC scanning|Focus mode NFC scanning]]
 +
 +
====Chain mode NFC scanning====
 +
Chain mode scanning means that the widget can be set in a chain and scanned one after another without the need of a user to click into each widget every time a scan is performed.
 +
 +
Two attributes were added:
 +
;<code>gn:nfcStartSequence</code> : once screen is loaded it defines the first widget into which data will be set after an NFC scan is performed and its value sets the target for the next scan
 +
;<code>gn:nfcSequence</code> : every widget that is in the scanning chain but it’s not the starting widget should have this attribute to define the next target where data will be saved in next NFC scan
 +
;<code>gn:typingTimeInterval</code> : represents a time from last <code>GnEditText</code> value change (in ms) after <code>gn:act_setOnTypingEnd</code> event will be raised
 +
;<code>gn:act_setOnTypingEnd</code> : event raised after <code>gn:typingTimeInterval</code> is passed
 +
i.e.<source lang="xml"><GnEditText
 +
      android:id=“@+id/firstWidget“
 +
      gn:nfcStartSequence=“@+id/secondWidget“
 +
    .../>
 +
<GnEditText
 +
      android:id=“@+id/secondWidget“
 +
      gn:nfcSequence=“@+id/firstWidget“
 +
    .../>
 +
</source>
 +
 +
Also notice in example that in <code>gn:nfcSequence=“@+id/firstWidget“</code> is set. This is called circular chain of NFC scans, it means that when the last widget in the chain is scanned it will jump back to first widget on the screen. When a circular chain is made you do not need to reload screen to restart NFC scans.
 +
 +
If there is no circular chain once the last NFC tag in a chain is scanned and there is no next target every new scan will set data in the last widget in chain.
 +
 +
====Focus mode NFC scanning====
 +
Once the screen is loaded if there is an NFC chain it is active. As soon as a widget is clicked on the chain is broken and only the focus mode scanning will work. This means that the widget in which the pointer is blinking (last tapped widget) will receive the results of the next NFC scan.
 +
 +
The only way to enable the chain scanning mode is to reload the screen where the chain exists.
 +
 +
==imeOptions==
 +
<code>imeOptions</code> define keyboard functionality that will be valid when options are enabled upon that <code>GnEditText</code>.
 +
 +
To activate <code>imeOptions</code> on a <code>GnEditText</code> attribute <code>“gn:imeOptions”</code> has to be set.
 +
 +
There are four action types of <code>imeOptions</code>:
 +
#[[#actionGo|actionGo]]
 +
#[[#actionSend|actionSend]]
 +
#[[#actionNext|actionNext]]
 +
#[[#actionDone|actionDone]]
 +
 +
===actionGo===
 +
When action go is set on <code>GnEditText</code> it is necessary to add another attribute <code>“gn:imeActionGo”</code>. The <code>imeActionGo</code> defines target layout that will be opened by pressing the <code>“enter/go”</code> key on a virtual keyboard.
 +
i.e.<source lang="xml">gn:imeOptions="actionGo"
 +
gn:imeActionGo="@+id/targetRootLayout"</source>
 +
 +
 +
===actionSend===
 +
When action sent is set on <code>GnEditText<code> it is necessary to add another attribute to <code>GnEditText<code> <code>“gn:imeActionSend”</code> action send defines action or action set that will get executed when the keyboard button enter/go is pressed.
 +
i.e.<source lang="xml">gn:imeOptions="actionSend"
 +
gn:imeActionSend="[action]|[action values],..."</source>
 +
 +
 +
===actionNext===
 +
When action next is set on <code>GnEditText</code> it is necessary to add another attribute to <code>GnEditText “gn:imeActionNext”</code>. Action next will take user to the next field that accepts text on pressing enter/go on keyboard. Options to navigate to the next fields are: <code>FOCUS_UP</code>, <code>FOCUS_DOWN</code>, <code>FOCUS_LEFT</code>, <code>FOCUS_RIGHT</code>, <code>FOCUS_BACKWARD</code>, <code>FOCUS_FORWARD</code>.
 +
i.e.<source lang="xml">gn:imeOptions="actionNext"
 +
gn:imeActionNext="FOCUS_DOWN"</source>
 +
 +
 +
===actionDone===
 +
<code>actionDone</code> will hide the keyboard when enter/go on virtual keyboard is pressed.
 +
i.e.<source lang="xml">gn:imeOptions=“actionDone”</source>

Revision as of 08:21, 24 June 2016

Inherited classes
View
Android class type
LinearLayout
Child elements
EditText, Button
Widget XML tag
<com.ginstr.widgets.GnEditText>


GnEditText is a multi-source EditText. It’s used to enter text data or acquire it from other sources.

Other sources are:

  • NFC
  • QR

Layout Configuration

Attribute Description
#gn:s_sourceType* Defines source type (keyboard input, NFC, QR, GPS, serial, time etc...)
#gn:qrCameraRequired Checks if camera is required
#gn:showAddress Sets GPS data type displayed in EditText
#gn:typeface Sets font for child EditText
#gn:s_text Sets text into EditText
#gn:s_hint Sets text hint into EditText
#gntextstyle Sets style for child EditText
#gn:background Sets background color for child EditText
#gn:textColor Sets font color for child EditText
#gn:textsize Sets font size for child EditText
#gn:s_nfcAlertType Sets alert type when NFC is scanned
#gn:s_gravity Sets the gravity of EditText content, this means text alignment within widget
#gn:minLines Sets minimum lines for EditText
#gn:maxLines Sets maximum lines for EditText
#gn:noServiceOnUpdate Prevents content update if EditText contains some data
#gn:focusable If present prevents user from focusing widget and entering data
#gn:nfcRequired Checks if NFC is required
#gn:Visible Shows or hides widget
#gn:nfcReadingsInterval Sets reading interval for NFC,
#gn:nfcReadingIntervalForSameContent Reading will be ignored and will only work if NFC with same id is read twice in a row within time defined by #gn:nfcReadingsInterval
#gn:nfcReadingGetAdditionalInfo Returns additional information about tag
#gn:s_nfcContentType When NFC is read instead of the ID the embedded content of NFC tag is read
#android:background Sets the background image for the element
#gn:inputType Defines the input mode for the keyboard which appears on the screen
#android:textColorHint Used to change the hint color when #gn:s_hint is set
#gn:useEntry Displays a button and entry field where a user can type “IMEI” and retrieve serial
#gn:nfcIntSequence Defines internal sequence of processing NFC scans when more then one NFC widget on screen is receiving NFC scan event
#gn:isMasked Masks the content of EditText gets with password artefacts
#gn:decimalFormat If GnEditText is target of calculation, set this attribute to change format of result
#gn:paddingLeft Defines internal space between text and left outer edge of the control
#gn:paddingRight Defines internal space between text and right outer edge of the control
#gn:paddingBottom Defines internal space between text and bottom outer edge of the control
#gn:paddingTop Defines internal space between text and top outer edge of the control
#gn:nfcActionLostFocus Triggers gn:act_setOnNfc when focus on GnEditText is lost
#gn:s_customLayoutXml Points to an XML file in “control” folder of ginstr app
#gn:trimDecimalPlaces Decimal value will be trimmed from widget when data is gathered from it
#gn:actionSetOnFocusLost Activates on focus lost attribute triggering
#gn:setOnFocusLost Action set which executes once focus is lost on GnEditText
#gn:autoLoadTimestamp Prevents autoloading timestamp
#gn:data_type Defines datatype of widget
#gn:typingTimeInterval Represents number of seconds after gn:act_setOnTypingEnd will be executed
#gn:autoLoadLocation Disables auto loading of GPS location when screen is loaded
#gn:autoAdjustHeight Changes behavior of input field
#gn:gpsPrecision Used in combination with #gn:s_sourceType="gps" and if #gn:gpsPrecision = “true” to ensure that only real gps data will be used

gn:s_sourceType

Defines source type

(String) values = input, NFC, QR, GPS, wifi, bt, serial

Value Description
input (default) Standard input via an on screen keyboard
NFC Input via a keyboard or by scanning a NFC tag. If there are multiple fields in same screen click on one to set active before scanning
QR Displays QR scan child button. Input via a keyboard or by selecting the button which will launch scanning application
GPS displays GPS location, there can be multiple GPS widgets on the same screen (related to attribute #gn:showAddress)
serial Displays serial number generated from IMEI. If attribute gn:useEntry is present then it will look for serial based on IMEI number provided in widget otherwise it will get IMEI from the device
time Displays current date time in milliseconds in widget
agversion Sets current ag version in the GnEditText on load of screen
aguser Sets current logged ag user into GnEditText widget on load of screen
wifi Displays WiFi fingerprint, there can be multiple WiFi fingerprint widgets on the same screen
gsm Displays GSM fingerprint, there can be multiple GSM fingerprint widgets on the same screen
bt Displays Bluetooth fingerprint, there can be multiple Bluetooth fingerprint widgets on the same screen

gn:qrCameraRequired

Checks if camera is required

(Boolean) values = true, false

Value Description
true= (Relevant for QR sourceType) if device doesn’t have a camera it shows error dialog
false (Relevant for QR sourceType) it will check for camera and if none is present it will only disable child button for scan and leave option for manual entry

gn:showAddress

Sets GPS data type displayed in EditText

(Boolean) values = true, false

Value Description
true= (Relevant for GPS sourceType) shows address of GPS location in EditText field
false (Relevant for GPS sourceType) shows coordinates of GPS location in EditText field

gn:typeface

Sets font for child EditText

(String) values = sans, serif, monospace

gn:s_text

Sets text into EditText

(String) values = text or @string/resourceId

gn:s_hint

Sets text hint into EditText

(String) values = text or @string/resourceId

gntextstyle

Sets style for child EditText

(String) values = normal, bold, italic

gn:background

Sets background color for child EditText

(Hex) values i.e. = #000000 (hex color value)

gn:textColor

Sets font color for child EditText

(Hex) values i.e. = #000000 (hex color value)

gn:textsize

Sets font size for child EditText

(Dimension) value i.e. = 10dp or 10sp

gn:s_nfcAlertType

Sets alert type when NFC is scanned

Value Description
vibrate= Phone will vibrate with a NFC scan
sound Phone will play a sound with a NFC scan

gn:s_gravity

Sets the gravity of EditText content, this means text alignment within widget

(String) value i.e. = CENTER, CENTER_HORIZONTAL

gn:minLines

Sets minimum lines for EditText

(Integer) values i.e. = 1, 2, 4, ...

gn:maxLines

Sets maximum lines for EditText

(Integer) values i.e. = 1, 2, 4, ...

gn:noServiceOnUpdate

Prevents content update if EditText contains some data

values = none

gn:focusable

If present prevents user from focusing widget and entering data

Values = none

gn:nfcRequired

Checks if NFC is required

(Boolean) values = true, false

Value Description
true= (Relevant for NFC sourceType) if not present it shows error dialog, if present but turned off shows dialog to open Android settings NFC screen
false (Relevant for NFC sourceType) does not check for NFC hardware

gn:Visible

Shows or hides widget

(Boolean) values = true, false

Value Description
true Displays widget. (NFC) click in control is necessary for NFC to work on this field
false Hides widget. (NFC) control gets autofocus for NFC,

IMPORTANT : there can be only one GnEditText on layout with this attribute false and sourceType nfc

gn:nfcReadingsInterval

Sets reading interval for NFC, if less time than defined has passed a message will be shown and reading ignored

(Integer) value = 1, 2, 5, …

If multiple widget use NFC each one has its own individual timer

gn:nfcReadingIntervalForSameContent

Reading will be ignored and will only work if NFC with same id is read twice in a row within time defined by #gn:nfcReadingsInterval. If set to false then different id tags will produce same behaviour

(Boolean) values = true, false

gn:nfcReadingGetAdditionalInfo

Returns additional information about tag

gn:s_nfcContentType

When NFC is read instead of the ID the embedded content of NFC tag is read

(String) value = embedded

android:background

Sets the background image for the element

(String) value = @drawable/nameOfResource,

i.e. @drawable/imageOne the image resource has to be set inside of drawable folder (read more here)

gn:inputType

Defines the input mode for the keyboard which appears on the screen. For example setting the input type to number will display a numeric keyboard when user taps on this GnEditText.

Input types and combinations supported:

Input Type Description
TYPE_CLASS_NUMBER allows “0123456789” characters to be entered
TYPE_CLASS_NUMBER|TYPE_NUMBER_FLAG_SIGNED|TYPE_NUMBER_FLAG_DECIMAL allows "0123456789.,-" to be entered
TYPE_CLASS_NUMBER|TYPE_NUMBER_FLAG_SIGNED allows "0123456789-" to be entered
TYPE_NUMBER_FLAG_DECIMAL allows "0123456789.," to be entered
TYPE_CLASS_PHONE allows “0123456789+” and opens numerical keyboard

android:textColorHint

Used to change the hint color when #gn:s_hint is set

gn:useEntry

This attribute is only used when #gn:s_sourceType is set to serial. If this attribute is set the widget will display a button and entry field where a user can type “IMEI” and retrieve serial. If the field is omitted then only the entry field is displayed and the value is retrieve automatically for the current device

gn:nfcIntSequence

Defines internal sequence of processing NFC scans when more then one NFC widget on screen is receiving NFC scan event. This is an alternative to chain mode NFC scanning

gn:isMasked

When set the content of EditText gets masked with password artefacts

(Boolean) values = true, false

gn:decimalFormat

If GnEditText is target of calculation, set this attribute to change format of result. By default format is set to 0.00 which will show calculation result as i.e. 2.13, 121.67,… Please check format available on this link (under heading “Special Pattern Characters”).

gn:paddingLeft

If set, padding provides ability to define internal space between text and left outer edge of the control.

Use of measuring unit with value is obligatory

(String) value = 12dp, 1dp, etc...

gn:paddingRight

If set, padding provides ability to define internal space between text and right outer edge of the control.

Use of measuring unit with value is obligatory

(String) value = 12dp, 1dp, etc...

gn:paddingBottom

If set, padding provides ability to define internal space between text and bottom outer edge of the control.

Use of measuring unit with value is obligatory

(String) value = 12dp, 1dp, etc...

gn:paddingTop

If set, padding provides ability to define internal space between text and top outer edge of the control.

Use of measuring unit with value is obligatory

(String) value = 12dp, 1dp, etc...

gn:nfcActionLostFocus

If attribute is set to true it will trigger gn:act_setOnNfc when focus on GnEditText is lost

(Boolean) values = true, false

gn:s_customLayoutXml

If set it should point to an XML file in “control” folder of ginstr app

(String) : someXmlLayoutName.xml

More details in #Alternative layout

gn:trimDecimalPlaces

If attribute is true, decimal value will be trimmed from widget when data is gathered from it

(Boolean) value : true

gn:actionSetOnFocusLost

In order to activate on focus lost attribute triggering this attribute has to be set to true

(Boolean) value : true

gn:setOnFocusLost

Action set which executes once focus is lost on GnEditText

gn:autoLoadTimestamp

Prevents autoloading timestamp when widget with gn:s_sourceType=”time” is loaded on screen

(Boolean) value : false

gn:data_type

Defines datatype of widget

gn:typingTimeInterval

Represents number of seconds after gn:act_setOnTypingEnd will be executed

gn:autoLoadLocation

When set to falseand widget is set to type "GPS" it disables auto loading of GPS location when screen is loaded. In this case GPS information will have to be loaded from database or gn:act_reloadAutofilledWidgets will have to be called to resolve current location

gn:autoAdjustHeight

When set changes behaviour of input field. When input field has no content it is stretched to show entire hint text. As soon as text is entered into field height of field shrinks to size of inputted text,

(Boolean) value : true

gn:gpsPrecision

Used in combination with #gn:s_sourceType="gps" and if #gn:gpsPrecision = “true” to ensure that only real gps data will be used |}

Alternative layout

Alternative layout can be set into control folder. It can have any name and end with .xml and it has to have XML structure.

It has to contain two widgets with following ids:

EditText @+id/enEditText 
this represents input field for data

Button @+id/enEditTextButton : this button is visible in certain configurations like when widget has gn:s_sourceType="qr" The rest of the widgets and attributes in this XML structure can be defined as it’s needed, there is no constraints.

NFC scan modes

This option is only available on GnEditText when the widget has the mode set to “NFC”. NFC scan modes that are only relevant when there is more than one widget on screen that has gn:s_sourceType=“nfc“.

There are two modes of scanning available:

  1. Chain mode NFC scanning
  2. Focus mode NFC scanning

Chain mode NFC scanning

Chain mode scanning means that the widget can be set in a chain and scanned one after another without the need of a user to click into each widget every time a scan is performed.

Two attributes were added:

gn:nfcStartSequence 
once screen is loaded it defines the first widget into which data will be set after an NFC scan is performed and its value sets the target for the next scan
gn:nfcSequence 
every widget that is in the scanning chain but it’s not the starting widget should have this attribute to define the next target where data will be saved in next NFC scan
gn:typingTimeInterval 
represents a time from last GnEditText value change (in ms) after gn:act_setOnTypingEnd event will be raised
gn:act_setOnTypingEnd 
event raised after gn:typingTimeInterval is passed

i.e.<source lang="xml"><GnEditText

     android:id=“@+id/firstWidget“
     gn:nfcStartSequence=“@+id/secondWidget“ 
    .../>

<GnEditText

     android:id=“@+id/secondWidget“
     gn:nfcSequence=“@+id/firstWidget“ 
    .../>

</source>

Also notice in example that in gn:nfcSequence=“@+id/firstWidget“ is set. This is called circular chain of NFC scans, it means that when the last widget in the chain is scanned it will jump back to first widget on the screen. When a circular chain is made you do not need to reload screen to restart NFC scans.

If there is no circular chain once the last NFC tag in a chain is scanned and there is no next target every new scan will set data in the last widget in chain.

Focus mode NFC scanning

Once the screen is loaded if there is an NFC chain it is active. As soon as a widget is clicked on the chain is broken and only the focus mode scanning will work. This means that the widget in which the pointer is blinking (last tapped widget) will receive the results of the next NFC scan.

The only way to enable the chain scanning mode is to reload the screen where the chain exists.

imeOptions

imeOptions define keyboard functionality that will be valid when options are enabled upon that GnEditText.

To activate imeOptions on a GnEditText attribute “gn:imeOptions” has to be set.

There are four action types of imeOptions:

  1. actionGo
  2. actionSend
  3. actionNext
  4. actionDone

actionGo

When action go is set on GnEditText it is necessary to add another attribute “gn:imeActionGo”. The imeActionGo defines target layout that will be opened by pressing the “enter/go” key on a virtual keyboard. i.e.<source lang="xml">gn:imeOptions="actionGo" gn:imeActionGo="@+id/targetRootLayout"</source>


actionSend

When action sent is set on GnEditText it is necessary to add another attribute to GnEditText “gn:imeActionSend” action send defines action or action set that will get executed when the keyboard button enter/go is pressed. i.e.<source lang="xml">gn:imeOptions="actionSend" gn:imeActionSend="[action]|[action values],..."</source>


actionNext

When action next is set on GnEditText it is necessary to add another attribute to GnEditText “gn:imeActionNext”. Action next will take user to the next field that accepts text on pressing enter/go on keyboard. Options to navigate to the next fields are: FOCUS_UP, FOCUS_DOWN, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_BACKWARD, FOCUS_FORWARD. i.e.<source lang="xml">gn:imeOptions="actionNext" gn:imeActionNext="FOCUS_DOWN"</source>


actionDone

actionDone will hide the keyboard when enter/go on virtual keyboard is pressed. i.e.<source lang="xml">gn:imeOptions=“actionDone”</source>