Skip to content

Commit

Permalink
fix: Change permission from CAMERA to WRITE EXTERNAL STORAGE
Browse files Browse the repository at this point in the history
  • Loading branch information
prajwal27 committed Mar 20, 2020
1 parent ca882ae commit f0fc0ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class CustomerProfileActivity: MifosBaseActivity(),CustomerProfileContract.View

override fun onOptionsItemSelected(item: MenuItem): Boolean {
if (item.itemId == R.id.menu_customer_profile_share) {
checkCameraPermission()
checkWriteExternalStoragePermission()
return true
}
else return super.onOptionsItemSelected(item)
Expand Down Expand Up @@ -79,7 +79,7 @@ class CustomerProfileActivity: MifosBaseActivity(),CustomerProfileContract.View
return returnedBitmap
}

override fun checkCameraPermission() {
override fun checkWriteExternalStoragePermission() {
if (CheckSelfPermissionAndRequest.checkSelfPermission(this,
android.Manifest.permission.WRITE_EXTERNAL_STORAGE)){
shareImage()
Expand Down Expand Up @@ -110,7 +110,7 @@ class CustomerProfileActivity: MifosBaseActivity(),CustomerProfileContract.View
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>,
grantResults: IntArray) {
when (requestCode) {
ConstantKeys.PERMISSIONS_REQUEST_CAMERA -> {
ConstantKeys.PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE -> {
if (grantResults.size > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
shareImage()
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import org.mifos.mobile.cn.ui.base.MvpView
interface CustomerProfileContract {

interface View: MvpView{
fun checkCameraPermission();
fun checkWriteExternalStoragePermission();

fun requestPermission();

Expand Down

0 comments on commit f0fc0ef

Please sign in to comment.