{"_id":"588861fa165af631008ee1cb","category":{"_id":"588861fa165af631008ee1bc","__v":0,"version":"588861fa165af631008ee1b8","project":"54861bb654b3ce0b00367292","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-09-11T08:50:30.403Z","from_sync":false,"order":3,"slug":"android-essentials-kit","title":"Android / Essentials KIt"},"project":"54861bb654b3ce0b00367292","user":"548d74b716fc980b00e2a786","version":{"_id":"588861fa165af631008ee1b8","__v":1,"project":"54861bb654b3ce0b00367292","createdAt":"2017-01-25T08:29:46.061Z","releaseDate":"2017-01-25T08:29:46.061Z","categories":["588861fa165af631008ee1b9","588861fa165af631008ee1ba","588861fa165af631008ee1bb","588861fa165af631008ee1bc","588861fa165af631008ee1bd","588861fa165af631008ee1be","588861fa165af631008ee1bf","588861fa165af631008ee1c0","588861fa165af631008ee1c1","588861fa165af631008ee1c2","588861fa165af631008ee1c3","588861fa165af631008ee1c4","588861fa165af631008ee1c5","588861fa165af631008ee1c6","588861fa165af631008ee1c7","588861fa165af631008ee1c8","588861fa165af631008ee1c9"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"5.0.0","version":"5.0"},"__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-09-11T09:01:20.282Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":33,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Actions\"\n}\n[/block]\nActions is the ability to extend functionality on clickable buttons in an experience, to lean more about actions, please visit knowledge base  <a href=\"http://helpdesk.elasticode.com/articles/3068-actions-and-how-to-work-with-them\" target=\"_blank\">here</a>\n\nHere is a way you can extend that with your own functionality\nIn order to add an action, simply create an ``ElasticodeAction`` object with the parameters:\n* Name - A string representation of your code block\n* ElasticodeOnClickListener - With `onClick` event contains the proper functionality.\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// Add the following code before calling elasticode.ready()\\n\\n// Create\\nElasticodeAction showVideoAction = new ElasticodeAction(\\\"Show video\\\", new ElasticodeOnClickListener() {\\n            :::at:::Override\\n            public void onClick(View v) {\\n                super.onClick(v);\\n                // Show video\\n            }\\n        });\\n\\n// Add to Elasticode object\\nelasticode.addActions(showVideoAction);\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\nOnce you will add this, this action will immediately populate as an option in the action option box:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/1557b18-2323.png\",\n        \"2323.png\",\n        620,\n        365,\n        \"#34648e\"\n      ],\n      \"sizing\": \"80\",\n      \"border\": true\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"extra-setup-actions-1","type":"basic","title":"Extra setup / Actions"}

Extra setup / Actions


[block:api-header] { "type": "basic", "title": "Actions" } [/block] Actions is the ability to extend functionality on clickable buttons in an experience, to lean more about actions, please visit knowledge base <a href="http://helpdesk.elasticode.com/articles/3068-actions-and-how-to-work-with-them" target="_blank">here</a> Here is a way you can extend that with your own functionality In order to add an action, simply create an ``ElasticodeAction`` object with the parameters: * Name - A string representation of your code block * ElasticodeOnClickListener - With `onClick` event contains the proper functionality. [block:code] { "codes": [ { "code": "// Add the following code before calling elasticode.ready()\n\n// Create\nElasticodeAction showVideoAction = new ElasticodeAction(\"Show video\", new ElasticodeOnClickListener() {\n @Override\n public void onClick(View v) {\n super.onClick(v);\n // Show video\n }\n });\n\n// Add to Elasticode object\nelasticode.addActions(showVideoAction);", "language": "java" } ] } [/block] Once you will add this, this action will immediately populate as an option in the action option box: [block:image] { "images": [ { "image": [ "https://files.readme.io/1557b18-2323.png", "2323.png", 620, 365, "#34648e" ], "sizing": "80", "border": true } ] } [/block]