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

Signature

Widget is represented by a button. When button is clicked signature activity is opened where user can take signature. After user has taken signature, signature is shown in gallery below the button.

Widget id, ${gbamID}:

mediaSignature

Back to GBAM widgets table

Datatypes

Value is stored from widget to database as signature datatype.

Predefined user data

PreLoaded

Properties panel

User will configure this data in properties panels of selected widget:

GENERAL
  • "label", ${widgetLabel}
  • "max signatures" , input field.
    • number can not be smaller than 1
    • if user did not provide any value set it to 1
    • if number 1 or more then add following attribute to widget : gn:maxMediaTaken and set to entered number
    • if number is 1 then add the following attribute to widget: gn:hideCounter and set to true
VALIDATIONS
    <columnSignature required="true|false"></columnSignature>
ACTION
  • -
ACTION MESSAGES
  • -
DATABASE
  • "is part of database", checkbox option by default is set as checked. When checked database column is created for this widget.
  • "additional ginstr web column settings":
  • "replicate", if true, replicates signatures from server to android client, add to configuration.xml:
<columnSignature>
    <replicate>true|false</replicate>
</columnSignature>

Code snippets

GBAM Code Variables

Variables which are used in code snippet below but not defined in user modifiable inputs.

Common widget code

<com.ginstr.widgets.GnMediaAction
    android:id="@+id/${widgetID}_button"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    gn:act_setAfterMediaTaken="[gn:act_copyDataNew]|[@+id/${widgetID}_button,@+id/${widgetID}_gallery]"
    gn:s_actionType="signature"
    gn:dataType="signature"
    gn:buttonText="@string/${widgetID}"
    gn:style="@style/mediaSignature_button"/>

<LinearLayout
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    gn:style="@style/mediaSignature_galleryContainer">

        <com.ginstr.widgets.GnMediaGallery
            android:id="@+id/${widgetID}_gallery"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            gn:dataType="signature"
            gn:allowPhotoDeletion="true"
            gn:mediaActionId="@+id/${widgetID}_button"
            gn:style="@style/mediaSignature_gallery" />
</LinearLayout>

strings.xml

Lines to be added for each language.

<string name="${widgetID}">${widgetLabel}</string>

internal widget layout

This widget has internal structure widget_en_mediaaction_signature.xml