Ask for permission before opening the camera (#934)
This commit is contained in:
parent
4335fa4f72
commit
e02430bcd0
|
@ -11,7 +11,7 @@ Other changes:
|
||||||
-
|
-
|
||||||
|
|
||||||
Bugfix 🐛:
|
Bugfix 🐛:
|
||||||
-
|
- Ask for permission before opening the camera (#934)
|
||||||
|
|
||||||
Translations 🗣:
|
Translations 🗣:
|
||||||
-
|
-
|
||||||
|
|
|
@ -43,7 +43,9 @@ import im.vector.riotx.R
|
||||||
import im.vector.riotx.core.extensions.getMeasurements
|
import im.vector.riotx.core.extensions.getMeasurements
|
||||||
import im.vector.riotx.core.utils.PERMISSIONS_EMPTY
|
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_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.core.utils.PERMISSIONS_FOR_WRITING_FILES
|
||||||
|
import im.vector.riotx.features.attachments.AttachmentTypeSelectorView.Callback
|
||||||
import kotlin.math.max
|
import kotlin.math.max
|
||||||
|
|
||||||
private const val ANIMATION_DURATION = 250
|
private const val ANIMATION_DURATION = 250
|
||||||
|
@ -222,8 +224,7 @@ class AttachmentTypeSelectorView(context: Context,
|
||||||
* The all possible types to pick with their required permissions.
|
* The all possible types to pick with their required permissions.
|
||||||
*/
|
*/
|
||||||
enum class Type(val permissionsBit: Int) {
|
enum class Type(val permissionsBit: Int) {
|
||||||
|
CAMERA(PERMISSIONS_FOR_TAKING_PHOTO),
|
||||||
CAMERA(PERMISSIONS_EMPTY),
|
|
||||||
GALLERY(PERMISSIONS_FOR_WRITING_FILES),
|
GALLERY(PERMISSIONS_FOR_WRITING_FILES),
|
||||||
FILE(PERMISSIONS_FOR_WRITING_FILES),
|
FILE(PERMISSIONS_FOR_WRITING_FILES),
|
||||||
STICKER(PERMISSIONS_EMPTY),
|
STICKER(PERMISSIONS_EMPTY),
|
||||||
|
|
|
@ -1316,7 +1316,7 @@ class RoomDetailFragment @Inject constructor(
|
||||||
AttachmentTypeSelectorView.Type.AUDIO -> attachmentsHelper.selectAudio()
|
AttachmentTypeSelectorView.Type.AUDIO -> attachmentsHelper.selectAudio()
|
||||||
AttachmentTypeSelectorView.Type.CONTACT -> attachmentsHelper.selectContact()
|
AttachmentTypeSelectorView.Type.CONTACT -> attachmentsHelper.selectContact()
|
||||||
AttachmentTypeSelectorView.Type.STICKER -> vectorBaseActivity.notImplemented("Adding stickers")
|
AttachmentTypeSelectorView.Type.STICKER -> vectorBaseActivity.notImplemented("Adding stickers")
|
||||||
}
|
}.exhaustive
|
||||||
}
|
}
|
||||||
|
|
||||||
// AttachmentsHelper.Callback
|
// AttachmentsHelper.Callback
|
||||||
|
|
Loading…
Reference in New Issue