Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "type": "LinearLayout",
- "layout_height": "match_parent",
- "layout_width": "match_parent",
- "padding": "8dp",
- "orientation": "vertical",
- "children": [
- {
- "type": "EditText",
- "id": "etUsername",
- "layout_height": "wrap_content",
- "layout_width": "match_parent",
- "hint": "Username"
- },
- {
- "type": "EditText",
- "id": "etPassword",
- "layout_height": "wrap_content",
- "layout_width": "match_parent",
- "layout_marginTop": "4dp",
- "hint": "Password"
- },
- {
- "type": "Button",
- "id": "btnLogin",
- "layout_height": "wrap_content",
- "layout_width": "match_parent",
- "layout_marginTop": "4dp",
- "text": "Login",
- "onClick": {
- "action": "apiCall",
- "extras": {
- "endpoint": "www.someapi.com/api/v1/login",
- "method": "POST",
- "body": {
- "username": "",
- "password": ""
- }
- }
- }
- }
- ]
- }
- {
- "onClick": {
- "@": {
- "action": "apiCall",
- "extras": {
- "endpoint": "www.someapi.com/api/v1/login",
- "method": "POST",
- "body": {
- "username": "@{form.data.username}",
- "password": "@{form.data.password}"
- }
- }
- }
- }
- }
- {
- "onChange": {
- "@": {
- "action": "change",
- "changes": [
- {
- "path": "form.data.username",
- "value": "<insert the text value from the TextWatcher before triggering the event>"
- }
- ]
- }
- }
- }
Add Comment
Please, Sign In to add comment