Skip to content

Commit

Permalink
Merge pull request #160 from prajwal27/bug-share-button
Browse files Browse the repository at this point in the history
fix: Change permission from CAMERA to WRITE EXTERNAL STORAGE
  • Loading branch information
abhijitramesh authored Jun 11, 2020
2 parents a37095f + f0fc0ef commit 757a316
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 757a316

Please sign in to comment.