Skip to content

Commit 0d3f101

Browse files
Merge pull request #6 from smartdevelopers-ir/changes_for_android_11
Changes for android 11
2 parents dbdab36 + 5ad86b5 commit 0d3f101

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

SmartFileBrowser/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ android {
3131
}
3232
}
3333
group = 'ir.smartdevelopers'
34-
version = '1.4.3'
34+
version = '1.4.4'
3535
task sourcesJar(type: Jar) {
3636
archiveClassifier.set("sources")
3737
from android.sourceSets.main.java.srcDirs

SmartFileBrowser/src/main/java/ir/smartdevelopers/smartfilebrowser/acitivties/FileBrowserMainActivity.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ private void initViews(Bundle savedInstanceState) {
679679
mBottomNavigationView.setUseElevation(true);
680680
mBottomNavigationView.setTitleState(AHBottomNavigation.TitleState.ALWAYS_SHOW);
681681

682-
int[] res = {R.attr.actionBarSize};
682+
int[] res = {android.R.attr.actionBarSize};
683683
TypedArray typedArray = obtainStyledAttributes(res);
684684
mActionBarSize = typedArray.getDimensionPixelSize(0, 56) +
685685
(int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 24, getResources().getDisplayMetrics());
@@ -1002,9 +1002,10 @@ private void initGalleryToolbarViews() {
10021002
}
10031003

10041004
private void openSystemGalleryApp() {
1005-
Intent galleyIntent = new Intent(Intent.ACTION_PICK);
1005+
Intent galleyIntent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
10061006
galleyIntent.setType("image/*");
10071007
galleyIntent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, mCanSelectMultipleInGallery);
1008+
galleyIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
10081009
startActivityForResult(galleyIntent, REQ_CODE_PICK_BY_GALLEY);
10091010
}
10101011

@@ -1445,6 +1446,10 @@ public int getGalleryItemSelectionCount() {
14451446
public void imageUpdated(String newFilePath, int editedImagePosition) {
14461447
if (mGalleryAdapter != null) {
14471448
mGalleryAdapter.getItem(editedImagePosition).setPath(newFilePath);
1449+
mGalleryAdapter.getItem(editedImagePosition)
1450+
.setUri(FileProvider.getUriForFile(getApplicationContext(),
1451+
getPackageName()+".sfb_provider",new File(newFilePath)));
1452+
14481453
if (Build.VERSION.SDK_INT < 21) {
14491454
mGalleryAdapter.notifyItemChanged(editedImagePosition);
14501455
}

0 commit comments

Comments
 (0)