Skip to content

Commit

Permalink
Merge pull request #59 from Arctosoft/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
hej2010 authored Apr 6, 2024
2 parents 9be1676 + 2c08e51 commit fb9e231
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 19 deletions.
5 changes: 3 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "se.arctosoft.vault"
minSdk 28
targetSdk 34
versionCode 24
versionName "1.8.0"
versionCode 25
versionName "1.8.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -24,6 +24,7 @@ android {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
applicationIdSuffix '.dev'
}
applicationVariants.all { variant ->
variant.outputs.all {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
android:theme="@style/Theme.Vault">
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="se.arctosoft.vault.fileprovider"
android:authorities="${applicationId}.fileprovider"
android:grantUriPermissions="true"
android:exported="false">
<meta-data
Expand Down
44 changes: 29 additions & 15 deletions app/src/main/java/se/arctosoft/vault/GalleryDirectoryActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,21 +165,21 @@ private void init() {
return;
}
DocumentFile documentFile = DocumentFile.fromSingleUri(this, currentDirectory);
if (documentFile == null || !documentFile.isDirectory() || !documentFile.exists()) {
if (isAllFolder || (documentFile != null && documentFile.isDirectory() && documentFile.exists())) {
setupViewpager();
setupRecycler();
setClickListeners();

if (!viewModel.isInitialised()) {
if (isAllFolder) {
findAllFiles();
} else {
findFilesIn(currentDirectory);
}
}
} else {
Toaster.getInstance(this).showLong(getString(R.string.directory_does_not_exist));
finish();
return;
}
setupViewpager();
setupRecycler();
setClickListeners();

if (!viewModel.isInitialised()) {
if (isAllFolder) {
findAllFiles();
} else {
findFilesIn(currentDirectory);
}
}
}

Expand Down Expand Up @@ -359,8 +359,22 @@ private void findFilesIn(Uri directoryUri) {
if (g.isDirectory()) {
int finalI = i;
new Thread(() -> {
g.setFilesInDirectory(FileStuff.getFilesInFolder(this, g.getUri()));
runOnUiThread(() -> galleryGridAdapter.notifyItemChanged(finalI));
List<GalleryFile> found = FileStuff.getFilesInFolder(this, g.getUri());
if (found.isEmpty()) {
runOnUiThread(() -> {
synchronized (LOCK) {
int i1 = viewModel.getGalleryFiles().indexOf(g);
if (i1 >= 0) {
viewModel.getGalleryFiles().remove(i1);
galleryGridAdapter.notifyItemRemoved(i1);
galleryPagerAdapter.notifyItemRemoved(i1);
}
}
});
} else {
g.setFilesInDirectory(found);
runOnUiThread(() -> galleryGridAdapter.notifyItemChanged(finalI));
}
}).start();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import java.util.List;
import java.util.Map;

import se.arctosoft.vault.BuildConfig;
import se.arctosoft.vault.GalleryDirectoryActivity;
import se.arctosoft.vault.R;
import se.arctosoft.vault.adapters.viewholders.GalleryPagerViewHolder;
Expand Down Expand Up @@ -498,7 +499,7 @@ private void showDelete(FragmentActivity context, GalleryFile galleryFile, Galle
}

private void shareOrOpenWith(FragmentActivity context, Uri decryptedCacheUri, boolean open) {
Uri uri = FileProvider.getUriForFile(weakReference.get(), "se.arctosoft.vault.fileprovider", new File(decryptedCacheUri.getPath()));
Uri uri = FileProvider.getUriForFile(weakReference.get(), BuildConfig.APPLICATION_ID + ".fileprovider", new File(decryptedCacheUri.getPath()));
if (uri != null) {
Intent intent;
if (open) {
Expand Down
2 changes: 2 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/25.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Fixed can't open the All folder
* Folders without encrypted files are now hidden
2 changes: 2 additions & 0 deletions fastlane/metadata/android/sv-SE/changelogs/25.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Alla-mappen kan nu öppnas igen
* Mappar utan krypterade filer är nu dolda

0 comments on commit fb9e231

Please sign in to comment.