{"action":"created","comment":{"url":"https://api.github.com/repos/Swati4star/Images-to-PDF/pulls/comments/199318361","pull_request_review_id":133421175,"id":199318361,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5OTMxODM2MQ==","diff_hunk":"@@ -324,6 +341,67 @@ public String string(@StringRes int resId) {\n             ButterKnife.bind(this, itemView);\n         }\n     }\n+    private void setPassword(final String fileName) {\n+        final MaterialDialog dialog = new MaterialDialog.Builder(mActivity)\n+                .title(R.string.set_password)\n+                .customView(R.layout.custom_dialog, true)\n+                .positiveText(android.R.string.ok)\n+                .negativeText(android.R.string.cancel)\n+                .build();\n+\n+        mPositiveAction = dialog.getActionButton(DialogAction.POSITIVE);\n+        mPasswordInput = dialog.getCustomView().findViewById(R.id.password);\n+        mPasswordInput.addTextChangedListener(\n+                new TextWatcher() {\n+                    @Override\n+                    public void beforeTextChanged(CharSequence s, int start, int count, int after) {\n+                    }\n+\n+                    @Override\n+                    public void onTextChanged(CharSequence s, int start, int before, int count) {\n+                        mPositiveAction.setEnabled(s.toString().trim().length() > 0);\n+                    }\n+\n+                    @Override\n+                    public void afterTextChanged(Editable input) {\n+                        if (StringUtils.isEmpty(input)) {\n+                            Snackbar.make(Objects.requireNonNull(mActivity).findViewById(android.R.id.content),\n+                                    R.string.snackbar_password_cannot_be_blank,\n+                                    Snackbar.LENGTH_LONG).show();\n+                        } else {\n+                            mPassword = input.toString();\n+\n+                        }\n+                    }\n+                });\n+        dialog.show();\n+        mPositiveAction.setEnabled(false);\n+        mPositiveAction.setOnClickListener(new View.OnClickListener() {\n+            public void onClick(View v) {\n+                try {\n+                    doEncryption(fileName);\n+                } catch (IOException | DocumentException e) {\n+                    e.printStackTrace();\n+                }\n+                dialog.dismiss();\n+                notifyDataSetChanged();\n+                Snackbar.make(Objects.requireNonNull(mActivity).findViewById(android.R.id.content),\n+                        R.string.password_added,\n+                        Snackbar.LENGTH_LONG).show();\n+            }\n+        });\n+\n+    }\n+    private void doEncryption(String path) throws IOException, DocumentException {\n+        PdfReader reader = new PdfReader(path);\n+        PdfStamper stamper = new PdfStamper(reader,new FileOutputStream(\"/storage/emulated/0/PDFfiles/sample.pdf\"));","path":"app/src/main/java/swati4star/createpdf/adapter/ViewFilesAdapter.java","position":114,"original_position":114,"commit_id":"3ef32797a855a2c7d02a70dcef59ef04341ad1af","original_commit_id":"3ef32797a855a2c7d02a70dcef59ef04341ad1af","user":{"login":"shiv07tiwari","id":38163725,"node_id":"MDQ6VXNlcjM4MTYzNzI1","avatar_url":"https://avatars3.githubusercontent.com/u/38163725?v=4","gravatar_id":"","url":"https://api.github.com/users/shiv07tiwari","html_url":"https://github.com/shiv07tiwari","followers_url":"https://api.github.com/users/shiv07tiwari/followers","following_url":"https://api.github.com/users/shiv07tiwari/following{/other_user}","gists_url":"https://api.github.com/users/shiv07tiwari/gists{/gist_id}","starred_url":"https://api.github.com/users/shiv07tiwari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shiv07tiwari/subscriptions","organizations_url":"https://api.github.com/users/shiv07tiwari/orgs","repos_url":"https://api.github.com/users/shiv07tiwari/repos","events_url":"https://api.github.com/users/shiv07tiwari/events{/privacy}","received_events_url":"https://api.github.com/users/shiv07tiwari/received_events","type":"User","site_admin":false},"body":"If I delete the file, then how the reader and stamper are gonna encrypt the file.. i guess then it is same as creating another pdf with encryption.\r\n","created_at":"2018-06-30T09:29:36Z","updated_at":"2018-06-30T09:29:36Z","html_url":"https://github.com/Swati4star/Images-to-PDF/pull/134#discussion_r199318361","pull_request_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/pulls/134","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Swati4star/Images-to-PDF/pulls/comments/199318361"},"html":{"href":"https://github.com/Swati4star/Images-to-PDF/pull/134#discussion_r199318361"},"pull_request":{"href":"https://api.github.com/repos/Swati4star/Images-to-PDF/pulls/134"}},"in_reply_to_id":199318096},"pull_request":{"url":"https://api.github.com/repos/Swati4star/Images-to-PDF/pulls/134","id":198467825,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4NDY3ODI1","html_url":"https://github.com/Swati4star/Images-to-PDF/pull/134","diff_url":"https://github.com/Swati4star/Images-to-PDF/pull/134.diff","patch_url":"https://github.com/Swati4star/Images-to-PDF/pull/134.patch","issue_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/issues/134","number":134,"state":"open","locked":false,"title":"Created an option to add password after pdf creation.","user":{"login":"shiv07tiwari","id":38163725,"node_id":"MDQ6VXNlcjM4MTYzNzI1","avatar_url":"https://avatars3.githubusercontent.com/u/38163725?v=4","gravatar_id":"","url":"https://api.github.com/users/shiv07tiwari","html_url":"https://github.com/shiv07tiwari","followers_url":"https://api.github.com/users/shiv07tiwari/followers","following_url":"https://api.github.com/users/shiv07tiwari/following{/other_user}","gists_url":"https://api.github.com/users/shiv07tiwari/gists{/gist_id}","starred_url":"https://api.github.com/users/shiv07tiwari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shiv07tiwari/subscriptions","organizations_url":"https://api.github.com/users/shiv07tiwari/orgs","repos_url":"https://api.github.com/users/shiv07tiwari/repos","events_url":"https://api.github.com/users/shiv07tiwari/events{/privacy}","received_events_url":"https://api.github.com/users/shiv07tiwari/received_events","type":"User","site_admin":false},"body":"# Description\r\n\r\nPlease include a summary of the change and which issue is fixed. List any dependencies that are required for this change.\r\nIf there are any UI change, please include the screenshots also.\r\n\r\nFixes #(issue)\r\n\r\n## Type of change\r\nJust put an x in the [] which are valid.\r\n- [ ] Bug fix (non-breaking change which fixes an issue)\r\n- [x ] New feature (non-breaking change which adds functionality)\r\n\r\n\r\n# Checklist:\r\n- [x ] My code follows the style guidelines of this project\r\n- [x ] I have performed a self-review of my own code\r\n- [x ] I have commented my code, particularly in hard-to-understand areas\r\n- [x ] I have made corresponding changes to the documentation\r\n- [x ] My changes generate no new warnings\r\n","created_at":"2018-06-30T09:07:46Z","updated_at":"2018-06-30T09:29:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6f13d755448846e989ad20c427a4149e7caf6d06","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/pulls/134/commits","review_comments_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/pulls/134/comments","review_comment_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/issues/134/comments","statuses_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/statuses/3ef32797a855a2c7d02a70dcef59ef04341ad1af","head":{"label":"shiv07tiwari:master","ref":"master","sha":"3ef32797a855a2c7d02a70dcef59ef04341ad1af","user":{"login":"shiv07tiwari","id":38163725,"node_id":"MDQ6VXNlcjM4MTYzNzI1","avatar_url":"https://avatars3.githubusercontent.com/u/38163725?v=4","gravatar_id":"","url":"https://api.github.com/users/shiv07tiwari","html_url":"https://github.com/shiv07tiwari","followers_url":"https://api.github.com/users/shiv07tiwari/followers","following_url":"https://api.github.com/users/shiv07tiwari/following{/other_user}","gists_url":"https://api.github.com/users/shiv07tiwari/gists{/gist_id}","starred_url":"https://api.github.com/users/shiv07tiwari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shiv07tiwari/subscriptions","organizations_url":"https://api.github.com/users/shiv07tiwari/orgs","repos_url":"https://api.github.com/users/shiv07tiwari/repos","events_url":"https://api.github.com/users/shiv07tiwari/events{/privacy}","received_events_url":"https://api.github.com/users/shiv07tiwari/received_events","type":"User","site_admin":false},"repo":{"id":139233638,"node_id":"MDEwOlJlcG9zaXRvcnkxMzkyMzM2Mzg=","name":"Images-to-PDF","full_name":"shiv07tiwari/Images-to-PDF","owner":{"login":"shiv07tiwari","id":38163725,"node_id":"MDQ6VXNlcjM4MTYzNzI1","avatar_url":"https://avatars3.githubusercontent.com/u/38163725?v=4","gravatar_id":"","url":"https://api.github.com/users/shiv07tiwari","html_url":"https://github.com/shiv07tiwari","followers_url":"https://api.github.com/users/shiv07tiwari/followers","following_url":"https://api.github.com/users/shiv07tiwari/following{/other_user}","gists_url":"https://api.github.com/users/shiv07tiwari/gists{/gist_id}","starred_url":"https://api.github.com/users/shiv07tiwari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shiv07tiwari/subscriptions","organizations_url":"https://api.github.com/users/shiv07tiwari/orgs","repos_url":"https://api.github.com/users/shiv07tiwari/repos","events_url":"https://api.github.com/users/shiv07tiwari/events{/privacy}","received_events_url":"https://api.github.com/users/shiv07tiwari/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shiv07tiwari/Images-to-PDF","description":"An app to convert images to PDF file!","fork":true,"url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF","forks_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/forks","keys_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/teams","hooks_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/hooks","issue_events_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/issues/events{/number}","events_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/events","assignees_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/assignees{/user}","branches_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/branches{/branch}","tags_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/tags","blobs_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/git/refs{/sha}","trees_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/statuses/{sha}","languages_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/languages","stargazers_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/stargazers","contributors_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/contributors","subscribers_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/subscribers","subscription_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/subscription","commits_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/commits{/sha}","git_commits_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/git/commits{/sha}","comments_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/comments{/number}","issue_comment_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/issues/comments{/number}","contents_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/contents/{+path}","compare_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/merges","archive_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/downloads","issues_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/issues{/number}","pulls_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/pulls{/number}","milestones_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/milestones{/number}","notifications_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/labels{/name}","releases_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/releases{/id}","deployments_url":"https://api.github.com/repos/shiv07tiwari/Images-to-PDF/deployments","created_at":"2018-06-30T08:43:36Z","updated_at":"2018-06-30T09:06:38Z","pushed_at":"2018-06-30T09:06:37Z","git_url":"git://github.com/shiv07tiwari/Images-to-PDF.git","ssh_url":"git@github.com:shiv07tiwari/Images-to-PDF.git","clone_url":"https://github.com/shiv07tiwari/Images-to-PDF.git","svn_url":"https://github.com/shiv07tiwari/Images-to-PDF","homepage":"","size":39081,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Swati4star:master","ref":"master","sha":"bec2c40fc2d405fcac851a71ee7b26ede3e70cc2","user":{"login":"Swati4star","id":9164477,"node_id":"MDQ6VXNlcjkxNjQ0Nzc=","avatar_url":"https://avatars3.githubusercontent.com/u/9164477?v=4","gravatar_id":"","url":"https://api.github.com/users/Swati4star","html_url":"https://github.com/Swati4star","followers_url":"https://api.github.com/users/Swati4star/followers","following_url":"https://api.github.com/users/Swati4star/following{/other_user}","gists_url":"https://api.github.com/users/Swati4star/gists{/gist_id}","starred_url":"https://api.github.com/users/Swati4star/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Swati4star/subscriptions","organizations_url":"https://api.github.com/users/Swati4star/orgs","repos_url":"https://api.github.com/users/Swati4star/repos","events_url":"https://api.github.com/users/Swati4star/events{/privacy}","received_events_url":"https://api.github.com/users/Swati4star/received_events","type":"User","site_admin":false},"repo":{"id":52264160,"node_id":"MDEwOlJlcG9zaXRvcnk1MjI2NDE2MA==","name":"Images-to-PDF","full_name":"Swati4star/Images-to-PDF","owner":{"login":"Swati4star","id":9164477,"node_id":"MDQ6VXNlcjkxNjQ0Nzc=","avatar_url":"https://avatars3.githubusercontent.com/u/9164477?v=4","gravatar_id":"","url":"https://api.github.com/users/Swati4star","html_url":"https://github.com/Swati4star","followers_url":"https://api.github.com/users/Swati4star/followers","following_url":"https://api.github.com/users/Swati4star/following{/other_user}","gists_url":"https://api.github.com/users/Swati4star/gists{/gist_id}","starred_url":"https://api.github.com/users/Swati4star/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Swati4star/subscriptions","organizations_url":"https://api.github.com/users/Swati4star/orgs","repos_url":"https://api.github.com/users/Swati4star/repos","events_url":"https://api.github.com/users/Swati4star/events{/privacy}","received_events_url":"https://api.github.com/users/Swati4star/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Swati4star/Images-to-PDF","description":"An app to convert images to PDF file!","fork":false,"url":"https://api.github.com/repos/Swati4star/Images-to-PDF","forks_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/forks","keys_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/teams","hooks_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/hooks","issue_events_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/issues/events{/number}","events_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/events","assignees_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/assignees{/user}","branches_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/branches{/branch}","tags_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/tags","blobs_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/git/refs{/sha}","trees_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/statuses/{sha}","languages_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/languages","stargazers_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/stargazers","contributors_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/contributors","subscribers_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/subscribers","subscription_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/subscription","commits_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/commits{/sha}","git_commits_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/git/commits{/sha}","comments_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/comments{/number}","issue_comment_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/issues/comments{/number}","contents_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/contents/{+path}","compare_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/merges","archive_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/downloads","issues_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/issues{/number}","pulls_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/pulls{/number}","milestones_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/milestones{/number}","notifications_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/labels{/name}","releases_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/releases{/id}","deployments_url":"https://api.github.com/repos/Swati4star/Images-to-PDF/deployments","created_at":"2016-02-22T10:00:46Z","updated_at":"2018-06-29T16:41:42Z","pushed_at":"2018-06-30T09:07:46Z","git_url":"git://github.com/Swati4star/Images-to-PDF.git","ssh_url":"git@github.com:Swati4star/Images-to-PDF.git","clone_url":"https://github.com/Swati4star/Images-to-PDF.git","svn_url":"https://github.com/Swati4star/Images-to-PDF","homepage":"","size":39081,"stargazers_count":119,"watchers_count":119,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":98,"mirror_url":null,"archived":false,"open_issues_count":28,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":98,"open_issues":28,"watchers":119,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Swati4star/Images-to-PDF/pulls/134"},"html":{"href":"https://github.com/Swati4star/Images-to-PDF/pull/134"},"issue":{"href":"https://api.github.com/repos/Swati4star/Images-to-PDF/issues/134"},"comments":{"href":"https://api.github.com/repos/Swati4star/Images-to-PDF/issues/134/comments"},"review_comments":{"href":"https://api.github.com/repos/Swati4star/Images-to-PDF/pulls/134/comments"},"review_comment":{"href":"https://api.github.com/repos/Swati4star/Images-to-PDF/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Swati4star/Images-to-PDF/pulls/134/commits"},"statuses":{"href":"https://api.github.com/repos/Swati4star/Images-to-PDF/statuses/3ef32797a855a2c7d02a70dcef59ef04341ad1af"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"shiv07tiwari"}}