{"action":"created","comment":{"url":"https://api.github.com/repos/WunderMusik/WunderMusik/pulls/comments/59367562","id":59367562,"diff_hunk":"@@ -0,0 +1,76 @@\n+package ru.bmstu.wundermusik;\n+\n+import android.app.Activity;\n+import android.content.Context;\n+import android.content.Intent;\n+import android.net.ConnectivityManager;\n+import android.net.NetworkInfo;\n+import android.os.Handler;\n+import android.support.v7.app.AppCompatActivity;\n+import android.os.Bundle;\n+import android.view.View;\n+import android.widget.Button;\n+import android.widget.ProgressBar;\n+import android.widget.TextView;\n+\n+public class SplashActivity extends AppCompatActivity {\n+\n+    Button checkNetBtn;\n+    ProgressBar preloader;\n+    TextView netStatus;\n+\n+    @Override\n+    protected void onCreate(Bundle savedInstanceState) {\n+        super.onCreate(savedInstanceState);\n+        setContentView(R.layout.activity_splash);\n+\n+        checkNetBtn = (Button) findViewById(R.id.check_btn);\n+        preloader = (ProgressBar) findViewById(R.id.preloader);\n+        netStatus = (TextView) findViewById(R.id.net_status);\n+        checkNetBtn.setVisibility(View.GONE);\n+        netStatus.setVisibility(View.GONE);\n+\n+        final Context context = SplashActivity.this;\n+\n+        new Handler().postDelayed(new Runnable() {\n+            @Override\n+            public void run() {\n+                if (isOnline()) {\n+                    startMainActivity(context);\n+                }\n+                else {\n+                    showCheckButton();\n+                }\n+            }\n+        }, 2000);\n+    }\n+\n+    public boolean isOnline() {\n+        ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n+        NetworkInfo netInfo = cm.getActiveNetworkInfo();\n+        return netInfo != null && netInfo.isConnectedOrConnecting();\n+    }\n+\n+    public void showCheckButton() {\n+        preloader.setVisibility(View.GONE);\n+        checkNetBtn.setVisibility(View.VISIBLE);\n+        netStatus.setVisibility(View.VISIBLE);\n+        netStatus.setText(\"\");\n+    }\n+\n+    public void checkInternet(View view) {\n+        if (isOnline()) {\n+            netStatus.setText(R.string.net_success_status);\n+            startMainActivity(SplashActivity.this);\n+        }\n+        else {\n+            netStatus.setText(R.string.no_net_status);\n+        }\n+    }\n+\n+    public static void startMainActivity(Context ctx) {\n+        Intent intent = new Intent(ctx, MainActivity.class);\n+        ctx.startActivity(intent);\n+        ((Activity) ctx).finish();","path":"app/src/main/java/ru/bmstu/wundermusik/SplashActivity.java","position":74,"original_position":74,"commit_id":"32443ab5bfd30bddba2f05bd082abae77dac2af1","original_commit_id":"32443ab5bfd30bddba2f05bd082abae77dac2af1","user":{"login":"eugene195","id":6753938,"avatar_url":"https://avatars.githubusercontent.com/u/6753938?v=3","gravatar_id":"","url":"https://api.github.com/users/eugene195","html_url":"https://github.com/eugene195","followers_url":"https://api.github.com/users/eugene195/followers","following_url":"https://api.github.com/users/eugene195/following{/other_user}","gists_url":"https://api.github.com/users/eugene195/gists{/gist_id}","starred_url":"https://api.github.com/users/eugene195/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eugene195/subscriptions","organizations_url":"https://api.github.com/users/eugene195/orgs","repos_url":"https://api.github.com/users/eugene195/repos","events_url":"https://api.github.com/users/eugene195/events{/privacy}","received_events_url":"https://api.github.com/users/eugene195/received_events","type":"User","site_admin":false},"body":"Зачем?) Само дропнется, если надо будет\r\nИли ты так кнопку назад дизейблишь?\r\nТогда лучше в мейнактивити просто почистить бекстек, мне кажется","created_at":"2016-04-12T12:37:36Z","updated_at":"2016-04-12T12:37:36Z","html_url":"https://github.com/WunderMusik/WunderMusik/pull/23#discussion_r59367562","pull_request_url":"https://api.github.com/repos/WunderMusik/WunderMusik/pulls/23","_links":{"self":{"href":"https://api.github.com/repos/WunderMusik/WunderMusik/pulls/comments/59367562"},"html":{"href":"https://github.com/WunderMusik/WunderMusik/pull/23#discussion_r59367562"},"pull_request":{"href":"https://api.github.com/repos/WunderMusik/WunderMusik/pulls/23"}}},"pull_request":{"url":"https://api.github.com/repos/WunderMusik/WunderMusik/pulls/23","id":66007491,"html_url":"https://github.com/WunderMusik/WunderMusik/pull/23","diff_url":"https://github.com/WunderMusik/WunderMusik/pull/23.diff","patch_url":"https://github.com/WunderMusik/WunderMusik/pull/23.patch","issue_url":"https://api.github.com/repos/WunderMusik/WunderMusik/issues/23","number":23,"state":"open","locked":false,"title":"Splash screen","user":{"login":"xammi","id":5506243,"avatar_url":"https://avatars.githubusercontent.com/u/5506243?v=3","gravatar_id":"","url":"https://api.github.com/users/xammi","html_url":"https://github.com/xammi","followers_url":"https://api.github.com/users/xammi/followers","following_url":"https://api.github.com/users/xammi/following{/other_user}","gists_url":"https://api.github.com/users/xammi/gists{/gist_id}","starred_url":"https://api.github.com/users/xammi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xammi/subscriptions","organizations_url":"https://api.github.com/users/xammi/orgs","repos_url":"https://api.github.com/users/xammi/repos","events_url":"https://api.github.com/users/xammi/events{/privacy}","received_events_url":"https://api.github.com/users/xammi/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-11T14:54:52Z","updated_at":"2016-04-12T12:37:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bd35a21584b4e97cb963b2e6408377f92e53fad1","assignee":{"login":"eugene195","id":6753938,"avatar_url":"https://avatars.githubusercontent.com/u/6753938?v=3","gravatar_id":"","url":"https://api.github.com/users/eugene195","html_url":"https://github.com/eugene195","followers_url":"https://api.github.com/users/eugene195/followers","following_url":"https://api.github.com/users/eugene195/following{/other_user}","gists_url":"https://api.github.com/users/eugene195/gists{/gist_id}","starred_url":"https://api.github.com/users/eugene195/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eugene195/subscriptions","organizations_url":"https://api.github.com/users/eugene195/orgs","repos_url":"https://api.github.com/users/eugene195/repos","events_url":"https://api.github.com/users/eugene195/events{/privacy}","received_events_url":"https://api.github.com/users/eugene195/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/WunderMusik/WunderMusik/milestones/3","html_url":"https://github.com/WunderMusik/WunderMusik/milestones/Sprint%203","labels_url":"https://api.github.com/repos/WunderMusik/WunderMusik/milestones/3/labels","id":1676532,"number":3,"title":"Sprint 3","description":"","creator":{"login":"nfetissow","id":9667832,"avatar_url":"https://avatars.githubusercontent.com/u/9667832?v=3","gravatar_id":"","url":"https://api.github.com/users/nfetissow","html_url":"https://github.com/nfetissow","followers_url":"https://api.github.com/users/nfetissow/followers","following_url":"https://api.github.com/users/nfetissow/following{/other_user}","gists_url":"https://api.github.com/users/nfetissow/gists{/gist_id}","starred_url":"https://api.github.com/users/nfetissow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfetissow/subscriptions","organizations_url":"https://api.github.com/users/nfetissow/orgs","repos_url":"https://api.github.com/users/nfetissow/repos","events_url":"https://api.github.com/users/nfetissow/events{/privacy}","received_events_url":"https://api.github.com/users/nfetissow/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":0,"state":"open","created_at":"2016-03-31T16:41:03Z","updated_at":"2016-04-11T14:54:52Z","due_on":"2016-04-09T21:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/WunderMusik/WunderMusik/pulls/23/commits","review_comments_url":"https://api.github.com/repos/WunderMusik/WunderMusik/pulls/23/comments","review_comment_url":"https://api.github.com/repos/WunderMusik/WunderMusik/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WunderMusik/WunderMusik/issues/23/comments","statuses_url":"https://api.github.com/repos/WunderMusik/WunderMusik/statuses/32443ab5bfd30bddba2f05bd082abae77dac2af1","head":{"label":"WunderMusik:splash_screen","ref":"splash_screen","sha":"32443ab5bfd30bddba2f05bd082abae77dac2af1","user":{"login":"WunderMusik","id":17528685,"avatar_url":"https://avatars.githubusercontent.com/u/17528685?v=3","gravatar_id":"","url":"https://api.github.com/users/WunderMusik","html_url":"https://github.com/WunderMusik","followers_url":"https://api.github.com/users/WunderMusik/followers","following_url":"https://api.github.com/users/WunderMusik/following{/other_user}","gists_url":"https://api.github.com/users/WunderMusik/gists{/gist_id}","starred_url":"https://api.github.com/users/WunderMusik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WunderMusik/subscriptions","organizations_url":"https://api.github.com/users/WunderMusik/orgs","repos_url":"https://api.github.com/users/WunderMusik/repos","events_url":"https://api.github.com/users/WunderMusik/events{/privacy}","received_events_url":"https://api.github.com/users/WunderMusik/received_events","type":"Organization","site_admin":false},"repo":{"id":52724781,"name":"WunderMusik","full_name":"WunderMusik/WunderMusik","owner":{"login":"WunderMusik","id":17528685,"avatar_url":"https://avatars.githubusercontent.com/u/17528685?v=3","gravatar_id":"","url":"https://api.github.com/users/WunderMusik","html_url":"https://github.com/WunderMusik","followers_url":"https://api.github.com/users/WunderMusik/followers","following_url":"https://api.github.com/users/WunderMusik/following{/other_user}","gists_url":"https://api.github.com/users/WunderMusik/gists{/gist_id}","starred_url":"https://api.github.com/users/WunderMusik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WunderMusik/subscriptions","organizations_url":"https://api.github.com/users/WunderMusik/orgs","repos_url":"https://api.github.com/users/WunderMusik/repos","events_url":"https://api.github.com/users/WunderMusik/events{/privacy}","received_events_url":"https://api.github.com/users/WunderMusik/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WunderMusik/WunderMusik","description":"","fork":false,"url":"https://api.github.com/repos/WunderMusik/WunderMusik","forks_url":"https://api.github.com/repos/WunderMusik/WunderMusik/forks","keys_url":"https://api.github.com/repos/WunderMusik/WunderMusik/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WunderMusik/WunderMusik/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WunderMusik/WunderMusik/teams","hooks_url":"https://api.github.com/repos/WunderMusik/WunderMusik/hooks","issue_events_url":"https://api.github.com/repos/WunderMusik/WunderMusik/issues/events{/number}","events_url":"https://api.github.com/repos/WunderMusik/WunderMusik/events","assignees_url":"https://api.github.com/repos/WunderMusik/WunderMusik/assignees{/user}","branches_url":"https://api.github.com/repos/WunderMusik/WunderMusik/branches{/branch}","tags_url":"https://api.github.com/repos/WunderMusik/WunderMusik/tags","blobs_url":"https://api.github.com/repos/WunderMusik/WunderMusik/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WunderMusik/WunderMusik/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WunderMusik/WunderMusik/git/refs{/sha}","trees_url":"https://api.github.com/repos/WunderMusik/WunderMusik/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WunderMusik/WunderMusik/statuses/{sha}","languages_url":"https://api.github.com/repos/WunderMusik/WunderMusik/languages","stargazers_url":"https://api.github.com/repos/WunderMusik/WunderMusik/stargazers","contributors_url":"https://api.github.com/repos/WunderMusik/WunderMusik/contributors","subscribers_url":"https://api.github.com/repos/WunderMusik/WunderMusik/subscribers","subscription_url":"https://api.github.com/repos/WunderMusik/WunderMusik/subscription","commits_url":"https://api.github.com/repos/WunderMusik/WunderMusik/commits{/sha}","git_commits_url":"https://api.github.com/repos/WunderMusik/WunderMusik/git/commits{/sha}","comments_url":"https://api.github.com/repos/WunderMusik/WunderMusik/comments{/number}","issue_comment_url":"https://api.github.com/repos/WunderMusik/WunderMusik/issues/comments{/number}","contents_url":"https://api.github.com/repos/WunderMusik/WunderMusik/contents/{+path}","compare_url":"https://api.github.com/repos/WunderMusik/WunderMusik/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WunderMusik/WunderMusik/merges","archive_url":"https://api.github.com/repos/WunderMusik/WunderMusik/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WunderMusik/WunderMusik/downloads","issues_url":"https://api.github.com/repos/WunderMusik/WunderMusik/issues{/number}","pulls_url":"https://api.github.com/repos/WunderMusik/WunderMusik/pulls{/number}","milestones_url":"https://api.github.com/repos/WunderMusik/WunderMusik/milestones{/number}","notifications_url":"https://api.github.com/repos/WunderMusik/WunderMusik/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WunderMusik/WunderMusik/labels{/name}","releases_url":"https://api.github.com/repos/WunderMusik/WunderMusik/releases{/id}","deployments_url":"https://api.github.com/repos/WunderMusik/WunderMusik/deployments","created_at":"2016-02-28T14:20:32Z","updated_at":"2016-02-28T14:35:09Z","pushed_at":"2016-04-12T09:25:23Z","git_url":"git://github.com/WunderMusik/WunderMusik.git","ssh_url":"git@github.com:WunderMusik/WunderMusik.git","clone_url":"https://github.com/WunderMusik/WunderMusik.git","svn_url":"https://github.com/WunderMusik/WunderMusik","homepage":null,"size":150,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":19,"forks":0,"open_issues":19,"watchers":0,"default_branch":"master"}},"base":{"label":"WunderMusik:master","ref":"master","sha":"5cb9f018d98e601018c43ae8b720ea152a67f378","user":{"login":"WunderMusik","id":17528685,"avatar_url":"https://avatars.githubusercontent.com/u/17528685?v=3","gravatar_id":"","url":"https://api.github.com/users/WunderMusik","html_url":"https://github.com/WunderMusik","followers_url":"https://api.github.com/users/WunderMusik/followers","following_url":"https://api.github.com/users/WunderMusik/following{/other_user}","gists_url":"https://api.github.com/users/WunderMusik/gists{/gist_id}","starred_url":"https://api.github.com/users/WunderMusik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WunderMusik/subscriptions","organizations_url":"https://api.github.com/users/WunderMusik/orgs","repos_url":"https://api.github.com/users/WunderMusik/repos","events_url":"https://api.github.com/users/WunderMusik/events{/privacy}","received_events_url":"https://api.github.com/users/WunderMusik/received_events","type":"Organization","site_admin":false},"repo":{"id":52724781,"name":"WunderMusik","full_name":"WunderMusik/WunderMusik","owner":{"login":"WunderMusik","id":17528685,"avatar_url":"https://avatars.githubusercontent.com/u/17528685?v=3","gravatar_id":"","url":"https://api.github.com/users/WunderMusik","html_url":"https://github.com/WunderMusik","followers_url":"https://api.github.com/users/WunderMusik/followers","following_url":"https://api.github.com/users/WunderMusik/following{/other_user}","gists_url":"https://api.github.com/users/WunderMusik/gists{/gist_id}","starred_url":"https://api.github.com/users/WunderMusik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WunderMusik/subscriptions","organizations_url":"https://api.github.com/users/WunderMusik/orgs","repos_url":"https://api.github.com/users/WunderMusik/repos","events_url":"https://api.github.com/users/WunderMusik/events{/privacy}","received_events_url":"https://api.github.com/users/WunderMusik/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WunderMusik/WunderMusik","description":"","fork":false,"url":"https://api.github.com/repos/WunderMusik/WunderMusik","forks_url":"https://api.github.com/repos/WunderMusik/WunderMusik/forks","keys_url":"https://api.github.com/repos/WunderMusik/WunderMusik/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WunderMusik/WunderMusik/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WunderMusik/WunderMusik/teams","hooks_url":"https://api.github.com/repos/WunderMusik/WunderMusik/hooks","issue_events_url":"https://api.github.com/repos/WunderMusik/WunderMusik/issues/events{/number}","events_url":"https://api.github.com/repos/WunderMusik/WunderMusik/events","assignees_url":"https://api.github.com/repos/WunderMusik/WunderMusik/assignees{/user}","branches_url":"https://api.github.com/repos/WunderMusik/WunderMusik/branches{/branch}","tags_url":"https://api.github.com/repos/WunderMusik/WunderMusik/tags","blobs_url":"https://api.github.com/repos/WunderMusik/WunderMusik/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WunderMusik/WunderMusik/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WunderMusik/WunderMusik/git/refs{/sha}","trees_url":"https://api.github.com/repos/WunderMusik/WunderMusik/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WunderMusik/WunderMusik/statuses/{sha}","languages_url":"https://api.github.com/repos/WunderMusik/WunderMusik/languages","stargazers_url":"https://api.github.com/repos/WunderMusik/WunderMusik/stargazers","contributors_url":"https://api.github.com/repos/WunderMusik/WunderMusik/contributors","subscribers_url":"https://api.github.com/repos/WunderMusik/WunderMusik/subscribers","subscription_url":"https://api.github.com/repos/WunderMusik/WunderMusik/subscription","commits_url":"https://api.github.com/repos/WunderMusik/WunderMusik/commits{/sha}","git_commits_url":"https://api.github.com/repos/WunderMusik/WunderMusik/git/commits{/sha}","comments_url":"https://api.github.com/repos/WunderMusik/WunderMusik/comments{/number}","issue_comment_url":"https://api.github.com/repos/WunderMusik/WunderMusik/issues/comments{/number}","contents_url":"https://api.github.com/repos/WunderMusik/WunderMusik/contents/{+path}","compare_url":"https://api.github.com/repos/WunderMusik/WunderMusik/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WunderMusik/WunderMusik/merges","archive_url":"https://api.github.com/repos/WunderMusik/WunderMusik/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WunderMusik/WunderMusik/downloads","issues_url":"https://api.github.com/repos/WunderMusik/WunderMusik/issues{/number}","pulls_url":"https://api.github.com/repos/WunderMusik/WunderMusik/pulls{/number}","milestones_url":"https://api.github.com/repos/WunderMusik/WunderMusik/milestones{/number}","notifications_url":"https://api.github.com/repos/WunderMusik/WunderMusik/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WunderMusik/WunderMusik/labels{/name}","releases_url":"https://api.github.com/repos/WunderMusik/WunderMusik/releases{/id}","deployments_url":"https://api.github.com/repos/WunderMusik/WunderMusik/deployments","created_at":"2016-02-28T14:20:32Z","updated_at":"2016-02-28T14:35:09Z","pushed_at":"2016-04-12T09:25:23Z","git_url":"git://github.com/WunderMusik/WunderMusik.git","ssh_url":"git@github.com:WunderMusik/WunderMusik.git","clone_url":"https://github.com/WunderMusik/WunderMusik.git","svn_url":"https://github.com/WunderMusik/WunderMusik","homepage":null,"size":150,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":19,"forks":0,"open_issues":19,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WunderMusik/WunderMusik/pulls/23"},"html":{"href":"https://github.com/WunderMusik/WunderMusik/pull/23"},"issue":{"href":"https://api.github.com/repos/WunderMusik/WunderMusik/issues/23"},"comments":{"href":"https://api.github.com/repos/WunderMusik/WunderMusik/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/WunderMusik/WunderMusik/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/WunderMusik/WunderMusik/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WunderMusik/WunderMusik/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/WunderMusik/WunderMusik/statuses/32443ab5bfd30bddba2f05bd082abae77dac2af1"}}}}