{"action":"created","comment":{"url":"https://api.github.com/repos/fossasia/open-event-android/pulls/comments/120256760","pull_request_review_id":42202554,"id":120256760,"diff_hunk":"@@ -0,0 +1,205 @@\n+package org.fossasia.openevent.activities;\n+\n+import android.app.SearchManager;\n+import android.content.Context;\n+import android.content.Intent;\n+import android.os.Bundle;\n+import android.support.v7.widget.LinearLayoutManager;\n+import android.support.v7.widget.RecyclerView;\n+import android.support.v7.widget.SearchView;\n+import android.text.TextUtils;\n+import android.view.Menu;\n+import android.view.MenuInflater;\n+import android.view.View;\n+import android.widget.TextView;\n+\n+import org.fossasia.openevent.OpenEventApp;\n+import org.fossasia.openevent.R;\n+import org.fossasia.openevent.adapters.GlobalSearchAdapter;\n+import org.fossasia.openevent.data.Microlocation;\n+import org.fossasia.openevent.data.Speaker;\n+import org.fossasia.openevent.data.Track;\n+\n+import java.util.ArrayList;\n+import java.util.List;\n+import java.util.Locale;\n+\n+import butterknife.BindView;\n+import io.realm.Case;\n+import io.realm.Realm;\n+import io.realm.RealmResults;\n+import timber.log.Timber;\n+\n+public class SearchActivity extends BaseActivity implements SearchView.OnQueryTextListener {\n+\n+    private GlobalSearchAdapter globalSearchAdapter;\n+    private List<Object> results = new ArrayList<>();\n+\n+    private Realm realm = Realm.getDefaultInstance();\n+\n+    private SearchView searchView;\n+    private String searchText;\n+\n+    private final String SEARCH = \"SAVE_KEY_ON_ROTATE\";\n+\n+    @BindView(R.id.search_recyclerView)\n+    RecyclerView searchRecyclerView;\n+    @BindView(R.id.txt_no_results)\n+    TextView noResultsView;\n+\n+    @Override\n+    protected void onCreate(Bundle savedInstanceState) {\n+        super.onCreate(savedInstanceState);\n+\n+        OpenEventApp.getEventBus().register(this);\n+\n+        handleVisibility();\n+\n+        globalSearchAdapter = new GlobalSearchAdapter(results, this);\n+        searchRecyclerView.setAdapter(globalSearchAdapter);\n+        searchRecyclerView.setLayoutManager(new LinearLayoutManager(this));\n+\n+        if (savedInstanceState != null && savedInstanceState.getString(SEARCH) != null) {\n+            searchText = savedInstanceState.getString(SEARCH);\n+        }\n+\n+        if (Intent.ACTION_SEARCH.equals(getIntent().getAction())) {\n+            handleIntent(getIntent());\n+        }\n+\n+    }\n+\n+    @Override\n+    protected int getLayoutResource() {\n+        return R.layout.activity_search;\n+    }\n+\n+    @Override\n+    public boolean onCreateOptionsMenu(Menu menu) {\n+\n+        MenuInflater inflater = getMenuInflater();\n+        inflater.inflate(R.menu.menu_home, menu);\n+        SearchManager searchManager =\n+                (SearchManager) getSystemService(Context.SEARCH_SERVICE);\n+        searchView = (SearchView) menu.findItem(R.id.action_search_home).getActionView();\n+        searchView.setSearchableInfo(\n+                searchManager.getSearchableInfo(getComponentName()));\n+\n+        searchView.setOnQueryTextListener(this);\n+        if (searchText != null) {\n+            searchView.setQuery(searchText, true);\n+        }\n+        return true;\n+    }\n+\n+    @Override\n+    public boolean onQueryTextChange(String query) {\n+        if(query!=null) {\n+            searchQuery(query);\n+            searchText = query;\n+        }\n+        else{\n+            results.clear();\n+            handleVisibility();\n+        }\n+        return true;\n+    }\n+\n+    @Override\n+    public boolean onQueryTextSubmit(String query) {\n+        searchView.clearFocus();\n+        return true;\n+    }\n+\n+    @Override\n+    protected void onNewIntent(Intent intent) {\n+        super.onNewIntent(intent);\n+        handleIntent(intent);\n+    }\n+\n+    public void handleIntent(Intent intent) {\n+        final String query = intent.getStringExtra(SearchManager.QUERY);\n+        searchQuery(query);\n+    }\n+\n+    private void searchQuery(String constraint) {\n+","path":"android/app/src/main/java/org/fossasia/openevent/activities/SearchActivity.java","position":126,"original_position":126,"commit_id":"8ffc93c970a7201b671cb040259a039131ef7b63","original_commit_id":"db87fa8e7e620440576d6624bde36780fea3bfaf","user":{"login":"iamareebjamal","id":3874064,"avatar_url":"https://avatars3.githubusercontent.com/u/3874064?v=3","gravatar_id":"","url":"https://api.github.com/users/iamareebjamal","html_url":"https://github.com/iamareebjamal","followers_url":"https://api.github.com/users/iamareebjamal/followers","following_url":"https://api.github.com/users/iamareebjamal/following{/other_user}","gists_url":"https://api.github.com/users/iamareebjamal/gists{/gist_id}","starred_url":"https://api.github.com/users/iamareebjamal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamareebjamal/subscriptions","organizations_url":"https://api.github.com/users/iamareebjamal/orgs","repos_url":"https://api.github.com/users/iamareebjamal/repos","events_url":"https://api.github.com/users/iamareebjamal/events{/privacy}","received_events_url":"https://api.github.com/users/iamareebjamal/received_events","type":"User","site_admin":false},"body":"Remove empty lines from function start. Only add to separate blocks of statements between functions","created_at":"2017-06-06T03:10:22Z","updated_at":"2017-06-06T03:26:14Z","html_url":"https://github.com/fossasia/open-event-android/pull/1565#discussion_r120256760","pull_request_url":"https://api.github.com/repos/fossasia/open-event-android/pulls/1565","_links":{"self":{"href":"https://api.github.com/repos/fossasia/open-event-android/pulls/comments/120256760"},"html":{"href":"https://github.com/fossasia/open-event-android/pull/1565#discussion_r120256760"},"pull_request":{"href":"https://api.github.com/repos/fossasia/open-event-android/pulls/1565"}}},"pull_request":{"url":"https://api.github.com/repos/fossasia/open-event-android/pulls/1565","id":120813200,"html_url":"https://github.com/fossasia/open-event-android/pull/1565","diff_url":"https://github.com/fossasia/open-event-android/pull/1565.diff","patch_url":"https://github.com/fossasia/open-event-android/pull/1565.patch","issue_url":"https://api.github.com/repos/fossasia/open-event-android/issues/1565","number":1565,"state":"open","locked":false,"title":"feat:New Home+Bookmarks Merged into Main Screen(#1499)","user":{"login":"shreyasnbhat","id":19890557,"avatar_url":"https://avatars2.githubusercontent.com/u/19890557?v=3","gravatar_id":"","url":"https://api.github.com/users/shreyasnbhat","html_url":"https://github.com/shreyasnbhat","followers_url":"https://api.github.com/users/shreyasnbhat/followers","following_url":"https://api.github.com/users/shreyasnbhat/following{/other_user}","gists_url":"https://api.github.com/users/shreyasnbhat/gists{/gist_id}","starred_url":"https://api.github.com/users/shreyasnbhat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shreyasnbhat/subscriptions","organizations_url":"https://api.github.com/users/shreyasnbhat/orgs","repos_url":"https://api.github.com/users/shreyasnbhat/repos","events_url":"https://api.github.com/users/shreyasnbhat/events{/privacy}","received_events_url":"https://api.github.com/users/shreyasnbhat/received_events","type":"User","site_admin":false},"body":"feat:Global Search Added along with Bookmarks added to Home Page(#1499)\r\nFirst steps for issues #1499 \r\nScreenshots have been posted in the Issue itself \r\n","created_at":"2017-05-16T12:21:12Z","updated_at":"2017-06-06T03:26:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"72b81181294e5c39b452ed172d15ea8ecfa3fd1b","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/fossasia/open-event-android/pulls/1565/commits","review_comments_url":"https://api.github.com/repos/fossasia/open-event-android/pulls/1565/comments","review_comment_url":"https://api.github.com/repos/fossasia/open-event-android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fossasia/open-event-android/issues/1565/comments","statuses_url":"https://api.github.com/repos/fossasia/open-event-android/statuses/8ffc93c970a7201b671cb040259a039131ef7b63","head":{"label":"shreyasnbhat:global-search","ref":"global-search","sha":"8ffc93c970a7201b671cb040259a039131ef7b63","user":{"login":"shreyasnbhat","id":19890557,"avatar_url":"https://avatars2.githubusercontent.com/u/19890557?v=3","gravatar_id":"","url":"https://api.github.com/users/shreyasnbhat","html_url":"https://github.com/shreyasnbhat","followers_url":"https://api.github.com/users/shreyasnbhat/followers","following_url":"https://api.github.com/users/shreyasnbhat/following{/other_user}","gists_url":"https://api.github.com/users/shreyasnbhat/gists{/gist_id}","starred_url":"https://api.github.com/users/shreyasnbhat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shreyasnbhat/subscriptions","organizations_url":"https://api.github.com/users/shreyasnbhat/orgs","repos_url":"https://api.github.com/users/shreyasnbhat/repos","events_url":"https://api.github.com/users/shreyasnbhat/events{/privacy}","received_events_url":"https://api.github.com/users/shreyasnbhat/received_events","type":"User","site_admin":false},"repo":{"id":79933487,"name":"open-event-android","full_name":"shreyasnbhat/open-event-android","owner":{"login":"shreyasnbhat","id":19890557,"avatar_url":"https://avatars2.githubusercontent.com/u/19890557?v=3","gravatar_id":"","url":"https://api.github.com/users/shreyasnbhat","html_url":"https://github.com/shreyasnbhat","followers_url":"https://api.github.com/users/shreyasnbhat/followers","following_url":"https://api.github.com/users/shreyasnbhat/following{/other_user}","gists_url":"https://api.github.com/users/shreyasnbhat/gists{/gist_id}","starred_url":"https://api.github.com/users/shreyasnbhat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shreyasnbhat/subscriptions","organizations_url":"https://api.github.com/users/shreyasnbhat/orgs","repos_url":"https://api.github.com/users/shreyasnbhat/repos","events_url":"https://api.github.com/users/shreyasnbhat/events{/privacy}","received_events_url":"https://api.github.com/users/shreyasnbhat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shreyasnbhat/open-event-android","description":"Open Event Android App Generator","fork":true,"url":"https://api.github.com/repos/shreyasnbhat/open-event-android","forks_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/forks","keys_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/teams","hooks_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/hooks","issue_events_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/issues/events{/number}","events_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/events","assignees_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/assignees{/user}","branches_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/branches{/branch}","tags_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/tags","blobs_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/statuses/{sha}","languages_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/languages","stargazers_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/stargazers","contributors_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/contributors","subscribers_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/subscribers","subscription_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/subscription","commits_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/contents/{+path}","compare_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/merges","archive_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/downloads","issues_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/issues{/number}","pulls_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/pulls{/number}","milestones_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/milestones{/number}","notifications_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/labels{/name}","releases_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/releases{/id}","deployments_url":"https://api.github.com/repos/shreyasnbhat/open-event-android/deployments","created_at":"2017-01-24T17:06:21Z","updated_at":"2017-03-11T02:37:27Z","pushed_at":"2017-06-06T03:06:55Z","git_url":"git://github.com/shreyasnbhat/open-event-android.git","ssh_url":"git@github.com:shreyasnbhat/open-event-android.git","clone_url":"https://github.com/shreyasnbhat/open-event-android.git","svn_url":"https://github.com/shreyasnbhat/open-event-android","homepage":"https://github.com/fossasia/open-event-android/raw/apk/app-fdroid-debug.apk","size":178604,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"development"}},"base":{"label":"fossasia:development","ref":"development","sha":"2db3e450f4c294dc3387df918f6e67fe229b2b55","user":{"login":"fossasia","id":6295529,"avatar_url":"https://avatars0.githubusercontent.com/u/6295529?v=3","gravatar_id":"","url":"https://api.github.com/users/fossasia","html_url":"https://github.com/fossasia","followers_url":"https://api.github.com/users/fossasia/followers","following_url":"https://api.github.com/users/fossasia/following{/other_user}","gists_url":"https://api.github.com/users/fossasia/gists{/gist_id}","starred_url":"https://api.github.com/users/fossasia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fossasia/subscriptions","organizations_url":"https://api.github.com/users/fossasia/orgs","repos_url":"https://api.github.com/users/fossasia/repos","events_url":"https://api.github.com/users/fossasia/events{/privacy}","received_events_url":"https://api.github.com/users/fossasia/received_events","type":"Organization","site_admin":false},"repo":{"id":35269607,"name":"open-event-android","full_name":"fossasia/open-event-android","owner":{"login":"fossasia","id":6295529,"avatar_url":"https://avatars0.githubusercontent.com/u/6295529?v=3","gravatar_id":"","url":"https://api.github.com/users/fossasia","html_url":"https://github.com/fossasia","followers_url":"https://api.github.com/users/fossasia/followers","following_url":"https://api.github.com/users/fossasia/following{/other_user}","gists_url":"https://api.github.com/users/fossasia/gists{/gist_id}","starred_url":"https://api.github.com/users/fossasia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fossasia/subscriptions","organizations_url":"https://api.github.com/users/fossasia/orgs","repos_url":"https://api.github.com/users/fossasia/repos","events_url":"https://api.github.com/users/fossasia/events{/privacy}","received_events_url":"https://api.github.com/users/fossasia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fossasia/open-event-android","description":"Open Event Android App Generator https://github.com/fossasia/open-event-android/raw/apk/sample-apk-development.apk http://droidgen.eventyay.com","fork":false,"url":"https://api.github.com/repos/fossasia/open-event-android","forks_url":"https://api.github.com/repos/fossasia/open-event-android/forks","keys_url":"https://api.github.com/repos/fossasia/open-event-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fossasia/open-event-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fossasia/open-event-android/teams","hooks_url":"https://api.github.com/repos/fossasia/open-event-android/hooks","issue_events_url":"https://api.github.com/repos/fossasia/open-event-android/issues/events{/number}","events_url":"https://api.github.com/repos/fossasia/open-event-android/events","assignees_url":"https://api.github.com/repos/fossasia/open-event-android/assignees{/user}","branches_url":"https://api.github.com/repos/fossasia/open-event-android/branches{/branch}","tags_url":"https://api.github.com/repos/fossasia/open-event-android/tags","blobs_url":"https://api.github.com/repos/fossasia/open-event-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fossasia/open-event-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fossasia/open-event-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/fossasia/open-event-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fossasia/open-event-android/statuses/{sha}","languages_url":"https://api.github.com/repos/fossasia/open-event-android/languages","stargazers_url":"https://api.github.com/repos/fossasia/open-event-android/stargazers","contributors_url":"https://api.github.com/repos/fossasia/open-event-android/contributors","subscribers_url":"https://api.github.com/repos/fossasia/open-event-android/subscribers","subscription_url":"https://api.github.com/repos/fossasia/open-event-android/subscription","commits_url":"https://api.github.com/repos/fossasia/open-event-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/fossasia/open-event-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/fossasia/open-event-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/fossasia/open-event-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/fossasia/open-event-android/contents/{+path}","compare_url":"https://api.github.com/repos/fossasia/open-event-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fossasia/open-event-android/merges","archive_url":"https://api.github.com/repos/fossasia/open-event-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fossasia/open-event-android/downloads","issues_url":"https://api.github.com/repos/fossasia/open-event-android/issues{/number}","pulls_url":"https://api.github.com/repos/fossasia/open-event-android/pulls{/number}","milestones_url":"https://api.github.com/repos/fossasia/open-event-android/milestones{/number}","notifications_url":"https://api.github.com/repos/fossasia/open-event-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fossasia/open-event-android/labels{/name}","releases_url":"https://api.github.com/repos/fossasia/open-event-android/releases{/id}","deployments_url":"https://api.github.com/repos/fossasia/open-event-android/deployments","created_at":"2015-05-08T09:04:11Z","updated_at":"2017-05-26T14:56:53Z","pushed_at":"2017-06-06T03:06:57Z","git_url":"git://github.com/fossasia/open-event-android.git","ssh_url":"git@github.com:fossasia/open-event-android.git","clone_url":"https://github.com/fossasia/open-event-android.git","svn_url":"https://github.com/fossasia/open-event-android","homepage":"","size":98188,"stargazers_count":308,"watchers_count":308,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":339,"mirror_url":null,"open_issues_count":41,"forks":339,"open_issues":41,"watchers":308,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/fossasia/open-event-android/pulls/1565"},"html":{"href":"https://github.com/fossasia/open-event-android/pull/1565"},"issue":{"href":"https://api.github.com/repos/fossasia/open-event-android/issues/1565"},"comments":{"href":"https://api.github.com/repos/fossasia/open-event-android/issues/1565/comments"},"review_comments":{"href":"https://api.github.com/repos/fossasia/open-event-android/pulls/1565/comments"},"review_comment":{"href":"https://api.github.com/repos/fossasia/open-event-android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fossasia/open-event-android/pulls/1565/commits"},"statuses":{"href":"https://api.github.com/repos/fossasia/open-event-android/statuses/8ffc93c970a7201b671cb040259a039131ef7b63"}}}}
{"actor":{"display_login":"iamareebjamal"}}