m (→NFC scan modes) |
m |
||
Line 13: | Line 13: | ||
*QR | *QR | ||
− | == | + | ==XML Attributes Description== |
Note: An attribute marked with asterisk (<span style="color:#FF0000">*</span>) is a mandatory parameter when creating widget. | Note: An attribute marked with asterisk (<span style="color:#FF0000">*</span>) is a mandatory parameter when creating widget. | ||
Line 154: | Line 154: | ||
|} | |} | ||
− | ===gn:s_sourceType=== | + | ==Alternative layout== |
+ | Alternative layout can be set into control folder. It can have any name ending with ".xml" and it must have valid XML structure. | ||
+ | |||
+ | It must 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 required, there are no constraints. | ||
+ | |||
+ | ==NFC scan modes== | ||
+ | This option is only available on <code>GnEditText</code> when the widget has the mode set to <code>“NFC”</code>. | ||
+ | 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> | ||
+ | |||
+ | <code>actionSend</code> 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>. | ||
+ | |||
+ | <code>actionNext</code> 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> | ||
+ | |||
+ | ==gn:s_sourceType== | ||
Defines source type | Defines source type | ||
Line 199: | Line 281: | ||
|} | |} | ||
− | + | ==gn:qrCameraRequired== | |
Checks if camera is required | Checks if camera is required | ||
Line 216: | Line 298: | ||
|} | |} | ||
− | + | ==gn:showAddress== | |
Sets GPS data type displayed in <code>[http://developer.android.com/reference/android/widget/EditText.html EditText]</code> | Sets GPS data type displayed in <code>[http://developer.android.com/reference/android/widget/EditText.html EditText]</code> | ||
Line 233: | Line 315: | ||
|} | |} | ||
− | + | ==gn:typeface== | |
Sets font for child <code>[http://developer.android.com/reference/android/widget/EditText.html EditText]</code> | Sets font for child <code>[http://developer.android.com/reference/android/widget/EditText.html EditText]</code> | ||
''(String)'' values = <code>sans</code>, <code>serif</code>, <code>monospace</code> | ''(String)'' values = <code>sans</code>, <code>serif</code>, <code>monospace</code> | ||
− | + | ==gn:s_text== | |
Sets text into <code>[http://developer.android.com/reference/android/widget/EditText.html EditText]</code> | Sets text into <code>[http://developer.android.com/reference/android/widget/EditText.html EditText]</code> | ||
''(String)'' values = <code>text</code> or <code>@string/resourceId</code> | ''(String)'' values = <code>text</code> or <code>@string/resourceId</code> | ||
− | + | ==gn:s_hint== | |
Sets text hint into <code>[http://developer.android.com/reference/android/widget/EditText.html EditText]</code> | Sets text hint into <code>[http://developer.android.com/reference/android/widget/EditText.html EditText]</code> | ||
''(String)'' values = <code>text</code> or <code>@string/resourceId</code> | ''(String)'' values = <code>text</code> or <code>@string/resourceId</code> | ||
− | + | ==gntextstyle== | |
Sets style for child <code>[http://developer.android.com/reference/android/widget/EditText.html EditText]</code> | Sets style for child <code>[http://developer.android.com/reference/android/widget/EditText.html EditText]</code> | ||
''(String)'' values = <code>normal</code>, <code>bold</code>, <code>italic</code> | ''(String)'' values = <code>normal</code>, <code>bold</code>, <code>italic</code> | ||
− | + | ==gn:background== | |
Sets background color for child <code>[http://developer.android.com/reference/android/widget/EditText.html EditText]</code> | Sets background color for child <code>[http://developer.android.com/reference/android/widget/EditText.html EditText]</code> | ||
''(Hex)'' values i.e. = <code>#000000</code> (hex color value) | ''(Hex)'' values i.e. = <code>#000000</code> (hex color value) | ||
− | + | ==gn:textColor== | |
Sets font color for child <code>[http://developer.android.com/reference/android/widget/EditText.html EditText]</code> | Sets font color for child <code>[http://developer.android.com/reference/android/widget/EditText.html EditText]</code> | ||
''(Hex)'' values i.e. = <code>#000000</code> (hex color value) | ''(Hex)'' values i.e. = <code>#000000</code> (hex color value) | ||
− | + | ==gn:textsize== | |
Sets font size for child <code>[http://developer.android.com/reference/android/widget/EditText.html EditText]</code> | Sets font size for child <code>[http://developer.android.com/reference/android/widget/EditText.html EditText]</code> | ||
''(Dimension)'' value i.e. = <code>10dp</code> or <code>10sp</code> | ''(Dimension)'' value i.e. = <code>10dp</code> or <code>10sp</code> | ||
− | + | ==gn:s_nfcAlertType== | |
Sets alert type when NFC is scanned | Sets alert type when NFC is scanned | ||
Line 283: | Line 365: | ||
|} | |} | ||
− | + | ==gn:s_gravity== | |
Sets the gravity of <code>[http://developer.android.com/reference/android/widget/EditText.html EditText]</code> content, this means text alignment within widget | Sets the gravity of <code>[http://developer.android.com/reference/android/widget/EditText.html EditText]</code> content, this means text alignment within widget | ||
''(String)'' value i.e. = <code>CENTER</code>, <code>CENTER_HORIZONTAL</code> | ''(String)'' value i.e. = <code>CENTER</code>, <code>CENTER_HORIZONTAL</code> | ||
− | + | ==gn:minLines== | |
Sets minimum lines for <code>[http://developer.android.com/reference/android/widget/EditText.html EditText]</code> | Sets minimum 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:maxLines== | |
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== | |
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> | ||
− | + | ==gn:focusable== | |
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== | |
Checks if NFC is required | Checks if NFC is required | ||
Line 325: | Line 407: | ||
|} | |} | ||
− | + | ==gn:Visible== | |
Shows or hides widget | Shows or hides widget | ||
Line 343: | Line 425: | ||
|} | |} | ||
− | + | ==gn:nfcReadingsInterval== | |
Sets reading interval for NFC, if less time than defined has passed a message will be shown and reading ignored | Sets reading interval for NFC, if less time than defined has passed a message will be shown and reading ignored | ||
Line 350: | Line 432: | ||
If multiple widgets use NFC each one has its own individual timer | If multiple widgets 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 <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== | |
Returns additional information about tag | Returns additional information about tag | ||
− | + | ==gn:s_nfcContentType== | |
When NFC is read instead of the ID the embedded content of NFC tag is read | When NFC is read instead of the ID the embedded content of NFC tag is read | ||
''(String)'' value = <code>embedded</code> | ''(String)'' value = <code>embedded</code> | ||
− | + | ==android:background== | |
Sets the background image for the element | Sets the background image for the element | ||
Line 369: | Line 451: | ||
::i.e. <code>@drawable/imageOne</code> the image resource has to be set inside of drawable folder (read more [[Ginstr_app#Drawable|here]]) | ::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>. | 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>. | ||
Line 395: | Line 477: | ||
|} | |} | ||
− | + | ==android:textColorHint== | |
Used to change the hint color when <code>[[#gn:s_hint]]</code> is set | 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 | 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 | 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 | 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> | ''(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>,… | 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”). | 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. | If set, padding provides ability to define internal space between text and left outer edge of the control. | ||
Line 420: | Line 502: | ||
''(String)'' value = <code>12dp</code>, <code>1dp</code>, etc... | ''(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. | If set, padding provides ability to define internal space between text and right outer edge of the control. | ||
Line 427: | Line 509: | ||
''(String)'' value = <code>12dp</code>, <code>1dp</code>, etc... | ''(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. | If set, padding provides ability to define internal space between text and bottom outer edge of the control. | ||
Line 434: | Line 516: | ||
''(String)'' value = <code>12dp</code>, <code>1dp</code>, etc... | ''(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. | If set, padding provides ability to define internal space between text and top outer edge of the control. | ||
Line 441: | Line 523: | ||
''(String)'' value = <code>12dp</code>, <code>1dp</code>, etc... | ''(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 | 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> | ''(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 | If set it should point to an XML file in '''“control”''' folder of ginstr app | ||
Line 453: | Line 535: | ||
More details in [[#Alternative layout]] | 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 | If attribute is <code>true</code>, decimal value will be trimmed from widget when data is gathered from it | ||
''(Boolean)'' value : <code>true</code> | ''(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> | In order to activate on focus lost attribute triggering this attribute has to be set to <code>true</code> | ||
''(Boolean)'' value : <code>true</code> | ''(Boolean)'' value : <code>true</code> | ||
− | + | ==gn:setOnFocusLost== | |
Action set which executes once focus is lost on <code>[[GnEditText]]</code> | 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 | Prevents autoloading timestamp when widget with <code>gn:s_sourceType=”time”</code> is loaded on screen | ||
''(Boolean)'' value : <code>false</code> | ''(Boolean)'' value : <code>false</code> | ||
− | + | ==gn:data_type== | |
Defines datatype of widget | Defines datatype of widget | ||
− | + | ==gn:typingTimeInterval== | |
Represents number of seconds after <code>[[gn:act_setOnTypingEnd]]</code> will be executed | 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 | 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, | 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> | ''(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. | 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. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 13:55, 24 June 2016
Contents
- 1 XML Attributes Description
- 2 Alternative layout
- 3 NFC scan modes
- 4 imeOptions
- 5 gn:s_sourceType
- 6 gn:qrCameraRequired
- 7 gn:showAddress
- 8 gn:typeface
- 9 gn:s_text
- 10 gn:s_hint
- 11 gntextstyle
- 12 gn:background
- 13 gn:textColor
- 14 gn:textsize
- 15 gn:s_nfcAlertType
- 16 gn:s_gravity
- 17 gn:minLines
- 18 gn:maxLines
- 19 gn:noServiceOnUpdate
- 20 gn:focusable
- 21 gn:nfcRequired
- 22 gn:Visible
- 23 gn:nfcReadingsInterval
- 24 gn:nfcReadingIntervalForSameContent
- 25 gn:nfcReadingGetAdditionalInfo
- 26 gn:s_nfcContentType
- 27 android:background
- 28 gn:inputType
- 29 android:textColorHint
- 30 gn:useEntry
- 31 gn:nfcIntSequence
- 32 gn:isMasked
- 33 gn:decimalFormat
- 34 gn:paddingLeft
- 35 gn:paddingRight
- 36 gn:paddingBottom
- 37 gn:paddingTop
- 38 gn:nfcActionLostFocus
- 39 gn:s_customLayoutXml
- 40 gn:trimDecimalPlaces
- 41 gn:actionSetOnFocusLost
- 42 gn:setOnFocusLost
- 43 gn:autoLoadTimestamp
- 44 gn:data_type
- 45 gn:typingTimeInterval
- 46 gn:autoLoadLocation
- 47 gn:autoAdjustHeight
- 48 gn:gpsPrecision
- 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
XML Attributes Description
Note: An attribute marked with asterisk (*) is a mandatory parameter when creating widget.
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
|
Alternative layout
Alternative layout can be set into control folder. It can have any name ending with ".xml" and it must have valid XML structure.
It must 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 required, there are 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:
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) aftergn: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
:
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”
actionSend
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”
.
actionNext
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>
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 |
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 widgets 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)
- i.e.
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 false
and 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.