Removed redundant Song title and artist name in lyrics toolbar

This commit is contained in:
Prathamesh More 2022-01-25 14:22:02 +05:30
parent 62e016bf9b
commit 051a9d8ef9
2 changed files with 21 additions and 49 deletions

View file

@ -149,7 +149,6 @@ class LyricsFragment : AbsMusicServiceFragment(R.layout.fragment_lyrics) {
setupWakelock()
setupViews()
setupToolbar()
updateTitleSong()
}
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() {
requireActivity().window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
}

View file

@ -27,6 +27,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorSurface"
android:gravity="start"
android:navigationIcon="@drawable/ic_keyboard_arrow_down_black"
app:contentInsetLeft="0dp"
@ -36,43 +37,31 @@
app:subtitleTextAppearance="@style/TextViewCaption"
app:titleMargin="0dp"
app:titleMarginStart="0dp"
android:background="?attr/colorSurface"
app:titleTextAppearance="@style/TextViewSubtitle1"
tools:subtitle="@tools:sample/full_names"
tools:title="@tools:sample/full_names" />
app:titleTextAppearance="@style/TextViewSubtitle1">
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabLyrics"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorSurface"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:tabIndicator="@drawable/tab_lyrics_indicator"
app:tabIndicatorAnimationMode="elastic"
app:tabIndicatorFullWidth="false"
app:tabIndicatorHeight="5dp" />
</com.google.android.material.appbar.MaterialToolbar>
</com.google.android.material.appbar.AppBarLayout>
<androidx.constraintlayout.widget.ConstraintLayout
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/lyricsPager"
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
android:id="@+id/tabLyrics"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorSurface"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:tabIndicator="@drawable/tab_lyrics_indicator"
app:tabIndicatorAnimationMode="elastic"
app:tabIndicatorFullWidth="false"
app:tabIndicatorHeight="5dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
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
android:id="@+id/edit_button"