From 48943f211b5a63d5f3489691d4f57bd3f44b6286 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 1 Apr 2020 18:21:45 +0200 Subject: [PATCH] adding a couple player UI improvements --- .../voicerecorder/fragments/PlayerFragment.kt | 10 ++++++++++ app/src/main/res/layout/fragment_player.xml | 7 ++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/voicerecorder/fragments/PlayerFragment.kt b/app/src/main/kotlin/com/simplemobiletools/voicerecorder/fragments/PlayerFragment.kt index a7c0727..4da0a95 100644 --- a/app/src/main/kotlin/com/simplemobiletools/voicerecorder/fragments/PlayerFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/voicerecorder/fragments/PlayerFragment.kt @@ -11,11 +11,14 @@ import android.os.Looper import android.os.PowerManager import android.provider.MediaStore import android.util.AttributeSet +import android.util.Log import android.widget.SeekBar import com.simplemobiletools.commons.extensions.* +import com.simplemobiletools.commons.helpers.isOnMainThread import com.simplemobiletools.voicerecorder.R import com.simplemobiletools.voicerecorder.activities.SimpleActivity import com.simplemobiletools.voicerecorder.adapters.RecordingsAdapter +import com.simplemobiletools.voicerecorder.extensions.config import com.simplemobiletools.voicerecorder.models.Recording import kotlinx.android.synthetic.main.fragment_player.view.* import java.util.* @@ -42,6 +45,7 @@ class PlayerFragment(context: Context, attributeSet: AttributeSet) : MyViewPager override fun onAttachedToWindow() { super.onAttachedToWindow() + setupColors() val recordings = getRecordings() RecordingsAdapter(context as SimpleActivity, recordings, recordings_list, recordings_fastscroller) { playRecording(it as Recording) @@ -227,5 +231,11 @@ class PlayerFragment(context: Context, attributeSet: AttributeSet) : MyViewPager private fun setupColors() { recordings_fastscroller.updatePrimaryColor() recordings_fastscroller.updateBubbleColors() + context.updateTextColors(player_controls_wrapper) + + val textColor = context.config.textColor + arrayListOf(previous_btn, play_pause_btn, next_btn).forEach { + it.applyColorFilter(textColor) + } } } diff --git a/app/src/main/res/layout/fragment_player.xml b/app/src/main/res/layout/fragment_player.xml index b358228..55f5b97 100644 --- a/app/src/main/res/layout/fragment_player.xml +++ b/app/src/main/res/layout/fragment_player.xml @@ -33,7 +33,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" - android:paddingBottom="@dimen/activity_margin"> + android:paddingBottom="@dimen/activity_margin" + tools:ignore="HardcodedText"> + android:text="00:00" /> + android:text="00:00" />