feat: 优化代码

pull/172/head
kunfei 5 years ago
parent 41e1afb05c
commit 741835f498
  1. 5
      app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt
  2. 11
      app/src/main/res/layout/activity_audio_play.xml

@ -46,9 +46,8 @@ class AudioPlayActivity :
private var adjustProgress = false
override fun onActivityCreated(savedInstanceState: Bundle?) {
setSupportActionBar(toolbar)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
AudioPlay.titleData.observe(this, Observer { toolbar.title = it })
title_bar.transparent()
AudioPlay.titleData.observe(this, Observer { title_bar.title = it })
AudioPlay.coverData.observe(this, Observer { upCover(it) })
viewModel.initData(intent)
initView()

@ -21,13 +21,10 @@
android:layout_height="match_parent"
android:background="#50000000" />
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
<io.legado.app.ui.widget.TitleBar
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="?attr/actionBarStyle"
android:fitsSystemWindows="true"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:layout_constraintTop_toTopOf="parent" />
<TextView
@ -40,7 +37,7 @@
android:paddingStart="3dp"
android:paddingEnd="3dp"
android:visibility="invisible"
app:layout_constraintTop_toBottomOf="@id/toolbar"
app:layout_constraintTop_toBottomOf="@id/title_bar"
app:layout_constraintRight_toRightOf="parent" />
<io.legado.app.ui.widget.image.CircleImageView
@ -54,7 +51,7 @@
app:layout_constraintBottom_toTopOf="@+id/ll_player_progress"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/toolbar" />
app:layout_constraintTop_toBottomOf="@+id/title_bar" />
<TextView
android:id="@+id/tv_sub_title"

Loading…
Cancel
Save