mirror of
				https://github.com/SimpleMobileTools/Simple-Camera.git
				synced 2025-06-27 09:02:59 +02: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:
		| @@ -314,9 +314,8 @@ class MainActivity : SimpleActivity(), PhotoProcessor.MediaSavedListener, Camera | ||||
|         if (mIsInPhotoMode) { | ||||
|             toggleBottomButtons(true) | ||||
|             mPreview?.tryTakePicture() | ||||
|             capture_black_screen.animate().alpha(0.8f).setDuration(CAPTURE_ANIMATION_DURATION).withEndAction { | ||||
|                 capture_black_screen.animate().alpha(0f).setDuration(CAPTURE_ANIMATION_DURATION).start() | ||||
|             }.start() | ||||
|             shutter_animation.alpha = 1.0f | ||||
|             shutter_animation.animate().alpha(0f).setDuration(CAPTURE_ANIMATION_DURATION).start() | ||||
|         } else { | ||||
|             mPreview?.toggleRecording() | ||||
|         } | ||||
| @@ -527,11 +526,6 @@ class MainActivity : SimpleActivity(), PhotoProcessor.MediaSavedListener, Camera | ||||
|  | ||||
|     override fun toggleBottomButtons(hide: Boolean) { | ||||
|         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 | ||||
|             toggle_camera.isClickable = !hide | ||||
|             toggle_flash.isClickable = !hide | ||||
|   | ||||
| @@ -14,7 +14,7 @@ | ||||
|         android:layout_height="match_parent" /> | ||||
|  | ||||
|     <View | ||||
|         android:id="@+id/capture_black_screen" | ||||
|         android:id="@+id/shutter_animation" | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="match_parent" | ||||
|         android:alpha="0" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user