From wiki.ginstr.com
Jump to: navigation, search
m
(Example)
 
(14 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
<span STYLE="font-size: xx-large"><code>GnDatePicker</code></span>
 
<span STYLE="font-size: xx-large"><code>GnDatePicker</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/DatePicker.html DatePicker]</code>
 
;Widget XML tag: <code><com.ginstr.widgets.GnDatePicker></code>
 
  
 +
;Widget XML tag
 +
: <code><com.ginstr.widgets.GnDatePicker></code>
  
<code>[[GnDatePicker]]</code> provides date entry.
+
;Description
 +
: <code>[[GnDatePicker]]</code> inherits regular Android <code>[http://developer.android.com/reference/android/widget/DatePicker.html DatePicker]</code> widget.
 +
: It provides date entry.
  
If layout configuration options below are not required, <code>[http://developer.android.com/reference/android/widget/DatePicker.html Android DatePicker]</code> can be used instead.
 
 
==XML Attributes Description==
 
==XML Attributes Description==
 
{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
 
{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
Line 16: Line 16:
 
! scope="col" | Description
 
! scope="col" | Description
 
|-
 
|-
| title="Attribute" | <code>[[#gn:s_minDate|gn:s_minDate]]</code>
+
| title="Attribute" | <code>gn:dataType</code>
 +
| title="Description" | Represents widget data type
 +
Can be
 +
* <code>[[Datatypes#dateTime|dateTime]]</code>
 +
* <code>[[Datatypes#date|date]]</code>
 +
|-
 +
| title="Attribute" | <code>gn:s_minDate</code>
 
| title="Description" | Sets minimum permitted date
 
| title="Description" | Sets minimum permitted date
 +
Can be
 +
* <code>current</code> - Sets the current date as minimum date
 +
* <code>minusX</code> - Sets minimum date as current date minus <code>X</code> days
 +
* <code>plusX</code> - Sets minimum date as current date plus <code>X</code> days
 
|-
 
|-
| title="Attribute" | <code>[[#gn:s_maxDate|gn:s_maxDate]]</code>
+
| title="Attribute" | <code>gn:s_maxDate</code>
 
| title="Description" | Sets maximum permitted date
 
| title="Description" | Sets maximum permitted date
 +
Can be
 +
* <code>current</code> - Sets the current date as maximum date
 +
* <code>minusX</code> - Sets maximum date as current date minus <code>X</code> days
 +
* <code>plusX</code> - Sets maximum date as current date plus <code>X</code> days
 +
|-
 +
| title="Attribute" | <code>gn:textColor</code>(M103.8.1)
 +
| title="Description" | Defines widget's color
 +
Can be
 +
* <code>hardcoded</code> - hexadecimal color representation e.g. #000000
 
|}
 
|}
  
==<code>gn:s_minDate</code>==
+
==Events==
Sets minimum permitted date
+
: <code>[[gn:act_setClick]]</code>
 
+
: <code>[[gn:act_setLongClick]]</code>
''(String)'' values = <code>current</code>, <code>minusX</code>, <code>plusX</code>
+
: <code>[[gn:act_setOnDate]]</code>
  
 +
==Data types==
 
{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
 
{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
 
|-
 
|-
! scope="col" | Value
+
! scope="col" | Input
! scope="col" | Description
 
 
|-
 
|-
| title="Value" | <code>current</code>
+
| title="Value" | <code>[[Datatypes#text|text]]</code>
| title="Description" | Sets the current date as minimum date
 
 
|-
 
|-
| title="Value" | <code>minusX</code>
+
| title="Value" | <code>[[Datatypes#date|date]]</code>
| title="Description" | Sets minimum date as current date minus <code>X</code> days
 
 
|-
 
|-
| title="Value" | <code>plusX</code>
+
| title="Value" | <code>[[Datatypes#dateTime|dateTime]]</code>
| title="Description" | Sets minimum date as current date plus <code>X</code> days
 
 
|}
 
|}
 
==<code>gn:s_maxDate</code>==
 
Sets maximum permitted date
 
 
''(String)'' values = <code>current</code>, <code>minusX</code>, <code>plusX</code>
 
  
 
{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
 
{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
 
|-
 
|-
! scope="col" | Value
+
! scope="col" | Output
! scope="col" | Description
 
|-
 
| title="Value" | <code>current</code>
 
| title="Description" | Sets the current date as maximum date
 
 
|-
 
|-
| title="Value" | <code>minusX</code>
+
| title="Value" | <code>[[Datatypes#date|date]]</code>
| title="Description" | Sets maximum date as current date minus <code>X</code> days
 
 
|-
 
|-
| title="Value" | <code>plusX</code>
+
| title="Value" | <code>[[Datatypes#dateTime|dateTime]]</code>
| title="Description" | Sets maximum date as current date plus <code>X</code> days
 
 
|}
 
|}
 +
 +
==Example==
 +
<syntaxhighlight code="xml">
 +
<com.ginstr.widgets.GnDatePicker
 +
  android:id="@+id/meter_deinstallationDate"
 +
  android:layout_width="match_parent"
 +
  android:layout_height="wrap_content"
 +
  gn:textColor="#000000"
 +
  gn:dataType="date" />
 +
</syntaxhighlight>

Latest revision as of 00:57, 25 March 2020

GnDatePicker

Widget XML tag
<com.ginstr.widgets.GnDatePicker>
Description
GnDatePicker inherits regular Android DatePicker widget.
It provides date entry.

XML Attributes Description

Attribute Description
gn:dataType Represents widget data type

Can be

gn:s_minDate Sets minimum permitted date

Can be

  • current - Sets the current date as minimum date
  • minusX - Sets minimum date as current date minus X days
  • plusX - Sets minimum date as current date plus X days
gn:s_maxDate Sets maximum permitted date

Can be

  • current - Sets the current date as maximum date
  • minusX - Sets maximum date as current date minus X days
  • plusX - Sets maximum date as current date plus X days
gn:textColor(M103.8.1) Defines widget's color

Can be

  • hardcoded - hexadecimal color representation e.g. #000000

Events

gn:act_setClick
gn:act_setLongClick
gn:act_setOnDate

Data types

Input
text
date
dateTime
Output
date
dateTime

Example

<com.ginstr.widgets.GnDatePicker
  android:id="@+id/meter_deinstallationDate" 
  android:layout_width="match_parent" 
  android:layout_height="wrap_content"
  gn:textColor="#000000"
  gn:dataType="date" />