140 Commits

Author SHA1 Message Date
darthpaul
776e842af5 remove logs 2022-07-13 17:08:20 +01:00
darthpaul
9c021c655b do some optimisations for pre SDK 29 devices 2022-07-13 16:39:18 +01:00
darthpaul
e1f292692a properly ensure RECORD_AUDIO permission is requested during camera initialisation
- since allowBackup is set to true in the manifest,
- it is possible for the app to be launch after a fresh install with mIsInPhotoMode=true in MainActivity
- this commit ensure the audio permission is requested at this point
- if the user denies, then it is initialised in photo mode instead
2022-07-10 18:57:01 +01:00
darthpaul
d5e1d61d02 fix passing bitmap thumbnail after IMAGE_CAPTURE intent
- add a new BitmapOutput, returned from the MediaOutputHelper when no output URI is specified in an IMAGE_CAPTURE intent
- in this format, take the picture without actually saving it and return the bitmap
- this behaviour is consistent with the implementation described in the official Android docs https://developer.android.com/training/camera/photobasics#TaskPhotoView
2022-07-09 02:55:41 +01:00
darthpaul
889a384f21 handle 3rd party image/video capture intents
- in MediaOutputHelper,
   - add support for specifying the output URI if present in the intent
   - when the output URI is specified,
       - for Image Capture, we return a `Bitmap` as a `data` extra and also the URI as the Intent data
       - for Video Capture we return the `Uri` as the Intent data
    - if no output URI is specified in the capture intent or if there is an error while trying to access the URI, use the default location with MediaStore, so we do not return inconsistent URIs (eg, SAF tree URIs)

- add CameraXInitializer to abstract CameraXPreview initialisation logic
2022-06-30 00:23:41 +01:00
darthpaul
b10d8639fd handle torch state in video capture
- set initial torch state to off
- enable/disable the torch when flash mode is on/off in video mode
2022-06-26 11:12:43 +01:00
darthpaul
79f9267383 handle storage location
- add MediaOutputHelper
   - to create OutputStream for photos
   - to create FileDescriptor for videos (currently requires API 26+)
2022-06-26 10:58:17 +01:00
darthpaul
f0030670cf add basic support for focus and metering 2022-06-25 17:51:13 +01:00
darthpaul
c398370446 handle playing media sounds
- add MediaSoundHelper to separate logic for playing media action sounds
- add support for playing media action sounds (shutter, start and stop recording) in CameraXPreview
2022-06-25 16:39:29 +01:00
darthpaul
074351b88f add initial camera-x implementation
- add CameraXPreview
  - basic support image capture
  - basic support for video capture
  - add CameraXPreviewListener to prevent coupling to MainActivity
  - support switching camera, flash light modes
- modify MyPreview interface to add default implementation for methods not needed by the CameraXPreview
2022-06-25 15:43:39 +01:00
tibbi
0cdf08b45f removing 2 more settings 2022-04-20 22:28:44 +02:00
tibbi
196f477d3e lets set the minimal required OS version to Android 10 2022-04-20 21:20:40 +02:00
tibbi
77458cc759 updating commons 2022-04-20 21:17:05 +02:00
tibbi
a713f8aba6 use a background thread for closing the camera on pause 2020-12-29 17:38:47 +01:00
tibbi
9928ed46c1 adding some crashfixes 2020-11-07 19:48:46 +01:00
tibbi
9734743705 do not show the New apps popup anymore 2020-11-07 19:48:31 +01:00
tibbi
c35e755488 show a dialog about new apps to some users 2020-05-16 19:51:46 +02:00
tibbi
4040fe8c0a use some helper extensions from Commons 2020-04-21 22:10:49 +02:00
tibbi
7e4985d629 fix #145, blink in a black screen at photo capturing 2019-09-03 11:26:52 +02:00
tibbi
b793026bbb replacing some images with vectors 2019-09-02 22:46:49 +02:00
tibbi
01099e353e updating kotlin, commons, gradle 2019-09-02 22:27:57 +02:00
tibbi
39aba65589 updated Commons, min Android OS to 5, removed Camera One implementation 2018-10-17 23:32:12 +02:00
tibbi
8fae1b167a fix a glitch preventing capturing multiple images in a row 2018-07-09 23:51:58 +02:00
tibbi
2c26981fd0 flip the icons used at toggle front/rear camera 2018-06-18 23:16:25 +02:00
tibbi
7e42da897a split the video and image capture intent checks 2018-06-18 23:12:49 +02:00
tibbi
ff33c4f30d notify the activity at stoping the video recording, fixed third party intents 2018-06-14 14:14:57 +02:00
tibbi
16fdbf8d5a fix handling of third party video intent 2018-06-14 13:53:51 +02:00
tibbi
368a9c109d hide the last photo preview too at third party intents 2018-06-11 11:49:19 +02:00
tibbi
104eca5196 update every button clickability on the main thread 2018-06-08 22:46:15 +02:00
tibbi
d7c4c76640 avoid launching multiple shutter actions at pressing volumes 2018-06-08 14:11:43 +02:00
tibbi
6c885c83c2 add some video recording handling 2018-06-06 21:50:09 +02:00
tibbi
9e3e732bbf handle toggling between photo and video modes 2018-06-06 15:09:09 +02:00
tibbi
045328daa3 remember which camera was used last, open it by default 2018-06-05 22:19:27 +02:00
tibbi
3f23f017d2 set the flash icon to Off at hiding to avoid glitches at reshowing 2018-06-05 21:25:23 +02:00
tibbi
94488adb24 make sure the bottom button visibility is updated on the main thread 2018-05-31 12:44:24 +02:00
tibbi
292e2f6ad0 lets remove PreviewListener interface, call activity functions directly 2018-05-30 17:27:30 +02:00
tibbi
184f87aab1 removing a redundant function 2018-05-30 15:02:26 +02:00
tibbi
a894f6e01c properly close the camera on pause 2018-05-30 11:21:02 +02:00
tibbi
c69e34a9b4 make sure flashlight changes are ignored if the device has no flashlight 2018-05-30 11:10:56 +02:00
tibbi
3fd08d3940 fix toggling between flash on/off 2018-05-29 19:56:45 +02:00
tibbi
26f33e8c26 add some initial PreviewCameraTwo implementation from the sample code 2018-05-28 21:47:23 +02:00
tibbi
77fb00097c show an AutoFitTextureView on Lollipop+ 2018-05-28 20:15:06 +02:00
tibbi
22d463f0e0 create a PreviewCameraTwo to be used with Camera2 API on Android 5+ 2018-05-28 20:12:02 +02:00
tibbi
0d71a4492b create an interface for some shared Preview functions 2018-05-28 19:30:31 +02:00
tibbi
3bc54c2e5f remove a few more direct variable calls at PreviewCameraOne 2018-05-28 16:15:29 +02:00
tibbi
e529bdd15c adding some initial camera states 2018-05-28 16:00:30 +02:00
tibbi
bc8459ce00 use a white focus circle at B&W theme 2018-05-28 11:59:57 +02:00
tibbi
18905792c0 simplify button drawable updating 2018-05-28 11:53:20 +02:00
tibbi
86d13eaf54 small cleanup at checking camera availability 2018-05-28 11:49:52 +02:00
tibbi
05dee60cb7 add a helper function for toggling timer visibility in the activity 2018-05-28 11:35:36 +02:00