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

GnLogin

Widget XML tag
<com.ginstr.widgets.GnLogin>
Description
GnLogin provides an interface for a user login. It is connected to ginstr SSO server and ginstr IW server.
In order to authenticate with any ginstr app it’s necessary to have an account on both SSO and ginstr server.
It also supports offline work mode. If there is no internet connection and there was a previously successful login, it will use the data from that login to authenticate itself.
After a successful login the user can process to layout provided as target.

XML Attributes Description

Attribute Description
gn:act_toLayoutLogin Special action used only on login widget to open another layout after successful login

Can be

  • layoutId - i.e. @+id/report

Example

<com.ginstr.widgets.GnLogin
  android:id="@+id/btnLogin"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:layout_below="@+id/txtAppName"
  android:layout_centerHorizontal="true"
  android:layout_marginLeft="20dp"
  android:layout_marginRight="20dp"
  gn:act_toLayoutLogin="@+id/report" />

Alternative layout

If the default look and feel needs to be changed, create or copy identical files from $defaultApp to current app "control" folder.
To provide alternative layout, the files mentioned above can be set into control folder of the current application. Files must be named as shown above and widgets with Id’s have to stay of same type and keep same id.

widget_en_login.xml

Widget Name Description
TextView @+id/tvCreateUser opens URL for user registration
GnEditText @+id/etUserName username container
GnEditText @+id/etPassword password container
Button @+id/bLogin click on this button will initiate login mechanism
CheckBox @+id/chkShowPw control used to show/hide entered password
TextView @+id/tvReset click on this button will initiate reset password mechanism