{"action":"created","comment":{"url":"https://api.github.com/repos/WhisperSystems/TextSecure/pulls/comments/25914274","id":25914274,"diff_hunk":"@@ -161,4 +224,56 @@ public void run() {\n       }\n     });\n   }\n+\n+  private class ThumbnailClickListener implements View.OnClickListener, OnLongClickListener {\n+    private final Slide slide;\n+\n+    public ThumbnailClickListener(Slide slide) {\n+      this.slide = slide;\n+    }\n+\n+    private void fireViewIntent() {\n+      Log.w(TAG, \"Clicked: \" + slide.getUri() + \" , \" + slide.getContentType());\n+      Intent intent = new Intent(Intent.ACTION_VIEW);\n+      intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n+      intent.setDataAndType(PartAuthority.getPublicPartUri(slide.getUri()), slide.getContentType());\n+      try {\n+        context.startActivity(intent);\n+      } catch (ActivityNotFoundException anfe) {\n+        Log.w(TAG, \"No activity existed to view the media.\");\n+        Toast.makeText(context, R.string.ConversationItem_unable_to_open_media, Toast.LENGTH_LONG).show();\n+      }\n+    }\n+\n+    @Override\n+    public void onClick(View v) {\n+      if (!selectedThreads.isEmpty()) {\n+        clickListener.onItemClick(null, ConversationListItem.this, -1, -1);\n+      } else if (MediaPreviewActivity.isContentTypeSupported(slide.getContentType())) {\n+        Intent intent = new Intent(context, MediaPreviewActivity.class);\n+        intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n+        intent.setDataAndType(slide.getUri(), slide.getContentType());\n+        intent.putExtra(MediaPreviewActivity.MASTER_SECRET_EXTRA, masterSecret);\n+        context.startActivity(intent);\n+      } else {\n+        AlertDialog.Builder builder = new AlertDialog.Builder(context);\n+        builder.setTitle(R.string.ConversationItem_view_secure_media_question);\n+        builder.setIcon(Dialogs.resolveIcon(context, R.attr.dialog_alert_icon));\n+        builder.setCancelable(true);\n+        builder.setMessage(R.string.ConversationItem_this_media_has_been_stored_in_an_encrypted_database_external_viewer_warning);\n+        builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {\n+          public void onClick(DialogInterface dialog, int which) {\n+            fireViewIntent();\n+          }\n+        });\n+        builder.setNegativeButton(R.string.no, null);\n+        builder.show();\n+      }\n+    }\n+\n+    @Override\n+    public boolean onLongClick(View v) {\n+      return clickListener.onItemLongClick(null, ConversationListItem.this, -1, -1);\n+    }\n+  }","path":"src/org/thoughtcrime/securesms/ConversationListItem.java","position":205,"original_position":205,"commit_id":"e3f9928cc43a928b7632b81b295c61f13bf57963","original_commit_id":"e3f9928cc43a928b7632b81b295c61f13bf57963","user":{"login":"moxie0","id":512439,"avatar_url":"https://avatars.githubusercontent.com/u/512439?v=3","gravatar_id":"","url":"https://api.github.com/users/moxie0","html_url":"https://github.com/moxie0","followers_url":"https://api.github.com/users/moxie0/followers","following_url":"https://api.github.com/users/moxie0/following{/other_user}","gists_url":"https://api.github.com/users/moxie0/gists{/gist_id}","starred_url":"https://api.github.com/users/moxie0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moxie0/subscriptions","organizations_url":"https://api.github.com/users/moxie0/orgs","repos_url":"https://api.github.com/users/moxie0/repos","events_url":"https://api.github.com/users/moxie0/events{/privacy}","received_events_url":"https://api.github.com/users/moxie0/received_events","type":"User","site_admin":false},"body":"i don't think all this should be in here, showing the thumbnail is probably enough","created_at":"2015-03-05T23:50:17Z","updated_at":"2015-03-05T23:50:17Z","html_url":"https://github.com/WhisperSystems/TextSecure/pull/2590#discussion_r25914274","pull_request_url":"https://api.github.com/repos/WhisperSystems/TextSecure/pulls/2590","_links":{"self":{"href":"https://api.github.com/repos/WhisperSystems/TextSecure/pulls/comments/25914274"},"html":{"href":"https://github.com/WhisperSystems/TextSecure/pull/2590#discussion_r25914274"},"pull_request":{"href":"https://api.github.com/repos/WhisperSystems/TextSecure/pulls/2590"}}},"pull_request":{"url":"https://api.github.com/repos/WhisperSystems/TextSecure/pulls/2590","id":30607590,"html_url":"https://github.com/WhisperSystems/TextSecure/pull/2590","diff_url":"https://github.com/WhisperSystems/TextSecure/pull/2590.diff","patch_url":"https://github.com/WhisperSystems/TextSecure/pull/2590.patch","issue_url":"https://api.github.com/repos/WhisperSystems/TextSecure/issues/2590","number":2590,"state":"open","locked":false,"title":"show image preview inside conversation list item views","user":{"login":"rhodey","id":3441581,"avatar_url":"https://avatars.githubusercontent.com/u/3441581?v=3","gravatar_id":"","url":"https://api.github.com/users/rhodey","html_url":"https://github.com/rhodey","followers_url":"https://api.github.com/users/rhodey/followers","following_url":"https://api.github.com/users/rhodey/following{/other_user}","gists_url":"https://api.github.com/users/rhodey/gists{/gist_id}","starred_url":"https://api.github.com/users/rhodey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhodey/subscriptions","organizations_url":"https://api.github.com/users/rhodey/orgs","repos_url":"https://api.github.com/users/rhodey/repos","events_url":"https://api.github.com/users/rhodey/events{/privacy}","received_events_url":"https://api.github.com/users/rhodey/received_events","type":"User","site_admin":false},"body":"1) removed two unused ImageViews from conversation_list_item_view\r\n2) created a new view for thread-level media preview (conversation_list_item_with_media_preview.xml)\r\n3) added two new columns ('snippet_part_uri' and 'snippet_part_type') to ThreadDatabase's 'thread' table\r\n4) added appropriate migration to DatabaseFactory\r\n5) modified ThreadRecord to contain a ListenableFutureTask<Slide> and ThreadDatabase to populate it\r\n6) updated ConversationActivity's draft saving logic to work with ThreadDatabase changes\r\n7) modified ConversationListItem, ConversationListAdapter, and ConversationListFragment to work with the new conversation_list_item_with_media_preview.xml view\r\n8) updated ShareListAdapter to work with the new ThreadDatabase.readerFor() method\r\n9) minor convenience changes to ImageSlide and DraftDatabase\r\n10) bumped versionCode to trigger database upgrade\r\n\r\nFixes #1934\r\n\r\n@mcginty has some major ImageSlide refactoring in the works, some of which this pull could benefit from, for now I'll just put this up here though.","created_at":"2015-03-05T23:36:01Z","updated_at":"2015-03-05T23:50:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/WhisperSystems/TextSecure/pulls/2590/commits","review_comments_url":"https://api.github.com/repos/WhisperSystems/TextSecure/pulls/2590/comments","review_comment_url":"https://api.github.com/repos/WhisperSystems/TextSecure/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WhisperSystems/TextSecure/issues/2590/comments","statuses_url":"https://api.github.com/repos/WhisperSystems/TextSecure/statuses/e3f9928cc43a928b7632b81b295c61f13bf57963","head":{"label":"rhodey:issue-1934","ref":"issue-1934","sha":"e3f9928cc43a928b7632b81b295c61f13bf57963","user":{"login":"rhodey","id":3441581,"avatar_url":"https://avatars.githubusercontent.com/u/3441581?v=3","gravatar_id":"","url":"https://api.github.com/users/rhodey","html_url":"https://github.com/rhodey","followers_url":"https://api.github.com/users/rhodey/followers","following_url":"https://api.github.com/users/rhodey/following{/other_user}","gists_url":"https://api.github.com/users/rhodey/gists{/gist_id}","starred_url":"https://api.github.com/users/rhodey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhodey/subscriptions","organizations_url":"https://api.github.com/users/rhodey/orgs","repos_url":"https://api.github.com/users/rhodey/repos","events_url":"https://api.github.com/users/rhodey/events{/privacy}","received_events_url":"https://api.github.com/users/rhodey/received_events","type":"User","site_admin":false},"repo":{"id":31562260,"name":"TextSecure","full_name":"rhodey/TextSecure","owner":{"login":"rhodey","id":3441581,"avatar_url":"https://avatars.githubusercontent.com/u/3441581?v=3","gravatar_id":"","url":"https://api.github.com/users/rhodey","html_url":"https://github.com/rhodey","followers_url":"https://api.github.com/users/rhodey/followers","following_url":"https://api.github.com/users/rhodey/following{/other_user}","gists_url":"https://api.github.com/users/rhodey/gists{/gist_id}","starred_url":"https://api.github.com/users/rhodey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhodey/subscriptions","organizations_url":"https://api.github.com/users/rhodey/orgs","repos_url":"https://api.github.com/users/rhodey/repos","events_url":"https://api.github.com/users/rhodey/events{/privacy}","received_events_url":"https://api.github.com/users/rhodey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rhodey/TextSecure","description":"A secure text messaging application for Android.","fork":true,"url":"https://api.github.com/repos/rhodey/TextSecure","forks_url":"https://api.github.com/repos/rhodey/TextSecure/forks","keys_url":"https://api.github.com/repos/rhodey/TextSecure/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rhodey/TextSecure/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rhodey/TextSecure/teams","hooks_url":"https://api.github.com/repos/rhodey/TextSecure/hooks","issue_events_url":"https://api.github.com/repos/rhodey/TextSecure/issues/events{/number}","events_url":"https://api.github.com/repos/rhodey/TextSecure/events","assignees_url":"https://api.github.com/repos/rhodey/TextSecure/assignees{/user}","branches_url":"https://api.github.com/repos/rhodey/TextSecure/branches{/branch}","tags_url":"https://api.github.com/repos/rhodey/TextSecure/tags","blobs_url":"https://api.github.com/repos/rhodey/TextSecure/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rhodey/TextSecure/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rhodey/TextSecure/git/refs{/sha}","trees_url":"https://api.github.com/repos/rhodey/TextSecure/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rhodey/TextSecure/statuses/{sha}","languages_url":"https://api.github.com/repos/rhodey/TextSecure/languages","stargazers_url":"https://api.github.com/repos/rhodey/TextSecure/stargazers","contributors_url":"https://api.github.com/repos/rhodey/TextSecure/contributors","subscribers_url":"https://api.github.com/repos/rhodey/TextSecure/subscribers","subscription_url":"https://api.github.com/repos/rhodey/TextSecure/subscription","commits_url":"https://api.github.com/repos/rhodey/TextSecure/commits{/sha}","git_commits_url":"https://api.github.com/repos/rhodey/TextSecure/git/commits{/sha}","comments_url":"https://api.github.com/repos/rhodey/TextSecure/comments{/number}","issue_comment_url":"https://api.github.com/repos/rhodey/TextSecure/issues/comments{/number}","contents_url":"https://api.github.com/repos/rhodey/TextSecure/contents/{+path}","compare_url":"https://api.github.com/repos/rhodey/TextSecure/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rhodey/TextSecure/merges","archive_url":"https://api.github.com/repos/rhodey/TextSecure/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rhodey/TextSecure/downloads","issues_url":"https://api.github.com/repos/rhodey/TextSecure/issues{/number}","pulls_url":"https://api.github.com/repos/rhodey/TextSecure/pulls{/number}","milestones_url":"https://api.github.com/repos/rhodey/TextSecure/milestones{/number}","notifications_url":"https://api.github.com/repos/rhodey/TextSecure/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rhodey/TextSecure/labels{/name}","releases_url":"https://api.github.com/repos/rhodey/TextSecure/releases{/id}","created_at":"2015-03-02T20:46:02Z","updated_at":"2015-03-02T20:46:05Z","pushed_at":"2015-03-05T23:41:48Z","git_url":"git://github.com/rhodey/TextSecure.git","ssh_url":"git@github.com:rhodey/TextSecure.git","clone_url":"https://github.com/rhodey/TextSecure.git","svn_url":"https://github.com/rhodey/TextSecure","homepage":"","size":38616,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"WhisperSystems:master","ref":"master","sha":"301ed0b25523a2ee1b105acc260145a49c461d62","user":{"login":"WhisperSystems","id":702459,"avatar_url":"https://avatars.githubusercontent.com/u/702459?v=3","gravatar_id":"","url":"https://api.github.com/users/WhisperSystems","html_url":"https://github.com/WhisperSystems","followers_url":"https://api.github.com/users/WhisperSystems/followers","following_url":"https://api.github.com/users/WhisperSystems/following{/other_user}","gists_url":"https://api.github.com/users/WhisperSystems/gists{/gist_id}","starred_url":"https://api.github.com/users/WhisperSystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WhisperSystems/subscriptions","organizations_url":"https://api.github.com/users/WhisperSystems/orgs","repos_url":"https://api.github.com/users/WhisperSystems/repos","events_url":"https://api.github.com/users/WhisperSystems/events{/privacy}","received_events_url":"https://api.github.com/users/WhisperSystems/received_events","type":"Organization","site_admin":false},"repo":{"id":2990192,"name":"TextSecure","full_name":"WhisperSystems/TextSecure","owner":{"login":"WhisperSystems","id":702459,"avatar_url":"https://avatars.githubusercontent.com/u/702459?v=3","gravatar_id":"","url":"https://api.github.com/users/WhisperSystems","html_url":"https://github.com/WhisperSystems","followers_url":"https://api.github.com/users/WhisperSystems/followers","following_url":"https://api.github.com/users/WhisperSystems/following{/other_user}","gists_url":"https://api.github.com/users/WhisperSystems/gists{/gist_id}","starred_url":"https://api.github.com/users/WhisperSystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WhisperSystems/subscriptions","organizations_url":"https://api.github.com/users/WhisperSystems/orgs","repos_url":"https://api.github.com/users/WhisperSystems/repos","events_url":"https://api.github.com/users/WhisperSystems/events{/privacy}","received_events_url":"https://api.github.com/users/WhisperSystems/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WhisperSystems/TextSecure","description":"A secure text messaging application for Android.","fork":false,"url":"https://api.github.com/repos/WhisperSystems/TextSecure","forks_url":"https://api.github.com/repos/WhisperSystems/TextSecure/forks","keys_url":"https://api.github.com/repos/WhisperSystems/TextSecure/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WhisperSystems/TextSecure/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WhisperSystems/TextSecure/teams","hooks_url":"https://api.github.com/repos/WhisperSystems/TextSecure/hooks","issue_events_url":"https://api.github.com/repos/WhisperSystems/TextSecure/issues/events{/number}","events_url":"https://api.github.com/repos/WhisperSystems/TextSecure/events","assignees_url":"https://api.github.com/repos/WhisperSystems/TextSecure/assignees{/user}","branches_url":"https://api.github.com/repos/WhisperSystems/TextSecure/branches{/branch}","tags_url":"https://api.github.com/repos/WhisperSystems/TextSecure/tags","blobs_url":"https://api.github.com/repos/WhisperSystems/TextSecure/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WhisperSystems/TextSecure/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WhisperSystems/TextSecure/git/refs{/sha}","trees_url":"https://api.github.com/repos/WhisperSystems/TextSecure/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WhisperSystems/TextSecure/statuses/{sha}","languages_url":"https://api.github.com/repos/WhisperSystems/TextSecure/languages","stargazers_url":"https://api.github.com/repos/WhisperSystems/TextSecure/stargazers","contributors_url":"https://api.github.com/repos/WhisperSystems/TextSecure/contributors","subscribers_url":"https://api.github.com/repos/WhisperSystems/TextSecure/subscribers","subscription_url":"https://api.github.com/repos/WhisperSystems/TextSecure/subscription","commits_url":"https://api.github.com/repos/WhisperSystems/TextSecure/commits{/sha}","git_commits_url":"https://api.github.com/repos/WhisperSystems/TextSecure/git/commits{/sha}","comments_url":"https://api.github.com/repos/WhisperSystems/TextSecure/comments{/number}","issue_comment_url":"https://api.github.com/repos/WhisperSystems/TextSecure/issues/comments{/number}","contents_url":"https://api.github.com/repos/WhisperSystems/TextSecure/contents/{+path}","compare_url":"https://api.github.com/repos/WhisperSystems/TextSecure/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WhisperSystems/TextSecure/merges","archive_url":"https://api.github.com/repos/WhisperSystems/TextSecure/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WhisperSystems/TextSecure/downloads","issues_url":"https://api.github.com/repos/WhisperSystems/TextSecure/issues{/number}","pulls_url":"https://api.github.com/repos/WhisperSystems/TextSecure/pulls{/number}","milestones_url":"https://api.github.com/repos/WhisperSystems/TextSecure/milestones{/number}","notifications_url":"https://api.github.com/repos/WhisperSystems/TextSecure/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WhisperSystems/TextSecure/labels{/name}","releases_url":"https://api.github.com/repos/WhisperSystems/TextSecure/releases{/id}","created_at":"2011-12-15T20:01:12Z","updated_at":"2015-03-05T22:19:34Z","pushed_at":"2015-03-05T21:10:15Z","git_url":"git://github.com/WhisperSystems/TextSecure.git","ssh_url":"git@github.com:WhisperSystems/TextSecure.git","clone_url":"https://github.com/WhisperSystems/TextSecure.git","svn_url":"https://github.com/WhisperSystems/TextSecure","homepage":"","size":61082,"stargazers_count":3642,"watchers_count":3642,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1024,"mirror_url":null,"open_issues_count":502,"forks":1024,"open_issues":502,"watchers":3642,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WhisperSystems/TextSecure/pulls/2590"},"html":{"href":"https://github.com/WhisperSystems/TextSecure/pull/2590"},"issue":{"href":"https://api.github.com/repos/WhisperSystems/TextSecure/issues/2590"},"comments":{"href":"https://api.github.com/repos/WhisperSystems/TextSecure/issues/2590/comments"},"review_comments":{"href":"https://api.github.com/repos/WhisperSystems/TextSecure/pulls/2590/comments"},"review_comment":{"href":"https://api.github.com/repos/WhisperSystems/TextSecure/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WhisperSystems/TextSecure/pulls/2590/commits"},"statuses":{"href":"https://api.github.com/repos/WhisperSystems/TextSecure/statuses/e3f9928cc43a928b7632b81b295c61f13bf57963"}}}}