Ask for permission before opening the camera (#934)

This commit is contained in:
Benoit Marty 2020-02-03 20:06:37 +01:00
parent 4335fa4f72
commit e02430bcd0
3 changed files with 13 additions and 12 deletions

View File

@ -11,7 +11,7 @@ Other changes:
-
Bugfix 🐛:
-
- Ask for permission before opening the camera (#934)
Translations 🗣:
-

View File

@ -43,7 +43,9 @@ import im.vector.riotx.R
import im.vector.riotx.core.extensions.getMeasurements
import im.vector.riotx.core.utils.PERMISSIONS_EMPTY
import im.vector.riotx.core.utils.PERMISSIONS_FOR_PICKING_CONTACT
import im.vector.riotx.core.utils.PERMISSIONS_FOR_TAKING_PHOTO
import im.vector.riotx.core.utils.PERMISSIONS_FOR_WRITING_FILES
import im.vector.riotx.features.attachments.AttachmentTypeSelectorView.Callback
import kotlin.math.max
private const val ANIMATION_DURATION = 250
@ -222,8 +224,7 @@ class AttachmentTypeSelectorView(context: Context,
* The all possible types to pick with their required permissions.
*/
enum class Type(val permissionsBit: Int) {
CAMERA(PERMISSIONS_EMPTY),
CAMERA(PERMISSIONS_FOR_TAKING_PHOTO),
GALLERY(PERMISSIONS_FOR_WRITING_FILES),
FILE(PERMISSIONS_FOR_WRITING_FILES),
STICKER(PERMISSIONS_EMPTY),

View File

@ -1316,7 +1316,7 @@ class RoomDetailFragment @Inject constructor(
AttachmentTypeSelectorView.Type.AUDIO -> attachmentsHelper.selectAudio()
AttachmentTypeSelectorView.Type.CONTACT -> attachmentsHelper.selectContact()
AttachmentTypeSelectorView.Type.STICKER -> vectorBaseActivity.notImplemented("Adding stickers")
}
}.exhaustive
}
// AttachmentsHelper.Callback