From wiki.ginstr.com
Jump to: navigation, search
(Change displayed layout as parameter)
m (formatting)
Line 10: Line 10:
 
===Change displayed layout as widget parameter===
 
===Change displayed layout as widget parameter===
  
;<code>gn:act_toLayoutSwipe="target"</code>
+
:;<code>gn:act_toLayoutSwipe="target"</code>
  
{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
+
:{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
 
|-
 
|-
 
! scope="col" | Parameter
 
! scope="col" | Parameter
 
! scope="col" | Description
 
! scope="col" | Description
 
|-
 
|-
| layout
+
| <code>layout</code>
 
| [[target]] which will be displayed on the screen
 
| [[target]] which will be displayed on the screen
 
Can be
 
Can be
 
* hardcoded id of target root layout
 
* hardcoded id of target root layout
* [[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)
+
* <code>[[GnDropDown]]</code> which has "local" 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)
 
|-
 
|-
 
|}
 
|}
Line 39: Line 41:
  
 
==Special attributes==
 
==Special attributes==
;<code>gn:disableSwipe</code>  
+
:;<code>gn:disableSwipe</code>  
: if attribute exists on widget, a widget swipe will behave differently:
+
:: if attribute exists on widget, a widget swipe will behave differently:
  
{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
+
:{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
 
|-
 
|-
 
! scope="col" | Attribute
 
! scope="col" | Attribute

Revision as of 19:56, 12 July 2017

gn:act_toLayoutSwipe

Description
Action used to change displayed root layout to desired target by swiping the widget.
Action returns
boolean

Action signatures

Change displayed layout as widget parameter

gn:act_toLayoutSwipe="target"
Parameter Description
layout target which will be displayed on the screen

Can be

  • hardcoded id of target root layout
  • 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)

Example

<ScrollView
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  xmlns:gn="http://schemas.ginstr.com/ginstr"
  android:id="@+id/page2"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  gn:act_toLayoutSwipe="@+id/page3" />

Special attributes

gn:disableSwipe
if attribute exists on widget, a widget swipe will behave differently:
Attribute Behaviour
left Swipes with the finger from right to left will be ignored
right Swipes with the finger from left to right will be ignored
invalid value If attribute has an invalid value, a pop up a message will appear for the designer ("Invalid swipe restriction command")
omitted If attribute is omitted, swipes in either direction will work with no restrictions