From wiki.ginstr.com
Jump to: navigation, search
m (formatting)
Line 7: Line 7:
  
 
;Description
 
;Description
: <code>[[GnAutoCmpleteTextView]]</code> inherits regular Android <code>[http://developer.android.com/reference/android/widget/AutoCompleteTextView.html AutoCompleteTextView]</code> widget.
+
: <code>[[GnAutoCompleteTextView]]</code> inherits regular Android <code>[http://developer.android.com/reference/android/widget/AutoCompleteTextView.html AutoCompleteTextView]</code> widget.
: It contains of EditText used to search entries of dropdown values and DropDown list which displays a list of entries which match search string.
+
: It consists of <code>[http://developer.android.com/reference/android/widget/EditText.html EditText]</code> used to search entries of dropdown values and DropDown list which displays a list of entries which match search string.
 
: It has two ways of functioning. It can receive values either from local resources or from the database.
 
: It has two ways of functioning. It can receive values either from local resources or from the database.
 
: See <code>[[gn:act_fill_dropdown]]</code> for retrieving values from local source.
 
: See <code>[[gn:act_fill_dropdown]]</code> for retrieving values from local source.
Line 19: Line 19:
 
! scope="col" | Description
 
! scope="col" | Description
 
|-
 
|-
| title="Attribute" | gn:s_sourceType
+
| title="Attribute" | <code>gn:s_sourceType</code>
 
| title="Description" | Sets source for data load into dropdown
 
| title="Description" | Sets source for data load into dropdown
 
Can be
 
Can be
* <code>local</code> - Sets the source as array from resources (@array/resourceId)
+
* <code>local</code> - Sets the source as array from resources (<code>@array/resourceId</code>)
 
* <code>database</code> - Sets the source as database  
 
* <code>database</code> - Sets the source as database  
 
|-
 
|-
| title="Attribute" | gn:s_decimalFormat
+
| title="Attribute" | <code>gn:s_decimalFormat</code>
 
| title="Description" | Formats dropdown data to specified number format
 
| title="Description" | Formats dropdown data to specified number format
 
|-
 
|-
| title="Attribute" | gn:completionThreshold
+
| title="Attribute" | <code>gn:completionThreshold</code>
 
| title="Description" | Defines the number of characters that the user must type before completion suggestions are displayed in a drop down menu.  
 
| title="Description" | Defines the number of characters that the user must type before completion suggestions are displayed in a drop down menu.  
 
|-
 
|-
| title="Attribute" | gn:typingTimeInterval
+
| title="Attribute" | <code>gn:typingTimeInterval</code>
 
| title="Description" | Represents number of miliseconds after <code>[[gn:act_setOnTypingEnd]]</code> will be executed
 
| title="Description" | Represents number of miliseconds after <code>[[gn:act_setOnTypingEnd]]</code> will be executed
 
Can be
 
Can be
 
* hardcoded
 
* hardcoded
 
|-
 
|-
| title="Attribute" | gn:triggerOnTypingEndEmptyItem
+
| title="Attribute" | <code>gn:triggerOnTypingEndEmptyItem</code>
| title="Description" | Triggers <code>[[gn:act_setOnTypingEnd]]</code> event even <code>GnEditText</code> content is empty.
+
| title="Description" | Triggers <code>[[gn:act_setOnTypingEnd]]</code> event even <code>[[GnEditText]]</code> content is empty.
 
Can be
 
Can be
 
* <code>true</code>
 
* <code>true</code>
Line 44: Line 44:
  
 
==Events==
 
==Events==
: [[gn:act_setOnTypingStart]]
+
: <code>[[gn:act_setOnTypingStart]]</code>
: [[gn:act_setOnTypingEnd]]
+
: <code>[[gn:act_setOnTypingEnd]]</code>
: [[gn:event_onSelectedItem]]
+
: <code>[[gn:event_onSelectedItem]]</code>
: [[gn:event_onClearedItem]]
+
: <code>[[gn:event_onClearedItem]]</code>
  
 
==Example==
 
==Example==

Revision as of 13:09, 12 July 2017

GnAutoCmpleteTextView

Widget XML tag
<com.ginstr.widgets.GnAutoCompleteTextView>
Description
GnAutoCompleteTextView inherits regular Android AutoCompleteTextView widget.
It consists of EditText used to search entries of dropdown values and DropDown list which displays a list of entries which match search string.
It has two ways of functioning. It can receive values either from local resources or from the database.
See gn:act_fill_dropdown for retrieving values from local source.

XML Attributes Description

Attribute Description
gn:s_sourceType Sets source for data load into dropdown

Can be

  • local - Sets the source as array from resources (@array/resourceId)
  • database - Sets the source as database
gn:s_decimalFormat Formats dropdown data to specified number format
gn:completionThreshold Defines the number of characters that the user must type before completion suggestions are displayed in a drop down menu.
gn:typingTimeInterval Represents number of miliseconds after gn:act_setOnTypingEnd will be executed

Can be

  • hardcoded
gn:triggerOnTypingEndEmptyItem Triggers gn:act_setOnTypingEnd event even GnEditText content is empty.

Can be

  • true
  • false

Events

gn:act_setOnTypingStart
gn:act_setOnTypingEnd
gn:event_onSelectedItem
gn:event_onClearedItem

Example

<com.ginstr.widgets.GnAutoCompleteTextView
  android:id="@+id/autoCompleteTextView1"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:layout_marginLeft="-5dp"
  android:background="#00000000"
  gn:s_sourceType="local"
  gn:data_source_key_local="@array/localAutoComplete"
  gn:completionThreshold="1"
  gn:act_validate="[name:RequiredValidator],[message=@string/screen2_dnrRequiredValidatorMessage]"
  gn:typingTimeInterval="1000"
  gn:triggerOnTypingEndEmptyItem="true"
  gn:act_setOnTypingStart="[gn:act_toast]|[START]"
  gn:act_setOnTypingEnd="[gn:act_toast]|[END]"
  gn:event_onSelectedItem="[gn:act_toast]|[SELECT]"
  gn:event_onClearedItem="[gn:act_toast]|[CLEAR]"/>