mirror of
https://github.com/cmclark00/RetroMusicPlayer.git
synced 2025-05-19 16:45:20 +01:00
Combine home section in single Recycler View
This commit is contained in:
parent
9ea7735261
commit
36a58d5869
39 changed files with 686 additions and 76 deletions
|
@ -250,13 +250,13 @@ class LyricsActivity : AbsMusicServiceActivity(), View.OnClickListener, ViewPage
|
|||
|
||||
override fun onPostExecute(l: Lyrics?) {
|
||||
lyrics = l
|
||||
offlineLyrics.visibility = View.VISIBLE
|
||||
offlineLyrics?.visibility = View.VISIBLE
|
||||
if (l == null) {
|
||||
offlineLyrics.setText(R.string.no_lyrics_found)
|
||||
offlineLyrics?.setText(R.string.no_lyrics_found)
|
||||
return
|
||||
}
|
||||
(activity as LyricsActivity).lyricsString = l.data
|
||||
offlineLyrics.text = l.data
|
||||
offlineLyrics?.text = l.data
|
||||
}
|
||||
|
||||
override fun onCancelled(s: Lyrics?) {
|
||||
|
|
|
@ -0,0 +1,177 @@
|
|||
package code.name.monkey.retromusic.ui.adapter
|
||||
|
||||
import android.util.DisplayMetrics
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.IntDef
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||
import code.name.monkey.appthemehelper.util.TintHelper
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.glide.GlideApp
|
||||
import code.name.monkey.retromusic.glide.RetroGlideExtension
|
||||
import code.name.monkey.retromusic.glide.RetroMusicColoredTarget
|
||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||
import code.name.monkey.retromusic.model.*
|
||||
import code.name.monkey.retromusic.ui.adapter.album.AlbumFullWidthAdapter
|
||||
import code.name.monkey.retromusic.ui.adapter.artist.ArtistAdapter
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||
import code.name.monkey.retromusic.views.MetalRecyclerViewPager
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
|
||||
|
||||
class HomeAdapter(private val activity: AppCompatActivity, private val homes: ArrayList<Home>, private val displayMetrics: DisplayMetrics) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||
|
||||
|
||||
override fun getItemViewType(position: Int): Int {
|
||||
return homes[position].homeSection
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
|
||||
val layout = LayoutInflater.from(activity).inflate(R.layout.section_recycler_view, parent, false)
|
||||
return when (viewType) {
|
||||
SUGGESTIONS -> SuggestionViewHolder(LayoutInflater.from(activity).inflate(R.layout.section_item_collage, parent, false))
|
||||
RECENT_ARTISTS, TOP_ARTISTS -> ArtistViewHolder(layout)
|
||||
GENRES -> GenreViewHolder(layout)
|
||||
else -> {
|
||||
AlbumViewHolder(LayoutInflater.from(activity).inflate(R.layout.metal_section_recycler_view, parent, false))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||
val home = homes[position]
|
||||
when (getItemViewType(position)) {
|
||||
SUGGESTIONS -> {
|
||||
val viewHolder = holder as SuggestionViewHolder
|
||||
viewHolder.bindView(home)
|
||||
}
|
||||
RECENT_ALBUMS, TOP_ALBUMS -> {
|
||||
val viewHolder = holder as AlbumViewHolder
|
||||
viewHolder.bindView(home)
|
||||
}
|
||||
RECENT_ARTISTS, TOP_ARTISTS -> {
|
||||
val viewHolder = holder as ArtistViewHolder
|
||||
viewHolder.bindView(home)
|
||||
}
|
||||
GENRES -> {
|
||||
val viewHolder = holder as GenreViewHolder
|
||||
viewHolder.bindView(home)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return homes.size
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@IntDef(SUGGESTIONS, RECENT_ALBUMS, TOP_ALBUMS, RECENT_ARTISTS, TOP_ARTISTS, GENRES, PLAYLISTS)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
annotation class HomeSection
|
||||
|
||||
const val SUGGESTIONS = 0
|
||||
const val RECENT_ALBUMS = 1
|
||||
const val TOP_ALBUMS = 2
|
||||
const val RECENT_ARTISTS = 3
|
||||
const val TOP_ARTISTS = 4
|
||||
const val GENRES = 5
|
||||
const val PLAYLISTS = 6
|
||||
|
||||
}
|
||||
|
||||
private inner class SuggestionViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
private val ids: ArrayList<Int> = arrayListOf(R.id.image_1, R.id.image_2, R.id.image_3, R.id.image_4, R.id.image_5, R.id.image_6, R.id.image_7)
|
||||
private var textView: TextView = itemView.findViewById(R.id.text)
|
||||
private var playSuggestion: FloatingActionButton = itemView.findViewById(R.id.playSuggestions)
|
||||
private var title: TextView = itemView.findViewById(R.id.sectionTitle)
|
||||
|
||||
fun bindView(home: Home) {
|
||||
val dataSet = home.arrayList as ArrayList<Song>
|
||||
for (id in 0 until ids.size) {
|
||||
val imageView = itemView.findViewById<ImageView>(ids[id])
|
||||
imageView.setOnClickListener {
|
||||
MusicPlayerRemote.enqueue(dataSet[id])
|
||||
}
|
||||
GlideApp.with(activity)
|
||||
.asBitmapPalette()
|
||||
.load(RetroGlideExtension.getSongModel(dataSet[id]))
|
||||
.transition(RetroGlideExtension.getDefaultTransition())
|
||||
.songOptions(dataSet[id])
|
||||
.into(object : RetroMusicColoredTarget(imageView) {
|
||||
override fun onColorReady(color: Int) {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
val color = ThemeStore.accentColor(activity)
|
||||
|
||||
textView.apply {
|
||||
setBackgroundColor(color);
|
||||
setTextColor(MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(color)))
|
||||
}
|
||||
title.text = activity.getString(home.title)
|
||||
|
||||
playSuggestion.apply {
|
||||
TintHelper.setTintAuto(this, MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(color)), false)
|
||||
TintHelper.setTintAuto(this, color, true)
|
||||
setOnClickListener { MusicPlayerRemote.openQueue(home.arrayList as ArrayList<Song>, 0, true) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private inner class AlbumViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
fun bindView(home: Home) {
|
||||
recyclerView.apply {
|
||||
adapter = AlbumFullWidthAdapter(activity, home.arrayList as ArrayList<Album>, displayMetrics)
|
||||
}
|
||||
title.text = activity.getString(home.title)
|
||||
}
|
||||
|
||||
val recyclerView: MetalRecyclerViewPager = view.findViewById(R.id.recyclerView)
|
||||
val title: TextView = view.findViewById(R.id.sectionTitle)
|
||||
|
||||
}
|
||||
|
||||
private inner class ArtistViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
fun bindView(home: Home) {
|
||||
recyclerView.apply {
|
||||
layoutManager = GridLayoutManager(activity, 1, GridLayoutManager.HORIZONTAL, false)
|
||||
val artistAdapter = ArtistAdapter(activity, home.arrayList as ArrayList<Artist>, PreferenceUtil.getInstance().getHomeGridStyle(context!!), false, null)
|
||||
adapter = artistAdapter
|
||||
}
|
||||
title.text = activity.getString(home.title)
|
||||
}
|
||||
|
||||
val recyclerView: RecyclerView = view.findViewById(R.id.recyclerView)
|
||||
val title: TextView = view.findViewById(R.id.sectionTitle)
|
||||
|
||||
}
|
||||
|
||||
private inner class GenreViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
fun bindView(home: Home) {
|
||||
recyclerView.apply {
|
||||
val genreAdapter = GenreAdapter(activity, home.arrayList as ArrayList<Genre>, R.layout.item_list)
|
||||
layoutManager = LinearLayoutManager(context)
|
||||
adapter = genreAdapter
|
||||
|
||||
}
|
||||
title.text = activity.getString(home.title)
|
||||
}
|
||||
|
||||
val recyclerView: RecyclerView = view.findViewById(R.id.recyclerView)
|
||||
val title: TextView = view.findViewById(R.id.sectionTitle)
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package code.name.monkey.retromusic.ui.adapter
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.recyclerview.widget.StaggeredGridLayoutManager
|
||||
import code.name.monkey.retromusic.interfaces.CabHolder
|
||||
import code.name.monkey.retromusic.model.Song
|
||||
import code.name.monkey.retromusic.ui.adapter.song.SongAdapter
|
||||
import java.util.*
|
||||
|
||||
class SpanSongsAdapter(activity: AppCompatActivity, dataSet: ArrayList<Song>, itemLayoutRes: Int, usePalette: Boolean, cabHolder: CabHolder?) : SongAdapter(activity, dataSet, itemLayoutRes, usePalette, cabHolder) {
|
||||
|
||||
override fun onBindViewHolder(holder: SongAdapter.ViewHolder, position: Int) {
|
||||
super.onBindViewHolder(holder, position)
|
||||
if (position == 0) {
|
||||
val params = StaggeredGridLayoutManager.LayoutParams(StaggeredGridLayoutManager.LayoutParams.WRAP_CONTENT, StaggeredGridLayoutManager.LayoutParams.MATCH_PARENT)
|
||||
params.isFullSpan = true
|
||||
holder.itemView.layoutParams = params
|
||||
}
|
||||
}
|
||||
}
|
|
@ -20,7 +20,6 @@ import android.util.DisplayMetrics
|
|||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import androidx.core.util.Pair
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.glide.GlideApp
|
||||
|
@ -30,21 +29,12 @@ import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
|||
import code.name.monkey.retromusic.model.Album
|
||||
import code.name.monkey.retromusic.util.NavigationUtil
|
||||
import code.name.monkey.retromusic.views.MetalRecyclerViewPager
|
||||
import java.util.*
|
||||
|
||||
class AlbumFullWithAdapter(private val activity: Activity,
|
||||
metrics: DisplayMetrics) : MetalRecyclerViewPager.MetalAdapter<AlbumFullWithAdapter.FullMetalViewHolder>(metrics) {
|
||||
private var dataSet: List<Album> = ArrayList()
|
||||
|
||||
fun swapData(list: ArrayList<Album>) {
|
||||
dataSet = list
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
class AlbumFullWidthAdapter(private val activity: Activity, private val dataSet: ArrayList<Album>, metrics: DisplayMetrics) :
|
||||
MetalRecyclerViewPager.MetalAdapter<AlbumFullWidthAdapter.FullMetalViewHolder>(metrics) {
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): FullMetalViewHolder {
|
||||
val viewItem = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.pager_item, parent, false)
|
||||
return FullMetalViewHolder(viewItem)
|
||||
return FullMetalViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.pager_item, parent, false))
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: FullMetalViewHolder, position: Int) {
|
||||
|
@ -97,7 +87,7 @@ class AlbumFullWithAdapter(private val activity: Activity,
|
|||
inner class FullMetalViewHolder(itemView: View) : MetalRecyclerViewPager.MetalViewHolder(itemView) {
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
val albumPairs = arrayOf<Pair<*, *>>(Pair.create<ImageView, String>(image, activity.resources.getString(R.string.transition_album_art)))
|
||||
val albumPairs = arrayOf<Pair<*, *>>(Pair.create(image, activity.resources.getString(R.string.transition_album_art)))
|
||||
NavigationUtil.goToAlbum(activity, dataSet[adapterPosition].id, *albumPairs)
|
||||
}
|
||||
}
|
|
@ -11,6 +11,7 @@ import android.view.View
|
|||
import android.view.ViewGroup
|
||||
import android.widget.SeekBar
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.transition.TransitionManager
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||
|
@ -57,6 +58,7 @@ class VolumeFragment : Fragment(), SeekBar.OnSeekBarChangeListener, OnAudioVolum
|
|||
if (volumeSeekBar == null) {
|
||||
return
|
||||
}
|
||||
|
||||
volumeSeekBar.max = maxVolume
|
||||
volumeSeekBar.progress = currentVolume
|
||||
volumeDown.setImageResource(if (currentVolume == 0) R.drawable.ic_volume_off_white_24dp else R.drawable.ic_volume_down_white_24dp)
|
||||
|
|
|
@ -10,7 +10,6 @@ import android.view.ViewGroup
|
|||
import android.widget.ImageView
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.util.TintHelper
|
||||
|
@ -21,31 +20,33 @@ import code.name.monkey.retromusic.glide.GlideApp
|
|||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||
import code.name.monkey.retromusic.interfaces.MainActivityFragmentCallbacks
|
||||
import code.name.monkey.retromusic.loaders.SongLoader
|
||||
import code.name.monkey.retromusic.model.*
|
||||
import code.name.monkey.retromusic.model.Home
|
||||
import code.name.monkey.retromusic.model.smartplaylist.HistoryPlaylist
|
||||
import code.name.monkey.retromusic.model.smartplaylist.LastAddedPlaylist
|
||||
import code.name.monkey.retromusic.model.smartplaylist.MyTopTracksPlaylist
|
||||
import code.name.monkey.retromusic.mvp.contract.HomeContract
|
||||
import code.name.monkey.retromusic.mvp.presenter.HomePresenter
|
||||
import code.name.monkey.retromusic.ui.adapter.CollageSongAdapter
|
||||
import code.name.monkey.retromusic.ui.adapter.GenreAdapter
|
||||
import code.name.monkey.retromusic.ui.adapter.album.AlbumFullWithAdapter
|
||||
import code.name.monkey.retromusic.ui.adapter.artist.ArtistAdapter
|
||||
import code.name.monkey.retromusic.ui.adapter.HomeAdapter
|
||||
import code.name.monkey.retromusic.ui.fragments.base.AbsMainActivityFragment
|
||||
import code.name.monkey.retromusic.util.Compressor
|
||||
import code.name.monkey.retromusic.util.NavigationUtil
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||
import code.name.monkey.retromusic.util.RetroUtil
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.CompositeDisposable
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import kotlinx.android.synthetic.main.fragment_banner_home.*
|
||||
import kotlinx.android.synthetic.main.home_section_content.*
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
|
||||
class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallbacks, HomeContract.HomeView {
|
||||
override fun loadHomes(homes: ArrayList<Home>) {
|
||||
recyclerView.apply {
|
||||
val homeAdapter = HomeAdapter(mainActivity, homes, displayMetrics)
|
||||
layoutManager = LinearLayoutManager(mainActivity)
|
||||
adapter = homeAdapter
|
||||
}
|
||||
}
|
||||
|
||||
val disposable: CompositeDisposable = CompositeDisposable()
|
||||
private lateinit var homePresenter: HomePresenter
|
||||
|
@ -208,19 +209,18 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
|
|||
//homeAdapter.swapDataSet(homes);
|
||||
}
|
||||
|
||||
override fun recentArtist(artists: ArrayList<Artist>) {
|
||||
recentArtistContainer.visibility = View.VISIBLE
|
||||
recentArtist.apply {
|
||||
val artistAdapter = ArtistAdapter(mainActivity, artists, PreferenceUtil.getInstance().getHomeGridStyle(context!!), false, null)
|
||||
layoutManager = GridLayoutManager(mainActivity, 1, GridLayoutManager.HORIZONTAL, false)
|
||||
adapter = artistAdapter
|
||||
}
|
||||
/*override fun recentArtist(artists: ArrayList<Artist>) {
|
||||
*//* recentArtistContainer.visibility = View.VISIBLE
|
||||
recentArtist.apply {
|
||||
val artistAdapter = ArtistAdapter(mainActivity, artists, PreferenceUtil.getInstance().getHomeGridStyle(context!!), false, null)
|
||||
layoutManager = GridLayoutManager(mainActivity, 1, GridLayoutManager.HORIZONTAL, false)
|
||||
adapter = artistAdapter
|
||||
}*//*
|
||||
}
|
||||
|
||||
override fun recentAlbum(albums: ArrayList<Album>) {
|
||||
recentAlbumsContainer.visibility = View.VISIBLE
|
||||
val artistAdapter = AlbumFullWithAdapter(mainActivity, displayMetrics)
|
||||
artistAdapter.swapData(albums)
|
||||
val artistAdapter = AlbumFullWidthAdapter(mainActivity, albums, displayMetrics)
|
||||
recentAlbum.adapter = artistAdapter
|
||||
}
|
||||
|
||||
|
@ -236,17 +236,27 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
|
|||
|
||||
override fun topAlbums(albums: ArrayList<Album>) {
|
||||
topAlbumsContainer.visibility = View.VISIBLE
|
||||
val artistAdapter = AlbumFullWithAdapter(mainActivity, displayMetrics)
|
||||
artistAdapter.swapData(albums)
|
||||
val artistAdapter = AlbumFullWidthAdapter(mainActivity, albums, displayMetrics)
|
||||
topAlbum.adapter = artistAdapter
|
||||
}
|
||||
|
||||
override fun suggestions(songs: ArrayList<Song>) {
|
||||
if (!songs.isEmpty()) {
|
||||
suggestionContainer.visibility = View.VISIBLE
|
||||
val artistAdapter = CollageSongAdapter(mainActivity, songs)
|
||||
val artistAdapter = SpanSongsAdapter(mainActivity, songs, R.layout.image, false, null)
|
||||
val manager = GridLayoutManager(mainActivity, 2, GridLayoutManager.HORIZONTAL, false)
|
||||
manager.spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() {
|
||||
override fun getSpanSize(position: Int): Int {
|
||||
return when (position) {
|
||||
0 -> 2
|
||||
else -> {
|
||||
1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
suggestionSongs.apply {
|
||||
layoutManager = if (RetroUtil.isTablet()) GridLayoutManager(mainActivity, 2) else LinearLayoutManager(mainActivity)
|
||||
layoutManager = if (RetroUtil.isTablet()) GridLayoutManager(mainActivity, 2) else manager
|
||||
adapter = artistAdapter
|
||||
}
|
||||
}
|
||||
|
@ -264,7 +274,7 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
|
|||
adapter = genreAdapter
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
companion object {
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ class ColorFragment : AbsPlayerFragment() {
|
|||
private fun setColors(backgroundColor: Int, textColor: Int) {
|
||||
playbackControlsFragment!!.setDark(textColor, backgroundColor)
|
||||
|
||||
colorGradientBackground.setBackgroundColor(backgroundColor)
|
||||
colorGradientBackground?.setBackgroundColor(backgroundColor)
|
||||
|
||||
ToolbarContentTintHelper.colorizeToolbar(playerToolbar, textColor, activity)
|
||||
|
||||
|
@ -230,7 +230,7 @@ class ColorFragment : AbsPlayerFragment() {
|
|||
|
||||
valueAnimator = ValueAnimator.ofObject(ArgbEvaluator(), paletteColor, i)
|
||||
valueAnimator!!.addUpdateListener { animation ->
|
||||
colorGradientBackground.setBackgroundColor(animation.animatedValue as Int)
|
||||
colorGradientBackground?.setBackgroundColor(animation.animatedValue as Int)
|
||||
}
|
||||
valueAnimator!!.setDuration(ViewUtil.RETRO_MUSIC_ANIM_TIME.toLong()).start()
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ class FlatPlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbac
|
|||
valueAnimator!!.addUpdateListener { animation ->
|
||||
val drawable = DrawableGradient(GradientDrawable.Orientation.TOP_BOTTOM,
|
||||
intArrayOf(animation.animatedValue as Int, android.R.color.transparent), 0)
|
||||
colorGradientBackground!!.background = drawable
|
||||
colorGradientBackground?.background = drawable
|
||||
|
||||
}
|
||||
valueAnimator!!.setDuration(ViewUtil.RETRO_MUSIC_ANIM_TIME.toLong()).start()
|
||||
|
|
|
@ -38,7 +38,7 @@ class PlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbacks {
|
|||
valueAnimator = ValueAnimator.ofObject(ArgbEvaluator(), android.R.color.transparent, i)
|
||||
valueAnimator!!.addUpdateListener { animation ->
|
||||
val drawable = DrawableGradient(GradientDrawable.Orientation.TOP_BOTTOM, intArrayOf(animation.animatedValue as Int, android.R.color.transparent), 0)
|
||||
colorGradientBackground!!.background = drawable
|
||||
colorGradientBackground?.background = drawable
|
||||
}
|
||||
valueAnimator!!.setDuration(ViewUtil.RETRO_MUSIC_ANIM_TIME.toLong()).start()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue