{"action":"created","comment":{"url":"https://api.github.com/repos/openhab/openhab-android/pulls/comments/166024574","pull_request_review_id":94049998,"id":166024574,"diff_hunk":"@@ -0,0 +1,41 @@\n+<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n+              xmlns:tools=\"http://schemas.android.com/tools\"\n+              android:layout_width=\"match_parent\"\n+              android:layout_height=\"match_parent\"\n+              android:gravity=\"center_horizontal|center_vertical\"\n+              android:orientation=\"vertical\">\n+    <ImageView\n+        android:id=\"@+id/network_error_image\"\n+        android:layout_width=\"100dp\"\n+        android:layout_height=\"wrap_content\"\n+        android:layout_gravity=\"center\"\n+        android:adjustViewBounds=\"true\"\n+        android:gravity=\"center\"\n+        android:scaleType=\"fitXY\"\n+        android:src=\"@drawable/ic_signal_cellular_off_black_24dp\"\n+        tools:ignore=\"contentDescription\"/>\n+\n+    <TextView\n+        android:id=\"@+id/network_error_description\"\n+        android:layout_width=\"wrap_content\"\n+        android:layout_height=\"wrap_content\"\n+        android:layout_gravity=\"center\"\n+        android:gravity=\"center\"\n+        android:paddingLeft=\"20dp\"\n+        android:paddingRight=\"20dp\"\n+        android:textAppearance=\"?android:attr/textAppearanceMedium\"\n+        android:textColor=\"@color/empty_list_text_color\"/>\n+\n+    <Button\n+        android:id=\"@+id/network_error_try_again\"\n+        style=\"?android:attr/buttonBarButtonStyle\"\n+        android:layout_width=\"wrap_content\"\n+        android:layout_height=\"wrap_content\"\n+        android:layout_gravity=\"center\"\n+        android:clickable=\"true\"\n+        android:focusable=\"true\"\n+        android:gravity=\"center\"\n+        android:text=\"@string/try_again_button\"\n+        android:textAppearance=\"?android:attr/textAppearanceMedium\"","path":"mobile/src/main/res/layout/fragment_no_network.xml","position":39,"original_position":39,"commit_id":"937afb904bf97c071105ad87b2f70f1a4ba020f2","original_commit_id":"937afb904bf97c071105ad87b2f70f1a4ba020f2","user":{"login":"maniac103","id":781373,"avatar_url":"https://avatars1.githubusercontent.com/u/781373?v=4","gravatar_id":"","url":"https://api.github.com/users/maniac103","html_url":"https://github.com/maniac103","followers_url":"https://api.github.com/users/maniac103/followers","following_url":"https://api.github.com/users/maniac103/following{/other_user}","gists_url":"https://api.github.com/users/maniac103/gists{/gist_id}","starred_url":"https://api.github.com/users/maniac103/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maniac103/subscriptions","organizations_url":"https://api.github.com/users/maniac103/orgs","repos_url":"https://api.github.com/users/maniac103/repos","events_url":"https://api.github.com/users/maniac103/events{/privacy}","received_events_url":"https://api.github.com/users/maniac103/received_events","type":"User","site_admin":false},"body":"This attribute should be removed as it overrides the buttonBarStyle.","created_at":"2018-02-05T16:22:38Z","updated_at":"2018-02-05T16:24:23Z","html_url":"https://github.com/openhab/openhab-android/pull/562#discussion_r166024574","pull_request_url":"https://api.github.com/repos/openhab/openhab-android/pulls/562","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/openhab/openhab-android/pulls/comments/166024574"},"html":{"href":"https://github.com/openhab/openhab-android/pull/562#discussion_r166024574"},"pull_request":{"href":"https://api.github.com/repos/openhab/openhab-android/pulls/562"}}},"pull_request":{"url":"https://api.github.com/repos/openhab/openhab-android/pulls/562","id":160177200,"html_url":"https://github.com/openhab/openhab-android/pull/562","diff_url":"https://github.com/openhab/openhab-android/pull/562.diff","patch_url":"https://github.com/openhab/openhab-android/pull/562.patch","issue_url":"https://api.github.com/repos/openhab/openhab-android/issues/562","number":562,"state":"open","locked":false,"title":"Get rid of magically passed around connection data","user":{"login":"FlorianSW","id":4892966,"avatar_url":"https://avatars1.githubusercontent.com/u/4892966?v=4","gravatar_id":"","url":"https://api.github.com/users/FlorianSW","html_url":"https://github.com/FlorianSW","followers_url":"https://api.github.com/users/FlorianSW/followers","following_url":"https://api.github.com/users/FlorianSW/following{/other_user}","gists_url":"https://api.github.com/users/FlorianSW/gists{/gist_id}","starred_url":"https://api.github.com/users/FlorianSW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FlorianSW/subscriptions","organizations_url":"https://api.github.com/users/FlorianSW/orgs","repos_url":"https://api.github.com/users/FlorianSW/repos","events_url":"https://api.github.com/users/FlorianSW/events{/privacy}","received_events_url":"https://api.github.com/users/FlorianSW/received_events","type":"User","site_admin":false},"body":"This is an attempt to completely rewrite how the app handles connection\r\ninformation to the openHAB server it is currently connected to. Instead of\r\npassing around the openHABbaseUrl, username and password into multiple\r\nplaces such as activities, drawers, adapters and fragment(list), this\r\ncommit tries to achieve the following:\r\n\r\n * A single point where you can get a connection from, no matter where you\r\n   are and what connection you may need (local, remove, cloud, ...)\r\n * An easy way to re-use connections provided by the new\r\n   ConnectionFactory: Instead of needed to save the conenction again in a\r\n   local member variable (in an activity or somewhere), just call\r\n   getConnection() with the same arguments again. If there's already a\r\n   cached connection and if it is still valid, you'll get the exact same\r\n   connection back\r\n * Abstraction of necessary preferences: The only point where the\r\n   preferences are accessed is the COnnectionFactory, that makes it easier\r\n   to change what preferences are needed to construct a connection and,\r\n   e.g., later change when what preferences are used.\r\n * Decouple the connection data management from the openHAB discovery\r\n   service: The discovery service should simply put the discovered OH into\r\n   the preferences, if it was successful, the rest is managed by the\r\n   ConnectionFactory, which, by itself, does not try to discovery\r\n   anything.\r\n * Make it easier to construct the exact connection object you need: Just\r\n   request a Connection with Connections.REMOTE, .LOCAL, .CLOUD if you\r\n   require a specific type of connection, or use .ANY to get any working\r\n   connection object back, no need to use if/elses to get what you want.\r\n * Error handling: If your Activity uses connections from the\r\n   ConnectionFactory and currently implements AppCompatActivity, inherit\r\n   from ConnectionAvailbilityAwareActivity now, which will handle most of\r\n   the connection errors that may occur there (no network, no URL set),\r\n   otherwise, simply catch these exceptions, if they could occur for your\r\n   requested type (.ANY only currently, all others will return null if the\r\n   connection could not be obtained.\r\n\r\nThis commit also takes over things from PR #496:\r\n* Demo mode is disabled by default and only enable it if no urls are\r\nconfigured and bonjour fails. Fixes #179\r\n* Save discovered url in settings. Fixes #11 and #248\r\n* Inform the user that the app tries to discover oh and if that failes\r\nit informs the user that the demo mode will be enabled. Fixes #8\r\n* Use https for demo mode\r\n* Discover http oh, not https. I think most people just use the default\r\ncertificate. Certificate warnings have to be turned off to make this\r\nworking, so this\r\nadds no security at all.\r\n* Only discover when no url is set.","created_at":"2017-12-26T23:54:17Z","updated_at":"2018-02-05T16:24:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3e97d690885dc49ddaff109b9b1392deaec7535a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/openhab/openhab-android/pulls/562/commits","review_comments_url":"https://api.github.com/repos/openhab/openhab-android/pulls/562/comments","review_comment_url":"https://api.github.com/repos/openhab/openhab-android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openhab/openhab-android/issues/562/comments","statuses_url":"https://api.github.com/repos/openhab/openhab-android/statuses/937afb904bf97c071105ad87b2f70f1a4ba020f2","head":{"label":"FlorianSW:rework/connection_management","ref":"rework/connection_management","sha":"937afb904bf97c071105ad87b2f70f1a4ba020f2","user":{"login":"FlorianSW","id":4892966,"avatar_url":"https://avatars1.githubusercontent.com/u/4892966?v=4","gravatar_id":"","url":"https://api.github.com/users/FlorianSW","html_url":"https://github.com/FlorianSW","followers_url":"https://api.github.com/users/FlorianSW/followers","following_url":"https://api.github.com/users/FlorianSW/following{/other_user}","gists_url":"https://api.github.com/users/FlorianSW/gists{/gist_id}","starred_url":"https://api.github.com/users/FlorianSW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FlorianSW/subscriptions","organizations_url":"https://api.github.com/users/FlorianSW/orgs","repos_url":"https://api.github.com/users/FlorianSW/repos","events_url":"https://api.github.com/users/FlorianSW/events{/privacy}","received_events_url":"https://api.github.com/users/FlorianSW/received_events","type":"User","site_admin":false},"repo":{"id":89610792,"name":"openhab.android","full_name":"FlorianSW/openhab.android","owner":{"login":"FlorianSW","id":4892966,"avatar_url":"https://avatars1.githubusercontent.com/u/4892966?v=4","gravatar_id":"","url":"https://api.github.com/users/FlorianSW","html_url":"https://github.com/FlorianSW","followers_url":"https://api.github.com/users/FlorianSW/followers","following_url":"https://api.github.com/users/FlorianSW/following{/other_user}","gists_url":"https://api.github.com/users/FlorianSW/gists{/gist_id}","starred_url":"https://api.github.com/users/FlorianSW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FlorianSW/subscriptions","organizations_url":"https://api.github.com/users/FlorianSW/orgs","repos_url":"https://api.github.com/users/FlorianSW/repos","events_url":"https://api.github.com/users/FlorianSW/events{/privacy}","received_events_url":"https://api.github.com/users/FlorianSW/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/FlorianSW/openhab.android","description":"openHAB Android app","fork":true,"url":"https://api.github.com/repos/FlorianSW/openhab.android","forks_url":"https://api.github.com/repos/FlorianSW/openhab.android/forks","keys_url":"https://api.github.com/repos/FlorianSW/openhab.android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FlorianSW/openhab.android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FlorianSW/openhab.android/teams","hooks_url":"https://api.github.com/repos/FlorianSW/openhab.android/hooks","issue_events_url":"https://api.github.com/repos/FlorianSW/openhab.android/issues/events{/number}","events_url":"https://api.github.com/repos/FlorianSW/openhab.android/events","assignees_url":"https://api.github.com/repos/FlorianSW/openhab.android/assignees{/user}","branches_url":"https://api.github.com/repos/FlorianSW/openhab.android/branches{/branch}","tags_url":"https://api.github.com/repos/FlorianSW/openhab.android/tags","blobs_url":"https://api.github.com/repos/FlorianSW/openhab.android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FlorianSW/openhab.android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FlorianSW/openhab.android/git/refs{/sha}","trees_url":"https://api.github.com/repos/FlorianSW/openhab.android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FlorianSW/openhab.android/statuses/{sha}","languages_url":"https://api.github.com/repos/FlorianSW/openhab.android/languages","stargazers_url":"https://api.github.com/repos/FlorianSW/openhab.android/stargazers","contributors_url":"https://api.github.com/repos/FlorianSW/openhab.android/contributors","subscribers_url":"https://api.github.com/repos/FlorianSW/openhab.android/subscribers","subscription_url":"https://api.github.com/repos/FlorianSW/openhab.android/subscription","commits_url":"https://api.github.com/repos/FlorianSW/openhab.android/commits{/sha}","git_commits_url":"https://api.github.com/repos/FlorianSW/openhab.android/git/commits{/sha}","comments_url":"https://api.github.com/repos/FlorianSW/openhab.android/comments{/number}","issue_comment_url":"https://api.github.com/repos/FlorianSW/openhab.android/issues/comments{/number}","contents_url":"https://api.github.com/repos/FlorianSW/openhab.android/contents/{+path}","compare_url":"https://api.github.com/repos/FlorianSW/openhab.android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FlorianSW/openhab.android/merges","archive_url":"https://api.github.com/repos/FlorianSW/openhab.android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FlorianSW/openhab.android/downloads","issues_url":"https://api.github.com/repos/FlorianSW/openhab.android/issues{/number}","pulls_url":"https://api.github.com/repos/FlorianSW/openhab.android/pulls{/number}","milestones_url":"https://api.github.com/repos/FlorianSW/openhab.android/milestones{/number}","notifications_url":"https://api.github.com/repos/FlorianSW/openhab.android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FlorianSW/openhab.android/labels{/name}","releases_url":"https://api.github.com/repos/FlorianSW/openhab.android/releases{/id}","deployments_url":"https://api.github.com/repos/FlorianSW/openhab.android/deployments","created_at":"2017-04-27T15:10:00Z","updated_at":"2017-04-27T15:10:01Z","pushed_at":"2018-02-04T11:54:22Z","git_url":"git://github.com/FlorianSW/openhab.android.git","ssh_url":"git@github.com:FlorianSW/openhab.android.git","clone_url":"https://github.com/FlorianSW/openhab.android.git","svn_url":"https://github.com/FlorianSW/openhab.android","homepage":null,"size":21805,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openhab:master","ref":"master","sha":"c69143826c21f112b69ec1d72fa849d5a5b291c7","user":{"login":"openhab","id":1007353,"avatar_url":"https://avatars0.githubusercontent.com/u/1007353?v=4","gravatar_id":"","url":"https://api.github.com/users/openhab","html_url":"https://github.com/openhab","followers_url":"https://api.github.com/users/openhab/followers","following_url":"https://api.github.com/users/openhab/following{/other_user}","gists_url":"https://api.github.com/users/openhab/gists{/gist_id}","starred_url":"https://api.github.com/users/openhab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openhab/subscriptions","organizations_url":"https://api.github.com/users/openhab/orgs","repos_url":"https://api.github.com/users/openhab/repos","events_url":"https://api.github.com/users/openhab/events{/privacy}","received_events_url":"https://api.github.com/users/openhab/received_events","type":"Organization","site_admin":false},"repo":{"id":18703240,"name":"openhab-android","full_name":"openhab/openhab-android","owner":{"login":"openhab","id":1007353,"avatar_url":"https://avatars0.githubusercontent.com/u/1007353?v=4","gravatar_id":"","url":"https://api.github.com/users/openhab","html_url":"https://github.com/openhab","followers_url":"https://api.github.com/users/openhab/followers","following_url":"https://api.github.com/users/openhab/following{/other_user}","gists_url":"https://api.github.com/users/openhab/gists{/gist_id}","starred_url":"https://api.github.com/users/openhab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openhab/subscriptions","organizations_url":"https://api.github.com/users/openhab/orgs","repos_url":"https://api.github.com/users/openhab/repos","events_url":"https://api.github.com/users/openhab/events{/privacy}","received_events_url":"https://api.github.com/users/openhab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openhab/openhab-android","description":"openHAB Android client","fork":false,"url":"https://api.github.com/repos/openhab/openhab-android","forks_url":"https://api.github.com/repos/openhab/openhab-android/forks","keys_url":"https://api.github.com/repos/openhab/openhab-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openhab/openhab-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openhab/openhab-android/teams","hooks_url":"https://api.github.com/repos/openhab/openhab-android/hooks","issue_events_url":"https://api.github.com/repos/openhab/openhab-android/issues/events{/number}","events_url":"https://api.github.com/repos/openhab/openhab-android/events","assignees_url":"https://api.github.com/repos/openhab/openhab-android/assignees{/user}","branches_url":"https://api.github.com/repos/openhab/openhab-android/branches{/branch}","tags_url":"https://api.github.com/repos/openhab/openhab-android/tags","blobs_url":"https://api.github.com/repos/openhab/openhab-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openhab/openhab-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openhab/openhab-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/openhab/openhab-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openhab/openhab-android/statuses/{sha}","languages_url":"https://api.github.com/repos/openhab/openhab-android/languages","stargazers_url":"https://api.github.com/repos/openhab/openhab-android/stargazers","contributors_url":"https://api.github.com/repos/openhab/openhab-android/contributors","subscribers_url":"https://api.github.com/repos/openhab/openhab-android/subscribers","subscription_url":"https://api.github.com/repos/openhab/openhab-android/subscription","commits_url":"https://api.github.com/repos/openhab/openhab-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/openhab/openhab-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/openhab/openhab-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/openhab/openhab-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/openhab/openhab-android/contents/{+path}","compare_url":"https://api.github.com/repos/openhab/openhab-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openhab/openhab-android/merges","archive_url":"https://api.github.com/repos/openhab/openhab-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openhab/openhab-android/downloads","issues_url":"https://api.github.com/repos/openhab/openhab-android/issues{/number}","pulls_url":"https://api.github.com/repos/openhab/openhab-android/pulls{/number}","milestones_url":"https://api.github.com/repos/openhab/openhab-android/milestones{/number}","notifications_url":"https://api.github.com/repos/openhab/openhab-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openhab/openhab-android/labels{/name}","releases_url":"https://api.github.com/repos/openhab/openhab-android/releases{/id}","deployments_url":"https://api.github.com/repos/openhab/openhab-android/deployments","created_at":"2014-04-12T12:09:03Z","updated_at":"2018-02-03T01:01:59Z","pushed_at":"2018-02-05T16:21:04Z","git_url":"git://github.com/openhab/openhab-android.git","ssh_url":"git@github.com:openhab/openhab-android.git","clone_url":"https://github.com/openhab/openhab-android.git","svn_url":"https://github.com/openhab/openhab-android","homepage":"","size":21431,"stargazers_count":180,"watchers_count":180,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":178,"mirror_url":null,"archived":false,"open_issues_count":136,"license":{"key":"epl-1.0","name":"Eclipse Public License 1.0","spdx_id":"EPL-1.0","url":"https://api.github.com/licenses/epl-1.0"},"forks":178,"open_issues":136,"watchers":180,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openhab/openhab-android/pulls/562"},"html":{"href":"https://github.com/openhab/openhab-android/pull/562"},"issue":{"href":"https://api.github.com/repos/openhab/openhab-android/issues/562"},"comments":{"href":"https://api.github.com/repos/openhab/openhab-android/issues/562/comments"},"review_comments":{"href":"https://api.github.com/repos/openhab/openhab-android/pulls/562/comments"},"review_comment":{"href":"https://api.github.com/repos/openhab/openhab-android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openhab/openhab-android/pulls/562/commits"},"statuses":{"href":"https://api.github.com/repos/openhab/openhab-android/statuses/937afb904bf97c071105ad87b2f70f1a4ba020f2"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"maniac103"}}