Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search Fix #296

Merged
merged 28 commits into from
Jul 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b6868ce
Enhancement options in text to pdf
shiv07tiwari Jul 17, 2018
ac163f1
Changes
shiv07tiwari Jul 17, 2018
099bc4e
Changes
shiv07tiwari Jul 17, 2018
1ec9e96
Merge branch 'master' of https://github.com/Swati4star/Images-to-PDF
shiv07tiwari Jul 17, 2018
65b0075
Merge branch 'master' of https://github.com/Swati4star/Images-to-PDF
shiv07tiwari Jul 19, 2018
88cc997
Added About Screen
shiv07tiwari Jul 20, 2018
7f78105
Minor
shiv07tiwari Jul 20, 2018
185bfcf
Changed UI
shiv07tiwari Jul 20, 2018
b188e55
Fix
shiv07tiwari Jul 20, 2018
1dcab7e
Changes
shiv07tiwari Jul 20, 2018
fa2901d
Update
shiv07tiwari Jul 21, 2018
201f421
Added more filters
shiv07tiwari Jul 21, 2018
6943292
Image fix
shiv07tiwari Jul 21, 2018
a74e70c
Merge branch 'master' of https://github.com/Swati4star/Images-to-PDF
shiv07tiwari Jul 21, 2018
655764c
View Files UI Fix
shiv07tiwari Jul 21, 2018
eedfe28
Merge branch 'master' of https://github.com/Swati4star/Images-to-PDF
shiv07tiwari Jul 21, 2018
c87507e
Merge branch 'master' of https://github.com/Swati4star/Images-to-PDF
shiv07tiwari Jul 22, 2018
b648907
improving code climate
Swati4star Jul 22, 2018
1451366
Merge branch 'master' of https://github.com/Swati4star/Images-to-PDF
shiv07tiwari Jul 23, 2018
6c58892
Update
shiv07tiwari Jul 26, 2018
97fd8fd
Added undo option
shiv07tiwari Jul 27, 2018
7f88b74
Check fix
shiv07tiwari Jul 27, 2018
852c404
Variable change
shiv07tiwari Jul 27, 2018
e0c4097
Merge branch 'master' into master
shiv07tiwari Jul 27, 2018
a9fc70b
Update
shiv07tiwari Jul 28, 2018
759b22b
Update
shiv07tiwari Jul 28, 2018
93b391d
Search Fix
shiv07tiwari Jul 28, 2018
b8b6267
Fix
shiv07tiwari Jul 28, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion app/src/main/java/swati4star/createpdf/util/DirectoryUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public DirectoryUtils(Context context) {
public ArrayList<File> searchPDF(String query) {
ArrayList<File> searchResult = new ArrayList<>();
final File[] files = getOrCreatePdfDirectory().listFiles();
ArrayList<File> pdfs = getPdfsFromPdfFolder(files);
ArrayList<File> pdfs = searchPdfsFromPdfFolder(files);
for (File pdf : pdfs) {
String path = pdf.getPath();
String[] fileName = path.split("/");
Expand Down Expand Up @@ -82,6 +82,25 @@ public ArrayList<File> getPdfsFromPdfFolder(File[] files) {
return pdfFiles;
}

private ArrayList<File> searchPdfsFromPdfFolder(File[] files) {
final ArrayList<File> pdfFiles = new ArrayList<>();
for (File file : files) {
if (!file.isDirectory() && file.getName().endsWith(mContext.getString(R.string.pdf_ext))) {
pdfFiles.add(file);
Log.v("adding", file.getName());
}
if (file.isDirectory()) {
for (File dirFiles : file.listFiles()) {
if (!dirFiles.isDirectory() && dirFiles.getName().endsWith(mContext.getString(R.string.pdf_ext))) {
pdfFiles.add(dirFiles);
Log.v("adding", dirFiles.getName());
}
}
}
}
return pdfFiles;
}

/**
* create PDF directory if directory does not exists
*/
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -302,5 +302,4 @@
<string name="snackbar_undoAction">Undo</string>
<string name="pdf_does_not_exist_message">The PDF doesn\'t exist.</string>
<string name="image_rearranging_options">Image Rearranging Options</string>

</resources>