TrackController: refactor button (delayed action) UI and use handler.

This commit is contained in:
Dennis Guse
2020-11-10 20:26:26 +01:00
parent 96bc347374
commit 1e8beff015
13 changed files with 192 additions and 233 deletions
@@ -1,5 +0,0 @@
<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" />
+5
View File
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_button_stop_disabled" android:state_enabled="false" />
<item android:drawable="@drawable/ic_button_stop" />
</selector>
@@ -24,9 +24,4 @@
android:strokeWidth="4.82273865"
android:strokeAlpha="1"
android:strokeColor="#00000000" />
<path
android:name="fade_out_circle"
android:fillAlpha="0.0"
android:fillColor="#a31a1f"
android:pathData="M62.5,62.5m-0,-62a50,50 0,1 1,-0 123a50,50 0,1 1,-0 -123" />
</vector>
@@ -1,6 +0,0 @@
<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,41 +0,0 @@
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt">
<aapt:attr name="android:drawable">
<vector
android:width="82dp"
android:height="82dp"
android:viewportWidth="125"
android:viewportHeight="125">
<path
android:fillAlpha="1"
android:fillColor="#00000000"
android:pathData="M2.516,63.008a60.239,59.73 134.879,1 0,119.968 -1.017a60.239,59.73 134.879,1 0,-119.968 1.017z"
android:strokeWidth="5.03194237"
android:strokeAlpha="1"
android:strokeColor="#555555" />
<path
android:fillAlpha="1"
android:fillColor="#484848"
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="1"
android:fillColor="#ffffff"
android:fillType="nonZero"
android:pathData="M53.02,54.02h17.46v17.46h-17.46z"
android:strokeWidth="1.04023623"
android:strokeAlpha="1"
android:strokeColor="#414141" />
<path
android:name="fade_out_circle"
android:fillAlpha="0.0"
android:fillColor="#a31a1f"
android:pathData="M62.5,62.5m-0,-62a50,50 0,1 1,-0 123a50,50 0,1 1,-0 -123"></path>
</vector>
</aapt:attr>
<target
android:name="fade_out_circle"
android:animation="@animator/button_animator" />
</animated-vector>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<transition xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The drawables used here can be solid colors, gradients, shapes, images, etc. -->
<item android:drawable="@color/track_controller_background_normal" />
<item android:drawable="@color/track_controller_background_activated" />
</transition>
@@ -19,7 +19,7 @@ limitations under the License.
android:id="@+id/track_controller_container"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@color/track_controller_background"
android:background="@color/track_controller_background_normal"
android:orientation="vertical"
android:paddingLeft="8dp"
android:paddingRight="8dp">
@@ -30,7 +30,8 @@ limitations under the License.
android:layout_height="0dp"
android:layout_weight="10"
android:background="@android:color/transparent"
android:contentDescription="@string/image_record" />
android:contentDescription="@string/image_record"
android:src="@drawable/ic_button_record" />
<RelativeLayout
android:layout_width="match_parent"
@@ -62,7 +63,7 @@ limitations under the License.
android:layout_weight="10"
android:background="@android:color/transparent"
android:contentDescription="@string/image_stop"
android:src="@drawable/ic_button_stop_disabled" />
android:src="@drawable/button_stop" />
</LinearLayout>
</merge>
+16 -11
View File
@@ -13,13 +13,14 @@ 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.
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<LinearLayout
android:id="@+id/track_controller_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/track_controller_background"
android:background="@drawable/track_controller_background"
android:paddingTop="8dp"
android:paddingBottom="8dp">
@@ -29,32 +30,36 @@ limitations under the License.
android:layout_height="wrap_content"
android:layout_weight="10"
android:background="@android:color/transparent"
android:contentDescription="@string/image_record" />
android:contentDescription="@string/image_record"
android:src="@drawable/ic_button_record" />
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="6"
android:gravity="center"
android:layout_gravity="center">
android:layout_gravity="center"
android:layout_weight="6">
<TextView
android:id="@+id/track_controller_total_time"
style="@style/TextSmall"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:textColor="@android:color/white" />
android:gravity="center"
android:textColor="@android:color/white"
tools:text="0:12:34" />
<TextView
android:id="@+id/track_controller_status"
style="@style/TextMicro"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@id/track_controller_total_time"
android:layout_alignParentStart="true"
android:singleLine="true" />
android:gravity="center"
android:singleLine="true"
tools:text="@string/generic_recording" />
</RelativeLayout>
<ImageButton
@@ -64,7 +69,7 @@ limitations under the License.
android:layout_weight="10"
android:background="@android:color/transparent"
android:contentDescription="@string/image_stop"
android:src="@drawable/ic_button_stop_disabled" />
android:src="@drawable/button_stop" />
</LinearLayout>
</merge>
+2 -1
View File
@@ -35,7 +35,8 @@ limitations under the License.
<color name="text_gradient_center">#B2000000</color> <!-- black 70% opacity -->
<color name="text_gradient_end">#00000000</color> <!-- black 0% opacity -->
<color name="text_gradient_start">#FF000000</color> <!-- black 100% opacity -->
<color name="track_controller_background">#FF0E0E0E</color> <!-- dark gray -->
<color name="track_controller_background_normal">#FF0E0E0E</color> <!-- dark gray -->
<color name="track_controller_background_activated">#3F0000</color>
<color name="splashscreen_background">#272727</color>
</resources>
+2 -2
View File
@@ -631,8 +631,8 @@ limitations under the License.
<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>
<string name="hold_to_stop">Hold to stop</string>
<string name="hold_to_pause">Hold to pause</string>
<string name="toast_message_instant_track_was_exported">Last track exported</string>
<string name="instant_export_enabled_summary">Export track to storage after recording is finished</string>