From wiki.ginstr.com
Jump to: navigation, search
m
Line 2: Line 2:
 
<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]]
;Inherited classes: <code>[http://developer.android.com/reference/android/view/View.html View]</code>
 
;Android class type: <code>[http://developer.android.com/reference/android/widget/LinearLayout.html LinearLayout]</code>
 
;Child elements: <code>[http://developer.android.com/reference/android/widget/TextView.html TextView]</code>, <code>[http://developer.android.com/reference/android/widget/Button.html Button]</code>
 
;Widget XML tag: <code><com.ginstr.widgets.GnEmail></code>
 
  
 +
;Widget XML tag
 +
: <code><com.ginstr.widgets.GnEmail></code>
  
<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 <code>edit</code> button.
+
;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.
 +
: 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 <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 can be found at <code>$defaultApp/control/dialog_en_email.xml</code>
 +
: Dialog screen listview row definition can be found at <code>$defaultApp/control/dialog_en_email_row.xml</code>
 +
: All of the aforementioned layouts can be used to modify the look and feel of the widget.  
  
On click, a new dialog window will open which has <code>add</code>, <code>edit</code>, <code>remove</code> and <code>close</code> buttons which can be used to manipulate emails.
+
==XML Attributes Description==
 +
: none
  
The dialog has a built in [[gn:act_validateScreen|validate screen action]] when <code>add</code> or <code>edit</code> is executed.
+
==Example==
 
+
<syntaxhighlight code="xml">
By default, widget definition can be found in '''$defaultApp/control/[[#widget_en_email.xml|widget_en_email.xml]]'''. This layout describes how the widget will look on screen.
+
<com.ginstr.widgets.GnEmail
 
+
  android:id="@+id/plant_userNameRecordCreation"
The dialog screen that loads on clicking <code>edit</code> can be found at '''$defaultApp/control/[[#dialog_en_email.xml|dialog_en_email.xml]]'''
+
  android:layout_width="match_parent"
 
+
  android:layout_height="wrap_content" />
Dialog screen listview row definition can be found at '''$defaultApp/control/[[#dialog_en_email_row.xml|dialog_en_email_row.xml]]'''
+
</syntaxhighlight>
 
 
All of the aforementioned layouts can be used to modify the look and feel of the widget.
 
 
 
==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===
 
;<code>[http://developer.android.com/reference/android/widget/TextView.html TextView]</code> <code>@+id/etEmail</code>: this text field represents emails stored in the widget
 
;<code>[http://developer.android.com/reference/android/widget/Button.html Button]</code><code>@+id/etEmailManage</code>: this button opens dialog screen to manage email entries
 
 
 
===dialog_en_email.xml===
 
;<code>[[GnEditText]]</code> <code>@+id/etEmailDialogName</code>: this input field is used to define email entry <code>name</code> attribute
 
;<code>[[GnEditText]]</code> <code>@+id/etEmailDialogAddress</code>: this input field is used to define email entry <code>email</code> attribute
 
;<code>[http://developer.android.com/reference/android/widget/ListView.html ListView]</code> <code>@+id/lstEmailDialogAddresses</code>: displays currently stored email entries in widget
 
;<code>[http://developer.android.com/reference/android/widget/Button.html Button]</code><code>@+id/btnEmailDialogAdd</code>: this button adds data that is set into <code>[[GnEditText|GnEditTexts]]</code> into widget and refreshes the listview
 
;<code>[http://developer.android.com/reference/android/widget/Button.html Button]</code><code>@+id/btnEmailDialogEdit</code>: this button, after clicking on list item and modifying entry data, will replace stored entry data with newly entered data
 
;<code>[http://developer.android.com/reference/android/widget/Button.html Button]</code><code>@+id/btnEmailDialogRemove</code>: after clicking on list item, clicking this button will remove the entry from the list
 
;<code>[http://developer.android.com/reference/android/widget/Button.html Button]</code><code>@+id/btnEmailDialogRemove</code>: this button closes dialog and refreshes widget on screen with data
 
 
 
===dialog_en_email_row.xml===
 
;<code>[http://developer.android.com/reference/android/widget/LinearLayout.html LinearLayout]</code> <code>@+id/etEmailRow</code>: this container represents a single list row
 
;<code>[http://developer.android.com/reference/android/widget/TextView.html TextView]</code> <code>@+id/etEmailName</code>: this text widget will display email entry <code>name</code> attribute
 
;<code>[http://developer.android.com/reference/android/widget/TextView.html TextView]</code> <code>@+id/etEmailRowAddress</code>: this text widget will display email entry <code>email</code> attribute
 
 
 
The aforementioned widgets must keep their type and id but the rest of the attributes and customisations can be done as required. Remaining widgets not mentioned in this xml files structure can be added/modified as required, there are no constraints.
 

Revision as of 14:06, 21 March 2017

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 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 can be found at $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

Example

<com.ginstr.widgets.GnEmail
  android:id="@+id/plant_userNameRecordCreation"
  android:layout_width="match_parent"
  android:layout_height="wrap_content" />