Guest User

Untitled

a guest
Dec 15th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. {
  2. "type": "LinearLayout",
  3. "layout_height": "match_parent",
  4. "layout_width": "match_parent",
  5. "padding": "8dp",
  6. "orientation": "vertical",
  7. "children": [
  8. {
  9. "type": "EditText",
  10. "id": "etUsername",
  11. "layout_height": "wrap_content",
  12. "layout_width": "match_parent",
  13. "hint": "Username"
  14. },
  15. {
  16. "type": "EditText",
  17. "id": "etPassword",
  18. "layout_height": "wrap_content",
  19. "layout_width": "match_parent",
  20. "layout_marginTop": "4dp",
  21. "hint": "Password"
  22. },
  23. {
  24. "type": "Button",
  25. "id": "btnLogin",
  26. "layout_height": "wrap_content",
  27. "layout_width": "match_parent",
  28. "layout_marginTop": "4dp",
  29. "text": "Login",
  30. "onClick": {
  31. "action": "apiCall",
  32. "extras": {
  33. "endpoint": "www.someapi.com/api/v1/login",
  34. "method": "POST",
  35. "body": {
  36. "username": "",
  37. "password": ""
  38. }
  39. }
  40. }
  41. }
  42. ]
  43. }
  44.  
  45. {
  46. "onClick": {
  47. "@": {
  48. "action": "apiCall",
  49. "extras": {
  50. "endpoint": "www.someapi.com/api/v1/login",
  51. "method": "POST",
  52. "body": {
  53. "username": "@{form.data.username}",
  54. "password": "@{form.data.password}"
  55. }
  56. }
  57. }
  58. }
  59. }
  60.  
  61. {
  62. "onChange": {
  63. "@": {
  64. "action": "change",
  65. "changes": [
  66. {
  67. "path": "form.data.username",
  68. "value": "<insert the text value from the TextWatcher before triggering the event>"
  69. }
  70. ]
  71. }
  72. }
  73. }
Add Comment
Please, Sign In to add comment