{"action":"created","comment":{"url":"https://api.github.com/repos/IYCI/MyClass/pulls/comments/48683085","id":48683085,"diff_hunk":"@@ -38,7 +45,39 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,\n                              Bundle savedInstanceState) {\n         if (mView == null) {\n             mView = inflater.inflate(R.layout.fragment_search, container, false);\n+\n+            if (!Connections.isNetworkAvailable(mActivity)) {\n+                LinearLayout errorView = (LinearLayout) mView.findViewById(R.id.error_view);\n+                TextView errorMessage = (TextView) mView.findViewById(R.id.error_message);\n+                ImageView errorIcon = (ImageView) mView.findViewById(R.id.error_icon);\n+\n+                errorView.setVisibility(View.VISIBLE);\n+                errorMessage.setText(mActivity.getString(R.string.error_message_network));\n+                errorIcon.setImageResource(R.drawable.ic_cloud_off_black_36dp);\n+                return mView;\n+            }\n+\n+            SearchFetchTask searchFetchTask = new SearchFetchTask(mActivity, new AsyncTaskCallbackInterface() {\n+                @Override\n+                public void onOperationComplete(Bundle bundle) {\n+                    if (bundle != null && bundle.getBoolean(\"valid_return\")) {\n+                        setupTabs(bundle);\n+                        LinearLayout tabLayout = (LinearLayout) mView.findViewById(R.id.search_detail_layout);\n+                        tabLayout.setVisibility(View.VISIBLE);\n+                    } else {\n+                        LinearLayout errorView = (LinearLayout) mView.findViewById(R.id.error_view);\n+                        TextView errorMessage = (TextView) mView.findViewById(R.id.error_message);","path":"app/src/main/java/com/YC2010/jason/myclass/ui/fragments/SearchFragment.java","position":41,"original_position":41,"commit_id":"0d129db382a61e97d0439f44a2416dcc689d81f1","original_commit_id":"0d129db382a61e97d0439f44a2416dcc689d81f1","user":{"login":"IYCI","id":10443152,"avatar_url":"https://avatars.githubusercontent.com/u/10443152?v=3","gravatar_id":"","url":"https://api.github.com/users/IYCI","html_url":"https://github.com/IYCI","followers_url":"https://api.github.com/users/IYCI/followers","following_url":"https://api.github.com/users/IYCI/following{/other_user}","gists_url":"https://api.github.com/users/IYCI/gists{/gist_id}","starred_url":"https://api.github.com/users/IYCI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IYCI/subscriptions","organizations_url":"https://api.github.com/users/IYCI/orgs","repos_url":"https://api.github.com/users/IYCI/repos","events_url":"https://api.github.com/users/IYCI/events{/privacy}","received_events_url":"https://api.github.com/users/IYCI/received_events","type":"User","site_admin":false},"body":"in this condition, need to set the retry button visibility gone or something like that.\r\n\r\n","created_at":"2016-01-02T07:10:10Z","updated_at":"2016-01-02T07:10:10Z","html_url":"https://github.com/IYCI/MyClass/pull/42#discussion_r48683085","pull_request_url":"https://api.github.com/repos/IYCI/MyClass/pulls/42","_links":{"self":{"href":"https://api.github.com/repos/IYCI/MyClass/pulls/comments/48683085"},"html":{"href":"https://github.com/IYCI/MyClass/pull/42#discussion_r48683085"},"pull_request":{"href":"https://api.github.com/repos/IYCI/MyClass/pulls/42"}}},"pull_request":{"url":"https://api.github.com/repos/IYCI/MyClass/pulls/42","id":54897543,"html_url":"https://github.com/IYCI/MyClass/pull/42","diff_url":"https://github.com/IYCI/MyClass/pull/42.diff","patch_url":"https://github.com/IYCI/MyClass/pull/42.patch","issue_url":"https://api.github.com/repos/IYCI/MyClass/issues/42","number":42,"state":"open","locked":false,"title":"Add error view for course search","user":{"login":"19506jk","id":6495516,"avatar_url":"https://avatars.githubusercontent.com/u/6495516?v=3","gravatar_id":"","url":"https://api.github.com/users/19506jk","html_url":"https://github.com/19506jk","followers_url":"https://api.github.com/users/19506jk/followers","following_url":"https://api.github.com/users/19506jk/following{/other_user}","gists_url":"https://api.github.com/users/19506jk/gists{/gist_id}","starred_url":"https://api.github.com/users/19506jk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/19506jk/subscriptions","organizations_url":"https://api.github.com/users/19506jk/orgs","repos_url":"https://api.github.com/users/19506jk/repos","events_url":"https://api.github.com/users/19506jk/events{/privacy}","received_events_url":"https://api.github.com/users/19506jk/received_events","type":"User","site_admin":false},"body":"Include network error and course not found error\r\nImprove error handling when fetching for a course\r\nPrevent user from cancelling the loading dialog\r\nResolve #19","created_at":"2016-01-01T22:36:21Z","updated_at":"2016-01-02T07:10:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d9d8780468393b80fd7359ee924b003ee1cb12d3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/IYCI/MyClass/pulls/42/commits","review_comments_url":"https://api.github.com/repos/IYCI/MyClass/pulls/42/comments","review_comment_url":"https://api.github.com/repos/IYCI/MyClass/pulls/comments{/number}","comments_url":"https://api.github.com/repos/IYCI/MyClass/issues/42/comments","statuses_url":"https://api.github.com/repos/IYCI/MyClass/statuses/0d129db382a61e97d0439f44a2416dcc689d81f1","head":{"label":"IYCI:ErrorView","ref":"ErrorView","sha":"0d129db382a61e97d0439f44a2416dcc689d81f1","user":{"login":"IYCI","id":10443152,"avatar_url":"https://avatars.githubusercontent.com/u/10443152?v=3","gravatar_id":"","url":"https://api.github.com/users/IYCI","html_url":"https://github.com/IYCI","followers_url":"https://api.github.com/users/IYCI/followers","following_url":"https://api.github.com/users/IYCI/following{/other_user}","gists_url":"https://api.github.com/users/IYCI/gists{/gist_id}","starred_url":"https://api.github.com/users/IYCI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IYCI/subscriptions","organizations_url":"https://api.github.com/users/IYCI/orgs","repos_url":"https://api.github.com/users/IYCI/repos","events_url":"https://api.github.com/users/IYCI/events{/privacy}","received_events_url":"https://api.github.com/users/IYCI/received_events","type":"User","site_admin":false},"repo":{"id":36320045,"name":"MyClass","full_name":"IYCI/MyClass","owner":{"login":"IYCI","id":10443152,"avatar_url":"https://avatars.githubusercontent.com/u/10443152?v=3","gravatar_id":"","url":"https://api.github.com/users/IYCI","html_url":"https://github.com/IYCI","followers_url":"https://api.github.com/users/IYCI/followers","following_url":"https://api.github.com/users/IYCI/following{/other_user}","gists_url":"https://api.github.com/users/IYCI/gists{/gist_id}","starred_url":"https://api.github.com/users/IYCI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IYCI/subscriptions","organizations_url":"https://api.github.com/users/IYCI/orgs","repos_url":"https://api.github.com/users/IYCI/repos","events_url":"https://api.github.com/users/IYCI/events{/privacy}","received_events_url":"https://api.github.com/users/IYCI/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/IYCI/MyClass","description":"A UWaterloo course based app","fork":false,"url":"https://api.github.com/repos/IYCI/MyClass","forks_url":"https://api.github.com/repos/IYCI/MyClass/forks","keys_url":"https://api.github.com/repos/IYCI/MyClass/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IYCI/MyClass/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IYCI/MyClass/teams","hooks_url":"https://api.github.com/repos/IYCI/MyClass/hooks","issue_events_url":"https://api.github.com/repos/IYCI/MyClass/issues/events{/number}","events_url":"https://api.github.com/repos/IYCI/MyClass/events","assignees_url":"https://api.github.com/repos/IYCI/MyClass/assignees{/user}","branches_url":"https://api.github.com/repos/IYCI/MyClass/branches{/branch}","tags_url":"https://api.github.com/repos/IYCI/MyClass/tags","blobs_url":"https://api.github.com/repos/IYCI/MyClass/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IYCI/MyClass/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IYCI/MyClass/git/refs{/sha}","trees_url":"https://api.github.com/repos/IYCI/MyClass/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IYCI/MyClass/statuses/{sha}","languages_url":"https://api.github.com/repos/IYCI/MyClass/languages","stargazers_url":"https://api.github.com/repos/IYCI/MyClass/stargazers","contributors_url":"https://api.github.com/repos/IYCI/MyClass/contributors","subscribers_url":"https://api.github.com/repos/IYCI/MyClass/subscribers","subscription_url":"https://api.github.com/repos/IYCI/MyClass/subscription","commits_url":"https://api.github.com/repos/IYCI/MyClass/commits{/sha}","git_commits_url":"https://api.github.com/repos/IYCI/MyClass/git/commits{/sha}","comments_url":"https://api.github.com/repos/IYCI/MyClass/comments{/number}","issue_comment_url":"https://api.github.com/repos/IYCI/MyClass/issues/comments{/number}","contents_url":"https://api.github.com/repos/IYCI/MyClass/contents/{+path}","compare_url":"https://api.github.com/repos/IYCI/MyClass/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IYCI/MyClass/merges","archive_url":"https://api.github.com/repos/IYCI/MyClass/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IYCI/MyClass/downloads","issues_url":"https://api.github.com/repos/IYCI/MyClass/issues{/number}","pulls_url":"https://api.github.com/repos/IYCI/MyClass/pulls{/number}","milestones_url":"https://api.github.com/repos/IYCI/MyClass/milestones{/number}","notifications_url":"https://api.github.com/repos/IYCI/MyClass/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IYCI/MyClass/labels{/name}","releases_url":"https://api.github.com/repos/IYCI/MyClass/releases{/id}","created_at":"2015-05-26T19:53:09Z","updated_at":"2015-12-22T22:51:19Z","pushed_at":"2016-01-01T22:36:24Z","git_url":"git://github.com/IYCI/MyClass.git","ssh_url":"git@github.com:IYCI/MyClass.git","clone_url":"https://github.com/IYCI/MyClass.git","svn_url":"https://github.com/IYCI/MyClass","homepage":"","size":3642,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":16,"forks":0,"open_issues":16,"watchers":3,"default_branch":"develop"}},"base":{"label":"IYCI:develop","ref":"develop","sha":"df26032194896c736039dff882a141839b1e9e3e","user":{"login":"IYCI","id":10443152,"avatar_url":"https://avatars.githubusercontent.com/u/10443152?v=3","gravatar_id":"","url":"https://api.github.com/users/IYCI","html_url":"https://github.com/IYCI","followers_url":"https://api.github.com/users/IYCI/followers","following_url":"https://api.github.com/users/IYCI/following{/other_user}","gists_url":"https://api.github.com/users/IYCI/gists{/gist_id}","starred_url":"https://api.github.com/users/IYCI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IYCI/subscriptions","organizations_url":"https://api.github.com/users/IYCI/orgs","repos_url":"https://api.github.com/users/IYCI/repos","events_url":"https://api.github.com/users/IYCI/events{/privacy}","received_events_url":"https://api.github.com/users/IYCI/received_events","type":"User","site_admin":false},"repo":{"id":36320045,"name":"MyClass","full_name":"IYCI/MyClass","owner":{"login":"IYCI","id":10443152,"avatar_url":"https://avatars.githubusercontent.com/u/10443152?v=3","gravatar_id":"","url":"https://api.github.com/users/IYCI","html_url":"https://github.com/IYCI","followers_url":"https://api.github.com/users/IYCI/followers","following_url":"https://api.github.com/users/IYCI/following{/other_user}","gists_url":"https://api.github.com/users/IYCI/gists{/gist_id}","starred_url":"https://api.github.com/users/IYCI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IYCI/subscriptions","organizations_url":"https://api.github.com/users/IYCI/orgs","repos_url":"https://api.github.com/users/IYCI/repos","events_url":"https://api.github.com/users/IYCI/events{/privacy}","received_events_url":"https://api.github.com/users/IYCI/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/IYCI/MyClass","description":"A UWaterloo course based app","fork":false,"url":"https://api.github.com/repos/IYCI/MyClass","forks_url":"https://api.github.com/repos/IYCI/MyClass/forks","keys_url":"https://api.github.com/repos/IYCI/MyClass/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IYCI/MyClass/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IYCI/MyClass/teams","hooks_url":"https://api.github.com/repos/IYCI/MyClass/hooks","issue_events_url":"https://api.github.com/repos/IYCI/MyClass/issues/events{/number}","events_url":"https://api.github.com/repos/IYCI/MyClass/events","assignees_url":"https://api.github.com/repos/IYCI/MyClass/assignees{/user}","branches_url":"https://api.github.com/repos/IYCI/MyClass/branches{/branch}","tags_url":"https://api.github.com/repos/IYCI/MyClass/tags","blobs_url":"https://api.github.com/repos/IYCI/MyClass/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IYCI/MyClass/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IYCI/MyClass/git/refs{/sha}","trees_url":"https://api.github.com/repos/IYCI/MyClass/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IYCI/MyClass/statuses/{sha}","languages_url":"https://api.github.com/repos/IYCI/MyClass/languages","stargazers_url":"https://api.github.com/repos/IYCI/MyClass/stargazers","contributors_url":"https://api.github.com/repos/IYCI/MyClass/contributors","subscribers_url":"https://api.github.com/repos/IYCI/MyClass/subscribers","subscription_url":"https://api.github.com/repos/IYCI/MyClass/subscription","commits_url":"https://api.github.com/repos/IYCI/MyClass/commits{/sha}","git_commits_url":"https://api.github.com/repos/IYCI/MyClass/git/commits{/sha}","comments_url":"https://api.github.com/repos/IYCI/MyClass/comments{/number}","issue_comment_url":"https://api.github.com/repos/IYCI/MyClass/issues/comments{/number}","contents_url":"https://api.github.com/repos/IYCI/MyClass/contents/{+path}","compare_url":"https://api.github.com/repos/IYCI/MyClass/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IYCI/MyClass/merges","archive_url":"https://api.github.com/repos/IYCI/MyClass/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IYCI/MyClass/downloads","issues_url":"https://api.github.com/repos/IYCI/MyClass/issues{/number}","pulls_url":"https://api.github.com/repos/IYCI/MyClass/pulls{/number}","milestones_url":"https://api.github.com/repos/IYCI/MyClass/milestones{/number}","notifications_url":"https://api.github.com/repos/IYCI/MyClass/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IYCI/MyClass/labels{/name}","releases_url":"https://api.github.com/repos/IYCI/MyClass/releases{/id}","created_at":"2015-05-26T19:53:09Z","updated_at":"2015-12-22T22:51:19Z","pushed_at":"2016-01-01T22:36:24Z","git_url":"git://github.com/IYCI/MyClass.git","ssh_url":"git@github.com:IYCI/MyClass.git","clone_url":"https://github.com/IYCI/MyClass.git","svn_url":"https://github.com/IYCI/MyClass","homepage":"","size":3642,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":16,"forks":0,"open_issues":16,"watchers":3,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/IYCI/MyClass/pulls/42"},"html":{"href":"https://github.com/IYCI/MyClass/pull/42"},"issue":{"href":"https://api.github.com/repos/IYCI/MyClass/issues/42"},"comments":{"href":"https://api.github.com/repos/IYCI/MyClass/issues/42/comments"},"review_comments":{"href":"https://api.github.com/repos/IYCI/MyClass/pulls/42/comments"},"review_comment":{"href":"https://api.github.com/repos/IYCI/MyClass/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/IYCI/MyClass/pulls/42/commits"},"statuses":{"href":"https://api.github.com/repos/IYCI/MyClass/statuses/0d129db382a61e97d0439f44a2416dcc689d81f1"}}}}