From wiki.ginstr.com
Jump to: navigation, search
(Created page with "<div style="float:right; clear:both; margin-left:0.5em;">__TOC__</div> ;Can be used on widgets: any widget ;Additional required attributes on bound widget: none ;Event trigg...")
 
m
Line 20: Line 20:
 
*<code>target</code> – can be:
 
*<code>target</code> – can be:
 
**<code>@+id/targetLayoutId</code> – id of target root layout
 
**<code>@+id/targetLayoutId</code> – id of target root layout
**<code>aliasOfLayout</code> – Alias of root layout to open.
+
**<code>aliasOfLayout</code> – Alias of root layout to open
 
**<code>[[GnDropDown]]</code> which has <code>“local”</code> datasource from <code>@array/someArray</code> with <code>@array/someArray_value</code>, <code>someArray_value</code> should contain id’s of root layouts for screens without <code>@+id/prefix</code> (this can be used on i.e. <code>[[gn:act_setItemSelect]]</code> of dropdown when value is changed to go to different screen or in other scenarios)
 
**<code>[[GnDropDown]]</code> which has <code>“local”</code> datasource from <code>@array/someArray</code> with <code>@array/someArray_value</code>, <code>someArray_value</code> should contain id’s of root layouts for screens without <code>@+id/prefix</code> (this can be used on i.e. <code>[[gn:act_setItemSelect]]</code> of dropdown when value is changed to go to different screen or in other scenarios)
  
 
*<code>@+id/targetLayoutId</code> – id of target root layout to open
 
*<code>@+id/targetLayoutId</code> – id of target root layout to open
  
*<code>aliasOfLayout</code> – Alias of root layout to open.
+
*<code>aliasOfLayout</code> – Alias of root layout to open
  
 
==XML usage preview==
 
==XML usage preview==

Revision as of 09:42, 30 June 2016

Can be used on widgets
any widget
Additional required attributes on bound widget
none
Event trigger for action
click on a widget (gn:act_toLayoutClick)
Can be used as


gn:act_toLayoutClick changes displayed root layout to desired target.

Action signature

gn:act_toLayoutClick=”target”
gn:act_toLayoutClick=”aliasOfLayout”

Value field content

  • target – can be:
    • @+id/targetLayoutId – id of target root layout
    • aliasOfLayout – Alias of root layout to open
    • GnDropDown which has “local” datasource from @array/someArray with @array/someArray_value, someArray_value should contain id’s of root layouts for screens without @+id/prefix (this can be used on i.e. gn:act_setItemSelect of dropdown when value is changed to go to different screen or in other scenarios)
  • @+id/targetLayoutId – id of target root layout to open
  • aliasOfLayout – Alias of root layout to open

XML usage preview

The example below uses gn:act_toLayoutClick=”target” to display another root layout that is contained in folder “layout” on the device. When the user clicks on this button another layout with id “@+id/navigation0” is opened.

<source lang="xml"> <Button

   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:text="Click to go to layout navigation0"
   ek:act_toLayoutClick="@+id/navigation0" />

</source>

The target XML layout that is opened by widget is shown below: <source lang="xml"> <FrameLayout xmnls:android="http://schemas.android.com/apk/res/android"

   xmnls:tools="http://schemas.android.com/tools"
   xmnls:ek="http://schemas.enaikoon.com/enaikoon"
   android:id="@+id/navigation0"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:background=""#ffb400" >
   <TextView
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:text="I am layout @+id/navigation0"
       android:textColor="#000000" />

</FrameLayout> </source>

Special attributes

gn:disableSwipe
If widget is using attribute gn:act_toLayoutSwipe then if gn:disableSwipe="left|right" attribute exists on widget, a widget swipe will behave differently:
a. if attribute has an invalid value, a pop up a message will appear for the designer "Invalid swipe restriction command"
b. if it has "left" value, swipes with the finger from right to left or vice versa will be ignored
c. if it has "right" value, swipes with the finger from left to right or vice versa will be ignored
d. if attribute is omitted, swipes in either direction will work with no restrictions