From wiki.ginstr.com
Jump to: navigation, search

GnTextView

Widget XML tag
<com.ginstr.widgets.GnTextView>
Description
Android TextView with some additional features.

XML Attributes Description

Attribute Description
gn:s_textStyle Sets style of text

Can be

  • bold
  • boldItalic
  • italic
gn:s_decimalFormat If GnTextView is target of calculation, set this attribute to change format of result.

By default format is set to 0.00 which will show calculation result as i.e. 2.13, 121.67,…

Please check format available on this page (under heading “Special Pattern Characters”).

Can be

  • hardcoded
gn:s_text Displays text in GnTextView

Can be

  • @string
gn:letterSpacing Increases/decreases distance between the letters

Can be

  • hardcoded, i.e. 0.05, -0.10
gn:showCurrentDate Displays date in GnTextView, based on gn:dateTimeFormat format

Can be

  • true
  • false
gn:showCurrentTime Displays time in GnTextView, based on gn:dateTimeFormat format

Can be

  • true
  • false
gn:dateTimeFormat Formats date/time in GnTextView

Can be

gn:s_gravity Sets the gravity of GnTextView content, this means text alignment within widget

Can be

  • CENTER_HORIZONTAL
  • top|left
  • bottom
  • bottom|center
  • center|bottom
android:autoLink Controls whether links such as urls and email addresses are automatically found and converted to clickable links. The default value is "none", disabling this feature.

Can be

  • web Match Web URLs.
  • email Match email addresses.
  • phone Match phone numbers.
  • map Match map addresses.
  • all Match all patterns (equivalent to web|email|phone|map).
  • none Match no patterns (default)
gn:dataType Defines datatype of widget

Events

gn:act_setClick
gn:act_setLongClick

Data types

Input
text
number
iBeacon
dateTime
date
time
pointer
phoneNumber
gps
counter
enum
Output
text

Example

<com.ginstr.widgets.GnTextView
  android:id="@+id/page5_CurrentDate"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_alignParentLeft="true" 
  android:layout_marginTop="10dp"
  android:textSize="25sp"
  android:textColor="#151515"
  gn:showCurrentDate="true"
  gn:dateTimeFormat="dd.MM.yyyy"/>