mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-06-27 09:02:59 +02:00
PR changes:
- remove rotating close icon from shutter button - remove toggling flashlight on each countdown tick - remove sound (to be addressed later)
This commit is contained in:
@ -847,7 +847,6 @@ class MainActivity : SimpleActivity(), PhotoProcessor.MediaSavedListener, Camera
|
||||
timer_text.beVisible()
|
||||
countDownTimer = object : CountDownTimer(timerMode.millisInFuture, 1000) {
|
||||
override fun onTick(millisUntilFinished: Long) {
|
||||
mPreview!!.toggleFlash()
|
||||
val seconds = (TimeUnit.MILLISECONDS.toSeconds(millisUntilFinished) + 1).toString()
|
||||
timer_text.setText(seconds)
|
||||
}
|
||||
|
@ -23,10 +23,6 @@ class MediaSoundHelper(context: Context) {
|
||||
mediaActionSound.play(MediaActionSound.STOP_VIDEO_RECORDING)
|
||||
}
|
||||
|
||||
fun playFocusCompleteSound() {
|
||||
mediaActionSound.play(MediaActionSound.FOCUS_COMPLETE)
|
||||
}
|
||||
|
||||
fun release() {
|
||||
mediaActionSound.release()
|
||||
}
|
||||
|
@ -465,16 +465,6 @@ class CameraXPreview(
|
||||
listener.onChangeFlashMode(flashState)
|
||||
}
|
||||
|
||||
override fun toggleFlash() {
|
||||
if (config.isSoundEnabled) {
|
||||
mediaSoundHelper.playFocusCompleteSound()
|
||||
}
|
||||
camera?.cameraControl?.enableTorch(true)
|
||||
cameraHandler.postDelayed({
|
||||
camera?.cameraControl?.enableTorch(false)
|
||||
}, TOGGLE_FLASH_DELAY)
|
||||
}
|
||||
|
||||
override fun tryTakePicture() {
|
||||
val imageCapture = imageCapture ?: throw IllegalStateException("Camera initialization failed.")
|
||||
|
||||
|
@ -19,6 +19,4 @@ interface MyPreview {
|
||||
fun initVideoMode()
|
||||
|
||||
fun showChangeResolution()
|
||||
|
||||
fun toggleFlash()
|
||||
}
|
||||
|
@ -29,9 +29,4 @@
|
||||
android:drawable="@drawable/shutter_unpressed_to_pressed"
|
||||
android:fromId="@id/unpressed"
|
||||
android:toId="@id/pressed" />
|
||||
|
||||
<transition
|
||||
android:drawable="@drawable/shutter_pressed_to_timer_cancel"
|
||||
android:fromId="@id/pressed"
|
||||
android:toId="@id/timer_cancel" />
|
||||
</animated-selector>
|
||||
|
@ -8,13 +8,8 @@
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M256,485C382.47,485 485,382.47 485,256C485,129.53 382.47,27 256,27C129.53,27 27,129.53 27,256C27,382.47 129.53,485 256,485ZM256,465C370.32,465 463,371.43 463,256C463,140.57 370.32,47 256,47C141.68,47 49,140.57 49,256C49,371.43 141.68,465 256,465Z" />
|
||||
|
||||
<group
|
||||
android:name="inner_cancel"
|
||||
android:pivotX="256"
|
||||
android:pivotY="256">
|
||||
<path
|
||||
android:fillColor="#FFFDFD"
|
||||
android:fillColor="#ffffff"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M255.5,426C349.67,426 426,349.67 426,255.5C426,161.34 349.67,85 255.5,85C161.34,85 85,161.34 85,255.5C85,349.67 161.34,426 255.5,426ZM201,302.54L209.46,311L256,264.46L302.54,311L311,302.54L264.46,256L311,209.46L302.54,201L256,247.54L209.46,201L201,209.46L247.54,256L201,302.54Z" />
|
||||
</group>
|
||||
</vector>
|
||||
|
@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:drawable="@drawable/ic_shutter_timer_cancel">
|
||||
|
||||
<target android:name="inner_cancel">
|
||||
<aapt:attr name="android:animation">
|
||||
<set>
|
||||
<objectAnimator
|
||||
android:duration="@integer/icon_anim_duration"
|
||||
android:interpolator="@android:anim/accelerate_interpolator"
|
||||
android:propertyName="rotation"
|
||||
android:valueFrom="60"
|
||||
android:valueTo="0"
|
||||
android:valueType="floatType" />
|
||||
</set>
|
||||
</aapt:attr>
|
||||
</target>
|
||||
</animated-vector>
|
Reference in New Issue
Block a user