New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Camera UI fixes #348
Camera UI fixes #348
Conversation
- handle requesting READ_MEDIA_IMAGES and READ_MEDIA_VIDEO for Android 13+ - request WRITE_EXTERNAL_STORAGE for Android 12 and below - set the permission WRITE_EXTERNAL_STORAGE to maxSdkVersion=32 in the AndroidManifest
the shutter sound plays way too early, before the actual photo is taken. And the top menu after extending the aspect ratio or flashlight are still a bit lower than the main buttons on the main screen. Cant you just use the same margin there? I can see the 4:3 moving a bit after reselectingi t. |
and capturing a video crashes right after start on my Android 11, |
it actually isnt crashing on a fresh install, try checking an upgrade from the old to new version, there are still many people using the old one. That bottom shadow seems to be higher during videos without a reason than at photos. Guess moving the recording time above the shutter button would help, theres still enough place. |
Hi @tibbi,
The only difference I noticed is in the height. So I will set them to be the same height and hopefully, this would correct what you observed.
|
- handle exception when creating media output - if only one resolution is supported, no need to restart the camera
shutter sound has to be played at exact same time as the photo is captured. I moved the phone after hearing the sound and the images were blurry. |
it crashes if I use Video mode and click on HD and pick any resolution (4 items available), then click on Photo and click on the aspect ratio picker. Guess it will be because the 16:9 ratio is hidden and you count on 4 items being visible or so. |
@@ -606,7 +631,7 @@ class MainActivity : SimpleActivity(), PhotoProcessor.MediaSavedListener, Camera | |||
toggle_flash.beVisible() | |||
} else { | |||
toggle_flash.beInvisible() | |||
toggle_flash.setImageResource(R.drawable.ic_flash_off_vector) | |||
toggle_flash.icon = AppCompatResources.getDrawable(this, R.drawable.ic_flash_off_vector) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any specific reason for using compat on some places? Just removing Android Studio warnings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No specific reason. Just an old habit.
Since we have minSDK 29
, we can just call getDrawable but then we have the warning on Android Studio.
Do you want me to change this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you dont need to call any drawable, just set image resource directly, like it used to be
- this seems like a bug on the MaterialToggleGroup; for example, when 4 items are added to it and removed and later on 3 items added, it will crash - the only feasible fix is to create a new MaterialToggleGroup when displaying the options - calling invalidate, removeAllViews, etc do not work
alright, looks good now, will do more testing on different devices and see how it goes :) Thanks |
Notes
READ_MEDIA_IMAGES
andREAD_MEDIA_VIDEO
for Android 13+WRITE_EXTERNAL_STORAGE
for Android 12 and belowWRITE_EXTERNAL_STORAGE
to maxSdkVersion=32 in the AndroidManifest1.2.0-beta02