fix #241 stop button lock (#362)

* fix #241 stop button lock

Adds a delay and animation to the stop and pause buttons

- short vibration when starting to push the buttons
- long vibration when action was executed
- Toast to show "Hold to stop/pause recording"
This commit is contained in:
Peter Storch
2020-08-15 21:50:06 +02:00
committed by GitHub
parent a87d2e5b09
commit 18546fd3cc
14 changed files with 143 additions and 110 deletions
@@ -0,0 +1,5 @@
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@integer/buttonDelayMillis"
android:propertyName="fillAlpha"
android:valueFrom="1.0"
android:valueTo="0.0" />
-19
View File
@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
Copyright 2013 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_button_pause_pressed" android:state_pressed="true" />
<item android:drawable="@drawable/ic_button_pause" />
</selector>
-19
View File
@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
Copyright 2013 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_button_stop_pressed" android:state_pressed="true" />
<item android:drawable="@drawable/ic_button_stop" />
</selector>
@@ -24,4 +24,9 @@
android:strokeWidth="4.82273865"
android:strokeAlpha="1"
android:strokeColor="#00000000" />
<path android:name="fade_out_circle"
android:pathData="M62.5,62.5m-0,-62a50,50 0,1 1,-0 123a50,50 0,1 1,-0 -123"
android:fillAlpha="0.0"
android:fillColor="#a31a1f">
</path>
</vector>
@@ -0,0 +1,6 @@
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/ic_button_pause" >
<target
android:name="fade_out_circle"
android:animation="@animator/button_animator" />
</animated-vector>
@@ -1,34 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="82dp"
android:height="82dp"
android:viewportWidth="125"
android:viewportHeight="125">
<path
android:fillAlpha="1"
android:fillColor="#00000000"
android:pathData="M62.5,62.5m-59.984,0a59.984,59.984 0,1 1,119.968 0a59.984,59.984 0,1 1,-119.968 0"
android:strokeWidth="5.03185225"
android:strokeAlpha="1"
android:strokeColor="#a31a1f" />
<path
android:fillAlpha="0.4"
android:fillColor="#414141"
android:pathData="M62.5,62.5m-50,0a50,50 0,1 1,100 0a50,50 0,1 1,-100 0"
android:strokeWidth="6.9172821"
android:strokeAlpha="1"
android:strokeColor="#00000000" />
<path
android:fillAlpha="0.87843137"
android:fillColor="#efefef"
android:pathData="M54,54.059h5v17.941h-5z"
android:strokeWidth="4.82273912"
android:strokeAlpha="1"
android:strokeColor="#00000000" />
<path
android:fillAlpha="0.87843137"
android:fillColor="#efefef"
android:pathData="M66,54h5v17.941h-5z"
android:strokeWidth="4.82273865"
android:strokeAlpha="1"
android:strokeColor="#00000000" />
</vector>
+5
View File
@@ -25,4 +25,9 @@
android:strokeWidth="1.04023623"
android:strokeAlpha="1"
android:strokeColor="#414141" />
<path android:name="fade_out_circle"
android:pathData="M62.5,62.5m-0,-62a50,50 0,1 1,-0 123a50,50 0,1 1,-0 -123"
android:fillAlpha="0.0"
android:fillColor="#a31a1f">
</path>
</vector>
@@ -0,0 +1,6 @@
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/ic_button_stop" >
<target
android:name="fade_out_circle"
android:animation="@animator/button_animator" />
</animated-vector>
@@ -1,34 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="82dp"
android:height="82dp"
android:viewportWidth="125"
android:viewportHeight="125">
<path
android:fillColor="#00000000"
android:pathData="M2.516,63.009a60.239,59.73 134.856,1 0,119.967 -1.017a60.239,59.73 134.856,1 0,-119.967 1.017z"
android:strokeWidth="5.0319"
android:strokeColor="#555" />
<path android:pathData="M62.5,62.5m-0,-50a50,50 0,1 1,-0 100a50,50 0,1 1,-0 -100">
<aapt:attr name="android:fillColor">
<gradient
android:endX="62.5"
android:endY="112.5"
android:startX="62.5"
android:startY="12.5"
android:type="linear">
<item
android:color="#FF404040"
android:offset="0" />
<item
android:color="#FF555555"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#dbdbdb"
android:pathData="M53.02,54.02h17.46v17.46h-17.46z"
android:strokeWidth="1.0402"
android:strokeColor="#414141" />
</vector>
+2
View File
@@ -231,4 +231,6 @@
<bool name="import_prevent_reimport_default">true</bool>
<string name="settings_recording_key" translatable="false">settingsRecordingKey</string>
<integer name="buttonDelayMillis">1500</integer>
</resources>
+3
View File
@@ -584,4 +584,7 @@ limitations under the License.
<!-- Share image -->
<string name="share_image_subject">I would like to share an image with you</string>
<string name="share_image_body">I think you might be interested in this image.</string>
<string name="hold_to_stop">Hold to stop recording</string>
<string name="hold_to_pause">Hold to pause recording</string>
</resources>