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

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