From 0f0573e5bda99d928fb75fb8177a8635bd77031c Mon Sep 17 00:00:00 2001 From: Jannik Date: Mon, 16 Nov 2020 20:42:25 +0100 Subject: [PATCH] adjust size of rewind/fast forward button --- .../org/mosad/teapod/ui/components/FastForwardButton.kt | 4 ++-- .../java/org/mosad/teapod/ui/components/RewindButton.kt | 4 ++-- app/src/main/res/layout/button_fast_forward.xml | 8 ++------ app/src/main/res/layout/button_rewind.xml | 8 ++------ 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/org/mosad/teapod/ui/components/FastForwardButton.kt b/app/src/main/java/org/mosad/teapod/ui/components/FastForwardButton.kt index b1ae6cd..74f282a 100644 --- a/app/src/main/java/org/mosad/teapod/ui/components/FastForwardButton.kt +++ b/app/src/main/java/org/mosad/teapod/ui/components/FastForwardButton.kt @@ -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) diff --git a/app/src/main/java/org/mosad/teapod/ui/components/RewindButton.kt b/app/src/main/java/org/mosad/teapod/ui/components/RewindButton.kt index 6bc2fd8..41f7064 100644 --- a/app/src/main/java/org/mosad/teapod/ui/components/RewindButton.kt +++ b/app/src/main/java/org/mosad/teapod/ui/components/RewindButton.kt @@ -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) diff --git a/app/src/main/res/layout/button_fast_forward.xml b/app/src/main/res/layout/button_fast_forward.xml index 40cc527..7399973 100644 --- a/app/src/main/res/layout/button_fast_forward.xml +++ b/app/src/main/res/layout/button_fast_forward.xml @@ -1,6 +1,5 @@ @@ -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" /> @@ -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" />