{"action":"created","comment":{"url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/pulls/comments/74934064","id":74934064,"diff_hunk":"@@ -0,0 +1,152 @@\n+package com.easyrouteapp;\n+\n+import android.app.SearchManager;\n+import android.content.Context;\n+import android.content.Intent;\n+import android.os.Build;\n+import android.support.design.widget.FloatingActionButton;\n+import android.support.v4.app.FragmentTransaction;\n+import android.support.v4.view.MenuItemCompat;\n+import android.support.v7.app.AppCompatActivity;\n+import android.os.Bundle;\n+import android.support.v7.widget.SearchView;\n+import android.support.v7.widget.Toolbar;\n+import android.util.Log;\n+import android.view.Menu;\n+import android.view.MenuItem;\n+import android.view.View;\n+import android.widget.Toast;\n+\n+import com.easyrouteapp.async.GeocodingTask;\n+import com.easyrouteapp.async.RestWebServiceRoutesTask;\n+import com.easyrouteapp.domain.EntityBase;\n+import com.easyrouteapp.dto.FilterDto;\n+import com.easyrouteapp.event.GeoCodeLoadedEvent;\n+import com.easyrouteapp.event.ReverseGeoCodeLoadedEvent;\n+import com.easyrouteapp.event.StartDetailRouteEvent;\n+import com.easyrouteapp.fragment.RoutesFragment;\n+import com.easyrouteapp.helper.StatusNetworkConnectionHelper;\n+\n+import org.greenrobot.eventbus.EventBus;\n+import org.greenrobot.eventbus.Subscribe;\n+import org.greenrobot.eventbus.ThreadMode;\n+\n+import java.util.ArrayList;\n+import java.util.List;\n+\n+public class MainActivity extends AppCompatActivity {\n+    private Toolbar searchToolbar;\n+    private RoutesFragment fragRoutes;\n+    private List<EntityBase> routes = new ArrayList<>();\n+\n+    @Override\n+    protected void onCreate(Bundle savedInstanceState) {\n+        super.onCreate(savedInstanceState);\n+        setContentView(R.layout.activity_main);\n+        EventBus.getDefault().register(MainActivity.this);\n+\n+        searchToolbar = (Toolbar) findViewById(R.id.tb_search);\n+        searchToolbar.setLogo(R.mipmap.ic_launcher);\n+        setSupportActionBar(searchToolbar);\n+\n+        fragRoutes = (RoutesFragment) getSupportFragmentManager().findFragmentById(R.id.routes_fragment_container);\n+        if (fragRoutes == null) {\n+            fragRoutes = new RoutesFragment();\n+            FragmentTransaction ft = getSupportFragmentManager().beginTransaction();\n+            ft.replace(R.id.routes_fragment_container, fragRoutes, \"routesFrag\");\n+            ft.commit();\n+        }\n+        seachRoutesByQuery(getIntent());\n+    }\n+\n+    @Override\n+    public void onDestroy(){\n+        super.onDestroy();\n+        EventBus.getDefault().unregister(MainActivity.this);\n+    }\n+\n+    @Override\n+    public boolean onCreateOptionsMenu(Menu menu) {\n+        getMenuInflater().inflate(R.menu.menu_main, menu);\n+        SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);\n+        SearchView searchView;\n+        MenuItem item = menu.findItem(R.id.action_searchable_activity);\n+        searchView = getSearchView(item);\n+        searchView.setSearchableInfo( searchManager.getSearchableInfo( getComponentName() ) );\n+        searchView.setQueryHint(getResources().getString(R.string.search_hint));\n+        addFloatButtonActionListener((FloatingActionButton) findViewById(R.id.fab));\n+        return true;\n+    }\n+\n+    private void addFloatButtonActionListener(FloatingActionButton floatButton) {\n+        floatButton.setOnClickListener(new View.OnClickListener() {\n+            @Override\n+            public void onClick(View view) {\n+                if(!StatusNetworkConnectionHelper.verifyConnection(MainActivity.this) ) {\n+                    Toast.makeText(getApplicationContext(), getResources().getString(R.string.message_without_con), Toast.LENGTH_LONG).show();\n+                    return;\n+                }\n+                new GeocodingTask(getApplicationContext()).execute(getResources().getString(R.string.name_default_city_map));\n+            }\n+        });\n+    }\n+\n+    private SearchView getSearchView(MenuItem item) {\n+        if( Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB ){\n+            return (SearchView) item.getActionView();\n+        }\n+        return (SearchView) MenuItemCompat.getActionView( item );\n+    }\n+\n+    @Override\n+    public boolean onOptionsItemSelected(MenuItem item) {\n+        return super.onOptionsItemSelected(item);\n+    }\n+\n+    @Subscribe(threadMode = ThreadMode.MAIN)\n+    public void onEventStartDetail(StartDetailRouteEvent event) {","path":"app/src/main/java/com/easyrouteapp/MainActivity.java","position":107,"original_position":107,"commit_id":"6602bdf2fbebfb50d1f9089837e4bc83ede4010d","original_commit_id":"6602bdf2fbebfb50d1f9089837e4bc83ede4010d","user":{"login":"arctouch-luizsantana","id":6574799,"avatar_url":"https://avatars.githubusercontent.com/u/6574799?v=3","gravatar_id":"","url":"https://api.github.com/users/arctouch-luizsantana","html_url":"https://github.com/arctouch-luizsantana","followers_url":"https://api.github.com/users/arctouch-luizsantana/followers","following_url":"https://api.github.com/users/arctouch-luizsantana/following{/other_user}","gists_url":"https://api.github.com/users/arctouch-luizsantana/gists{/gist_id}","starred_url":"https://api.github.com/users/arctouch-luizsantana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arctouch-luizsantana/subscriptions","organizations_url":"https://api.github.com/users/arctouch-luizsantana/orgs","repos_url":"https://api.github.com/users/arctouch-luizsantana/repos","events_url":"https://api.github.com/users/arctouch-luizsantana/events{/privacy}","received_events_url":"https://api.github.com/users/arctouch-luizsantana/received_events","type":"User","site_admin":false},"body":"do you really need a Event bus to open a new Activity?","created_at":"2016-08-16T13:30:46Z","updated_at":"2016-08-16T13:30:46Z","html_url":"https://github.com/josefmeyer89/EasyRouteApp/pull/1#discussion_r74934064","pull_request_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/pulls/comments/74934064"},"html":{"href":"https://github.com/josefmeyer89/EasyRouteApp/pull/1#discussion_r74934064"},"pull_request":{"href":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/pulls/1","id":81151695,"html_url":"https://github.com/josefmeyer89/EasyRouteApp/pull/1","diff_url":"https://github.com/josefmeyer89/EasyRouteApp/pull/1.diff","patch_url":"https://github.com/josefmeyer89/EasyRouteApp/pull/1.patch","issue_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/issues/1","number":1,"state":"open","locked":false,"title":"Branch V1 app pull request","user":{"login":"josefmeyer89","id":12829525,"avatar_url":"https://avatars.githubusercontent.com/u/12829525?v=3","gravatar_id":"","url":"https://api.github.com/users/josefmeyer89","html_url":"https://github.com/josefmeyer89","followers_url":"https://api.github.com/users/josefmeyer89/followers","following_url":"https://api.github.com/users/josefmeyer89/following{/other_user}","gists_url":"https://api.github.com/users/josefmeyer89/gists{/gist_id}","starred_url":"https://api.github.com/users/josefmeyer89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josefmeyer89/subscriptions","organizations_url":"https://api.github.com/users/josefmeyer89/orgs","repos_url":"https://api.github.com/users/josefmeyer89/repos","events_url":"https://api.github.com/users/josefmeyer89/events{/privacy}","received_events_url":"https://api.github.com/users/josefmeyer89/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-12T17:06:30Z","updated_at":"2016-08-16T13:30:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e08ae2f30d129e54b020724ddf9f29e86868d11c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/pulls/1/commits","review_comments_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/pulls/1/comments","review_comment_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/issues/1/comments","statuses_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/statuses/6602bdf2fbebfb50d1f9089837e4bc83ede4010d","head":{"label":"josefmeyer89:V1_APP","ref":"V1_APP","sha":"6602bdf2fbebfb50d1f9089837e4bc83ede4010d","user":{"login":"josefmeyer89","id":12829525,"avatar_url":"https://avatars.githubusercontent.com/u/12829525?v=3","gravatar_id":"","url":"https://api.github.com/users/josefmeyer89","html_url":"https://github.com/josefmeyer89","followers_url":"https://api.github.com/users/josefmeyer89/followers","following_url":"https://api.github.com/users/josefmeyer89/following{/other_user}","gists_url":"https://api.github.com/users/josefmeyer89/gists{/gist_id}","starred_url":"https://api.github.com/users/josefmeyer89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josefmeyer89/subscriptions","organizations_url":"https://api.github.com/users/josefmeyer89/orgs","repos_url":"https://api.github.com/users/josefmeyer89/repos","events_url":"https://api.github.com/users/josefmeyer89/events{/privacy}","received_events_url":"https://api.github.com/users/josefmeyer89/received_events","type":"User","site_admin":false},"repo":{"id":65389756,"name":"EasyRouteApp","full_name":"josefmeyer89/EasyRouteApp","owner":{"login":"josefmeyer89","id":12829525,"avatar_url":"https://avatars.githubusercontent.com/u/12829525?v=3","gravatar_id":"","url":"https://api.github.com/users/josefmeyer89","html_url":"https://github.com/josefmeyer89","followers_url":"https://api.github.com/users/josefmeyer89/followers","following_url":"https://api.github.com/users/josefmeyer89/following{/other_user}","gists_url":"https://api.github.com/users/josefmeyer89/gists{/gist_id}","starred_url":"https://api.github.com/users/josefmeyer89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josefmeyer89/subscriptions","organizations_url":"https://api.github.com/users/josefmeyer89/orgs","repos_url":"https://api.github.com/users/josefmeyer89/repos","events_url":"https://api.github.com/users/josefmeyer89/events{/privacy}","received_events_url":"https://api.github.com/users/josefmeyer89/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/josefmeyer89/EasyRouteApp","description":"Easy Route is an App that help users to find routes and timetables of Florianópolis public transportation.","fork":false,"url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp","forks_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/forks","keys_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/teams","hooks_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/hooks","issue_events_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/issues/events{/number}","events_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/events","assignees_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/assignees{/user}","branches_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/branches{/branch}","tags_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/tags","blobs_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/git/refs{/sha}","trees_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/statuses/{sha}","languages_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/languages","stargazers_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/stargazers","contributors_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/contributors","subscribers_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/subscribers","subscription_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/subscription","commits_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/commits{/sha}","git_commits_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/git/commits{/sha}","comments_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/comments{/number}","issue_comment_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/issues/comments{/number}","contents_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/contents/{+path}","compare_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/merges","archive_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/downloads","issues_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/issues{/number}","pulls_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/pulls{/number}","milestones_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/milestones{/number}","notifications_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/labels{/name}","releases_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/releases{/id}","deployments_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/deployments","created_at":"2016-08-10T14:34:59Z","updated_at":"2016-08-12T20:19:38Z","pushed_at":"2016-08-16T12:00:32Z","git_url":"git://github.com/josefmeyer89/EasyRouteApp.git","ssh_url":"git@github.com:josefmeyer89/EasyRouteApp.git","clone_url":"https://github.com/josefmeyer89/EasyRouteApp.git","svn_url":"https://github.com/josefmeyer89/EasyRouteApp","homepage":null,"size":359,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"josefmeyer89:master","ref":"master","sha":"901d419be72bb894abac1c732d4d2f42fdc63eca","user":{"login":"josefmeyer89","id":12829525,"avatar_url":"https://avatars.githubusercontent.com/u/12829525?v=3","gravatar_id":"","url":"https://api.github.com/users/josefmeyer89","html_url":"https://github.com/josefmeyer89","followers_url":"https://api.github.com/users/josefmeyer89/followers","following_url":"https://api.github.com/users/josefmeyer89/following{/other_user}","gists_url":"https://api.github.com/users/josefmeyer89/gists{/gist_id}","starred_url":"https://api.github.com/users/josefmeyer89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josefmeyer89/subscriptions","organizations_url":"https://api.github.com/users/josefmeyer89/orgs","repos_url":"https://api.github.com/users/josefmeyer89/repos","events_url":"https://api.github.com/users/josefmeyer89/events{/privacy}","received_events_url":"https://api.github.com/users/josefmeyer89/received_events","type":"User","site_admin":false},"repo":{"id":65389756,"name":"EasyRouteApp","full_name":"josefmeyer89/EasyRouteApp","owner":{"login":"josefmeyer89","id":12829525,"avatar_url":"https://avatars.githubusercontent.com/u/12829525?v=3","gravatar_id":"","url":"https://api.github.com/users/josefmeyer89","html_url":"https://github.com/josefmeyer89","followers_url":"https://api.github.com/users/josefmeyer89/followers","following_url":"https://api.github.com/users/josefmeyer89/following{/other_user}","gists_url":"https://api.github.com/users/josefmeyer89/gists{/gist_id}","starred_url":"https://api.github.com/users/josefmeyer89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josefmeyer89/subscriptions","organizations_url":"https://api.github.com/users/josefmeyer89/orgs","repos_url":"https://api.github.com/users/josefmeyer89/repos","events_url":"https://api.github.com/users/josefmeyer89/events{/privacy}","received_events_url":"https://api.github.com/users/josefmeyer89/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/josefmeyer89/EasyRouteApp","description":"Easy Route is an App that help users to find routes and timetables of Florianópolis public transportation.","fork":false,"url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp","forks_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/forks","keys_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/teams","hooks_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/hooks","issue_events_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/issues/events{/number}","events_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/events","assignees_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/assignees{/user}","branches_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/branches{/branch}","tags_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/tags","blobs_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/git/refs{/sha}","trees_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/statuses/{sha}","languages_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/languages","stargazers_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/stargazers","contributors_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/contributors","subscribers_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/subscribers","subscription_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/subscription","commits_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/commits{/sha}","git_commits_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/git/commits{/sha}","comments_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/comments{/number}","issue_comment_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/issues/comments{/number}","contents_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/contents/{+path}","compare_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/merges","archive_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/downloads","issues_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/issues{/number}","pulls_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/pulls{/number}","milestones_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/milestones{/number}","notifications_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/labels{/name}","releases_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/releases{/id}","deployments_url":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/deployments","created_at":"2016-08-10T14:34:59Z","updated_at":"2016-08-12T20:19:38Z","pushed_at":"2016-08-16T12:00:32Z","git_url":"git://github.com/josefmeyer89/EasyRouteApp.git","ssh_url":"git@github.com:josefmeyer89/EasyRouteApp.git","clone_url":"https://github.com/josefmeyer89/EasyRouteApp.git","svn_url":"https://github.com/josefmeyer89/EasyRouteApp","homepage":null,"size":359,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/pulls/1"},"html":{"href":"https://github.com/josefmeyer89/EasyRouteApp/pull/1"},"issue":{"href":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/issues/1"},"comments":{"href":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/josefmeyer89/EasyRouteApp/statuses/6602bdf2fbebfb50d1f9089837e4bc83ede4010d"}}}}
{"actor":{"display_login":"arctouch-luizsantana"}}