mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-26 15:57:34 +00:00
Improve animations on audio controls, enable push to talk
// FREEBIE
This commit is contained in:
8
res/animator/bottom_pause_to_play_animation.xml
Normal file
8
res/animator/bottom_pause_to_play_animation.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="@integer/play_button_animation_duration"
|
||||
android:interpolator="@android:interpolator/accelerate_decelerate"
|
||||
android:propertyName="pathData"
|
||||
android:valueFrom="@string/pause_icon_bottom_path_data"
|
||||
android:valueTo="@string/play_icon_bottom_path_data"
|
||||
android:valueType="pathType"/>
|
8
res/animator/bottom_play_to_pause_animation.xml
Normal file
8
res/animator/bottom_play_to_pause_animation.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="@integer/play_button_animation_duration"
|
||||
android:interpolator="@android:interpolator/accelerate_decelerate"
|
||||
android:propertyName="pathData"
|
||||
android:valueFrom="@string/play_icon_bottom_path_data"
|
||||
android:valueTo="@string/pause_icon_bottom_path_data"
|
||||
android:valueType="pathType"/>
|
9
res/animator/rotate_90_animation.xml
Normal file
9
res/animator/rotate_90_animation.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<objectAnimator
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="@integer/play_button_animation_duration"
|
||||
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
|
||||
android:propertyName="rotation"
|
||||
android:valueFrom="0"
|
||||
android:valueTo="90"
|
||||
android:valueType="floatType"/>
|
9
res/animator/rotate_minus_90_animation.xml
Normal file
9
res/animator/rotate_minus_90_animation.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<objectAnimator
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="@integer/play_button_animation_duration"
|
||||
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
|
||||
android:propertyName="rotation"
|
||||
android:valueFrom="90"
|
||||
android:valueTo="0"
|
||||
android:valueType="floatType"/>
|
8
res/animator/upper_pause_to_play_animation.xml
Normal file
8
res/animator/upper_pause_to_play_animation.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="@integer/play_button_animation_duration"
|
||||
android:interpolator="@android:interpolator/accelerate_decelerate"
|
||||
android:propertyName="pathData"
|
||||
android:valueFrom="@string/pause_icon_upper_path_data"
|
||||
android:valueTo="@string/play_icon_upper_path_data"
|
||||
android:valueType="pathType"/>
|
8
res/animator/upper_play_to_pause_animation.xml
Normal file
8
res/animator/upper_play_to_pause_animation.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="@integer/play_button_animation_duration"
|
||||
android:interpolator="@android:interpolator/accelerate_decelerate"
|
||||
android:propertyName="pathData"
|
||||
android:valueFrom="@string/play_icon_upper_path_data"
|
||||
android:valueTo="@string/pause_icon_upper_path_data"
|
||||
android:valueType="pathType"/>
|
BIN
res/drawable-hdpi/ic_circle_fill_white_48dp.png
Normal file
BIN
res/drawable-hdpi/ic_circle_fill_white_48dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
BIN
res/drawable-mdpi/ic_circle_fill_white_48dp.png
Normal file
BIN
res/drawable-mdpi/ic_circle_fill_white_48dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.0 KiB |
BIN
res/drawable-xhdpi/ic_circle_fill_white_48dp.png
Normal file
BIN
res/drawable-xhdpi/ic_circle_fill_white_48dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
BIN
res/drawable-xxhdpi/ic_circle_fill_white_48dp.png
Normal file
BIN
res/drawable-xxhdpi/ic_circle_fill_white_48dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
BIN
res/drawable-xxxhdpi/ic_circle_fill_white_48dp.png
Normal file
BIN
res/drawable-xxxhdpi/ic_circle_fill_white_48dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
35
res/drawable/pause_icon.xml
Normal file
35
res/drawable/pause_icon.xml
Normal file
@@ -0,0 +1,35 @@
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="128"
|
||||
android:viewportHeight="128">
|
||||
<group
|
||||
android:name="@string/play_icon_group_parts"
|
||||
android:rotation="90"
|
||||
android:pivotX="64"
|
||||
android:pivotY="64"
|
||||
android:scaleX="1.5"
|
||||
android:scaleY="1.5">
|
||||
|
||||
<group android:name="@string/play_icon_group_top">
|
||||
<path
|
||||
android:name="@string/play_icon_top_path_name"
|
||||
android:pathData="@string/pause_icon_upper_path_data"
|
||||
android:fillColor="@android:color/white"
|
||||
android:strokeLineCap="butt"
|
||||
android:strokeLineJoin="miter"
|
||||
android:strokeMiterLimit="10"/>
|
||||
</group>
|
||||
<group android:name="@string/play_icon_group_bottom">
|
||||
<path
|
||||
android:name="@string/play_icon_bottom_path_name"
|
||||
android:pathData="@string/pause_icon_bottom_path_data"
|
||||
android:fillColor="@android:color/white"
|
||||
android:strokeLineCap="butt"
|
||||
android:strokeLineJoin="miter"
|
||||
android:strokeMiterLimit="10"/>
|
||||
</group>
|
||||
|
||||
</group>
|
||||
</vector>
|
18
res/drawable/pause_to_play_animation.xml
Normal file
18
res/drawable/pause_to_play_animation.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:drawable="@drawable/pause_icon"
|
||||
tools:targetApi="lollipop">
|
||||
|
||||
<target
|
||||
android:name="@string/play_icon_group_parts"
|
||||
android:animation="@animator/rotate_minus_90_animation"/>
|
||||
|
||||
<target
|
||||
android:name="@string/play_icon_top_path_name"
|
||||
android:animation="@animator/upper_pause_to_play_animation"/>
|
||||
|
||||
<target
|
||||
android:name="@string/play_icon_bottom_path_name"
|
||||
android:animation="@animator/bottom_pause_to_play_animation"/>
|
||||
</animated-vector>
|
34
res/drawable/play_icon.xml
Normal file
34
res/drawable/play_icon.xml
Normal file
@@ -0,0 +1,34 @@
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="128"
|
||||
android:viewportHeight="128">
|
||||
<group
|
||||
android:name="@string/play_icon_group_parts"
|
||||
android:pivotX="64"
|
||||
android:pivotY="64"
|
||||
android:scaleX="1.5"
|
||||
android:scaleY="1.5">
|
||||
|
||||
<group android:name="@string/play_icon_group_top">
|
||||
<path
|
||||
android:name="@string/play_icon_top_path_name"
|
||||
android:pathData="@string/play_icon_upper_path_data"
|
||||
android:fillColor="@android:color/white"
|
||||
android:strokeLineCap="butt"
|
||||
android:strokeLineJoin="miter"
|
||||
android:strokeMiterLimit="10"/>
|
||||
</group>
|
||||
<group android:name="@string/play_icon_group_bottom">
|
||||
<path
|
||||
android:name="@string/play_icon_bottom_path_name"
|
||||
android:pathData="@string/play_icon_bottom_path_data"
|
||||
android:fillColor="@android:color/white"
|
||||
android:strokeLineCap="butt"
|
||||
android:strokeLineJoin="miter"
|
||||
android:strokeMiterLimit="10"/>
|
||||
</group>
|
||||
|
||||
</group>
|
||||
</vector>
|
18
res/drawable/play_to_pause_animation.xml
Normal file
18
res/drawable/play_to_pause_animation.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:drawable="@drawable/play_icon"
|
||||
tools:targetApi="lollipop">
|
||||
|
||||
<target
|
||||
android:name="@string/play_icon_group_parts"
|
||||
android:animation="@animator/rotate_90_animation"/>
|
||||
|
||||
<target
|
||||
android:name="@string/play_icon_top_path_name"
|
||||
android:animation="@animator/upper_play_to_pause_animation"/>
|
||||
|
||||
<target
|
||||
android:name="@string/play_icon_bottom_path_name"
|
||||
android:animation="@animator/bottom_play_to_pause_animation"/>
|
||||
</animated-vector>
|
@@ -28,7 +28,7 @@
|
||||
app:matProg_barColor="@color/white"
|
||||
app:matProg_linearProgress="true"
|
||||
app:matProg_spinSpeed="0.333"
|
||||
tools:visibility="visible"/>
|
||||
tools:visibility="gone"/>
|
||||
|
||||
<ImageView android:id="@+id/play"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -39,6 +39,8 @@
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/circle_touch_highlight_background"
|
||||
android:src="@drawable/ic_play_circle_fill_white_48dp"
|
||||
android:scaleType="centerInside"
|
||||
tools:visibility="gone"
|
||||
android:contentDescription="Play"/>
|
||||
|
||||
<ImageView android:id="@+id/pause"
|
||||
@@ -50,6 +52,7 @@
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/circle_touch_highlight_background"
|
||||
android:src="@drawable/ic_pause_circle_fill_white_48dp"
|
||||
android:scaleType="centerInside"
|
||||
android:contentDescription="Pause"/>
|
||||
|
||||
<ImageView android:id="@+id/download"
|
||||
|
@@ -70,7 +70,8 @@
|
||||
android:background="@color/white"
|
||||
android:paddingTop="15dp"
|
||||
android:paddingBottom="15dp"
|
||||
app:tintColor="@color/grey_500"/>
|
||||
app:foregroundTintColor="@color/grey_500"
|
||||
app:backgroundTintColor="@color/white"/>
|
||||
|
||||
</org.thoughtcrime.securesms.components.RemovableMediaView>
|
||||
|
||||
|
@@ -65,7 +65,8 @@
|
||||
android:layout_width="210dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:tintColor="@color/white"
|
||||
app:foregroundTintColor="@color/white"
|
||||
app:backgroundTintColor="@color/blue_500"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
|
||||
|
@@ -55,7 +55,8 @@
|
||||
android:id="@+id/audio_view"
|
||||
android:layout_width="210dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:tintColor="@color/grey_500"
|
||||
app:foregroundTintColor="@color/grey_500"
|
||||
app:backgroundTintColor="@color/white"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
|
||||
|
@@ -154,7 +154,8 @@
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="AudioView">
|
||||
<attr name="tintColor" format="color" />
|
||||
<attr name="foregroundTintColor" format="color" />
|
||||
<attr name="backgroundTintColor" format="color" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="CircleColorImageView">
|
||||
|
4
res/values/integers.xml
Normal file
4
res/values/integers.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<integer name="play_button_animation_duration">300</integer>
|
||||
</resources>
|
20
res/values/vector_paths.xml
Normal file
20
res/values/vector_paths.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Play Icon -->
|
||||
<string name="play_icon_upper_path_data">M 44 32 L 44 64 L 100 64 L 100 64 Z</string>
|
||||
<string name="play_icon_bottom_path_data">M 44 96 L 44 64 L 100 64 L 100 64 Z</string>
|
||||
|
||||
<!-- Pause Icon -->
|
||||
<string name="pause_icon_upper_path_data">M 32 40 L 32 56 L 96 56 L 96 40 Z</string>
|
||||
<string name="pause_icon_bottom_path_data">M 32 88 L 32 72 L 96 72 L 96 88 Z</string>
|
||||
|
||||
<!-- Groups -->
|
||||
<string name="play_icon_group_top">upperpart</string>
|
||||
<string name="play_icon_group_bottom">bottompart</string>
|
||||
<string name="play_icon_group_parts">parts</string>
|
||||
|
||||
<!-- Path Name -->
|
||||
<string name="play_icon_top_path_name">upper</string>
|
||||
<string name="play_icon_bottom_path_name">bottom</string>
|
||||
|
||||
</resources>
|
Reference in New Issue
Block a user