{"action":"created","comment":{"url":"https://api.github.com/repos/kirich1409/Android-Homework/pulls/comments/25279027","id":25279027,"diff_hunk":"@@ -0,0 +1,101 @@\n+package net.k6.browser;\n+\n+import android.app.Activity;\n+import android.content.Context;\n+import android.content.Intent;\n+import android.graphics.Bitmap;\n+import android.graphics.Color;\n+import android.net.Uri;\n+import android.os.Bundle;\n+import android.text.TextUtils;\n+import android.view.View;\n+import android.view.inputmethod.InputMethodManager;\n+import android.webkit.WebView;\n+import android.webkit.WebViewClient;\n+import android.widget.Button;\n+import android.widget.EditText;\n+\n+import java.util.ArrayList;\n+import java.util.List;\n+\n+\n+public class BrowserActivity extends Activity {\n+\n+    @Override\n+    protected void onCreate(Bundle savedInstanceState) {\n+        super.onCreate(savedInstanceState);\n+        setContentView(R.layout.activity_browser);\n+        final WebView webView = (WebView) findViewById(R.id.webView);\n+        final EditText urlText = (EditText) findViewById(R.id.urlText);\n+        Button goButton = (Button) findViewById(R.id.goButton);\n+        final Button backButton = (Button) findViewById(R.id.backButton);\n+        final Button forwardButton = (Button) findViewById(R.id.forwardButton);\n+        Button historyButton = (Button) findViewById(R.id.historyButton);\n+        webView.setWebViewClient(new WebViewClient() {\n+            @Override\n+            public void onPageFinished(WebView view, String url) {\n+                super.onPageFinished(view, url);\n+                if (webView.canGoBack()) {\n+                    backButton.setEnabled(true);\n+                } else {\n+                    backButton.setEnabled(false);\n+                }\n+                if (webView.canGoForward()) {\n+                    forwardButton.setEnabled(true);\n+                } else {\n+                    forwardButton.setEnabled(false);\n+                }\n+            }\n+        });\n+        webView.getSettings().setLoadsImagesAutomatically(true);\n+        webView.getSettings().setJavaScriptEnabled(true);\n+        webView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);\n+        Intent intent = getIntent();\n+        if (\"android.intent.action.VIEW\".equals(intent.getAction())) {\n+            String uri = intent.getData().toString();\n+            if (!TextUtils.isEmpty(uri)) {\n+                webView.loadUrl(uri);\n+            }\n+        }\n+        backButton.setEnabled(false);\n+        forwardButton.setEnabled(false);\n+        goButton.setOnClickListener(new View.OnClickListener() {\n+            @Override\n+            public void onClick(View v) {\n+                String url = urlText.getText().toString();\n+                InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);\n+                inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);\n+                if (url != null) {\n+                    if (url.startsWith(\"http://\")) {\n+                        History.addHistory(url);\n+                        webView.loadUrl(url);\n+                    } else {\n+                        History.addHistory(url);\n+                        webView.loadUrl(\"http://\" + url);\n+                    }\n+                }\n+            }\n+        });\n+        backButton.setOnClickListener(new View.OnClickListener() {\n+            @Override\n+            public void onClick(View v) {\n+                webView.goBackOrForward(-1);","path":"01.UI/dsamuilov/Browser2/app/src/main/java/net/k6/browser/BrowserActivity.java","position":82,"original_position":82,"commit_id":"47d792b325628f5ad59b6e5c8b29ff6574b4c28f","original_commit_id":"47d792b325628f5ad59b6e5c8b29ff6574b4c28f","user":{"login":"kirich1409","id":2403657,"avatar_url":"https://avatars.githubusercontent.com/u/2403657?v=3","gravatar_id":"","url":"https://api.github.com/users/kirich1409","html_url":"https://github.com/kirich1409","followers_url":"https://api.github.com/users/kirich1409/followers","following_url":"https://api.github.com/users/kirich1409/following{/other_user}","gists_url":"https://api.github.com/users/kirich1409/gists{/gist_id}","starred_url":"https://api.github.com/users/kirich1409/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kirich1409/subscriptions","organizations_url":"https://api.github.com/users/kirich1409/orgs","repos_url":"https://api.github.com/users/kirich1409/repos","events_url":"https://api.github.com/users/kirich1409/events{/privacy}","received_events_url":"https://api.github.com/users/kirich1409/received_events","type":"User","site_admin":false},"body":"Что это за магия?","created_at":"2015-02-24T18:42:45Z","updated_at":"2015-02-24T18:42:45Z","html_url":"https://github.com/kirich1409/Android-Homework/pull/23#discussion_r25279027","pull_request_url":"https://api.github.com/repos/kirich1409/Android-Homework/pulls/23","_links":{"self":{"href":"https://api.github.com/repos/kirich1409/Android-Homework/pulls/comments/25279027"},"html":{"href":"https://github.com/kirich1409/Android-Homework/pull/23#discussion_r25279027"},"pull_request":{"href":"https://api.github.com/repos/kirich1409/Android-Homework/pulls/23"}}},"pull_request":{"url":"https://api.github.com/repos/kirich1409/Android-Homework/pulls/23","id":29544517,"html_url":"https://github.com/kirich1409/Android-Homework/pull/23","diff_url":"https://github.com/kirich1409/Android-Homework/pull/23.diff","patch_url":"https://github.com/kirich1409/Android-Homework/pull/23.patch","issue_url":"https://api.github.com/repos/kirich1409/Android-Homework/issues/23","number":23,"state":"open","locked":false,"title":"Dmitriy Samuilov: Add \"4.Browser\" homework","user":{"login":"FunnyGardener","id":10142335,"avatar_url":"https://avatars.githubusercontent.com/u/10142335?v=3","gravatar_id":"","url":"https://api.github.com/users/FunnyGardener","html_url":"https://github.com/FunnyGardener","followers_url":"https://api.github.com/users/FunnyGardener/followers","following_url":"https://api.github.com/users/FunnyGardener/following{/other_user}","gists_url":"https://api.github.com/users/FunnyGardener/gists{/gist_id}","starred_url":"https://api.github.com/users/FunnyGardener/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FunnyGardener/subscriptions","organizations_url":"https://api.github.com/users/FunnyGardener/orgs","repos_url":"https://api.github.com/users/FunnyGardener/repos","events_url":"https://api.github.com/users/FunnyGardener/events{/privacy}","received_events_url":"https://api.github.com/users/FunnyGardener/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-18T17:22:55Z","updated_at":"2015-02-24T18:42:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ecdc184376f366334eebb5139981ddbdb1457aee","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kirich1409/Android-Homework/pulls/23/commits","review_comments_url":"https://api.github.com/repos/kirich1409/Android-Homework/pulls/23/comments","review_comment_url":"https://api.github.com/repos/kirich1409/Android-Homework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kirich1409/Android-Homework/issues/23/comments","statuses_url":"https://api.github.com/repos/kirich1409/Android-Homework/statuses/47d792b325628f5ad59b6e5c8b29ff6574b4c28f","head":{"label":"FunnyGardener:dsamuilov/01.UI/4.Browser","ref":"dsamuilov/01.UI/4.Browser","sha":"47d792b325628f5ad59b6e5c8b29ff6574b4c28f","user":{"login":"FunnyGardener","id":10142335,"avatar_url":"https://avatars.githubusercontent.com/u/10142335?v=3","gravatar_id":"","url":"https://api.github.com/users/FunnyGardener","html_url":"https://github.com/FunnyGardener","followers_url":"https://api.github.com/users/FunnyGardener/followers","following_url":"https://api.github.com/users/FunnyGardener/following{/other_user}","gists_url":"https://api.github.com/users/FunnyGardener/gists{/gist_id}","starred_url":"https://api.github.com/users/FunnyGardener/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FunnyGardener/subscriptions","organizations_url":"https://api.github.com/users/FunnyGardener/orgs","repos_url":"https://api.github.com/users/FunnyGardener/repos","events_url":"https://api.github.com/users/FunnyGardener/events{/privacy}","received_events_url":"https://api.github.com/users/FunnyGardener/received_events","type":"User","site_admin":false},"repo":{"id":30486196,"name":"Android-Homework","full_name":"FunnyGardener/Android-Homework","owner":{"login":"FunnyGardener","id":10142335,"avatar_url":"https://avatars.githubusercontent.com/u/10142335?v=3","gravatar_id":"","url":"https://api.github.com/users/FunnyGardener","html_url":"https://github.com/FunnyGardener","followers_url":"https://api.github.com/users/FunnyGardener/followers","following_url":"https://api.github.com/users/FunnyGardener/following{/other_user}","gists_url":"https://api.github.com/users/FunnyGardener/gists{/gist_id}","starred_url":"https://api.github.com/users/FunnyGardener/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FunnyGardener/subscriptions","organizations_url":"https://api.github.com/users/FunnyGardener/orgs","repos_url":"https://api.github.com/users/FunnyGardener/repos","events_url":"https://api.github.com/users/FunnyGardener/events{/privacy}","received_events_url":"https://api.github.com/users/FunnyGardener/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/FunnyGardener/Android-Homework","description":"","fork":true,"url":"https://api.github.com/repos/FunnyGardener/Android-Homework","forks_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/forks","keys_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/teams","hooks_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/hooks","issue_events_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/issues/events{/number}","events_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/events","assignees_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/assignees{/user}","branches_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/branches{/branch}","tags_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/tags","blobs_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/git/refs{/sha}","trees_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/statuses/{sha}","languages_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/languages","stargazers_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/stargazers","contributors_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/contributors","subscribers_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/subscribers","subscription_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/subscription","commits_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/commits{/sha}","git_commits_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/git/commits{/sha}","comments_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/comments{/number}","issue_comment_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/issues/comments{/number}","contents_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/contents/{+path}","compare_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/merges","archive_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/downloads","issues_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/issues{/number}","pulls_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/pulls{/number}","milestones_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/milestones{/number}","notifications_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/labels{/name}","releases_url":"https://api.github.com/repos/FunnyGardener/Android-Homework/releases{/id}","created_at":"2015-02-08T09:07:08Z","updated_at":"2015-02-08T18:35:07Z","pushed_at":"2015-02-20T14:36:30Z","git_url":"git://github.com/FunnyGardener/Android-Homework.git","ssh_url":"git@github.com:FunnyGardener/Android-Homework.git","clone_url":"https://github.com/FunnyGardener/Android-Homework.git","svn_url":"https://github.com/FunnyGardener/Android-Homework","homepage":null,"size":278,"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":"kirich1409:master","ref":"master","sha":"dee00df14a2e41a9099cda6776fa8811f4768979","user":{"login":"kirich1409","id":2403657,"avatar_url":"https://avatars.githubusercontent.com/u/2403657?v=3","gravatar_id":"","url":"https://api.github.com/users/kirich1409","html_url":"https://github.com/kirich1409","followers_url":"https://api.github.com/users/kirich1409/followers","following_url":"https://api.github.com/users/kirich1409/following{/other_user}","gists_url":"https://api.github.com/users/kirich1409/gists{/gist_id}","starred_url":"https://api.github.com/users/kirich1409/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kirich1409/subscriptions","organizations_url":"https://api.github.com/users/kirich1409/orgs","repos_url":"https://api.github.com/users/kirich1409/repos","events_url":"https://api.github.com/users/kirich1409/events{/privacy}","received_events_url":"https://api.github.com/users/kirich1409/received_events","type":"User","site_admin":false},"repo":{"id":30448989,"name":"Android-Homework","full_name":"kirich1409/Android-Homework","owner":{"login":"kirich1409","id":2403657,"avatar_url":"https://avatars.githubusercontent.com/u/2403657?v=3","gravatar_id":"","url":"https://api.github.com/users/kirich1409","html_url":"https://github.com/kirich1409","followers_url":"https://api.github.com/users/kirich1409/followers","following_url":"https://api.github.com/users/kirich1409/following{/other_user}","gists_url":"https://api.github.com/users/kirich1409/gists{/gist_id}","starred_url":"https://api.github.com/users/kirich1409/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kirich1409/subscriptions","organizations_url":"https://api.github.com/users/kirich1409/orgs","repos_url":"https://api.github.com/users/kirich1409/repos","events_url":"https://api.github.com/users/kirich1409/events{/privacy}","received_events_url":"https://api.github.com/users/kirich1409/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kirich1409/Android-Homework","description":"","fork":false,"url":"https://api.github.com/repos/kirich1409/Android-Homework","forks_url":"https://api.github.com/repos/kirich1409/Android-Homework/forks","keys_url":"https://api.github.com/repos/kirich1409/Android-Homework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kirich1409/Android-Homework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kirich1409/Android-Homework/teams","hooks_url":"https://api.github.com/repos/kirich1409/Android-Homework/hooks","issue_events_url":"https://api.github.com/repos/kirich1409/Android-Homework/issues/events{/number}","events_url":"https://api.github.com/repos/kirich1409/Android-Homework/events","assignees_url":"https://api.github.com/repos/kirich1409/Android-Homework/assignees{/user}","branches_url":"https://api.github.com/repos/kirich1409/Android-Homework/branches{/branch}","tags_url":"https://api.github.com/repos/kirich1409/Android-Homework/tags","blobs_url":"https://api.github.com/repos/kirich1409/Android-Homework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kirich1409/Android-Homework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kirich1409/Android-Homework/git/refs{/sha}","trees_url":"https://api.github.com/repos/kirich1409/Android-Homework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kirich1409/Android-Homework/statuses/{sha}","languages_url":"https://api.github.com/repos/kirich1409/Android-Homework/languages","stargazers_url":"https://api.github.com/repos/kirich1409/Android-Homework/stargazers","contributors_url":"https://api.github.com/repos/kirich1409/Android-Homework/contributors","subscribers_url":"https://api.github.com/repos/kirich1409/Android-Homework/subscribers","subscription_url":"https://api.github.com/repos/kirich1409/Android-Homework/subscription","commits_url":"https://api.github.com/repos/kirich1409/Android-Homework/commits{/sha}","git_commits_url":"https://api.github.com/repos/kirich1409/Android-Homework/git/commits{/sha}","comments_url":"https://api.github.com/repos/kirich1409/Android-Homework/comments{/number}","issue_comment_url":"https://api.github.com/repos/kirich1409/Android-Homework/issues/comments{/number}","contents_url":"https://api.github.com/repos/kirich1409/Android-Homework/contents/{+path}","compare_url":"https://api.github.com/repos/kirich1409/Android-Homework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kirich1409/Android-Homework/merges","archive_url":"https://api.github.com/repos/kirich1409/Android-Homework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kirich1409/Android-Homework/downloads","issues_url":"https://api.github.com/repos/kirich1409/Android-Homework/issues{/number}","pulls_url":"https://api.github.com/repos/kirich1409/Android-Homework/pulls{/number}","milestones_url":"https://api.github.com/repos/kirich1409/Android-Homework/milestones{/number}","notifications_url":"https://api.github.com/repos/kirich1409/Android-Homework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kirich1409/Android-Homework/labels{/name}","releases_url":"https://api.github.com/repos/kirich1409/Android-Homework/releases{/id}","created_at":"2015-02-07T07:37:00Z","updated_at":"2015-02-23T15:22:36Z","pushed_at":"2015-02-23T15:22:36Z","git_url":"git://github.com/kirich1409/Android-Homework.git","ssh_url":"git@github.com:kirich1409/Android-Homework.git","clone_url":"https://github.com/kirich1409/Android-Homework.git","svn_url":"https://github.com/kirich1409/Android-Homework","homepage":null,"size":6954,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":14,"forks":10,"open_issues":14,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kirich1409/Android-Homework/pulls/23"},"html":{"href":"https://github.com/kirich1409/Android-Homework/pull/23"},"issue":{"href":"https://api.github.com/repos/kirich1409/Android-Homework/issues/23"},"comments":{"href":"https://api.github.com/repos/kirich1409/Android-Homework/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/kirich1409/Android-Homework/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/kirich1409/Android-Homework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kirich1409/Android-Homework/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/kirich1409/Android-Homework/statuses/47d792b325628f5ad59b6e5c8b29ff6574b4c28f"}}}}