{"action":"created","comment":{"url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/pulls/comments/58690981","id":58690981,"diff_hunk":"@@ -0,0 +1,106 @@\n+package fiware.smartcity.marketplace;\n+\n+import android.app.Activity;\n+import android.content.Context;\n+import android.graphics.drawable.Drawable;\n+import android.os.Message;\n+import android.support.v7.app.AppCompatActivity;\n+import android.support.v7.widget.Toolbar;\n+import android.transition.Scene;\n+import android.transition.TransitionManager;\n+import android.view.ViewGroup;\n+import android.webkit.WebChromeClient;\n+import android.webkit.WebView;\n+import android.webkit.WebViewClient;\n+import android.widget.RelativeLayout;\n+\n+import fiware.smartcity.Application;\n+import fiware.smartcity.MainActivity;\n+import fiware.smartcity.R;\n+\n+/**\n+ * Created by francisco on 29/03/16.\n+ */\n+public class MarketActivity {\n+    private Context context;\n+\n+    private static Activity activity;\n+\n+    private Drawable x, y;\n+    private WebView webView;\n+\n+    public MarketActivity(Context ctx) {\n+        context = ctx;\n+        activity = Application.mainActivity;\n+\n+        x = activity.getResources().getDrawable(R.drawable.clear);\n+        x.setBounds(0, 0, 50, 50);\n+\n+        y = activity.getResources().getDrawable(R.drawable.search);\n+        y.setBounds(0, 0, 50, 50);\n+    }\n+\n+    public void start() {\n+        ViewGroup rootContainer = (ViewGroup) activity.findViewById(R.id.mainFrame);\n+        activity.getLayoutInflater().inflate(R.layout.route, rootContainer);\n+\n+        ViewGroup routeContainer = (ViewGroup) activity.findViewById(R.id.frameRoute);\n+        Scene scene1 = Scene.getSceneForLayout(routeContainer, R.layout.activity_market, activity);\n+\n+        TransitionManager.go(scene1);\n+\n+        // Create a web view containing the Business API Ecosystem web page\n+        webView = (WebView) activity.findViewById(R.id.market);\n+\n+        webView.setWebViewClient(new WebViewClient());\n+        webView.setWebChromeClient(new WebChromeClient() {\n+            // Handle window.open requests in order to support PayPal redirection\n+            @Override\n+            public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) {\n+                webView.removeAllViews();\n+                webView.scrollTo(0, 0);\n+\n+                WebView newView = new WebView(context);\n+                newView.getSettings().setJavaScriptEnabled(true);\n+\n+                newView.setWebViewClient(new WebViewClient());\n+                newView.setWebChromeClient(new WebChromeClient() {\n+                    @Override\n+                    public void onCloseWindow(WebView view) {\n+                        // Remove the new view when the window is closed in order to return to the marketplace\n+                        ((WebView) view.getParent()).removeView(view);\n+                    }\n+                });\n+\n+                // Create dynamically a new view\n+                newView.setLayoutParams(new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));\n+                webView.addView(newView);\n+\n+                WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;\n+                transport.setWebView(newView);\n+                resultMsg.sendToTarget();\n+                return true;\n+            }\n+        });\n+\n+        webView.getSettings().setJavaScriptEnabled(true);\n+        webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);\n+        webView.getSettings().setSupportMultipleWindows(true);\n+\n+        webView.loadUrl(\"https://demo-mwc.conwet.com/\");\n+\n+        setupHeader();\n+    }\n+\n+    public void back() {\n+        ((MainActivity)activity).onMarketplaceClosed();\n+    }\n+\n+    private void setupHeader() {\n+        Toolbar myToolbar = (Toolbar) activity.findViewById(R.id.my_toolbar);\n+        ((AppCompatActivity)activity).setSupportActionBar(myToolbar);\n+\n+        ((AppCompatActivity)activity).getSupportActionBar().setTitle(\"Marketplace\");","path":"app/src/main/java/fiware/smartcity/marketplace/MarketActivity.java","position":103,"original_position":103,"commit_id":"c145c31c4a22b182a9a38d26b50ed4b6bd95d6a4","original_commit_id":"c145c31c4a22b182a9a38d26b50ed4b6bd95d6a4","user":{"login":"jmcanterafonseca","id":694782,"avatar_url":"https://avatars.githubusercontent.com/u/694782?v=3","gravatar_id":"","url":"https://api.github.com/users/jmcanterafonseca","html_url":"https://github.com/jmcanterafonseca","followers_url":"https://api.github.com/users/jmcanterafonseca/followers","following_url":"https://api.github.com/users/jmcanterafonseca/following{/other_user}","gists_url":"https://api.github.com/users/jmcanterafonseca/gists{/gist_id}","starred_url":"https://api.github.com/users/jmcanterafonseca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmcanterafonseca/subscriptions","organizations_url":"https://api.github.com/users/jmcanterafonseca/orgs","repos_url":"https://api.github.com/users/jmcanterafonseca/repos","events_url":"https://api.github.com/users/jmcanterafonseca/events{/privacy}","received_events_url":"https://api.github.com/users/jmcanterafonseca/received_events","type":"User","site_admin":false},"body":"\"Data Marketplace\"","created_at":"2016-04-06T11:44:22Z","updated_at":"2016-04-06T11:44:22Z","html_url":"https://github.com/Fiware/showcase.smartcity.carNavigator/pull/1#discussion_r58690981","pull_request_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/pulls/comments/58690981"},"html":{"href":"https://github.com/Fiware/showcase.smartcity.carNavigator/pull/1#discussion_r58690981"},"pull_request":{"href":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/pulls/1","id":64797270,"html_url":"https://github.com/Fiware/showcase.smartcity.carNavigator/pull/1","diff_url":"https://github.com/Fiware/showcase.smartcity.carNavigator/pull/1.diff","patch_url":"https://github.com/Fiware/showcase.smartcity.carNavigator/pull/1.patch","issue_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/issues/1","number":1,"state":"open","locked":false,"title":"Initial integration of the Business API Ecosystem","user":{"login":"fdelavega","id":2911173,"avatar_url":"https://avatars.githubusercontent.com/u/2911173?v=3","gravatar_id":"","url":"https://api.github.com/users/fdelavega","html_url":"https://github.com/fdelavega","followers_url":"https://api.github.com/users/fdelavega/followers","following_url":"https://api.github.com/users/fdelavega/following{/other_user}","gists_url":"https://api.github.com/users/fdelavega/gists{/gist_id}","starred_url":"https://api.github.com/users/fdelavega/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fdelavega/subscriptions","organizations_url":"https://api.github.com/users/fdelavega/orgs","repos_url":"https://api.github.com/users/fdelavega/repos","events_url":"https://api.github.com/users/fdelavega/events{/privacy}","received_events_url":"https://api.github.com/users/fdelavega/received_events","type":"User","site_admin":false},"body":"- New Menu item for accessing the marketplace\r\n- New view containing the marketplace as a WebView","created_at":"2016-03-31T14:16:03Z","updated_at":"2016-04-06T11:44:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"94829481ceb0451e49801c3ed7dd7cb4eaf20a08","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/pulls/1/commits","review_comments_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/pulls/1/comments","review_comment_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/issues/1/comments","statuses_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/statuses/c145c31c4a22b182a9a38d26b50ed4b6bd95d6a4","head":{"label":"FIWARE-TMForum:master","ref":"master","sha":"c145c31c4a22b182a9a38d26b50ed4b6bd95d6a4","user":{"login":"FIWARE-TMForum","id":15013013,"avatar_url":"https://avatars.githubusercontent.com/u/15013013?v=3","gravatar_id":"","url":"https://api.github.com/users/FIWARE-TMForum","html_url":"https://github.com/FIWARE-TMForum","followers_url":"https://api.github.com/users/FIWARE-TMForum/followers","following_url":"https://api.github.com/users/FIWARE-TMForum/following{/other_user}","gists_url":"https://api.github.com/users/FIWARE-TMForum/gists{/gist_id}","starred_url":"https://api.github.com/users/FIWARE-TMForum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FIWARE-TMForum/subscriptions","organizations_url":"https://api.github.com/users/FIWARE-TMForum/orgs","repos_url":"https://api.github.com/users/FIWARE-TMForum/repos","events_url":"https://api.github.com/users/FIWARE-TMForum/events{/privacy}","received_events_url":"https://api.github.com/users/FIWARE-TMForum/received_events","type":"Organization","site_admin":false},"repo":{"id":54959253,"name":"showcase.smartcity.carNavigator","full_name":"FIWARE-TMForum/showcase.smartcity.carNavigator","owner":{"login":"FIWARE-TMForum","id":15013013,"avatar_url":"https://avatars.githubusercontent.com/u/15013013?v=3","gravatar_id":"","url":"https://api.github.com/users/FIWARE-TMForum","html_url":"https://github.com/FIWARE-TMForum","followers_url":"https://api.github.com/users/FIWARE-TMForum/followers","following_url":"https://api.github.com/users/FIWARE-TMForum/following{/other_user}","gists_url":"https://api.github.com/users/FIWARE-TMForum/gists{/gist_id}","starred_url":"https://api.github.com/users/FIWARE-TMForum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FIWARE-TMForum/subscriptions","organizations_url":"https://api.github.com/users/FIWARE-TMForum/orgs","repos_url":"https://api.github.com/users/FIWARE-TMForum/repos","events_url":"https://api.github.com/users/FIWARE-TMForum/events{/privacy}","received_events_url":"https://api.github.com/users/FIWARE-TMForum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/FIWARE-TMForum/showcase.smartcity.carNavigator","description":"This repository contains the Java code of a FIWARE-enabled car navigator for Android","fork":true,"url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator","forks_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/forks","keys_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/teams","hooks_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/hooks","issue_events_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/issues/events{/number}","events_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/events","assignees_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/assignees{/user}","branches_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/branches{/branch}","tags_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/tags","blobs_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/git/refs{/sha}","trees_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/statuses/{sha}","languages_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/languages","stargazers_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/stargazers","contributors_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/contributors","subscribers_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/subscribers","subscription_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/subscription","commits_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/commits{/sha}","git_commits_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/git/commits{/sha}","comments_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/comments{/number}","issue_comment_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/issues/comments{/number}","contents_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/contents/{+path}","compare_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/merges","archive_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/downloads","issues_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/issues{/number}","pulls_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/pulls{/number}","milestones_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/milestones{/number}","notifications_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/labels{/name}","releases_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/releases{/id}","deployments_url":"https://api.github.com/repos/FIWARE-TMForum/showcase.smartcity.carNavigator/deployments","created_at":"2016-03-29T08:33:10Z","updated_at":"2016-03-29T08:33:11Z","pushed_at":"2016-03-30T16:50:14Z","git_url":"git://github.com/FIWARE-TMForum/showcase.smartcity.carNavigator.git","ssh_url":"git@github.com:FIWARE-TMForum/showcase.smartcity.carNavigator.git","clone_url":"https://github.com/FIWARE-TMForum/showcase.smartcity.carNavigator.git","svn_url":"https://github.com/FIWARE-TMForum/showcase.smartcity.carNavigator","homepage":"","size":1673,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Fiware:master","ref":"master","sha":"a2e53acdccc515354721a0a0788c76269c9ab737","user":{"login":"Fiware","id":5936803,"avatar_url":"https://avatars.githubusercontent.com/u/5936803?v=3","gravatar_id":"","url":"https://api.github.com/users/Fiware","html_url":"https://github.com/Fiware","followers_url":"https://api.github.com/users/Fiware/followers","following_url":"https://api.github.com/users/Fiware/following{/other_user}","gists_url":"https://api.github.com/users/Fiware/gists{/gist_id}","starred_url":"https://api.github.com/users/Fiware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fiware/subscriptions","organizations_url":"https://api.github.com/users/Fiware/orgs","repos_url":"https://api.github.com/users/Fiware/repos","events_url":"https://api.github.com/users/Fiware/events{/privacy}","received_events_url":"https://api.github.com/users/Fiware/received_events","type":"Organization","site_admin":false},"repo":{"id":54025220,"name":"showcase.smartcity.carNavigator","full_name":"Fiware/showcase.smartcity.carNavigator","owner":{"login":"Fiware","id":5936803,"avatar_url":"https://avatars.githubusercontent.com/u/5936803?v=3","gravatar_id":"","url":"https://api.github.com/users/Fiware","html_url":"https://github.com/Fiware","followers_url":"https://api.github.com/users/Fiware/followers","following_url":"https://api.github.com/users/Fiware/following{/other_user}","gists_url":"https://api.github.com/users/Fiware/gists{/gist_id}","starred_url":"https://api.github.com/users/Fiware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fiware/subscriptions","organizations_url":"https://api.github.com/users/Fiware/orgs","repos_url":"https://api.github.com/users/Fiware/repos","events_url":"https://api.github.com/users/Fiware/events{/privacy}","received_events_url":"https://api.github.com/users/Fiware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Fiware/showcase.smartcity.carNavigator","description":"This repository contains the Java code of a FIWARE-enabled car navigator for Android","fork":false,"url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator","forks_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/forks","keys_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/teams","hooks_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/hooks","issue_events_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/issues/events{/number}","events_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/events","assignees_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/assignees{/user}","branches_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/branches{/branch}","tags_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/tags","blobs_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/git/refs{/sha}","trees_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/statuses/{sha}","languages_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/languages","stargazers_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/stargazers","contributors_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/contributors","subscribers_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/subscribers","subscription_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/subscription","commits_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/commits{/sha}","git_commits_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/git/commits{/sha}","comments_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/comments{/number}","issue_comment_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/issues/comments{/number}","contents_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/contents/{+path}","compare_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/merges","archive_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/downloads","issues_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/issues{/number}","pulls_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/pulls{/number}","milestones_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/milestones{/number}","notifications_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/labels{/name}","releases_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/releases{/id}","deployments_url":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/deployments","created_at":"2016-03-16T11:12:00Z","updated_at":"2016-03-16T11:15:25Z","pushed_at":"2016-04-06T11:33:16Z","git_url":"git://github.com/Fiware/showcase.smartcity.carNavigator.git","ssh_url":"git@github.com:Fiware/showcase.smartcity.carNavigator.git","clone_url":"https://github.com/Fiware/showcase.smartcity.carNavigator.git","svn_url":"https://github.com/Fiware/showcase.smartcity.carNavigator","homepage":"","size":1676,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/pulls/1"},"html":{"href":"https://github.com/Fiware/showcase.smartcity.carNavigator/pull/1"},"issue":{"href":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/issues/1"},"comments":{"href":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/Fiware/showcase.smartcity.carNavigator/statuses/c145c31c4a22b182a9a38d26b50ed4b6bd95d6a4"}}}}