GnEditText
- Widget XML tag
<com.ginstr.widgets.GnEditText>
- Description
GnEditText
is a multi-sourceEditText
.
- It is used to enter text data or acquire it from other sources.
XML Attributes Description
Note: An attribute marked with asterisk (*) is a mandatory parameter when creating widget.
Attribute | Description |
---|---|
gn:s_sourceType *
|
Defines source type.
Additional information here |
gn:showAddress
|
Sets GPS datatype displayed in EditText
Can be |
gn:s_text
|
Sets text into EditText
Can be
|
gn:s_hint
|
Sets text hint into EditText
Can be
|
gn:textStyle
|
Sets style for child EditText
Can be
|
gn:textColor
|
Sets font color for child EditText
Can be
|
gn:s_nfcAlertType
|
Sets alert type when NFC is scanned
Can be
|
gn:s_gravity
|
Sets the gravity of EditText content, this means text alignment within widget
Can be
|
gn:minLines
|
Sets minimum lines for EditText
Can be
|
gn:maxLines
|
Sets maximum lines for EditText
Can be
|
gn:noServiceOnUpdate
|
Prevents content update if EditText contains some data
Can be
|
gn:focusable
|
If present prevents user from focusing widget and entering data. In this case the widget will be a read-only
Can be
|
gn:nfcRequired
|
Checks if NFC is required
Can be |
gn:visible
|
Shows or hides widget
Can be
|
gn:nfcReadingsInterval
|
Sets reading interval (in seconds) for NFC, if less time than defined has passed a message will be shown and reading ignored
Can be
|
gn:s_nfcContentType
|
When NFC is read instead of the ID the embedded content of NFC tag is read
Can be
|
gn:inputType
|
Defines the input mode for the keyboard which appears on the screen
Additional information here |
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
Can be
|
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 page (under heading “Special Pattern Characters”). Can be
|
gn:paddingLeft
|
Defines internal space between text and left outer edge of the control
Can be
|
gn:paddingRight
|
Defines internal space between text and right outer edge of the control
Can be
|
gn:paddingBottom
|
Defines internal space between text and bottom outer edge of the control
Can be
|
gn:paddingTop
|
Defines internal space between text and top outer edge of the control
Can be
|
gn:s_customLayoutXml
|
Points to an XML file in “control” folder of ginstr app
Can be
|
gn:trimDecimalPlaces
|
Decimal value will be trimmed from widget when data is gathered from it
Can be
|
gn:actionSetOnFocusLost
|
Activates on focus lost attribute triggering
Can be
|
gn:autoLoadTimestamp
|
Prevents autoloading timestamp when widget with gn:s_sourceType="time" is loaded on screen
Can be
|
gn:dataType
|
Defines datatype of widget |
gn:typingTimeInterval
|
Represents number of miliseconds after gn:act_setOnTypingEnd will be executed
Can be
|
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
Can be |
gn:autoAdjustHeight
|
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.
Can be
|
gn:gpsPrecision
|
Used in combination with gn:s_sourceType="gps" to increased GPS data accuracy
Can be |
gn:imeOptions
|
Defines keyboard functionality that will be valid when options are enabled upon that GnEditText .
Additional information here |
gn:imeActionNext
|
Used in combination with gn:imeOptions="actionNext" , defines where to move focus after user clicks on the next button
Additional information here |
gn:qrAutoEnableTorch
|
Controls torch functionality when QR code is activated
Can be
|
gn:triggerOnTypingEndEmptyItem
|
Triggers gn:act_setOnTypingEnd event even GnEditText content is empty.
Can be
|
gn:getPointerValue
|
Used in combination with gn:dataType="pointer" , defines which pointer value will be displayed in GnEditText
Can be
|
gn:nfcPlaySoundAssetsFileName
|
Used in combination with gn:s_nfcAlertType="sound" , defines which customized sound file from assets folder will be used.
Can be
|
gn:continuousLocationService
|
When set to true and widget is set to type gn:s_sourceType="gps" , GPS location will be constantly refreshed in GnEditText
Can be |
gn:isInteger
|
DEPRECATED
Used in combination with
|
gn:isButtonTextVisible
|
Hides or shows text on button when QR code is activated
Can be
|
gn:maxNumberOfDecimals
|
Used in combination with gn:inputType="TYPE_NUMBER_FLAG_DECIMAL" , defines how many decimals user is allowed to type in via keyboard after decimal point (milestone 101)
Can be
|
gn:autoCapitalize
|
Changes the first letter of entered text to upper case
Can be
|
gn:disableMinDistanceCheck
|
Works in combination with gn:s_sourceType GPS. Enables or disables GPS service check regarding the distance between two GPS points.
Can be
|
Events
gn:act_setClick
gn:act_setLongClick
gn:act_setOnNfc
gn:act_setOnGps
gn:act_setOnQr
gn:act_setOnWiFi
gn:act_setOnGSM
gn:act_setOnBT
gn:act_setOnBLE
gn:act_setOnTypingEnd
gn:act_setOnFocusLost
gn:act_setOnTypingStart
gn:act_setOnTypingEnd
Example
<com.ginstr.widgets.GnEditText android:id="@+id/bebraObjekte_ObjektNummer" android:layout_width="match_parent" android:layout_height="wrap_content" gn:s_hint="@string/txtObjectNumberHint" gn:s_sourceType="input" gn:inputType="NUMBER" />
Source types
Defines source type
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 |
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 |
ble
|
Displays Bluetooth LE fingerprint, there can be multiple Bluetooth LE fingerprint widgets on the same screen |
Input types
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 Note that when signed integer is entered maximum allowed characters into input field including "-" is 15. "-" is also counted as a digit. |
TYPE_NUMBER_FLAG_DECIMAL
|
allows "0123456789.," to be entered |
TYPE_CLASS_PHONE
|
allows “0123456789+” and opens numerical keyboard |
Data types
Input |
---|
text
|
number
|
dateTime
|
gps
|
pointer
|
email
|
phoneNumber
|
counter
|
enum
|
fingerprint
|
Output |
---|
text
|
number
|
dateTime
|
gps
|
pointer
|
email
|
phoneNumber
|
IME options
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.
Input types and combinations supported:
Input Type | Description |
---|---|
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. |
actionSend
|
When action sent is set on GnEditText it is necessary to add another attribute "gn:imeActionSend "
actionSend defines action or action set that will get executed when the keyboard button enter/go is pressed. |
actionNext
|
When action next is set on GnEditText it is necessary to add another attribute "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:
|
actionDone
|
actionDone will hide the keyboard when enter/go on virtual keyboard is pressed.
|
Example
actionGo
gn:imeOptions="actionGo" gn:imeActionGo="@+id/targetRootLayout"
actionSend
gn:imeOptions="actionSend" gn:imeActionSend="[action]|[action values],..."
actionNext
gn:imeOptions="actionNext" gn:imeActionNext="FOCUS_DOWN"
actionDone
gn:imeOptions="actionDone"
Alternative layout
- If the default look and feel needs to be changed, create or copy identical files from $defaultApp to current app "control" folder.
- To provide alternative layout, the files mentioned above can be set into control folder of the current application. Files must be named as shown above and widgets with Id’s have to stay of same type and keep same id.