{"action":"created","comment":{"url":"https://api.github.com/repos/iic-ninjas/mokojin/pulls/comments/26219728","id":26219728,"diff_hunk":"@@ -95,117 +110,72 @@ public void run() {\n         }, 1000);\n     }\n \n-    public void onResume() {\n-        super.onResume();\n-        mQueueAdapter.loadObjects();\n-    }\n-\n     @OnItemLongClick(R.id.queue_list_view)\n     boolean onPlayerLongClick(int position) {\n         ChooseCharactersActivity.chooseCharacter(getActivity(), mQueueAdapter.getItem(position).getPlayer());\n         return true;\n     }\n-    \n+\n     @OnClick(R.id.add_player_button)\n     void onAddPlayerClick(){\n         AddPlayerActivity.launch(getActivity());\n     }\n \n-    static class QueueAdapter extends ParseQueryAdapter<QueueItem>{\n-        private List<Integer> mNonDismissedPositions;\n-\n-        public QueueAdapter(Context context) {\n-            super(context, new QueryFactory<QueueItem>() {\n-                @Override\n-                public ParseQuery<QueueItem> create() {\n-                    ParseQuery<QueueItem> query = ParseQuery.getQuery(QueueItem.class);\n-                    query.orderByAscending(\"createdAt\");\n-                    query.include(\"player.person\");\n-                    query.include(\"player.characterA\");\n-                    query.include(\"player.characterB\");\n-                    return query;\n-                }\n-            });\n-            setPaginationEnabled(false);\n-\n-            addOnQueryLoadListener(new OnQueryLoadListener<QueueItem>() {\n-                @Override\n-                public void onLoading() {\n-                    // Must be implemented\n-                }\n-\n-                @Override\n-                public void onLoaded(List<QueueItem> queueItems, Exception e) {\n-                    // Initialize the array of non-dismissed positions to include all queried items\n-\n-                    Integer[] positionsArray;\n-                    positionsArray = new Integer[queueItems.size()];\n-                    for (int i = 0; i < queueItems.size(); i++) {\n-                        positionsArray[i] = i;\n-                    }\n-                    mNonDismissedPositions = new ArrayList(Arrays.asList(positionsArray));\n-                }\n-            });\n-            \n+    class QueueAdapter extends BaseAdapter {\n+\n+        class PlayerQueueItemViewHolder {\n+            private Date mStartDate;\n+\n+            @InjectView(R.id.player_name) TextView textView;\n+            @InjectView(R.id.time_in_queue) TextView clockView;\n+            @InjectView(R.id.player_character_image) CharacterViewer characterViewer;\n+\n+            public PlayerQueueItemViewHolder(View view) { ButterKnife.inject(this, view); }\n+\n+            public void setStartDate(Date mStartDate) {\n+                this.mStartDate = mStartDate;\n+                updateClock();\n+            }\n+\n+            private void updateClock(){\n+                long millisecondsAgo = new Date().getTime() - mStartDate.getTime();\n+                long secondsAgo = millisecondsAgo / 1000;\n+                clockView.setText(DateUtils.formatElapsedTime(secondsAgo));\n+            }\n         }\n \n \n         @Override\n         public int getCount() {\n-            return mNonDismissedPositions != null ? mNonDismissedPositions.size() : 0;\n+            return mQueueItems.size();\n         }\n \n         @Override\n         public QueueItem getItem(int position) {\n-            return super.getItem(mNonDismissedPositions.get(position));\n-        }\n-\n-        @Override public long getItemId(int position) {\n-            return mNonDismissedPositions.get(position);\n+            return mQueueItems.get(position);\n         }\n \n-        public void dismissItem(int position) {\n-            mNonDismissedPositions.remove(position);\n+        @Override\n+        public long getItemId(int position) {\n+            return 0;\n         }","path":"app/src/main/java/com/iic/mokojin/PlayerQueueFragment.java","position":209,"original_position":209,"commit_id":"664f73f628ecc0463bdb0665fb94c3bf5358b3f0","original_commit_id":"664f73f628ecc0463bdb0665fb94c3bf5358b3f0","user":{"login":"yonbergman","id":461578,"avatar_url":"https://avatars.githubusercontent.com/u/461578?v=3","gravatar_id":"","url":"https://api.github.com/users/yonbergman","html_url":"https://github.com/yonbergman","followers_url":"https://api.github.com/users/yonbergman/followers","following_url":"https://api.github.com/users/yonbergman/following{/other_user}","gists_url":"https://api.github.com/users/yonbergman/gists{/gist_id}","starred_url":"https://api.github.com/users/yonbergman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yonbergman/subscriptions","organizations_url":"https://api.github.com/users/yonbergman/orgs","repos_url":"https://api.github.com/users/yonbergman/repos","events_url":"https://api.github.com/users/yonbergman/events{/privacy}","received_events_url":"https://api.github.com/users/yonbergman/received_events","type":"User","site_admin":false},"body":"needed?","created_at":"2015-03-11T15:06:04Z","updated_at":"2015-03-11T15:06:04Z","html_url":"https://github.com/iic-ninjas/mokojin/pull/53#discussion_r26219728","pull_request_url":"https://api.github.com/repos/iic-ninjas/mokojin/pulls/53","_links":{"self":{"href":"https://api.github.com/repos/iic-ninjas/mokojin/pulls/comments/26219728"},"html":{"href":"https://github.com/iic-ninjas/mokojin/pull/53#discussion_r26219728"},"pull_request":{"href":"https://api.github.com/repos/iic-ninjas/mokojin/pulls/53"}}},"pull_request":{"url":"https://api.github.com/repos/iic-ninjas/mokojin/pulls/53","id":30949802,"html_url":"https://github.com/iic-ninjas/mokojin/pull/53","diff_url":"https://github.com/iic-ninjas/mokojin/pull/53.diff","patch_url":"https://github.com/iic-ninjas/mokojin/pull/53.patch","issue_url":"https://api.github.com/repos/iic-ninjas/mokojin/issues/53","number":53,"state":"open","locked":false,"title":"Auto refresh for main screen","user":{"login":"giladgo","id":1915716,"avatar_url":"https://avatars.githubusercontent.com/u/1915716?v=3","gravatar_id":"","url":"https://api.github.com/users/giladgo","html_url":"https://github.com/giladgo","followers_url":"https://api.github.com/users/giladgo/followers","following_url":"https://api.github.com/users/giladgo/following{/other_user}","gists_url":"https://api.github.com/users/giladgo/gists{/gist_id}","starred_url":"https://api.github.com/users/giladgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giladgo/subscriptions","organizations_url":"https://api.github.com/users/giladgo/orgs","repos_url":"https://api.github.com/users/giladgo/repos","events_url":"https://api.github.com/users/giladgo/events{/privacy}","received_events_url":"https://api.github.com/users/giladgo/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-11T14:48:38Z","updated_at":"2015-03-11T15:06:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d0975bd7e24051b1ad23ccd5d9e6fe4f3efcbaa8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/iic-ninjas/mokojin/pulls/53/commits","review_comments_url":"https://api.github.com/repos/iic-ninjas/mokojin/pulls/53/comments","review_comment_url":"https://api.github.com/repos/iic-ninjas/mokojin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/iic-ninjas/mokojin/issues/53/comments","statuses_url":"https://api.github.com/repos/iic-ninjas/mokojin/statuses/664f73f628ecc0463bdb0665fb94c3bf5358b3f0","head":{"label":"iic-ninjas:auto_refresh","ref":"auto_refresh","sha":"664f73f628ecc0463bdb0665fb94c3bf5358b3f0","user":{"login":"iic-ninjas","id":5079491,"avatar_url":"https://avatars.githubusercontent.com/u/5079491?v=3","gravatar_id":"","url":"https://api.github.com/users/iic-ninjas","html_url":"https://github.com/iic-ninjas","followers_url":"https://api.github.com/users/iic-ninjas/followers","following_url":"https://api.github.com/users/iic-ninjas/following{/other_user}","gists_url":"https://api.github.com/users/iic-ninjas/gists{/gist_id}","starred_url":"https://api.github.com/users/iic-ninjas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iic-ninjas/subscriptions","organizations_url":"https://api.github.com/users/iic-ninjas/orgs","repos_url":"https://api.github.com/users/iic-ninjas/repos","events_url":"https://api.github.com/users/iic-ninjas/events{/privacy}","received_events_url":"https://api.github.com/users/iic-ninjas/received_events","type":"Organization","site_admin":false},"repo":{"id":31545332,"name":"mokojin","full_name":"iic-ninjas/mokojin","owner":{"login":"iic-ninjas","id":5079491,"avatar_url":"https://avatars.githubusercontent.com/u/5079491?v=3","gravatar_id":"","url":"https://api.github.com/users/iic-ninjas","html_url":"https://github.com/iic-ninjas","followers_url":"https://api.github.com/users/iic-ninjas/followers","following_url":"https://api.github.com/users/iic-ninjas/following{/other_user}","gists_url":"https://api.github.com/users/iic-ninjas/gists{/gist_id}","starred_url":"https://api.github.com/users/iic-ninjas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iic-ninjas/subscriptions","organizations_url":"https://api.github.com/users/iic-ninjas/orgs","repos_url":"https://api.github.com/users/iic-ninjas/repos","events_url":"https://api.github.com/users/iic-ninjas/events{/privacy}","received_events_url":"https://api.github.com/users/iic-ninjas/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/iic-ninjas/mokojin","description":"Tekken Queue Manager","fork":false,"url":"https://api.github.com/repos/iic-ninjas/mokojin","forks_url":"https://api.github.com/repos/iic-ninjas/mokojin/forks","keys_url":"https://api.github.com/repos/iic-ninjas/mokojin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iic-ninjas/mokojin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iic-ninjas/mokojin/teams","hooks_url":"https://api.github.com/repos/iic-ninjas/mokojin/hooks","issue_events_url":"https://api.github.com/repos/iic-ninjas/mokojin/issues/events{/number}","events_url":"https://api.github.com/repos/iic-ninjas/mokojin/events","assignees_url":"https://api.github.com/repos/iic-ninjas/mokojin/assignees{/user}","branches_url":"https://api.github.com/repos/iic-ninjas/mokojin/branches{/branch}","tags_url":"https://api.github.com/repos/iic-ninjas/mokojin/tags","blobs_url":"https://api.github.com/repos/iic-ninjas/mokojin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iic-ninjas/mokojin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iic-ninjas/mokojin/git/refs{/sha}","trees_url":"https://api.github.com/repos/iic-ninjas/mokojin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iic-ninjas/mokojin/statuses/{sha}","languages_url":"https://api.github.com/repos/iic-ninjas/mokojin/languages","stargazers_url":"https://api.github.com/repos/iic-ninjas/mokojin/stargazers","contributors_url":"https://api.github.com/repos/iic-ninjas/mokojin/contributors","subscribers_url":"https://api.github.com/repos/iic-ninjas/mokojin/subscribers","subscription_url":"https://api.github.com/repos/iic-ninjas/mokojin/subscription","commits_url":"https://api.github.com/repos/iic-ninjas/mokojin/commits{/sha}","git_commits_url":"https://api.github.com/repos/iic-ninjas/mokojin/git/commits{/sha}","comments_url":"https://api.github.com/repos/iic-ninjas/mokojin/comments{/number}","issue_comment_url":"https://api.github.com/repos/iic-ninjas/mokojin/issues/comments{/number}","contents_url":"https://api.github.com/repos/iic-ninjas/mokojin/contents/{+path}","compare_url":"https://api.github.com/repos/iic-ninjas/mokojin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iic-ninjas/mokojin/merges","archive_url":"https://api.github.com/repos/iic-ninjas/mokojin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iic-ninjas/mokojin/downloads","issues_url":"https://api.github.com/repos/iic-ninjas/mokojin/issues{/number}","pulls_url":"https://api.github.com/repos/iic-ninjas/mokojin/pulls{/number}","milestones_url":"https://api.github.com/repos/iic-ninjas/mokojin/milestones{/number}","notifications_url":"https://api.github.com/repos/iic-ninjas/mokojin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iic-ninjas/mokojin/labels{/name}","releases_url":"https://api.github.com/repos/iic-ninjas/mokojin/releases{/id}","created_at":"2015-03-02T14:54:09Z","updated_at":"2015-03-11T11:32:34Z","pushed_at":"2015-03-11T14:48:11Z","git_url":"git://github.com/iic-ninjas/mokojin.git","ssh_url":"git@github.com:iic-ninjas/mokojin.git","clone_url":"https://github.com/iic-ninjas/mokojin.git","svn_url":"https://github.com/iic-ninjas/mokojin","homepage":"","size":4400,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"iic-ninjas:master","ref":"master","sha":"667cb09344a3a27711284250c35eb8f447264493","user":{"login":"iic-ninjas","id":5079491,"avatar_url":"https://avatars.githubusercontent.com/u/5079491?v=3","gravatar_id":"","url":"https://api.github.com/users/iic-ninjas","html_url":"https://github.com/iic-ninjas","followers_url":"https://api.github.com/users/iic-ninjas/followers","following_url":"https://api.github.com/users/iic-ninjas/following{/other_user}","gists_url":"https://api.github.com/users/iic-ninjas/gists{/gist_id}","starred_url":"https://api.github.com/users/iic-ninjas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iic-ninjas/subscriptions","organizations_url":"https://api.github.com/users/iic-ninjas/orgs","repos_url":"https://api.github.com/users/iic-ninjas/repos","events_url":"https://api.github.com/users/iic-ninjas/events{/privacy}","received_events_url":"https://api.github.com/users/iic-ninjas/received_events","type":"Organization","site_admin":false},"repo":{"id":31545332,"name":"mokojin","full_name":"iic-ninjas/mokojin","owner":{"login":"iic-ninjas","id":5079491,"avatar_url":"https://avatars.githubusercontent.com/u/5079491?v=3","gravatar_id":"","url":"https://api.github.com/users/iic-ninjas","html_url":"https://github.com/iic-ninjas","followers_url":"https://api.github.com/users/iic-ninjas/followers","following_url":"https://api.github.com/users/iic-ninjas/following{/other_user}","gists_url":"https://api.github.com/users/iic-ninjas/gists{/gist_id}","starred_url":"https://api.github.com/users/iic-ninjas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iic-ninjas/subscriptions","organizations_url":"https://api.github.com/users/iic-ninjas/orgs","repos_url":"https://api.github.com/users/iic-ninjas/repos","events_url":"https://api.github.com/users/iic-ninjas/events{/privacy}","received_events_url":"https://api.github.com/users/iic-ninjas/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/iic-ninjas/mokojin","description":"Tekken Queue Manager","fork":false,"url":"https://api.github.com/repos/iic-ninjas/mokojin","forks_url":"https://api.github.com/repos/iic-ninjas/mokojin/forks","keys_url":"https://api.github.com/repos/iic-ninjas/mokojin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iic-ninjas/mokojin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iic-ninjas/mokojin/teams","hooks_url":"https://api.github.com/repos/iic-ninjas/mokojin/hooks","issue_events_url":"https://api.github.com/repos/iic-ninjas/mokojin/issues/events{/number}","events_url":"https://api.github.com/repos/iic-ninjas/mokojin/events","assignees_url":"https://api.github.com/repos/iic-ninjas/mokojin/assignees{/user}","branches_url":"https://api.github.com/repos/iic-ninjas/mokojin/branches{/branch}","tags_url":"https://api.github.com/repos/iic-ninjas/mokojin/tags","blobs_url":"https://api.github.com/repos/iic-ninjas/mokojin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iic-ninjas/mokojin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iic-ninjas/mokojin/git/refs{/sha}","trees_url":"https://api.github.com/repos/iic-ninjas/mokojin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iic-ninjas/mokojin/statuses/{sha}","languages_url":"https://api.github.com/repos/iic-ninjas/mokojin/languages","stargazers_url":"https://api.github.com/repos/iic-ninjas/mokojin/stargazers","contributors_url":"https://api.github.com/repos/iic-ninjas/mokojin/contributors","subscribers_url":"https://api.github.com/repos/iic-ninjas/mokojin/subscribers","subscription_url":"https://api.github.com/repos/iic-ninjas/mokojin/subscription","commits_url":"https://api.github.com/repos/iic-ninjas/mokojin/commits{/sha}","git_commits_url":"https://api.github.com/repos/iic-ninjas/mokojin/git/commits{/sha}","comments_url":"https://api.github.com/repos/iic-ninjas/mokojin/comments{/number}","issue_comment_url":"https://api.github.com/repos/iic-ninjas/mokojin/issues/comments{/number}","contents_url":"https://api.github.com/repos/iic-ninjas/mokojin/contents/{+path}","compare_url":"https://api.github.com/repos/iic-ninjas/mokojin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iic-ninjas/mokojin/merges","archive_url":"https://api.github.com/repos/iic-ninjas/mokojin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iic-ninjas/mokojin/downloads","issues_url":"https://api.github.com/repos/iic-ninjas/mokojin/issues{/number}","pulls_url":"https://api.github.com/repos/iic-ninjas/mokojin/pulls{/number}","milestones_url":"https://api.github.com/repos/iic-ninjas/mokojin/milestones{/number}","notifications_url":"https://api.github.com/repos/iic-ninjas/mokojin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iic-ninjas/mokojin/labels{/name}","releases_url":"https://api.github.com/repos/iic-ninjas/mokojin/releases{/id}","created_at":"2015-03-02T14:54:09Z","updated_at":"2015-03-11T11:32:34Z","pushed_at":"2015-03-11T14:48:11Z","git_url":"git://github.com/iic-ninjas/mokojin.git","ssh_url":"git@github.com:iic-ninjas/mokojin.git","clone_url":"https://github.com/iic-ninjas/mokojin.git","svn_url":"https://github.com/iic-ninjas/mokojin","homepage":"","size":4400,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/iic-ninjas/mokojin/pulls/53"},"html":{"href":"https://github.com/iic-ninjas/mokojin/pull/53"},"issue":{"href":"https://api.github.com/repos/iic-ninjas/mokojin/issues/53"},"comments":{"href":"https://api.github.com/repos/iic-ninjas/mokojin/issues/53/comments"},"review_comments":{"href":"https://api.github.com/repos/iic-ninjas/mokojin/pulls/53/comments"},"review_comment":{"href":"https://api.github.com/repos/iic-ninjas/mokojin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/iic-ninjas/mokojin/pulls/53/commits"},"statuses":{"href":"https://api.github.com/repos/iic-ninjas/mokojin/statuses/664f73f628ecc0463bdb0665fb94c3bf5358b3f0"}}}}