From wiki.ginstr.com
Jump to: navigation, search
 
(9 intermediate revisions by 2 users not shown)
Line 17: Line 17:
 
|-
 
|-
 
| title="Attribute" | <code>gn:showOtherDates</code>
 
| title="Attribute" | <code>gn:showOtherDates</code>
| title="Description" | By default, only days of one month, in the min-max range, are shown. You can customize this by setting mcv_showOtherDates in xml, or by calling setShowOtherDates()
+
| title="Description" | By default, only days of one month, in the min-max range, are shown.
 
Flags are described here: https://github.com/prolificinteractive/material-calendarview/wiki/Customization#showing-other-dates
 
Flags are described here: https://github.com/prolificinteractive/material-calendarview/wiki/Customization#showing-other-dates
  
Line 27: Line 27:
 
* <code>all</code>
 
* <code>all</code>
 
* <code>defaults</code>
 
* <code>defaults</code>
 +
|-
 +
| title="Attribute" | <code>gn:selectionMode</code>
 +
| title="Description" | Four modes of selection are supported single, multiple, range or none. The default is single selection.
 +
Flags are described here: https://github.com/prolificinteractive/material-calendarview/wiki/Customization#xml
 +
 +
Can be
 +
* <code>none</code>
 +
* <code>single</code>
 +
* <code>multiple</code>
 +
* <code>range</code>
 +
|-
 +
| title="Attribute" | <code>gn:selectionColor</code>
 +
| title="Description" | Represents the color of the selector
 +
 +
Can be any hex color representation
 +
* <code>#000000</code>
 +
|-
 +
| title="Attribute" | <code>gn:arrowColorFilter</code>
 +
| title="Description" | Represents the color of the month switch arrows
 +
 +
Can be any hex color representation
 +
* <code>#000000</code>
 +
|-
 +
| title="Attribute" | <code>gn:headerTextColor</code>
 +
| title="Description" | Represents the text color of the header section (month year)
 +
 +
Can be any hex color representation
 +
* <code>#000000</code>
 +
|-
 +
| title="Attribute" | <code>gn:headerBackgroundColor</code>
 +
| title="Description" | Represents the background color of the header section (month year)
 +
 +
Can be any hex color representation
 +
* <code>#000000</code>
 +
|-
 +
| title="Attribute" | <code>gn:currentDayTextColor</code>
 +
| title="Description" | Represents the textcolor of the current day
 +
 +
Can be any hex color representation
 +
* <code>#000000</code>
 +
|-
 +
| title="Attribute" | <code>gn:currentMonthDayTextColor</code>
 +
| title="Description" | Represents the text color of the all days which are not the current day
 +
 +
Can be any hex color representation
 +
* <code>#000000</code>
 
|-
 
|-
 
| title="Attribute" | <code>gn:s_minDate</code>
 
| title="Attribute" | <code>gn:s_minDate</code>
Line 41: Line 87:
 
* <code>minusX</code> - Sets maximum date as current date minus <code>X</code> days
 
* <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
 
* <code>plusX</code> - Sets maximum date as current date plus <code>X</code> days
 +
|-
 +
| title="Attribute" | <code>gn:weekendBackgroundColor</code>
 +
| title="Description" | (milestone 103.8.0.5) Represents background color of weekend days <code>saturday, sunday</code>
 +
Can be any hex color representation
 +
* <code>#000000</code>
 +
|-
 +
| title="Attribute" | <code>gn:firstDayOfWeek</code>
 +
| title="Description" | (milestone 103.8.0.5) Configures calendar first day of week. IMPORTANT: value needs be provided in target before (i.e. variable) screen with GnCalendar is loaded
 +
* Valid [[target|targets]]:
 +
** <code>[[Datatypes#text|text]]</code>
 +
* Valid values in [[target|targets]]:
 +
** <code>monday</code>
 +
** <code>sunday</code>
 +
|-
 +
| title="Attribute" | <code>gn:weekdayBackgroundColor</code>
 +
| title="Description" | Represents the background color of week days
 +
 +
Can be any hex color representation
 +
* <code>#000000</code>
 +
|-
 
|}
 
|}
 
==Events==
 
: <code>[[gn:act_setClick]]</code>
 
: <code>[[gn:act_setLongClick]]</code>
 
: <code>[[gn:act_setOnDate]]</code>
 
  
 
==Data types==
 
==Data types==
Line 53: Line 114:
 
! scope="col" | Input
 
! scope="col" | Input
 
|-
 
|-
| title="Value" | <code>[[Datatypes#text|text]]</code>
+
| title="Value" | <code>[[Datatypes#rowsColumn|rowsColumn]]([[Datatypes#date|date]])</code>
|-
 
| title="Value" | <code>[[Datatypes#date|date]]</code>
 
|-
 
| title="Value" | <code>[[Datatypes#dateTime|dateTime]]</code>
 
 
|}
 
|}
  
Line 64: Line 121:
 
! scope="col" | Output
 
! scope="col" | Output
 
|-
 
|-
| title="Value" | <code>[[Datatypes#date|date]]</code>
+
| title="Value" | <code>[[Datatypes#rowsColumn|rowsColumn]]([[Datatypes#date|date]])</code>
|-
 
| title="Value" | <code>[[Datatypes#dateTime|dateTime]]</code>
 
 
|}
 
|}
  
 
==Example==
 
==Example==
 
<syntaxhighlight code="xml">
 
<syntaxhighlight code="xml">
<com.ginstr.widgets.GnDatePicker
+
<com.ginstr.widgets.GnCalendar
   android:id="@+id/meter_deinstallationDate"  
+
  xmlns:app="http://schemas.android.com/apk/res-auto"
   android:layout_width="match_parent"  
+
   android:id="@+id/calendarView"
 +
   android:layout_width="match_parent"
 
   android:layout_height="wrap_content"
 
   android:layout_height="wrap_content"
   gn:dataType="date" />  
+
   gn:showOtherDates="none"
 +
  gn:selectionMode="range"
 +
  gn:selectionColor="#000000"
 +
  gn:arrowColorFilter="#ffffff"
 +
  gn:headerTextColor="#32a852"
 +
  gn:headerBackgroundColor="#00000000"
 +
  gn:currentDayTextColor="#a85232"
 +
  gn:currentMonthDayTextColor="#ffffff"
 +
  android:background="#00ffffff"
 +
/>
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 12:42, 21 September 2020

GnCalendar (M103.8.1)

Widget XML tag
<com.ginstr.widgets.GnCalendar>
Description
GnCalendar inherits MaterialCalendarView widget.
Provides single, multiple and range date selection.

XML Attributes Description

Attribute Description
gn:showOtherDates By default, only days of one month, in the min-max range, are shown.

Flags are described here: https://github.com/prolificinteractive/material-calendarview/wiki/Customization#showing-other-dates

Can be

  • other_months
  • out_of_range
  • decorated_disabled
  • none
  • all
  • defaults
gn:selectionMode Four modes of selection are supported single, multiple, range or none. The default is single selection.

Flags are described here: https://github.com/prolificinteractive/material-calendarview/wiki/Customization#xml

Can be

  • none
  • single
  • multiple
  • range
gn:selectionColor Represents the color of the selector

Can be any hex color representation

  • #000000
gn:arrowColorFilter Represents the color of the month switch arrows

Can be any hex color representation

  • #000000
gn:headerTextColor Represents the text color of the header section (month year)

Can be any hex color representation

  • #000000
gn:headerBackgroundColor Represents the background color of the header section (month year)

Can be any hex color representation

  • #000000
gn:currentDayTextColor Represents the textcolor of the current day

Can be any hex color representation

  • #000000
gn:currentMonthDayTextColor Represents the text color of the all days which are not the current day

Can be any hex color representation

  • #000000
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:weekendBackgroundColor (milestone 103.8.0.5) Represents background color of weekend days saturday, sunday

Can be any hex color representation

  • #000000
gn:firstDayOfWeek (milestone 103.8.0.5) Configures calendar first day of week. IMPORTANT: value needs be provided in target before (i.e. variable) screen with GnCalendar is loaded
gn:weekdayBackgroundColor Represents the background color of week days

Can be any hex color representation

  • #000000

Data types

Input
rowsColumn(date)
Output
rowsColumn(date)

Example

<com.ginstr.widgets.GnCalendar
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:id="@+id/calendarView"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  gn:showOtherDates="none"
  gn:selectionMode="range"
  gn:selectionColor="#000000"
  gn:arrowColorFilter="#ffffff"
  gn:headerTextColor="#32a852"
  gn:headerBackgroundColor="#00000000"
  gn:currentDayTextColor="#a85232"
  gn:currentMonthDayTextColor="#ffffff"
  android:background="#00ffffff"
/>