mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-02-18 04:10:45 +01:00
implement shutter animation
- remove animation to blink icons - implement the shutter animation by setting alpha=1 and animating to alpha=0
This commit is contained in:
parent
affcc078dd
commit
22df3d8c58
@ -314,9 +314,8 @@ class MainActivity : SimpleActivity(), PhotoProcessor.MediaSavedListener, Camera
|
|||||||
if (mIsInPhotoMode) {
|
if (mIsInPhotoMode) {
|
||||||
toggleBottomButtons(true)
|
toggleBottomButtons(true)
|
||||||
mPreview?.tryTakePicture()
|
mPreview?.tryTakePicture()
|
||||||
capture_black_screen.animate().alpha(0.8f).setDuration(CAPTURE_ANIMATION_DURATION).withEndAction {
|
shutter_animation.alpha = 1.0f
|
||||||
capture_black_screen.animate().alpha(0f).setDuration(CAPTURE_ANIMATION_DURATION).start()
|
shutter_animation.animate().alpha(0f).setDuration(CAPTURE_ANIMATION_DURATION).start()
|
||||||
}.start()
|
|
||||||
} else {
|
} else {
|
||||||
mPreview?.toggleRecording()
|
mPreview?.toggleRecording()
|
||||||
}
|
}
|
||||||
@ -527,11 +526,6 @@ class MainActivity : SimpleActivity(), PhotoProcessor.MediaSavedListener, Camera
|
|||||||
|
|
||||||
override fun toggleBottomButtons(hide: Boolean) {
|
override fun toggleBottomButtons(hide: Boolean) {
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
val alpha = if (hide) 0f else 1f
|
|
||||||
shutter.animate().alpha(alpha).start()
|
|
||||||
toggle_camera.animate().alpha(alpha).start()
|
|
||||||
toggle_flash.animate().alpha(alpha).start()
|
|
||||||
|
|
||||||
shutter.isClickable = !hide
|
shutter.isClickable = !hide
|
||||||
toggle_camera.isClickable = !hide
|
toggle_camera.isClickable = !hide
|
||||||
toggle_flash.isClickable = !hide
|
toggle_flash.isClickable = !hide
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/capture_black_screen"
|
android:id="@+id/shutter_animation"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:alpha="0"
|
android:alpha="0"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user