File tree Expand file tree Collapse file tree 4 files changed +21
-2
lines changed
java/im/vector/app/features Expand file tree Collapse file tree 4 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -1582,6 +1582,9 @@ class TimelineFragment :
1582
1582
attachmentTypeSelector.setAttachmentVisibility(
1583
1583
AttachmentTypeSelectorView .Type .POLL , ! isThreadTimeLine()
1584
1584
)
1585
+ attachmentTypeSelector.setAttachmentVisibility(
1586
+ AttachmentTypeSelectorView .Type .VIDEO_CAMERA , ! vectorPreferences.builtinCameraIsEnabled()
1587
+ )
1585
1588
}
1586
1589
attachmentTypeSelector.show(views.composerLayout.views.attachmentButton)
1587
1590
}
@@ -2626,7 +2629,13 @@ class TimelineFragment :
2626
2629
2627
2630
private fun launchAttachmentProcess (type : AttachmentTypeSelectorView .Type ) {
2628
2631
when (type) {
2629
- AttachmentTypeSelectorView .Type .PHOTO_CAMERA -> attachmentsHelper.openVectorCamera(attachmentVectorCameraActivityResultLauncher)
2632
+ AttachmentTypeSelectorView .Type .PHOTO_CAMERA -> {
2633
+ if (vectorPreferences.builtinCameraIsEnabled()) {
2634
+ attachmentsHelper.openVectorCamera(attachmentVectorCameraActivityResultLauncher)
2635
+ } else {
2636
+ attachmentsHelper.openPhotoCamera(attachmentCameraActivityResultLauncher)
2637
+ }
2638
+ }
2630
2639
AttachmentTypeSelectorView .Type .VIDEO_CAMERA -> attachmentsHelper.openVideoCamera(attachmentCameraVideoActivityResultLauncher)
2631
2640
AttachmentTypeSelectorView .Type .FILE -> attachmentsHelper.selectFile(attachmentFileActivityResultLauncher)
2632
2641
AttachmentTypeSelectorView .Type .GALLERY -> attachmentsHelper.selectGallery(attachmentMediaActivityResultLauncher)
Original file line number Diff line number Diff line change @@ -158,11 +158,11 @@ class VectorPreferences @Inject constructor(
158
158
const val SETTINGS_USER_REFUSED_LAZY_LOADING_PREFERENCE_KEY = " SETTINGS_USER_REFUSED_LAZY_LOADING_PREFERENCE_KEY"
159
159
const val SETTINGS_DATA_SAVE_MODE_PREFERENCE_KEY = " SETTINGS_DATA_SAVE_MODE_PREFERENCE_KEY"
160
160
private const val SETTINGS_USE_JITSI_CONF_PREFERENCE_KEY = " SETTINGS_USE_JITSI_CONF_PREFERENCE_KEY"
161
- private const val SETTINGS_USE_NATIVE_CAMERA_PREFERENCE_KEY = " SETTINGS_USE_NATIVE_CAMERA_PREFERENCE_KEY"
162
161
private const val SETTINGS_ENABLE_SEND_VOICE_FEATURE_PREFERENCE_KEY = " SETTINGS_ENABLE_SEND_VOICE_FEATURE_PREFERENCE_KEY"
163
162
164
163
const val SETTINGS_LABS_ALLOW_EXTENDED_LOGS = " SETTINGS_LABS_ALLOW_EXTENDED_LOGS"
165
164
const val SETTINGS_LABS_AUTO_REPORT_UISI = " SETTINGS_LABS_AUTO_REPORT_UISI"
165
+ const val SETTINGS_LABS_ENABLE_BUILTIN_CAMERA = " SETTINGS_LABS_ENABLE_BUILTIN_CAMERA"
166
166
const val SETTINGS_PREF_SPACE_SHOW_ALL_ROOM_IN_HOME = " SETTINGS_PREF_SPACE_SHOW_ALL_ROOM_IN_HOME"
167
167
168
168
private const val SETTINGS_DEVELOPER_MODE_PREFERENCE_KEY = " SETTINGS_DEVELOPER_MODE_PREFERENCE_KEY"
@@ -361,6 +361,10 @@ class VectorPreferences @Inject constructor(
361
361
return defaultPrefs.getBoolean(SETTINGS_LABS_ENABLE_LATEX_MATHS , false )
362
362
}
363
363
364
+ fun builtinCameraIsEnabled (): Boolean {
365
+ return defaultPrefs.getBoolean(SETTINGS_LABS_ENABLE_BUILTIN_CAMERA , false )
366
+ }
367
+
364
368
fun failFast (): Boolean {
365
369
return buildMeta.isDebug || (developerMode() && defaultPrefs.getBoolean(SETTINGS_DEVELOPER_MODE_FAIL_FAST_PREFERENCE_KEY , false ))
366
370
}
Original file line number Diff line number Diff line change 3201
3201
<string name =" attachment_camera_video" >Take a video</string >
3202
3202
<string name =" attachment_camera_capture" >Capture</string >
3203
3203
<string name =" attachment_camera_flip" >Change camera</string >
3204
+ <string name =" labs_enable_builtin_camera" >Enable Built-in Camera</string >
3204
3205
3205
3206
<plurals name =" room_removed_messages" >
3206
3207
<item quantity =" one" >%d message removed</item >
Original file line number Diff line number Diff line change 59
59
android : title =" @string/labs_enable_latex_maths" />
60
60
<!-- </im.vector.app.core.preference.VectorPreferenceCategory>-->
61
61
62
+ <im .vector.app.core.preference.VectorSwitchPreference
63
+ android : defaultValue =" false"
64
+ android : key =" SETTINGS_LABS_ENABLE_BUILTIN_CAMERA"
65
+ android : title =" @string/labs_enable_builtin_camera" />
66
+
62
67
<im .vector.app.core.preference.VectorSwitchPreference
63
68
android : defaultValue =" @bool/settings_labs_thread_messages_default"
64
69
android : key =" SETTINGS_LABS_ENABLE_THREAD_MESSAGES_FINAL"
You can’t perform that action at this time.
0 commit comments