Removed redundant Song title and artist name in lyrics toolbar
This commit is contained in:
parent
62e016bf9b
commit
051a9d8ef9
2 changed files with 21 additions and 49 deletions
|
@ -149,7 +149,6 @@ class LyricsFragment : AbsMusicServiceFragment(R.layout.fragment_lyrics) {
|
||||||
setupWakelock()
|
setupWakelock()
|
||||||
setupViews()
|
setupViews()
|
||||||
setupToolbar()
|
setupToolbar()
|
||||||
updateTitleSong()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupViews() {
|
private fun setupViews() {
|
||||||
|
@ -186,22 +185,6 @@ class LyricsFragment : AbsMusicServiceFragment(R.layout.fragment_lyrics) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onPlayingMetaChanged() {
|
|
||||||
super.onPlayingMetaChanged()
|
|
||||||
updateTitleSong()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onServiceConnected() {
|
|
||||||
super.onServiceConnected()
|
|
||||||
updateTitleSong()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun updateTitleSong() {
|
|
||||||
song = MusicPlayerRemote.currentSong
|
|
||||||
binding.toolbar.title = song.title
|
|
||||||
binding.toolbar.subtitle = song.artistName
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun setupWakelock() {
|
private fun setupWakelock() {
|
||||||
requireActivity().window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
requireActivity().window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:background="?attr/colorSurface"
|
||||||
android:gravity="start"
|
android:gravity="start"
|
||||||
android:navigationIcon="@drawable/ic_keyboard_arrow_down_black"
|
android:navigationIcon="@drawable/ic_keyboard_arrow_down_black"
|
||||||
app:contentInsetLeft="0dp"
|
app:contentInsetLeft="0dp"
|
||||||
|
@ -36,29 +37,7 @@
|
||||||
app:subtitleTextAppearance="@style/TextViewCaption"
|
app:subtitleTextAppearance="@style/TextViewCaption"
|
||||||
app:titleMargin="0dp"
|
app:titleMargin="0dp"
|
||||||
app:titleMarginStart="0dp"
|
app:titleMarginStart="0dp"
|
||||||
android:background="?attr/colorSurface"
|
app:titleTextAppearance="@style/TextViewSubtitle1">
|
||||||
app:titleTextAppearance="@style/TextViewSubtitle1"
|
|
||||||
tools:subtitle="@tools:sample/full_names"
|
|
||||||
tools:title="@tools:sample/full_names" />
|
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_marginTop="?attr/actionBarSize">
|
|
||||||
|
|
||||||
<androidx.viewpager2.widget.ViewPager2
|
|
||||||
android:id="@+id/lyricsPager"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/tabLyrics">
|
|
||||||
|
|
||||||
</androidx.viewpager2.widget.ViewPager2>
|
|
||||||
|
|
||||||
<com.google.android.material.tabs.TabLayout
|
<com.google.android.material.tabs.TabLayout
|
||||||
android:id="@+id/tabLyrics"
|
android:id="@+id/tabLyrics"
|
||||||
|
@ -72,7 +51,17 @@
|
||||||
app:tabIndicatorAnimationMode="elastic"
|
app:tabIndicatorAnimationMode="elastic"
|
||||||
app:tabIndicatorFullWidth="false"
|
app:tabIndicatorFullWidth="false"
|
||||||
app:tabIndicatorHeight="5dp" />
|
app:tabIndicatorHeight="5dp" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</com.google.android.material.appbar.MaterialToolbar>
|
||||||
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<androidx.viewpager2.widget.ViewPager2
|
||||||
|
android:id="@+id/lyricsPager"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="?attr/actionBarSize"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
android:id="@+id/edit_button"
|
android:id="@+id/edit_button"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue