File tree Expand file tree Collapse file tree 3 files changed +10
-21
lines changed
library/multipicker/src/main/java/im/vector/lib/multipicker
java/im/vector/app/features/attachments Expand file tree Collapse file tree 3 files changed +10
-21
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,9 @@ class VectorCameraPicker {
31
31
* Start camera by using a ActivityResultLauncher.
32
32
* @return Uri of taken photo or null if the operation is cancelled.
33
33
*/
34
- fun start (activityResultLauncher : ActivityResultLauncher <Intent >) {
35
- activityResultLauncher.launch(createIntent())
34
+ fun start (context : Context , activityResultLauncher : ActivityResultLauncher <Intent >, targetClass : Class <* >) {
35
+ val intent = Intent (context, targetClass)
36
+ activityResultLauncher.launch(intent)
36
37
}
37
38
38
39
/* *
@@ -54,15 +55,4 @@ class VectorCameraPicker {
54
55
fun getTakenVideo (context : Context , videoUri : Uri ): MultiPickerVideoType ? {
55
56
return videoUri.toMultiPickerVideoType(context)
56
57
}
57
-
58
-
59
- private fun createIntent (): Intent {
60
- return Intent (ACTION_VECTOR_CAMERA ).apply {
61
- action = ACTION_VECTOR_CAMERA
62
- }
63
- }
64
-
65
- companion object {
66
- const val ACTION_VECTOR_CAMERA = " im.vector.app.action.VECTOR_CAMERA"
67
- }
68
58
}
Original file line number Diff line number Diff line change 291
291
android : name =" .features.attachments.preview.AttachmentsPreviewActivity"
292
292
android : theme =" @style/Theme.Vector.Black.AttachmentsPreview" />
293
293
<activity android : name =" .features.attachments.camera.AttachmentsCameraActivity"
294
- android : theme =" @style/Theme.Vector.Black.AttachmentsPreview"
295
- android : exported =" false" >
296
- <intent-filter >
297
- <action android : name =" im.vector.app.action.VECTOR_CAMERA" />
298
- <category android : name =" android.intent.category.DEFAULT" />
299
- </intent-filter >
300
- </activity >
294
+ android : theme =" @style/Theme.Vector.Black.AttachmentsPreview" />
301
295
<activity
302
296
android : name =" .features.call.VectorCallActivity"
303
297
android : configChanges =" screenSize|smallestScreenSize|screenLayout|orientation"
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import android.os.Bundle
22
22
import androidx.activity.result.ActivityResultLauncher
23
23
import im.vector.app.core.platform.Restorable
24
24
import im.vector.app.core.resources.BuildMeta
25
+ import im.vector.app.features.attachments.camera.AttachmentsCameraActivity
25
26
import im.vector.app.features.attachments.camera.MediaType
26
27
import im.vector.app.features.attachments.camera.VectorCameraOutput
27
28
import im.vector.lib.multipicker.MultiPicker
@@ -102,7 +103,11 @@ class AttachmentsHelper(
102
103
}
103
104
104
105
fun openVectorCamera (vectorCameraActivityResultLauncher : ActivityResultLauncher <Intent >) {
105
- MultiPicker .get(MultiPicker .VECTOR_CAMERA ).start(vectorCameraActivityResultLauncher)
106
+ MultiPicker .get(MultiPicker .VECTOR_CAMERA ).start(
107
+ context,
108
+ vectorCameraActivityResultLauncher,
109
+ AttachmentsCameraActivity ::class .java
110
+ )
106
111
}
107
112
108
113
/* *
You can’t perform that action at this time.
0 commit comments