mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-07-19 18:01:58 +03:00
Compare commits
6 Commits
35334c93cc
...
a9494626bb
Author | SHA1 | Date | |
---|---|---|---|
|
a9494626bb | ||
|
ec852b0e74 | ||
|
1fe13e84ce | ||
|
d8cb11808c | ||
|
63296829a8 | ||
|
dc9b261c48 |
@ -6,7 +6,7 @@ navigation = "2.5.3"
|
|||||||
gradlePlugin = "8.0.2"
|
gradlePlugin = "8.0.2"
|
||||||
androidxcore = "1.10.1"
|
androidxcore = "1.10.1"
|
||||||
ktlint = "0.43.2"
|
ktlint = "0.43.2"
|
||||||
ktlintGradle = "11.3.2"
|
ktlintGradle = "11.4.0"
|
||||||
detekt = "1.23.0"
|
detekt = "1.23.0"
|
||||||
preferences = "1.2.0"
|
preferences = "1.2.0"
|
||||||
media3 = "1.0.2"
|
media3 = "1.0.2"
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package org.moire.ultrasonic.adapters
|
package org.moire.ultrasonic.adapters
|
||||||
|
|
||||||
|
import android.graphics.PorterDuff
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.Checkable
|
import android.widget.Checkable
|
||||||
import android.widget.CheckedTextView
|
import android.widget.CheckedTextView
|
||||||
@ -45,6 +46,7 @@ class TrackViewHolder(val view: View) :
|
|||||||
|
|
||||||
var entry: Track? = null
|
var entry: Track? = null
|
||||||
private set
|
private set
|
||||||
|
var songLayout: LinearLayout = view.findViewById(R.id.song_layout)
|
||||||
var check: CheckedTextView = view.findViewById(R.id.song_check)
|
var check: CheckedTextView = view.findViewById(R.id.song_check)
|
||||||
var drag: ImageView = view.findViewById(R.id.song_drag)
|
var drag: ImageView = view.findViewById(R.id.song_drag)
|
||||||
var observableChecked = MutableLiveData(false)
|
var observableChecked = MutableLiveData(false)
|
||||||
@ -164,17 +166,22 @@ class TrackViewHolder(val view: View) :
|
|||||||
ContextCompat.getDrawable(view.context, R.drawable.ic_stat_play)!!
|
ContextCompat.getDrawable(view.context, R.drawable.ic_stat_play)!!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("MagicNumber")
|
||||||
private fun setPlayIcon(isPlaying: Boolean) {
|
private fun setPlayIcon(isPlaying: Boolean) {
|
||||||
if (isPlaying && !isPlayingCached) {
|
if (isPlaying && !isPlayingCached) {
|
||||||
isPlayingCached = true
|
isPlayingCached = true
|
||||||
title.setCompoundDrawablesWithIntrinsicBounds(
|
title.setCompoundDrawablesWithIntrinsicBounds(
|
||||||
playingIcon, null, null, null
|
playingIcon, null, null, null
|
||||||
)
|
)
|
||||||
|
songLayout.backgroundTintMode = PorterDuff.Mode.MULTIPLY
|
||||||
|
songLayout.elevation = 3F
|
||||||
} else if (!isPlaying && isPlayingCached) {
|
} else if (!isPlaying && isPlayingCached) {
|
||||||
isPlayingCached = false
|
isPlayingCached = false
|
||||||
title.setCompoundDrawablesWithIntrinsicBounds(
|
title.setCompoundDrawablesWithIntrinsicBounds(
|
||||||
0, 0, 0, 0
|
0, 0, 0, 0
|
||||||
)
|
)
|
||||||
|
songLayout.backgroundTintMode = PorterDuff.Mode.ADD
|
||||||
|
songLayout.elevation = 0F
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,6 @@ import androidx.recyclerview.widget.ItemTouchHelper
|
|||||||
import androidx.recyclerview.widget.ItemTouchHelper.ACTION_STATE_DRAG
|
import androidx.recyclerview.widget.ItemTouchHelper.ACTION_STATE_DRAG
|
||||||
import androidx.recyclerview.widget.ItemTouchHelper.ACTION_STATE_IDLE
|
import androidx.recyclerview.widget.ItemTouchHelper.ACTION_STATE_IDLE
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.LinearSmoothScroller
|
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.google.android.material.button.MaterialButton
|
import com.google.android.material.button.MaterialButton
|
||||||
import com.google.android.material.progressindicator.CircularProgressIndicator
|
import com.google.android.material.progressindicator.CircularProgressIndicator
|
||||||
@ -481,9 +480,7 @@ class PlayerFragment :
|
|||||||
val index = mediaPlayerManager.currentMediaItemIndex
|
val index = mediaPlayerManager.currentMediaItemIndex
|
||||||
|
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
val smoothScroller = LinearSmoothScroller(context)
|
viewManager.scrollToPosition(index)
|
||||||
smoothScroller.targetPosition = index
|
|
||||||
viewManager.startSmoothScroll(smoothScroller)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,9 @@
|
|||||||
a:id="@+id/song_layout"
|
a:id="@+id/song_layout"
|
||||||
a:layout_width="fill_parent"
|
a:layout_width="fill_parent"
|
||||||
a:layout_height="?android:attr/listPreferredItemHeight"
|
a:layout_height="?android:attr/listPreferredItemHeight"
|
||||||
|
a:background="?attr/colorSurface"
|
||||||
|
a:backgroundTint="?attr/colorPrimaryContainer"
|
||||||
|
a:backgroundTintMode="add"
|
||||||
a:minHeight="?android:attr/listPreferredItemHeight"
|
a:minHeight="?android:attr/listPreferredItemHeight"
|
||||||
a:orientation="horizontal">
|
a:orientation="horizontal">
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user