From wiki.ginstr.com
Revision as of 18:03, 23 June 2016 by Mark (talk | contribs)
Jump to: navigation, search
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

| title="Description" | Sets maximum lines for EditText

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

gn:noServiceOnUpdate

| title="Description" | 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