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

GnListOfMedia

Widget XML tag
<com.ginstr.widgets.GnListOfMedia>
Description
GnListOfMedia provides ability to enter media files into ginstr tables. Currently it only supports audio files. It is a composite control made of LinearLayout as root node. It has custom control layout for each type of media it uses which can be modified and defined.

XML Attributes Description

Note: An attribute marked with asterisk (*) is a mandatory parameter when creating widget.

Attribute Description
gn:rowXmlDefinition* Defines layout to parse for widget, it must be provided, see "Internal control layouts" heading for more information
gn:act_setAfterRowDeleted Optional event which can be used to implement additional business logic. Triggers after the row is deleted via button @+id/listOfMediaDelete
gn:act_setOnDeleteRowClick Optional event which can be used to implement additional business logic. Triggers before row is deleted. Row deletion can also be stopped if gn:act_break is executed in this action set.
gn:mediaType* Defines which media type is processed by the widget, currently only audio is supported.
gn:dataType* Defines datatype of widget

Events

gn:act_setClick
gn:act_setLongClick

Data types

Input
audio
Output
audio

Example

<com.ginstr.widgets.GnListOfMedia
    android:id="@+id/audioList"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    gn:rowXmlDefinition="listOfMediaRowAudio.xml"
    gn:act_setAfterRowDeleted="[gn:act_copyDataNew]|[@+id/audioList,@+id/Audio]"
    gn:mediaType="audio"
    gn:dataType="audio"
    gn:act_setOnDeleteRowClick="[gn:act_toast]|[@string/deletionToast]"			/>

Internal control layouts

Audio

Internal control layout can be set into control folder. It must be named as defined in the attribute "gn:rowXmlDefinition" and it must have valid XML structure.
Default control layout structure can be found here: listOfMediaRowAudio.xml
Widget Name Description
GnTextView @+id/listOfMediaTimeOfCreation this text field is used for displaying information of time of creation of the audio recording
GnTextView @+id/listOfMediaDuration this text field is used for displaying information of duration of audio recording
GnCheckBox @+id/listOfMediaPlayStop this "button" is used to start or stop reproduction of audio
GnCheckBox @+id/listOfMediaDelete this "button" is used to delete audio recording