adjust size of rewind/fast forward button

This commit is contained in:
Jannik 2020-11-16 20:42:25 +01:00
parent 6ce263832b
commit 0f0573e5bd
Signed by: Seil0
GPG Key ID: E8459F3723C52C24
4 changed files with 8 additions and 16 deletions

View File

@ -34,7 +34,7 @@ class FastForwardButton(context: Context, attrs: AttributeSet): FrameLayout(cont
addListener(object : AnimatorListenerAdapter() {
override fun onAnimationStart(animation: Animator?) {
imageButton.isEnabled = false // disable button
imageButton.setImageResource(R.drawable.ic_baseline_forward_24)
imageButton.setBackgroundResource(R.drawable.ic_baseline_forward_24)
}
override fun onAnimationEnd(animation: Animator?) {
imageButton.isEnabled = true // enable button
@ -50,7 +50,7 @@ class FastForwardButton(context: Context, attrs: AttributeSet): FrameLayout(cont
addListener(object : AnimatorListenerAdapter() {
override fun onAnimationEnd(animation: Animator?) {
imageButton.isEnabled = true // enable button
imageButton.setImageResource(R.drawable.ic_baseline_forward_10_24)
imageButton.setBackgroundResource(R.drawable.ic_baseline_forward_10_24)
textView.visibility = View.GONE
textView.animate().translationX(0f)

View File

@ -34,7 +34,7 @@ class RewindButton(context: Context, attrs: AttributeSet): FrameLayout(context,
addListener(object : AnimatorListenerAdapter() {
override fun onAnimationStart(animation: Animator?) {
imageButton.isEnabled = false // disable button
imageButton.setImageResource(R.drawable.ic_baseline_rewind_24)
imageButton.setBackgroundResource(R.drawable.ic_baseline_rewind_24)
}
override fun onAnimationEnd(animation: Animator?) {
imageButton.isEnabled = true // enable button
@ -50,7 +50,7 @@ class RewindButton(context: Context, attrs: AttributeSet): FrameLayout(context,
addListener(object : AnimatorListenerAdapter() {
override fun onAnimationEnd(animation: Animator?) {
imageButton.isEnabled = true // enable button
imageButton.setImageResource(R.drawable.ic_baseline_rewind_10_24)
imageButton.setBackgroundResource(R.drawable.ic_baseline_rewind_10_24)
textView.visibility = View.GONE
textView.animate().translationX(0f)

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -9,11 +8,8 @@
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentStart="true"
android:background="@android:color/transparent"
android:contentDescription="@string/forward_10"
android:scaleX="1.5"
android:scaleY="1.5"
app:srcCompat="@drawable/ic_baseline_forward_10_24" />
android:background="@drawable/ic_baseline_forward_10_24"
android:contentDescription="@string/forward_10" />
<TextView
android:id="@+id/textView"

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true">
@ -10,11 +9,8 @@
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentEnd="true"
android:background="@android:color/transparent"
android:contentDescription="@string/forward_10"
android:scaleX="1.5"
android:scaleY="1.5"
app:srcCompat="@drawable/ic_baseline_rewind_10_24" />
android:background="@drawable/ic_baseline_rewind_10_24"
android:contentDescription="@string/forward_10" />
<TextView
android:id="@+id/textView"