[Modify]保存图片权限修改
This commit is contained in:
@@ -5077,5 +5077,6 @@
|
||||
<string name="treasure_diamond_balance_is_insufficient">鉆石餘額不足,請先充值吧~</string>
|
||||
<string name="treasure_to_charge">去充值</string>
|
||||
<string name="treasure_in_find_love">通過尋愛之旅</string>
|
||||
<string name="give_application_storage_permission">請給予應用存儲權限,以正常保存圖片。</string>
|
||||
|
||||
</resources>
|
@@ -1,5 +1,7 @@
|
||||
package com.yizhuan.erban.community.photo;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.view.View;
|
||||
@@ -131,6 +133,7 @@ public class BigPhotoActivity extends BaseViewBindingActivity<ActivityBigPhotoBi
|
||||
finish();
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@Override
|
||||
public void onLongClick(int position) {
|
||||
if (!option.isSave()) {
|
||||
@@ -142,19 +145,25 @@ public class BigPhotoActivity extends BaseViewBindingActivity<ActivityBigPhotoBi
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
ExecutorCenter.getInstance().post(() -> {
|
||||
AlbumUtils.INSTANCE.addUrlToAlbum(context, item.getPath(), new Function1<Boolean, Unit>() {
|
||||
@Override
|
||||
public Unit invoke(Boolean aBoolean) {
|
||||
checkPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(aBoolean -> {
|
||||
if (aBoolean) {
|
||||
toast(ResUtil.getString(R.string.community_photo_bigphotoactivity_05));
|
||||
ExecutorCenter.getInstance().post(() -> {
|
||||
AlbumUtils.INSTANCE.addUrlToAlbum(context, item.getPath(), new Function1<Boolean, Unit>() {
|
||||
@Override
|
||||
public Unit invoke(Boolean aBoolean) {
|
||||
if (aBoolean) {
|
||||
toast(ResUtil.getString(R.string.community_photo_bigphotoactivity_05));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
toast(ResUtil.getString(R.string.give_application_storage_permission));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}));
|
||||
getDialogManager().showCommonPopupDialog(listBtn, ResUtil.getString(R.string.community_photo_bigphotoactivity_07));
|
||||
|
||||
|
Reference in New Issue
Block a user