Skip to content

Commit f56a8fe

Browse files
committed
Remove intent action for camera activity
1 parent e916709 commit f56a8fe

File tree

3 files changed

+10
-21
lines changed

3 files changed

+10
-21
lines changed

library/multipicker/src/main/java/im/vector/lib/multipicker/VectorCameraPicker.kt

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ class VectorCameraPicker {
3131
* Start camera by using a ActivityResultLauncher.
3232
* @return Uri of taken photo or null if the operation is cancelled.
3333
*/
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)
3637
}
3738

3839
/**
@@ -54,15 +55,4 @@ class VectorCameraPicker {
5455
fun getTakenVideo(context: Context, videoUri: Uri): MultiPickerVideoType? {
5556
return videoUri.toMultiPickerVideoType(context)
5657
}
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-
}
6858
}

vector/src/main/AndroidManifest.xml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -291,13 +291,7 @@
291291
android:name=".features.attachments.preview.AttachmentsPreviewActivity"
292292
android:theme="@style/Theme.Vector.Black.AttachmentsPreview" />
293293
<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" />
301295
<activity
302296
android:name=".features.call.VectorCallActivity"
303297
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"

vector/src/main/java/im/vector/app/features/attachments/AttachmentsHelper.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import android.os.Bundle
2222
import androidx.activity.result.ActivityResultLauncher
2323
import im.vector.app.core.platform.Restorable
2424
import im.vector.app.core.resources.BuildMeta
25+
import im.vector.app.features.attachments.camera.AttachmentsCameraActivity
2526
import im.vector.app.features.attachments.camera.MediaType
2627
import im.vector.app.features.attachments.camera.VectorCameraOutput
2728
import im.vector.lib.multipicker.MultiPicker
@@ -102,7 +103,11 @@ class AttachmentsHelper(
102103
}
103104

104105
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+
)
106111
}
107112

108113
/**

0 commit comments

Comments
 (0)