Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

FIX-FIN203 #80

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ public Uri getImageUri(Context inContext, Bitmap inImage) {

@Override
public void checkCameraPermission() {
if (CheckSelfPermissionAndRequest.checkSelfPermission(this,
Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
shareImage();
} else {
requestPermission();
if (CheckSelfPermissionAndRequest.checkSelfPermission(this,
Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
shareImage();
} else {
requestPermission();
}
}
}

@Override
public void requestPermission() {
Expand All @@ -156,18 +156,19 @@ public void loadCustomerPortrait() {
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
@NonNull int[] grantResults) {
switch (requestCode) {
case ConstantKeys.PERMISSIONS_REQUEST_CAMERA: {
if (grantResults.length > 0
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) {
shareImage();
} else {
Toaster.show(findViewById(android.R.id.content),
getString(R.string.permission_denied_write));
}
case ConstantKeys.PERMISSIONS_REQUEST_CAMERA: {switch (requestCode) {
case ConstantKeys.PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE: {
if (grantResults.length > 0
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) {
shareImage();
} else {
Toaster.show(findViewById(android.R.id.content),
getString(R.string.permission_denied_write));
}
}}
}
}
}

@Override
public void refreshUI() {
loadCustomerPortrait();
Expand Down