From wiki.ginstr.com
Jump to: navigation, search
Line 69: Line 69:
 
     gn:dataType="text"
 
     gn:dataType="text"
 
     gn:s_sourceType="input"
 
     gn:s_sourceType="input"
 +
    gn:autoAdjustHeight="true"
 
     gn:style="@style/textEditable_input"/>
 
     gn:style="@style/textEditable_input"/>
 
</syntaxhighlight>
 
</syntaxhighlight>

Revision as of 14:53, 16 May 2017

Text editable

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

Widget id, ${gbamID}

textEditable

Back to GBAM widgets table

Predefined user data

PreLoaded

Properties panel

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

GENERAL

to widget @+id/${widgetID}_input and @+id/${widgetID}_label is replaced style:
from textEditable_label to textEditableMultiline_label
from textEditable_input to textEditableMultiline_input
to configuration.xml column xml which is related to this widget is added following setting:

<multiline>true</multiline>
VALIDATIONS
ACTION
  • -
ACTION MESSAGES
  • -

Code snippets

GBAM Code Variables

Variables which are used in code snippet below but not defined in user modifiable inputs.

Common widget code

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

<com.ginstr.widgets.GnEditText
    android:id="@+id/${widgetID}_input"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    gn:s_hint="@string/${widgetID}Hint"
    gn:dataType="text"
    gn:s_sourceType="input"
    gn:autoAdjustHeight="true"
    gn:style="@style/textEditable_input"/>

strings.xml

Lines to be added for each language.

<string name="${widgetID}">${widgetLabel}</string>
<string name="${widgetID}Hint">${widgetHint}</string>