(→Events) |
|||
(14 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<div style="float:right; clear:both; margin-left:0.5em;">__TOC__</div> | <div style="float:right; clear:both; margin-left:0.5em;">__TOC__</div> | ||
<span STYLE="font-size: xx-large"><code>GnEmail</code></span> | <span STYLE="font-size: xx-large"><code>GnEmail</code></span> | ||
− | [[Category:Widget_Library]] | + | [[Category:Widget_Library]][[Category:Controls]] |
;Widget XML tag | ;Widget XML tag | ||
Line 7: | Line 7: | ||
;Description | ;Description | ||
− | : <code>GnEmail</code> provides support to enter email data into email datatype. It is used to store and retrieve data from the database. Once data is in the widget it’s possible to edit the data by clicking edit button. | + | : <code>[[GnEmail]]</code> provides support to enter email data into email datatype. It is used to store and retrieve data from the database. |
− | : On click, a new dialog window will open which has add, edit, remove and close buttons which can be used to manipulate emails. | + | |
− | : The dialog has a built in validate screen action when add or edit is executed. | + | : Once data is in the widget it’s possible to edit the data by clicking the '''edit''' button. |
− | : By default, widget definition can be found in <code>$defaultApp/control/widget_en_email.xml</code>. This layout describes how the widget will look on screen. | + | |
− | : The dialog screen that loads on clicking edit | + | : On click, a new dialog window will open which has '''add''', '''edit''', '''remove''' and '''close''' buttons which can be used to manipulate emails. |
− | : Dialog screen listview row definition can be found at <code>$defaultApp/control/dialog_en_email_row.xml</code> | + | |
+ | : The dialog has a built in [[gn:act_validateScreen|validate screen action]] when '''add''' or '''edit''' is executed. | ||
+ | |||
+ | : By default, widget definition can be found in <code>$defaultApp/control/[[#widget_en_email.xml|widget_en_email.xml]]</code>. This layout describes how the widget will look on screen. | ||
+ | |||
+ | : The dialog screen that loads on clicking '''edit''' is defined by <code>$defaultApp/control/[[#dialog_en_email.xml|dialog_en_email.xml]]</code> | ||
+ | |||
+ | : Dialog screen listview row definition can be found at <code>$defaultApp/control/[[#dialog_en_email_row.xml|dialog_en_email_row.xml]]</code> | ||
+ | |||
: All of the aforementioned layouts can be used to modify the look and feel of the widget. | : All of the aforementioned layouts can be used to modify the look and feel of the widget. | ||
==XML Attributes Description== | ==XML Attributes Description== | ||
: none | : none | ||
+ | |||
+ | ==Events== | ||
+ | : <code>[[gn:act_setClick]]</code> | ||
+ | : <code>[[gn:act_setLongClick]]</code> | ||
+ | |||
+ | ==Data types== | ||
+ | {| class="wikitable sortable" style="font-size: 85%; text-align: left;" | ||
+ | |- | ||
+ | ! scope="col" | Input | ||
+ | |- | ||
+ | | title="Value" | <code>[[Datatypes#email|email]]</code> | ||
+ | |} | ||
+ | |||
+ | {| class="wikitable sortable" style="font-size: 85%; text-align: left;" | ||
+ | |- | ||
+ | ! scope="col" | Output | ||
+ | |- | ||
+ | | title="Value" | <code>[[Datatypes#email|email]]</code> | ||
+ | |} | ||
==Example== | ==Example== | ||
Line 27: | Line 54: | ||
==Alternative layout== | ==Alternative layout== | ||
− | If the default look and feel needs to be changed, create or copy identical files from '''$defaultApp''' to current app "control" folder. | + | : 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. | |
− | 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. | ||
===widget_en_email.xml=== | ===widget_en_email.xml=== | ||
− | ;<code>[http://developer.android.com/reference/android/widget/TextView.html TextView]</code> <code>@+id/etEmail</code> | + | :{| class="wikitable sortable" style="font-size: 85%; text-align: left;" |
− | + | |- | |
+ | ! scope="col" | Widget | ||
+ | ! scope="col" | Name | ||
+ | ! scope="col" | Description | ||
+ | |- | ||
+ | | title="Widget" | <code>[http://developer.android.com/reference/android/widget/TextView.html TextView]</code> | ||
+ | | title="Name" | <code>@+id/etEmail</code> | ||
+ | | title="Description" | this text field represents emails stored in the widget | ||
+ | |- | ||
+ | | title="Widget" | <code>[http://developer.android.com/reference/android/widget/Button.html Button]</code> | ||
+ | | title="Name" | <code>@+id/etEmailManage</code> | ||
+ | | title="Description" | this button opens dialog screen to manage email entries | ||
+ | |} | ||
===dialog_en_email.xml=== | ===dialog_en_email.xml=== | ||
− | ;<code>[[GnEditText]]</code> <code>@+id/etEmailDialogName</code> | + | :{| class="wikitable sortable" style="font-size: 85%; text-align: left;" |
− | + | |- | |
− | + | ! scope="col" | Widget | |
− | + | ! scope="col" | Name | |
− | + | ! scope="col" | Description | |
− | + | |- | |
− | + | | title="Widget" | <code>[[GnEditText]]</code> | |
+ | | title="Name" | <code>@+id/etEmailDialogName</code> | ||
+ | | title="Description" | this input field is used to define email entry <code>name</code> attribute | ||
+ | |- | ||
+ | | title="Widget" | <code>[[GnEditText]]</code> | ||
+ | | title="Name" | <code>@+id/etEmailDialogAddress</code> | ||
+ | | title="Description" | this input field is used to define email entry <code>email</code> attribute | ||
+ | |- | ||
+ | | title="Widget" | <code>[http://developer.android.com/reference/android/widget/ListView.html ListView]</code> | ||
+ | | title="Name" | <code>@+id/lstEmailDialogAddresses</code> | ||
+ | | title="Description" | displays currently stored email entries in widget | ||
+ | |- | ||
+ | | title="Widget" | <code>[http://developer.android.com/reference/android/widget/Button.html Button]</code> | ||
+ | | title="Name" | <code>@+id/btnEmailDialogAdd</code> | ||
+ | | title="Description" | this button adds data that is set into <code>[[GnEditText|GnEditTexts]]</code> into widget and refreshes the listview | ||
+ | |- | ||
+ | | title="Widget" | <code>[http://developer.android.com/reference/android/widget/Button.html Button]</code> | ||
+ | | title="Name" | <code>@+id/btnEmailDialogEdit</code> | ||
+ | | title="Description" | this button, after clicking on list item and modifying entry data, will replace stored entry data with newly entered data | ||
+ | |- | ||
+ | | title="Widget" | <code>[http://developer.android.com/reference/android/widget/Button.html Button]</code> | ||
+ | | title="Name" | <code>@+id/btnEmailDialogRemove</code> | ||
+ | | title="Description" | after clicking on list item, clicking this button will remove the entry from the list | ||
+ | |- | ||
+ | | title="Widget" | <code>[http://developer.android.com/reference/android/widget/Button.html Button]</code> | ||
+ | | title="Name" | <code>@+id/btnEmailDialogClose</code> | ||
+ | | title="Description" | this button closes dialog and refreshes widget on screen with data | ||
+ | |} | ||
===dialog_en_email_row.xml=== | ===dialog_en_email_row.xml=== | ||
− | ;<code>[http://developer.android.com/reference/android/widget/LinearLayout.html LinearLayout]</code> <code>@+id/etEmailRow</code> | + | :{| class="wikitable sortable" style="font-size: 85%; text-align: left;" |
− | + | |- | |
− | + | ! scope="col" | Widget | |
− | + | ! scope="col" | Name | |
− | + | ! scope="col" | Description | |
+ | |- | ||
+ | | title="Widget" | <code>[http://developer.android.com/reference/android/widget/LinearLayout.html LinearLayout]</code> | ||
+ | | title="Name" | <code>@+id/etEmailRow</code> | ||
+ | | title="Description" | this container represents a single list row | ||
+ | |- | ||
+ | | title="Widget" | <code>[http://developer.android.com/reference/android/widget/TextView.html TextView]</code> | ||
+ | | title="Name" | <code>@+id/etEmailName</code> | ||
+ | | title="Description" | this text widget will display email entry <code>name</code> attribute | ||
+ | |- | ||
+ | | title="Widget" | <code>[http://developer.android.com/reference/android/widget/TextView.html TextView]</code> | ||
+ | | title="Name" | <code>@+id/etEmailRowAddress</code> | ||
+ | | title="Description" | this text widget will display email entry <code>email</code> attribute | ||
+ | |} |
Latest revision as of 10:41, 8 August 2019
GnEmail
- Widget XML tag
<com.ginstr.widgets.GnEmail>
- Description
GnEmail
provides support to enter email data into email datatype. It is used to store and retrieve data from the database.
- Once data is in the widget it’s possible to edit the data by clicking the edit button.
- On click, a new dialog window will open which has add, edit, remove and close buttons which can be used to manipulate emails.
- The dialog has a built in validate screen action when add or edit is executed.
- By default, widget definition can be found in
$defaultApp/control/widget_en_email.xml
. This layout describes how the widget will look on screen.
- The dialog screen that loads on clicking edit is defined by
$defaultApp/control/dialog_en_email.xml
- Dialog screen listview row definition can be found at
$defaultApp/control/dialog_en_email_row.xml
- All of the aforementioned layouts can be used to modify the look and feel of the widget.
XML Attributes Description
- none
Events
Data types
Input |
---|
email
|
Output |
---|
email
|
Example
<com.ginstr.widgets.GnEmail android:id="@+id/plant_userNameRecordCreation" android:layout_width="match_parent" android:layout_height="wrap_content" />
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.
widget_en_email.xml
Widget Name Description TextView
@+id/etEmail
this text field represents emails stored in the widget Button
@+id/etEmailManage
this button opens dialog screen to manage email entries
dialog_en_email.xml
Widget Name Description GnEditText
@+id/etEmailDialogName
this input field is used to define email entry name
attributeGnEditText
@+id/etEmailDialogAddress
this input field is used to define email entry email
attributeListView
@+id/lstEmailDialogAddresses
displays currently stored email entries in widget Button
@+id/btnEmailDialogAdd
this button adds data that is set into GnEditTexts
into widget and refreshes the listviewButton
@+id/btnEmailDialogEdit
this button, after clicking on list item and modifying entry data, will replace stored entry data with newly entered data Button
@+id/btnEmailDialogRemove
after clicking on list item, clicking this button will remove the entry from the list Button
@+id/btnEmailDialogClose
this button closes dialog and refreshes widget on screen with data
dialog_en_email_row.xml
Widget Name Description LinearLayout
@+id/etEmailRow
this container represents a single list row TextView
@+id/etEmailName
this text widget will display email entry name
attributeTextView
@+id/etEmailRowAddress
this text widget will display email entry email
attribute