{"action":"created","comment":{"url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/pulls/comments/128555057","pull_request_review_id":51246771,"id":128555057,"diff_hunk":"@@ -0,0 +1,67 @@\n+package com.danielkashin.yandexweatherapp.presentation.view.settings;\n+\n+import android.content.Context;\n+import android.os.Bundle;\n+import android.support.annotation.Nullable;\n+import android.support.v7.preference.Preference;\n+import android.support.v7.preference.PreferenceFragmentCompat;\n+import android.view.View;\n+\n+import com.danielkashin.yandexweatherapp.R;\n+import com.danielkashin.yandexweatherapp.data.services.refresh.RefreshDatabaseJob;\n+import com.danielkashin.yandexweatherapp.data.services.refresh.RefreshDatabaseManager;\n+import com.danielkashin.yandexweatherapp.presentation.view.main_drawer.ToolbarContainer;\n+\n+\n+public class SettingsFragment extends PreferenceFragmentCompat {\n+\n+  // ------------------------------------- newInstance --------------------------------------------\n+\n+  public static SettingsFragment newInstance() {\n+    return new SettingsFragment();\n+  }\n+\n+  // -------------------------------------- lifecycle ---------------------------------------------\n+\n+  @Override\n+  public void onAttach(Context context) {\n+    super.onAttach(context);\n+\n+    if (!(context instanceof ToolbarContainer)) {\n+      throw new IllegalStateException(\"Activity must be an instance of ToolbarContainer\");\n+    }\n+  }\n+\n+  @Override\n+  public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {\n+    super.onViewCreated(view, savedInstanceState);\n+    initializeView(view);\n+  }\n+\n+  @Override\n+  public void onStart() {\n+    ((ToolbarContainer) getActivity()).setTitle(getString(R.string.main_drawer_settings));\n+    super.onStart();\n+  }\n+\n+  @Override\n+  public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {\n+    setPreferencesFromResource(R.xml.settings, rootKey);\n+  }\n+\n+\n+  private void initializeView(View view) {\n+    findPreference(\"refresh_period\").setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {\n+      @Override\n+      public boolean onPreferenceChange(Preference preference, Object newValue) {\n+        if (newValue instanceof String) {","path":"app/src/main/java/com/danielkashin/yandexweatherapp/presentation/view/settings/SettingsFragment.java","position":57,"original_position":57,"commit_id":"13bd52f2414df00eddbd9cf9bcf089994cf1b216","original_commit_id":"13bd52f2414df00eddbd9cf9bcf089994cf1b216","user":{"login":"daniel-kashin","id":19728982,"avatar_url":"https://avatars2.githubusercontent.com/u/19728982?v=4","gravatar_id":"","url":"https://api.github.com/users/daniel-kashin","html_url":"https://github.com/daniel-kashin","followers_url":"https://api.github.com/users/daniel-kashin/followers","following_url":"https://api.github.com/users/daniel-kashin/following{/other_user}","gists_url":"https://api.github.com/users/daniel-kashin/gists{/gist_id}","starred_url":"https://api.github.com/users/daniel-kashin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniel-kashin/subscriptions","organizations_url":"https://api.github.com/users/daniel-kashin/orgs","repos_url":"https://api.github.com/users/daniel-kashin/repos","events_url":"https://api.github.com/users/daniel-kashin/events{/privacy}","received_events_url":"https://api.github.com/users/daniel-kashin/received_events","type":"User","site_admin":false},"body":"Ну нам нужно чтобы новое значение было строкой... Если настройка верная, а новое значение неверное, то какая нам разница, какая настройка?","created_at":"2017-07-20T15:49:05Z","updated_at":"2017-07-20T15:49:05Z","html_url":"https://github.com/daniel-kashin/yandex-mobilization-task-1/pull/2#discussion_r128555057","pull_request_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/pulls/comments/128555057"},"html":{"href":"https://github.com/daniel-kashin/yandex-mobilization-task-1/pull/2#discussion_r128555057"},"pull_request":{"href":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/pulls/2","id":130763701,"html_url":"https://github.com/daniel-kashin/yandex-mobilization-task-1/pull/2","diff_url":"https://github.com/daniel-kashin/yandex-mobilization-task-1/pull/2.diff","patch_url":"https://github.com/daniel-kashin/yandex-mobilization-task-1/pull/2.patch","issue_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/issues/2","number":2,"state":"open","locked":false,"title":"Homework 2","user":{"login":"daniel-kashin","id":19728982,"avatar_url":"https://avatars2.githubusercontent.com/u/19728982?v=4","gravatar_id":"","url":"https://api.github.com/users/daniel-kashin","html_url":"https://github.com/daniel-kashin","followers_url":"https://api.github.com/users/daniel-kashin/followers","following_url":"https://api.github.com/users/daniel-kashin/following{/other_user}","gists_url":"https://api.github.com/users/daniel-kashin/gists{/gist_id}","starred_url":"https://api.github.com/users/daniel-kashin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniel-kashin/subscriptions","organizations_url":"https://api.github.com/users/daniel-kashin/orgs","repos_url":"https://api.github.com/users/daniel-kashin/repos","events_url":"https://api.github.com/users/daniel-kashin/events{/privacy}","received_events_url":"https://api.github.com/users/daniel-kashin/received_events","type":"User","site_admin":false},"body":"Added UI to show current weather conditions. Now it`s possible to choose Temperature units and Interval of weather refresh in background. All screens support landscape orientation as well as portrait. The application is available in Russian and English languages.\r\n\r\nI use OpenWeatherMap API. Service with AndroidJob were used to perform bakground work.  SQLite and StorIO are responsible for caching data. I also used Dagger and some kind of Clean Architecture. Custom MVP library based on Loaders makes it easy to save Presenter state and Genearalize code. Settings are saving to SharedPreferences. There are five main packages in application: data, di, domain, presentation and utils. \r\n ","created_at":"2017-07-16T19:52:29Z","updated_at":"2017-07-20T15:49:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"56a6760f79e8d4c489aaf20016d08355c61efe26","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/pulls/2/commits","review_comments_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/pulls/2/comments","review_comment_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/pulls/comments{/number}","comments_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/issues/2/comments","statuses_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/statuses/13bd52f2414df00eddbd9cf9bcf089994cf1b216","head":{"label":"daniel-kashin:homework-2","ref":"homework-2","sha":"13bd52f2414df00eddbd9cf9bcf089994cf1b216","user":{"login":"daniel-kashin","id":19728982,"avatar_url":"https://avatars2.githubusercontent.com/u/19728982?v=4","gravatar_id":"","url":"https://api.github.com/users/daniel-kashin","html_url":"https://github.com/daniel-kashin","followers_url":"https://api.github.com/users/daniel-kashin/followers","following_url":"https://api.github.com/users/daniel-kashin/following{/other_user}","gists_url":"https://api.github.com/users/daniel-kashin/gists{/gist_id}","starred_url":"https://api.github.com/users/daniel-kashin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniel-kashin/subscriptions","organizations_url":"https://api.github.com/users/daniel-kashin/orgs","repos_url":"https://api.github.com/users/daniel-kashin/repos","events_url":"https://api.github.com/users/daniel-kashin/events{/privacy}","received_events_url":"https://api.github.com/users/daniel-kashin/received_events","type":"User","site_admin":false},"repo":{"id":96523950,"name":"yandex-mobilization-task-1","full_name":"daniel-kashin/yandex-mobilization-task-1","owner":{"login":"daniel-kashin","id":19728982,"avatar_url":"https://avatars2.githubusercontent.com/u/19728982?v=4","gravatar_id":"","url":"https://api.github.com/users/daniel-kashin","html_url":"https://github.com/daniel-kashin","followers_url":"https://api.github.com/users/daniel-kashin/followers","following_url":"https://api.github.com/users/daniel-kashin/following{/other_user}","gists_url":"https://api.github.com/users/daniel-kashin/gists{/gist_id}","starred_url":"https://api.github.com/users/daniel-kashin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniel-kashin/subscriptions","organizations_url":"https://api.github.com/users/daniel-kashin/orgs","repos_url":"https://api.github.com/users/daniel-kashin/repos","events_url":"https://api.github.com/users/daniel-kashin/events{/privacy}","received_events_url":"https://api.github.com/users/daniel-kashin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/daniel-kashin/yandex-mobilization-task-1","description":null,"fork":false,"url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1","forks_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/forks","keys_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/teams","hooks_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/hooks","issue_events_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/issues/events{/number}","events_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/events","assignees_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/assignees{/user}","branches_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/branches{/branch}","tags_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/tags","blobs_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/statuses/{sha}","languages_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/languages","stargazers_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/stargazers","contributors_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/contributors","subscribers_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/subscribers","subscription_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/subscription","commits_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/contents/{+path}","compare_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/merges","archive_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/downloads","issues_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/issues{/number}","pulls_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/pulls{/number}","milestones_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/milestones{/number}","notifications_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/labels{/name}","releases_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/releases{/id}","deployments_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/deployments","created_at":"2017-07-07T09:40:35Z","updated_at":"2017-07-09T19:40:03Z","pushed_at":"2017-07-16T19:55:32Z","git_url":"git://github.com/daniel-kashin/yandex-mobilization-task-1.git","ssh_url":"git@github.com:daniel-kashin/yandex-mobilization-task-1.git","clone_url":"https://github.com/daniel-kashin/yandex-mobilization-task-1.git","svn_url":"https://github.com/daniel-kashin/yandex-mobilization-task-1","homepage":null,"size":230,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"daniel-kashin:master","ref":"master","sha":"a6ed4dda918113ff56334237c1a9a295a43fd465","user":{"login":"daniel-kashin","id":19728982,"avatar_url":"https://avatars2.githubusercontent.com/u/19728982?v=4","gravatar_id":"","url":"https://api.github.com/users/daniel-kashin","html_url":"https://github.com/daniel-kashin","followers_url":"https://api.github.com/users/daniel-kashin/followers","following_url":"https://api.github.com/users/daniel-kashin/following{/other_user}","gists_url":"https://api.github.com/users/daniel-kashin/gists{/gist_id}","starred_url":"https://api.github.com/users/daniel-kashin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniel-kashin/subscriptions","organizations_url":"https://api.github.com/users/daniel-kashin/orgs","repos_url":"https://api.github.com/users/daniel-kashin/repos","events_url":"https://api.github.com/users/daniel-kashin/events{/privacy}","received_events_url":"https://api.github.com/users/daniel-kashin/received_events","type":"User","site_admin":false},"repo":{"id":96523950,"name":"yandex-mobilization-task-1","full_name":"daniel-kashin/yandex-mobilization-task-1","owner":{"login":"daniel-kashin","id":19728982,"avatar_url":"https://avatars2.githubusercontent.com/u/19728982?v=4","gravatar_id":"","url":"https://api.github.com/users/daniel-kashin","html_url":"https://github.com/daniel-kashin","followers_url":"https://api.github.com/users/daniel-kashin/followers","following_url":"https://api.github.com/users/daniel-kashin/following{/other_user}","gists_url":"https://api.github.com/users/daniel-kashin/gists{/gist_id}","starred_url":"https://api.github.com/users/daniel-kashin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniel-kashin/subscriptions","organizations_url":"https://api.github.com/users/daniel-kashin/orgs","repos_url":"https://api.github.com/users/daniel-kashin/repos","events_url":"https://api.github.com/users/daniel-kashin/events{/privacy}","received_events_url":"https://api.github.com/users/daniel-kashin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/daniel-kashin/yandex-mobilization-task-1","description":null,"fork":false,"url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1","forks_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/forks","keys_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/teams","hooks_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/hooks","issue_events_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/issues/events{/number}","events_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/events","assignees_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/assignees{/user}","branches_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/branches{/branch}","tags_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/tags","blobs_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/statuses/{sha}","languages_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/languages","stargazers_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/stargazers","contributors_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/contributors","subscribers_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/subscribers","subscription_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/subscription","commits_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/contents/{+path}","compare_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/merges","archive_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/downloads","issues_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/issues{/number}","pulls_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/pulls{/number}","milestones_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/milestones{/number}","notifications_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/labels{/name}","releases_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/releases{/id}","deployments_url":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/deployments","created_at":"2017-07-07T09:40:35Z","updated_at":"2017-07-09T19:40:03Z","pushed_at":"2017-07-16T19:55:32Z","git_url":"git://github.com/daniel-kashin/yandex-mobilization-task-1.git","ssh_url":"git@github.com:daniel-kashin/yandex-mobilization-task-1.git","clone_url":"https://github.com/daniel-kashin/yandex-mobilization-task-1.git","svn_url":"https://github.com/daniel-kashin/yandex-mobilization-task-1","homepage":null,"size":230,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/pulls/2"},"html":{"href":"https://github.com/daniel-kashin/yandex-mobilization-task-1/pull/2"},"issue":{"href":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/issues/2"},"comments":{"href":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/daniel-kashin/yandex-mobilization-task-1/statuses/13bd52f2414df00eddbd9cf9bcf089994cf1b216"}}}}
{"actor":{"display_login":"daniel-kashin"}}