From wiki.ginstr.com
Jump to: navigation, search
m (XML Attributes Description)
m
Line 8: Line 8:
 
;Description
 
;Description
 
: Widget which shows media items as images in table view. It is a composite control made of <code>[http://developer.android.com/reference/android/widget/TableLayout.html TableLayout]</code>, <code>[http://developer.android.com/reference/android/widget/TableRow.html TableRow]</code> and <code>[http://developer.android.com/reference/android/widget/ImageView.html ImageView]</code>.
 
: Widget which shows media items as images in table view. It is a composite control made of <code>[http://developer.android.com/reference/android/widget/TableLayout.html TableLayout]</code>, <code>[http://developer.android.com/reference/android/widget/TableRow.html TableRow]</code> and <code>[http://developer.android.com/reference/android/widget/ImageView.html ImageView]</code>.
: Clicking on the selected image will display it in full screen mode as a top overlay item. It can be used in conjunction with <code>[[GnMediaAction]]</code> widget, e.g. use <code>[[gn:act_copyData]]</code> action to display a picture in gallery widget just after the picture is taken.
+
: Clicking on the selected image will display it in full screen mode as a top overlay item.
 +
: It can be used in conjunction with <code>[[GnMediaAction]]</code> widget, e.g. use <code>[[gn:act_copyData]]</code> action to display a picture in gallery widget just after the picture is taken.
  
 
==XML Attributes Description==
 
==XML Attributes Description==

Revision as of 13:11, 12 July 2017

GnMediaGallery

Widget XML tag
<com.ginstr.widgets.GnMediaGallery>
Description
Widget which shows media items as images in table view. It is a composite control made of TableLayout, TableRow and ImageView.
Clicking on the selected image will display it in full screen mode as a top overlay item.
It can be used in conjunction with GnMediaAction widget, e.g. use gn:act_copyData action to display a picture in gallery widget just after the picture is taken.

XML Attributes Description

Attribute Description
gn:numberOfColumns* Defines number of displayed items per row

Can be

  • hardcoded, i.e. 3
gn:itemHorizontalSpacing Defines horizontal spacing between columns

Can be

  • hardcoded, i.e. 2 (expressed in dp)
gn:itemVerticalSpacing Defines vertical spacing between rows

Can be

  • hardcoded, i.e. 2 (expressed in dp)
gn:itemSameSize Defines how the images will be displayed in the widget

Can be

  • true - all images will be cropped to same (squared) size
  • false - each image will maintain aspect ratio
gn:clearOnNewDataAdd If set to true, each time data is added to gallery all previous data will be removed from it

Can be

  • true
  • false

Example

<com.ginstr.widgets.GnMediaGallery
  android:id="@+id/cleaningServicePhotosShow"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  gn:numberOfColumns="3"
  gn:itemHorizontalSpacing="5"
  gn:itemVerticalSpacing="5"
  gn:itemSameSize="true" />