From wiki.ginstr.com
Revision as of 13:11, 12 July 2017 by Mark (talk | contribs)
Jump to: navigation, search

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" />