From wiki.ginstr.com
Revision as of 12:29, 3 November 2016 by Bojan (talk | contribs)
Jump to: navigation, search

Text

Widget is used for textual input of data by user. Value will be stored as datatype TEXT.

Widget id, ${widgetID}:

see variants

Back to GBAM widgets table

Predefined user data

PreLoaded

AutoLoaded data which is known:

  • ${pageName} - name of the page to which widgets are added

Properties panel

User will configure this data in properties panel of selected widget:

GENERAL:

  • ${widgetLabel} - label of the widget user added to the screen
  • ${hintText} - hint text

Code snippets

Common widget code

<com.ginstr.widgets.GnTextView
    android:id="@+id/${pageName}_${widgetLabel}_label"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="@string/${pageName}_${widgetLabel}"
    gn:style="@style/${widgetID}_label"/>

<com.ginstr.widgets.GnEditText
    android:id="@+id/${pageName}_${widgetLabel}_input"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    gn:s_hint="@string/${pageName}_${widgetLabel}Hint"
    gn:dataType="text"
    gn:style="@style/${widgetID}_input"/>


strings.xml

Lines to be added for EN language

<string name="${pageName}_${widgetLabel}">${widgetLabel}</string>
<string name="${pageName}_${widgetLabel}Hint">${hintText}</string>


Lines to be added for DE language

<string name="${pageName}_${widgetLabel}">${widgetLabel}</string>
<string name="${pageName}_${widgetLabel}Hint">${hintText}</string>




Variants



Text editable variant

Widget id:

textEditable
Widget code
    gn:s_sourceType="input"




Nfc variant

Widget id:

nfc
Widget code
    gn:s_sourceType="nfc"




Barcode variant

Widget id:

qr
Widget code
    gn:s_sourceType="qr"



Text read only variant

Widget id:

textReadOnly
Widget code
    gn:s_sourceType="input"
    gn:focusable="false"
    android:background="#00000000"