mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-04-15 08:50:35 +03:00
Improve current playing song visibility
Disable scroll animation because not visible and causing bugs on first interaction
This commit is contained in:
parent
03d06896e9
commit
dc9b261c48
@ -1,5 +1,6 @@
|
||||
package org.moire.ultrasonic.adapters
|
||||
|
||||
import android.graphics.PorterDuff
|
||||
import android.view.View
|
||||
import android.widget.Checkable
|
||||
import android.widget.CheckedTextView
|
||||
@ -45,6 +46,7 @@ class TrackViewHolder(val view: View) :
|
||||
|
||||
var entry: Track? = null
|
||||
private set
|
||||
var songLayout: LinearLayout = view.findViewById(R.id.song_layout)
|
||||
var check: CheckedTextView = view.findViewById(R.id.song_check)
|
||||
var drag: ImageView = view.findViewById(R.id.song_drag)
|
||||
var observableChecked = MutableLiveData(false)
|
||||
@ -170,11 +172,13 @@ class TrackViewHolder(val view: View) :
|
||||
title.setCompoundDrawablesWithIntrinsicBounds(
|
||||
playingIcon, null, null, null
|
||||
)
|
||||
songLayout.backgroundTintMode = PorterDuff.Mode.ADD
|
||||
} else if (!isPlaying && isPlayingCached) {
|
||||
isPlayingCached = false
|
||||
title.setCompoundDrawablesWithIntrinsicBounds(
|
||||
0, 0, 0, 0
|
||||
)
|
||||
songLayout.backgroundTintMode = PorterDuff.Mode.MULTIPLY
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -481,9 +481,7 @@ class PlayerFragment :
|
||||
val index = mediaPlayerManager.currentMediaItemIndex
|
||||
|
||||
if (index != -1) {
|
||||
val smoothScroller = LinearSmoothScroller(context)
|
||||
smoothScroller.targetPosition = index
|
||||
viewManager.startSmoothScroll(smoothScroller)
|
||||
viewManager.scrollToPosition(index)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,9 @@
|
||||
a:id="@+id/song_layout"
|
||||
a:layout_width="fill_parent"
|
||||
a:layout_height="?android:attr/listPreferredItemHeight"
|
||||
a:background="#00000000"
|
||||
a:backgroundTint="@color/material_on_surface_stroke"
|
||||
a:backgroundTintMode="multiply"
|
||||
a:minHeight="?android:attr/listPreferredItemHeight"
|
||||
a:orientation="horizontal">
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user