diff --git a/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt b/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt index 6953ed891..cd114bc68 100644 --- a/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt +++ b/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt @@ -16,6 +16,7 @@ import io.legado.app.utils.getViewModel import io.legado.app.utils.observeEvent import kotlinx.android.synthetic.main.activity_audio_play.* import kotlinx.android.synthetic.main.view_title_bar.* +import org.apache.commons.lang3.time.DateFormatUtils import org.jetbrains.anko.sdk27.listeners.onClick import org.jetbrains.anko.sdk27.listeners.onLongClick @@ -52,7 +53,7 @@ class AudioPlayActivity : VMBaseActivity(R.layout.activity_a } player_progress.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener { override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) { - + tv_dur_time.text = DateFormatUtils.format(progress.toLong(), "mm:ss") } override fun onStartTrackingTouch(seekBar: SeekBar?) { @@ -67,7 +68,7 @@ class AudioPlayActivity : VMBaseActivity(R.layout.activity_a } private fun upView(book: Book) { - actionBar?.title = book.name + title_bar.title = book.name ImageLoader.load(this, book.getDisplayCover()) .placeholder(R.drawable.image_cover_default) .error(R.drawable.image_cover_default) @@ -121,9 +122,11 @@ class AudioPlayActivity : VMBaseActivity(R.layout.activity_a } observeEvent(Bus.AUDIO_PROGRESS) { if (!adjustProgress) player_progress.progress = it + tv_dur_time.text = DateFormatUtils.format(it.toLong(), "mm:ss") } observeEvent(Bus.AUDIO_SIZE) { player_progress.max = it + tv_all_time.text = DateFormatUtils.format(it.toLong(), "mm:ss") } } } \ No newline at end of file diff --git a/app/src/main/res/layout/activity_audio_play.xml b/app/src/main/res/layout/activity_audio_play.xml index 3c2a02ca5..a4b06402e 100644 --- a/app/src/main/res/layout/activity_audio_play.xml +++ b/app/src/main/res/layout/activity_audio_play.xml @@ -50,15 +50,16 @@ android:layout_height="wrap_content" android:gravity="center_vertical" android:orientation="horizontal" - android:paddingStart="5dp" - android:paddingEnd="5dp" + android:paddingStart="16dp" + android:paddingEnd="16dp" app:layout_constraintBottom_toTopOf="@+id/ll_play_menu"> + android:text="00:00" + tools:ignore="HardcodedText,RtlSymmetry" /> + android:layout_height="wrap_content" + android:text="00:00" + tools:ignore="HardcodedText" /> @@ -78,8 +81,8 @@ android:id="@+id/ll_play_menu" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingLeft="15dp" - android:paddingRight="15dp" + android:paddingLeft="24dp" + android:paddingRight="24dp" android:gravity="center_vertical" android:orientation="horizontal" app:layout_constraintBottom_toBottomOf="parent">