diff --git a/app/src/main/java/sushi/hardcore/droidfs/CameraActivity.kt b/app/src/main/java/sushi/hardcore/droidfs/CameraActivity.kt
index 5cc8b19..7a38daf 100644
--- a/app/src/main/java/sushi/hardcore/droidfs/CameraActivity.kt
+++ b/app/src/main/java/sushi/hardcore/droidfs/CameraActivity.kt
@@ -14,6 +14,7 @@ import android.view.*
import android.view.animation.Animation
import android.view.animation.LinearInterpolator
import android.view.animation.RotateAnimation
+import android.widget.ImageButton
import android.widget.ImageView
import android.widget.RelativeLayout
import android.widget.Toast
@@ -533,21 +534,30 @@ class CameraActivity : BaseActivity(), SensorOrientationListener.Listener {
withAudioEnabled()
}
}?.start(executor) {
+ val buttons = arrayOf(binding.imageCaptureMode, binding.imageRatio, binding.imageTimer, binding.imageModeSwitch, binding.imageCameraSwitch)
when (it) {
is VideoRecordEvent.Start -> {
binding.recordVideoButton.setImageResource(R.drawable.stop_recording_video_button)
+ for (i in buttons) {
+ i.isEnabled = false
+ i.alpha = 0.5F
+ }
isRecording = true
}
is VideoRecordEvent.Finalize -> {
if (it.hasError()) {
it.cause?.printStackTrace()
- Toast.makeText(applicationContext, it.cause?.message, Toast.LENGTH_SHORT).show()
+ Toast.makeText(applicationContext, it.cause?.message ?: ("Error: " + it.error), Toast.LENGTH_SHORT).show()
videoRecording?.close()
videoRecording = null
} else {
Toast.makeText(applicationContext, getString(R.string.video_save_success, path), Toast.LENGTH_SHORT).show()
}
binding.recordVideoButton.setImageResource(R.drawable.record_video_button)
+ for (i in buttons) {
+ i.isEnabled = true
+ i.alpha = 1F
+ }
isRecording = false
}
}
@@ -588,7 +598,7 @@ class CameraActivity : BaseActivity(), SensorOrientationListener.Listener {
orientedIcons.map { it.startAnimation(rotateAnimation) }
previousOrientation = realOrientation
imageCapture?.targetRotation = newOrientation
- videoCapture?.setTargetRotation(newOrientation)
+ videoCapture?.targetRotation = newOrientation
}
}
diff --git a/app/src/main/res/layout/activity_camera.xml b/app/src/main/res/layout/activity_camera.xml
index 731469c..d09157c 100644
--- a/app/src/main/res/layout/activity_camera.xml
+++ b/app/src/main/res/layout/activity_camera.xml
@@ -18,41 +18,49 @@
android:layout_height="40dp"
android:layout_marginTop="20dp">
-
-
-
-
-
@@ -104,11 +114,13 @@
-