adding a couple player UI improvements

This commit is contained in:
tibbi 2020-04-01 18:21:45 +02:00
parent 0173a8e4aa
commit 48943f211b
2 changed files with 14 additions and 3 deletions

View File

@ -11,11 +11,14 @@ import android.os.Looper
import android.os.PowerManager import android.os.PowerManager
import android.provider.MediaStore import android.provider.MediaStore
import android.util.AttributeSet import android.util.AttributeSet
import android.util.Log
import android.widget.SeekBar import android.widget.SeekBar
import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.isOnMainThread
import com.simplemobiletools.voicerecorder.R import com.simplemobiletools.voicerecorder.R
import com.simplemobiletools.voicerecorder.activities.SimpleActivity import com.simplemobiletools.voicerecorder.activities.SimpleActivity
import com.simplemobiletools.voicerecorder.adapters.RecordingsAdapter import com.simplemobiletools.voicerecorder.adapters.RecordingsAdapter
import com.simplemobiletools.voicerecorder.extensions.config
import com.simplemobiletools.voicerecorder.models.Recording import com.simplemobiletools.voicerecorder.models.Recording
import kotlinx.android.synthetic.main.fragment_player.view.* import kotlinx.android.synthetic.main.fragment_player.view.*
import java.util.* import java.util.*
@ -42,6 +45,7 @@ class PlayerFragment(context: Context, attributeSet: AttributeSet) : MyViewPager
override fun onAttachedToWindow() { override fun onAttachedToWindow() {
super.onAttachedToWindow() super.onAttachedToWindow()
setupColors()
val recordings = getRecordings() val recordings = getRecordings()
RecordingsAdapter(context as SimpleActivity, recordings, recordings_list, recordings_fastscroller) { RecordingsAdapter(context as SimpleActivity, recordings, recordings_list, recordings_fastscroller) {
playRecording(it as Recording) playRecording(it as Recording)
@ -227,5 +231,11 @@ class PlayerFragment(context: Context, attributeSet: AttributeSet) : MyViewPager
private fun setupColors() { private fun setupColors() {
recordings_fastscroller.updatePrimaryColor() recordings_fastscroller.updatePrimaryColor()
recordings_fastscroller.updateBubbleColors() 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)
}
} }
} }

View File

@ -33,7 +33,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:paddingBottom="@dimen/activity_margin"> android:paddingBottom="@dimen/activity_margin"
tools:ignore="HardcodedText">
<View <View
android:id="@+id/player_divider" android:id="@+id/player_divider"
@ -66,7 +67,7 @@
android:maxLines="1" android:maxLines="1"
android:paddingStart="@dimen/normal_margin" android:paddingStart="@dimen/normal_margin"
android:paddingEnd="@dimen/medium_margin" android:paddingEnd="@dimen/medium_margin"
tools:text="00:00" /> android:text="00:00" />
<com.simplemobiletools.commons.views.MySeekBar <com.simplemobiletools.commons.views.MySeekBar
android:id="@+id/player_progressbar" android:id="@+id/player_progressbar"
@ -92,7 +93,7 @@
android:maxLines="1" android:maxLines="1"
android:paddingStart="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin"
android:paddingEnd="@dimen/normal_margin" android:paddingEnd="@dimen/normal_margin"
tools:text="00:00" /> android:text="00:00" />
<LinearLayout <LinearLayout
android:id="@+id/player_controls" android:id="@+id/player_controls"