Fixing animations
This commit is contained in:
parent
5a51d0bfc0
commit
44baab2109
25 changed files with 476 additions and 386 deletions
File diff suppressed because one or more lines are too long
|
@ -3,6 +3,7 @@ package code.name.monkey.retromusic.activities
|
|||
import android.app.ActivityOptions
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.transition.Slide
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import android.view.SubMenu
|
||||
|
@ -42,6 +43,7 @@ import code.name.monkey.retromusic.util.PreferenceUtil
|
|||
import code.name.monkey.retromusic.util.RetroColorUtil
|
||||
import com.afollestad.materialcab.MaterialCab
|
||||
import com.bumptech.glide.Glide
|
||||
import kotlinx.android.synthetic.main.activity_album.albumCoverContainer
|
||||
import kotlinx.android.synthetic.main.activity_album.albumText
|
||||
import kotlinx.android.synthetic.main.activity_album.albumTitle
|
||||
import kotlinx.android.synthetic.main.activity_album.image
|
||||
|
@ -90,6 +92,16 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsView, C
|
|||
@Inject
|
||||
lateinit var albumDetailsPresenter: AlbumDetailsPresenter
|
||||
|
||||
private fun windowEnterTransition() {
|
||||
val slide = Slide()
|
||||
slide.excludeTarget(R.id.appBarLayout, true)
|
||||
slide.excludeTarget(R.id.status_bar, true)
|
||||
slide.excludeTarget(android.R.id.statusBarBackground, true)
|
||||
slide.excludeTarget(android.R.id.navigationBarBackground, true)
|
||||
|
||||
window.enterTransition = slide
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
setDrawUnderStatusBar()
|
||||
super.onCreate(savedInstanceState)
|
||||
|
@ -98,10 +110,24 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsView, C
|
|||
setNavigationbarColorAuto()
|
||||
setTaskDescriptionColorAuto()
|
||||
setLightNavigationBar(true)
|
||||
|
||||
ActivityCompat.postponeEnterTransition(this)
|
||||
window.sharedElementsUseOverlay = true
|
||||
|
||||
App.musicComponent.inject(this)
|
||||
albumDetailsPresenter.attachView(this)
|
||||
|
||||
if (intent.extras!!.containsKey(EXTRA_ALBUM_ID)) {
|
||||
intent.extras?.getInt(EXTRA_ALBUM_ID)?.let {
|
||||
albumDetailsPresenter.loadAlbum(it)
|
||||
albumCoverContainer?.transitionName = "${getString(R.string.transition_album_art)}_$it"
|
||||
}
|
||||
} else {
|
||||
finish()
|
||||
}
|
||||
|
||||
windowEnterTransition()
|
||||
ActivityCompat.postponeEnterTransition(this)
|
||||
|
||||
|
||||
artistImage = findViewById(R.id.artistImage)
|
||||
|
||||
setupRecyclerView()
|
||||
|
@ -109,7 +135,10 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsView, C
|
|||
artistImage.setOnClickListener {
|
||||
val artistPairs = ActivityOptions.makeSceneTransitionAnimation(
|
||||
this,
|
||||
UtilPair.create(artistImage, getString(R.string.transition_artist_image))
|
||||
UtilPair.create(
|
||||
artistImage,
|
||||
"${getString(R.string.transition_artist_image)}_${album.artistId}"
|
||||
)
|
||||
)
|
||||
NavigationUtil.goToArtistOptions(this, album.artistId, artistPairs)
|
||||
}
|
||||
|
@ -119,15 +148,6 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsView, C
|
|||
shuffleAction.apply {
|
||||
setOnClickListener { MusicPlayerRemote.openAndShuffleQueue(album.songs!!, true) }
|
||||
}
|
||||
|
||||
|
||||
albumDetailsPresenter.attachView(this)
|
||||
|
||||
if (intent.extras!!.containsKey(EXTRA_ALBUM_ID)) {
|
||||
intent.extras?.getInt(EXTRA_ALBUM_ID)?.let { albumDetailsPresenter.loadAlbum(it) }
|
||||
} else {
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupRecyclerView() {
|
||||
|
@ -150,7 +170,7 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsView, C
|
|||
}
|
||||
|
||||
override fun album(album: Album) {
|
||||
|
||||
complete()
|
||||
if (album.songs!!.isEmpty()) {
|
||||
finish()
|
||||
return
|
||||
|
|
|
@ -6,6 +6,7 @@ import android.os.Build
|
|||
import android.os.Bundle
|
||||
import android.text.Html
|
||||
import android.text.Spanned
|
||||
import android.transition.Slide
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
|
@ -49,8 +50,9 @@ import kotlinx.android.synthetic.main.activity_artist_content.playAction
|
|||
import kotlinx.android.synthetic.main.activity_artist_content.recyclerView
|
||||
import kotlinx.android.synthetic.main.activity_artist_content.shuffleAction
|
||||
import kotlinx.android.synthetic.main.activity_artist_content.songTitle
|
||||
import kotlinx.android.synthetic.main.activity_artist_details.artistImage
|
||||
import kotlinx.android.synthetic.main.activity_artist_details.artistCoverContainer
|
||||
import kotlinx.android.synthetic.main.activity_artist_details.artistTitle
|
||||
import kotlinx.android.synthetic.main.activity_artist_details.image
|
||||
import kotlinx.android.synthetic.main.activity_artist_details.imageContainer
|
||||
import kotlinx.android.synthetic.main.activity_artist_details.text
|
||||
import kotlinx.android.synthetic.main.activity_artist_details.toolbar
|
||||
|
@ -91,6 +93,16 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailsView,
|
|||
@Inject
|
||||
lateinit var artistDetailsPresenter: ArtistDetailsPresenter
|
||||
|
||||
private fun windowEnterTransition() {
|
||||
val slide = Slide()
|
||||
slide.excludeTarget(R.id.appBarLayout, true)
|
||||
slide.excludeTarget(R.id.status_bar, true)
|
||||
slide.excludeTarget(android.R.id.statusBarBackground, true)
|
||||
slide.excludeTarget(android.R.id.navigationBarBackground, true)
|
||||
|
||||
window.enterTransition = slide
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
setDrawUnderStatusBar()
|
||||
super.onCreate(savedInstanceState)
|
||||
|
@ -99,7 +111,21 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailsView,
|
|||
setNavigationbarColorAuto()
|
||||
setTaskDescriptionColorAuto()
|
||||
setLightNavigationBar(true)
|
||||
window.sharedElementsUseOverlay = true
|
||||
|
||||
App.musicComponent.inject(this)
|
||||
artistDetailsPresenter.attachView(this)
|
||||
|
||||
if (intent.extras!!.containsKey(EXTRA_ARTIST_ID)) {
|
||||
intent.extras?.getInt(EXTRA_ARTIST_ID)?.let {
|
||||
artistDetailsPresenter.loadArtist(it)
|
||||
artistCoverContainer?.transitionName = "${getString(R.string.transition_artist_image)}_$it"
|
||||
}
|
||||
} else {
|
||||
finish()
|
||||
}
|
||||
|
||||
windowEnterTransition()
|
||||
ActivityCompat.postponeEnterTransition(this)
|
||||
|
||||
setUpViews()
|
||||
|
@ -118,15 +144,6 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailsView,
|
|||
biographyText.maxLines = 4
|
||||
}
|
||||
}
|
||||
|
||||
App.musicComponent.inject(this)
|
||||
artistDetailsPresenter.attachView(this)
|
||||
|
||||
if (intent.extras!!.containsKey(EXTRA_ARTIST_ID)) {
|
||||
intent.extras?.getInt(EXTRA_ARTIST_ID)?.let { artistDetailsPresenter.loadArtist(it) }
|
||||
} else {
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
|
@ -184,6 +201,7 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailsView,
|
|||
}
|
||||
|
||||
override fun artist(artist: Artist) {
|
||||
complete()
|
||||
if (artist.songCount <= 0) {
|
||||
finish()
|
||||
}
|
||||
|
@ -238,7 +256,7 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailsView,
|
|||
|
||||
private fun loadArtistImage() {
|
||||
ArtistGlideRequest.Builder.from(Glide.with(this), artist).generatePalette(this).build()
|
||||
.dontAnimate().into(object : RetroMusicColoredTarget(artistImage) {
|
||||
.dontAnimate().into(object : RetroMusicColoredTarget(image) {
|
||||
override fun onColorReady(color: Int) {
|
||||
setColors(color)
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ open class AlbumAdapter(
|
|||
cabHolder,
|
||||
R.menu.menu_media_selection
|
||||
), FastScrollRecyclerView.SectionedAdapter {
|
||||
|
||||
var dataSet: ArrayList<Album>
|
||||
protected set
|
||||
|
||||
|
@ -87,14 +88,32 @@ open class AlbumAdapter(
|
|||
holder.itemView.isActivated = isChecked
|
||||
holder.title?.text = getAlbumTitle(album)
|
||||
holder.text?.text = getAlbumText(album)
|
||||
holder.playSongs?.setOnClickListener { album.songs?.let { songs -> MusicPlayerRemote.openQueue(songs, 0, true) } }
|
||||
holder.playSongs?.setOnClickListener {
|
||||
album.songs?.let { songs ->
|
||||
MusicPlayerRemote.openQueue(
|
||||
songs,
|
||||
0,
|
||||
true
|
||||
)
|
||||
}
|
||||
}
|
||||
loadAlbumCover(album, holder)
|
||||
}
|
||||
|
||||
protected open fun setColors(color: Int, holder: ViewHolder) {
|
||||
if (holder.paletteColorContainer != null) {
|
||||
holder.title?.setTextColor(MaterialValueHelper.getPrimaryTextColor(activity, ColorUtil.isColorLight(color)))
|
||||
holder.text?.setTextColor(MaterialValueHelper.getSecondaryTextColor(activity, ColorUtil.isColorLight(color)))
|
||||
holder.title?.setTextColor(
|
||||
MaterialValueHelper.getPrimaryTextColor(
|
||||
activity,
|
||||
ColorUtil.isColorLight(color)
|
||||
)
|
||||
)
|
||||
holder.text?.setTextColor(
|
||||
MaterialValueHelper.getSecondaryTextColor(
|
||||
activity,
|
||||
ColorUtil.isColorLight(color)
|
||||
)
|
||||
)
|
||||
holder.paletteColorContainer?.setBackgroundColor(color)
|
||||
}
|
||||
holder.mask?.backgroundTintList = ColorStateList.valueOf(color)
|
||||
|
@ -152,7 +171,8 @@ open class AlbumAdapter(
|
|||
override fun getSectionName(position: Int): String {
|
||||
var sectionName: String? = null
|
||||
when (PreferenceUtil.getInstance(activity).albumSortOrder) {
|
||||
SortOrder.AlbumSortOrder.ALBUM_A_Z, SortOrder.AlbumSortOrder.ALBUM_Z_A -> sectionName = dataSet[position].title
|
||||
SortOrder.AlbumSortOrder.ALBUM_A_Z, SortOrder.AlbumSortOrder.ALBUM_Z_A -> sectionName =
|
||||
dataSet[position].title
|
||||
SortOrder.AlbumSortOrder.ALBUM_ARTIST -> sectionName = dataSet[position].artistName
|
||||
SortOrder.AlbumSortOrder.ALBUM_YEAR -> return MusicUtil.getYearString(
|
||||
dataSet[position].year
|
||||
|
@ -175,13 +195,11 @@ open class AlbumAdapter(
|
|||
toggleChecked(adapterPosition)
|
||||
} else {
|
||||
val activityOptions = ActivityOptions.makeSceneTransitionAnimation(
|
||||
activity, image, activity.getString(
|
||||
R.string.transition_album_art
|
||||
)
|
||||
)
|
||||
NavigationUtil.goToAlbumOptions(
|
||||
activity, dataSet[adapterPosition].id, activityOptions
|
||||
activity,
|
||||
imageContainerCard ?: image,
|
||||
"${activity.getString(R.string.transition_album_art)}_${dataSet[adapterPosition].id}"
|
||||
)
|
||||
NavigationUtil.goToAlbumOptions(activity, dataSet[adapterPosition].id, activityOptions)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ import code.name.monkey.retromusic.model.Song
|
|||
import code.name.monkey.retromusic.util.NavigationUtil
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||
import com.bumptech.glide.Glide
|
||||
import java.util.*
|
||||
import java.util.ArrayList
|
||||
|
||||
class AlbumCoverPagerAdapter(
|
||||
fm: FragmentManager,
|
||||
|
|
|
@ -46,7 +46,15 @@ class AlbumFullWidthAdapter(
|
|||
val album = dataSet[position]
|
||||
holder.title?.text = getAlbumTitle(album)
|
||||
holder.text?.text = getAlbumText(album)
|
||||
holder.playSongs?.setOnClickListener { album.songs?.let { songs -> MusicPlayerRemote.openQueue(songs, 0, true) } }
|
||||
holder.playSongs?.setOnClickListener {
|
||||
album.songs?.let { songs ->
|
||||
MusicPlayerRemote.openQueue(
|
||||
songs,
|
||||
0,
|
||||
true
|
||||
)
|
||||
}
|
||||
}
|
||||
loadAlbumCover(album, holder)
|
||||
}
|
||||
|
||||
|
@ -68,7 +76,6 @@ class AlbumFullWidthAdapter(
|
|||
.build()
|
||||
.into(object : RetroMusicColoredTarget(holder.image!!) {
|
||||
override fun onColorReady(color: Int) {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -80,7 +87,11 @@ class AlbumFullWidthAdapter(
|
|||
inner class FullMetalViewHolder(itemView: View) : MetalRecyclerViewPager.MetalViewHolder(itemView) {
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
val activityOptions = ActivityOptions.makeSceneTransitionAnimation(activity, image, activity.getString(R.string.transition_album_art))
|
||||
val activityOptions = ActivityOptions.makeSceneTransitionAnimation(
|
||||
activity,
|
||||
imageContainerCard ?: image,
|
||||
"${activity.getString(R.string.transition_album_art)}_${dataSet[adapterPosition].id}"
|
||||
)
|
||||
NavigationUtil.goToAlbumOptions(activity, dataSet[adapterPosition].id, activityOptions)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,19 +3,27 @@ package code.name.monkey.retromusic.adapter.artist
|
|||
import android.app.ActivityOptions
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.view.*
|
||||
import android.view.LayoutInflater
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import code.name.monkey.appthemehelper.util.*
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.adapter.base.*
|
||||
import code.name.monkey.retromusic.glide.*
|
||||
import code.name.monkey.retromusic.adapter.base.AbsMultiSelectAdapter
|
||||
import code.name.monkey.retromusic.adapter.base.MediaEntryViewHolder
|
||||
import code.name.monkey.retromusic.glide.ArtistGlideRequest
|
||||
import code.name.monkey.retromusic.glide.RetroMusicColoredTarget
|
||||
import code.name.monkey.retromusic.helper.menu.SongsMenuHelper
|
||||
import code.name.monkey.retromusic.interfaces.CabHolder
|
||||
import code.name.monkey.retromusic.model.*
|
||||
import code.name.monkey.retromusic.util.*
|
||||
import code.name.monkey.retromusic.model.Artist
|
||||
import code.name.monkey.retromusic.model.Song
|
||||
import code.name.monkey.retromusic.util.MusicUtil
|
||||
import code.name.monkey.retromusic.util.NavigationUtil
|
||||
import com.bumptech.glide.Glide
|
||||
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
|
||||
import java.util.*
|
||||
import java.util.ArrayList
|
||||
|
||||
class ArtistAdapter(
|
||||
val activity: AppCompatActivity,
|
||||
|
@ -134,9 +142,9 @@ class ArtistAdapter(
|
|||
toggleChecked(adapterPosition)
|
||||
} else {
|
||||
val activityOptions = ActivityOptions.makeSceneTransitionAnimation(
|
||||
activity, image, activity.getString(
|
||||
R.string.transition_artist_image
|
||||
)
|
||||
activity,
|
||||
imageContainerCard ?: image,
|
||||
"${activity.getString(R.string.transition_artist_image)}_${dataSet[adapterPosition].id}"
|
||||
)
|
||||
NavigationUtil.goToArtistOptions(
|
||||
activity, dataSet[adapterPosition].id, activityOptions
|
||||
|
|
|
@ -19,29 +19,25 @@ import android.view.ViewGroup;
|
|||
import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import code.name.monkey.appthemehelper.util.ATHUtil;
|
||||
import code.name.monkey.retromusic.R;
|
||||
import com.google.android.material.card.MaterialCardView;
|
||||
import com.h6ah4i.android.widget.advrecyclerview.utils.AbstractDraggableSwipeableItemViewHolder;
|
||||
|
||||
import code.name.monkey.appthemehelper.util.ATHUtil;
|
||||
import code.name.monkey.retromusic.R;
|
||||
|
||||
public class MediaEntryViewHolder extends AbstractDraggableSwipeableItemViewHolder implements View.OnLongClickListener, View.OnClickListener {
|
||||
@Nullable
|
||||
public TextView title;
|
||||
public class MediaEntryViewHolder extends AbstractDraggableSwipeableItemViewHolder
|
||||
implements View.OnLongClickListener, View.OnClickListener {
|
||||
|
||||
@Nullable
|
||||
public TextView text;
|
||||
public View dragView;
|
||||
|
||||
@Nullable
|
||||
public TextView time;
|
||||
public View dummyContainer;
|
||||
|
||||
@Nullable
|
||||
public TextView imageText;
|
||||
public ImageView image;
|
||||
|
||||
@Nullable
|
||||
public ViewGroup imageContainer;
|
||||
|
@ -50,30 +46,34 @@ public class MediaEntryViewHolder extends AbstractDraggableSwipeableItemViewHold
|
|||
public MaterialCardView imageContainerCard;
|
||||
|
||||
@Nullable
|
||||
public View menu;
|
||||
|
||||
@Nullable
|
||||
public View dragView;
|
||||
|
||||
@Nullable
|
||||
public View paletteColorContainer;
|
||||
|
||||
@Nullable
|
||||
public RecyclerView recyclerView;
|
||||
|
||||
@Nullable
|
||||
public ImageButton playSongs;
|
||||
|
||||
@Nullable
|
||||
public View mask;
|
||||
public TextView imageText;
|
||||
|
||||
@Nullable
|
||||
public MaterialCardView imageTextContainer;
|
||||
|
||||
@Nullable
|
||||
public ImageView image;
|
||||
public View mask;
|
||||
|
||||
@Nullable
|
||||
public View dummyContainer;
|
||||
public View menu;
|
||||
|
||||
@Nullable
|
||||
public View paletteColorContainer;
|
||||
|
||||
@Nullable
|
||||
public ImageButton playSongs;
|
||||
|
||||
@Nullable
|
||||
public RecyclerView recyclerView;
|
||||
|
||||
@Nullable
|
||||
public TextView text;
|
||||
|
||||
@Nullable
|
||||
public TextView time;
|
||||
|
||||
@Nullable
|
||||
public TextView title;
|
||||
|
||||
public MediaEntryViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
|
@ -97,7 +97,8 @@ public class MediaEntryViewHolder extends AbstractDraggableSwipeableItemViewHold
|
|||
dummyContainer = itemView.findViewById(R.id.dummy_view);
|
||||
|
||||
if (imageContainerCard != null) {
|
||||
imageContainerCard.setCardBackgroundColor(ATHUtil.INSTANCE.resolveColor(itemView.getContext(), R.attr.colorSurface));
|
||||
imageContainerCard.setCardBackgroundColor(
|
||||
ATHUtil.INSTANCE.resolveColor(itemView.getContext(), R.attr.colorSurface));
|
||||
}
|
||||
itemView.setOnClickListener(this);
|
||||
itemView.setOnLongClickListener(this);
|
||||
|
@ -108,17 +109,20 @@ public class MediaEntryViewHolder extends AbstractDraggableSwipeableItemViewHold
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setImageTransitionName(@NonNull String transitionName) {
|
||||
if (imageContainerCard != null) {
|
||||
imageContainerCard.setTransitionName(transitionName);
|
||||
}
|
||||
if (image != null) {
|
||||
image.setTransitionName(transitionName);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ import code.name.monkey.retromusic.interfaces.CabHolder
|
|||
import code.name.monkey.retromusic.model.Song
|
||||
import code.name.monkey.retromusic.util.NavigationUtil
|
||||
import com.google.android.material.button.MaterialButton
|
||||
import java.util.*
|
||||
import java.util.ArrayList
|
||||
|
||||
open class PlaylistSongAdapter(
|
||||
activity: AppCompatActivity,
|
||||
|
@ -60,13 +60,11 @@ open class PlaylistSongAdapter(
|
|||
override fun onSongMenuItemClick(item: MenuItem): Boolean {
|
||||
if (item.itemId == R.id.action_go_to_album) {
|
||||
val activityOptions = ActivityOptions.makeSceneTransitionAnimation(
|
||||
activity, image, activity.getString(
|
||||
R.string.transition_album_art
|
||||
)
|
||||
)
|
||||
NavigationUtil.goToAlbumOptions(
|
||||
activity, dataSet[adapterPosition - 1].albumId, activityOptions
|
||||
activity,
|
||||
imageContainerCard ?: image,
|
||||
"${activity.getString(R.string.transition_album_art)}_${song.albumId}"
|
||||
)
|
||||
NavigationUtil.goToAlbumOptions(activity, song.albumId, activityOptions)
|
||||
return true
|
||||
}
|
||||
return super.onSongMenuItemClick(item)
|
||||
|
|
|
@ -26,7 +26,7 @@ import code.name.monkey.retromusic.util.PreferenceUtil
|
|||
import com.afollestad.materialcab.MaterialCab
|
||||
import com.bumptech.glide.Glide
|
||||
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
|
||||
import java.util.*
|
||||
import java.util.ArrayList
|
||||
|
||||
/**
|
||||
* Created by hemanths on 13/08/17.
|
||||
|
@ -42,6 +42,7 @@ open class SongAdapter(
|
|||
) : AbsMultiSelectAdapter<SongAdapter.ViewHolder, Song>(
|
||||
activity, cabHolder, R.menu.menu_media_selection
|
||||
), MaterialCab.Callback, FastScrollRecyclerView.SectionedAdapter {
|
||||
|
||||
var dataSet: ArrayList<Song>
|
||||
|
||||
protected var usePalette = false
|
||||
|
@ -183,10 +184,12 @@ open class SongAdapter(
|
|||
if (image != null && image!!.visibility == View.VISIBLE) {
|
||||
when (item.itemId) {
|
||||
R.id.action_go_to_album -> {
|
||||
val options: ActivityOptions = ActivityOptions.makeSceneTransitionAnimation(
|
||||
activity, image, activity.getString(R.string.transition_album_art)
|
||||
val activityOptions = ActivityOptions.makeSceneTransitionAnimation(
|
||||
activity,
|
||||
imageContainerCard ?: image,
|
||||
"${activity.getString(R.string.transition_album_art)}_${song.albumId}"
|
||||
)
|
||||
NavigationUtil.goToAlbumOptions(activity, song.albumId, options)
|
||||
NavigationUtil.goToAlbumOptions(activity, song.albumId, activityOptions)
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,8 +7,8 @@ import androidx.recyclerview.widget.RecyclerView
|
|||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.util.RetroUtil
|
||||
|
||||
|
||||
abstract class AbsLibraryPagerRecyclerViewCustomGridSizeFragment<A : RecyclerView.Adapter<*>, LM : RecyclerView.LayoutManager> : AbsLibraryPagerRecyclerViewFragment<A, LM>() {
|
||||
abstract class AbsLibraryPagerRecyclerViewCustomGridSizeFragment<A : RecyclerView.Adapter<*>, LM : RecyclerView.LayoutManager> :
|
||||
AbsLibraryPagerRecyclerViewFragment<A, LM>() {
|
||||
|
||||
private var gridSize: Int = 0
|
||||
private var sortOrder: String? = null
|
||||
|
@ -149,6 +149,4 @@ abstract class AbsLibraryPagerRecyclerViewCustomGridSizeFragment<A : RecyclerVie
|
|||
protected abstract fun loadUsePalette(): Boolean
|
||||
|
||||
protected abstract fun setUsePalette(usePalette: Boolean)
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -13,7 +13,9 @@ import code.name.monkey.retromusic.mvp.presenter.ArtistsView
|
|||
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||
import javax.inject.Inject
|
||||
|
||||
class ArtistsFragment : AbsLibraryPagerRecyclerViewCustomGridSizeFragment<ArtistAdapter, GridLayoutManager>(), ArtistsView {
|
||||
class ArtistsFragment : AbsLibraryPagerRecyclerViewCustomGridSizeFragment<ArtistAdapter, GridLayoutManager>(),
|
||||
ArtistsView {
|
||||
|
||||
override fun artists(artists: ArrayList<Artist>) {
|
||||
adapter?.swapDataSet(artists)
|
||||
}
|
||||
|
@ -33,6 +35,7 @@ class ArtistsFragment : AbsLibraryPagerRecyclerViewCustomGridSizeFragment<Artist
|
|||
super.onViewCreated(view, savedInstanceState)
|
||||
artistsPresenter.attachView(this)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
if (adapter!!.dataSet.isEmpty()) {
|
||||
|
@ -67,7 +70,6 @@ class ArtistsFragment : AbsLibraryPagerRecyclerViewCustomGridSizeFragment<Artist
|
|||
return ArtistAdapter(libraryFragment.mainActivity, dataSet, itemLayoutRes, loadUsePalette(), libraryFragment)
|
||||
}
|
||||
|
||||
|
||||
override fun loadGridSize(): Int {
|
||||
return PreferenceUtil.getInstance(requireContext()).getArtistGridSize(activity!!)
|
||||
}
|
||||
|
@ -101,7 +103,6 @@ class ArtistsFragment : AbsLibraryPagerRecyclerViewCustomGridSizeFragment<Artist
|
|||
adapter?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
|
||||
override fun loadSortOrder(): String {
|
||||
return PreferenceUtil.getInstance(requireContext()).artistSortOrder
|
||||
}
|
||||
|
@ -110,7 +111,6 @@ class ArtistsFragment : AbsLibraryPagerRecyclerViewCustomGridSizeFragment<Artist
|
|||
PreferenceUtil.getInstance(requireContext()).artistSortOrder = sortOrder
|
||||
}
|
||||
|
||||
|
||||
override fun showEmptyView() {
|
||||
adapter?.swapDataSet(ArrayList())
|
||||
}
|
||||
|
|
|
@ -20,21 +20,19 @@ import android.view.View
|
|||
import android.widget.PopupMenu
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.activities.tageditor.AbsTagEditorActivity
|
||||
import code.name.monkey.retromusic.activities.tageditor.SongTagEditorActivity
|
||||
import code.name.monkey.retromusic.dialogs.AddToPlaylistDialog
|
||||
import code.name.monkey.retromusic.dialogs.DeleteSongsDialog
|
||||
import code.name.monkey.retromusic.dialogs.SongDetailDialog
|
||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||
import code.name.monkey.retromusic.interfaces.PaletteColorHolder
|
||||
import code.name.monkey.retromusic.model.Song
|
||||
import code.name.monkey.retromusic.activities.tageditor.AbsTagEditorActivity
|
||||
import code.name.monkey.retromusic.activities.tageditor.SongTagEditorActivity
|
||||
import code.name.monkey.retromusic.util.MusicUtil
|
||||
import code.name.monkey.retromusic.util.NavigationUtil
|
||||
import code.name.monkey.retromusic.util.RingtoneManager
|
||||
|
||||
|
||||
object SongMenuHelper {
|
||||
val MENU_RES = R.menu.menu_item_song
|
||||
|
||||
|
@ -49,7 +47,12 @@ object SongMenuHelper {
|
|||
return true
|
||||
}
|
||||
R.id.action_share -> {
|
||||
activity.startActivity(Intent.createChooser(MusicUtil.createShareSongFileIntent(song, activity), null))
|
||||
activity.startActivity(
|
||||
Intent.createChooser(
|
||||
MusicUtil.createShareSongFileIntent(song, activity),
|
||||
null
|
||||
)
|
||||
)
|
||||
return true
|
||||
}
|
||||
R.id.action_delete_from_device -> {
|
||||
|
@ -72,7 +75,10 @@ object SongMenuHelper {
|
|||
val tagEditorIntent = Intent(activity, SongTagEditorActivity::class.java)
|
||||
tagEditorIntent.putExtra(AbsTagEditorActivity.EXTRA_ID, song.id)
|
||||
if (activity is PaletteColorHolder)
|
||||
tagEditorIntent.putExtra(AbsTagEditorActivity.EXTRA_PALETTE, (activity as PaletteColorHolder).paletteColor)
|
||||
tagEditorIntent.putExtra(
|
||||
AbsTagEditorActivity.EXTRA_PALETTE,
|
||||
(activity as PaletteColorHolder).paletteColor
|
||||
)
|
||||
activity.startActivity(tagEditorIntent)
|
||||
return true
|
||||
}
|
||||
|
@ -92,7 +98,8 @@ object SongMenuHelper {
|
|||
return false
|
||||
}
|
||||
|
||||
abstract class OnClickSongMenu protected constructor(private val activity: AppCompatActivity) : View.OnClickListener, PopupMenu.OnMenuItemClickListener {
|
||||
abstract class OnClickSongMenu protected constructor(private val activity: AppCompatActivity) :
|
||||
View.OnClickListener, PopupMenu.OnMenuItemClickListener {
|
||||
|
||||
open val menuRes: Int
|
||||
get() = MENU_RES
|
||||
|
|
|
@ -21,15 +21,19 @@ import code.name.monkey.retromusic.model.Artist
|
|||
import code.name.monkey.retromusic.mvp.Presenter
|
||||
import code.name.monkey.retromusic.mvp.PresenterImpl
|
||||
import code.name.monkey.retromusic.providers.interfaces.Repository
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import javax.inject.Inject
|
||||
import kotlin.coroutines.CoroutineContext
|
||||
|
||||
|
||||
/**
|
||||
* Created by hemanths on 20/08/17.
|
||||
*/
|
||||
interface AlbumDetailsView {
|
||||
|
||||
fun album(album: Album)
|
||||
|
||||
fun complete()
|
||||
|
@ -47,6 +51,7 @@ interface AlbumDetailsPresenter : Presenter<AlbumDetailsView> {
|
|||
class AlbumDetailsPresenterImpl @Inject constructor(
|
||||
private val repository: Repository
|
||||
) : PresenterImpl<AlbumDetailsView>(), AlbumDetailsPresenter, CoroutineScope {
|
||||
|
||||
private val job = Job()
|
||||
private lateinit var album: Album
|
||||
|
||||
|
@ -63,11 +68,10 @@ interface AlbumDetailsPresenter : Presenter<AlbumDetailsView> {
|
|||
view?.loadArtistImage(artist)
|
||||
|
||||
artist.albums?.filter { it.id != album.id }?.let {
|
||||
view?.moreAlbums(ArrayList(it))
|
||||
if (it.isNotEmpty()) view?.moreAlbums(ArrayList(it))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun loadAlbum(albumId: Int) {
|
||||
launch {
|
||||
when (val result = repository.albumById(albumId)) {
|
||||
|
@ -77,7 +81,6 @@ interface AlbumDetailsPresenter : Presenter<AlbumDetailsView> {
|
|||
}
|
||||
is Error -> withContext(Dispatchers.Main) { view?.complete() }
|
||||
}
|
||||
view?.complete()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,8 +21,12 @@ import code.name.monkey.retromusic.mvp.Presenter
|
|||
import code.name.monkey.retromusic.mvp.PresenterImpl
|
||||
import code.name.monkey.retromusic.providers.interfaces.Repository
|
||||
import code.name.monkey.retromusic.rest.model.LastFmArtist
|
||||
import kotlinx.coroutines.*
|
||||
import java.util.*
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import java.util.Locale
|
||||
import javax.inject.Inject
|
||||
import kotlin.coroutines.CoroutineContext
|
||||
|
||||
|
@ -69,7 +73,7 @@ interface ArtistDetailsPresenter : Presenter<ArtistDetailsView> {
|
|||
when (val result = repository.artistById(artistId)) {
|
||||
is Result.Success -> withContext(Dispatchers.Main) {
|
||||
view?.artist(result.data)
|
||||
view?.complete()
|
||||
|
||||
}
|
||||
is Result.Error -> withContext(Dispatchers.Main) {
|
||||
view?.showEmptyView()
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
|
||||
package code.name.monkey.retromusic.util;
|
||||
|
||||
import static code.name.monkey.retromusic.Constants.RATE_ON_GOOGLE_PLAY;
|
||||
import static code.name.monkey.retromusic.util.RetroUtil.openUrl;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ActivityOptions;
|
||||
import android.content.ActivityNotFoundException;
|
||||
|
@ -21,13 +24,9 @@ import android.content.Context;
|
|||
import android.content.Intent;
|
||||
import android.media.audiofx.AudioEffect;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import code.name.monkey.retromusic.R;
|
||||
import code.name.monkey.retromusic.activities.AboutActivity;
|
||||
import code.name.monkey.retromusic.activities.AlbumDetailsActivity;
|
||||
|
@ -47,13 +46,19 @@ import code.name.monkey.retromusic.activities.bugreport.BugReportActivity;
|
|||
import code.name.monkey.retromusic.helper.MusicPlayerRemote;
|
||||
import code.name.monkey.retromusic.model.Genre;
|
||||
import code.name.monkey.retromusic.model.Playlist;
|
||||
|
||||
import static code.name.monkey.retromusic.Constants.RATE_ON_GOOGLE_PLAY;
|
||||
import static code.name.monkey.retromusic.util.RetroUtil.openUrl;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
|
||||
public class NavigationUtil {
|
||||
|
||||
public static void bugReport(@NonNull Activity activity) {
|
||||
ActivityCompat.startActivity(activity, new Intent(activity, BugReportActivity.class), null);
|
||||
}
|
||||
|
||||
public static void goToAbout(@NonNull Activity activity) {
|
||||
ActivityCompat.startActivity(activity, new Intent(activity, AboutActivity.class), null);
|
||||
}
|
||||
|
||||
public static void goToAlbum(@NonNull Activity activity, int albumId) {
|
||||
Intent intent = new Intent(activity, AlbumDetailsActivity.class);
|
||||
intent.putExtra(AlbumDetailsActivity.EXTRA_ALBUM_ID, albumId);
|
||||
|
@ -68,6 +73,12 @@ public class NavigationUtil {
|
|||
ActivityCompat.startActivity(activity, intent, options.toBundle());
|
||||
}
|
||||
|
||||
public static void goToArtist(@NonNull Activity activity, int i) {
|
||||
Intent intent = new Intent(activity, ArtistDetailActivity.class);
|
||||
intent.putExtra(ArtistDetailActivity.EXTRA_ARTIST_ID, i);
|
||||
ActivityCompat.startActivity(activity, intent, null);
|
||||
}
|
||||
|
||||
public static void goToArtistOptions(@NotNull AppCompatActivity activity,
|
||||
int artistId,
|
||||
@NonNull ActivityOptions options) {
|
||||
|
@ -77,9 +88,27 @@ public class NavigationUtil {
|
|||
ActivityCompat.startActivity(activity, intent, options.toBundle());
|
||||
}
|
||||
|
||||
public static void goToArtist(@NonNull Activity activity, int i) {
|
||||
Intent intent = new Intent(activity, ArtistDetailActivity.class);
|
||||
intent.putExtra(ArtistDetailActivity.EXTRA_ARTIST_ID, i);
|
||||
public static void goToGenre(@NonNull Activity activity, @NonNull Genre genre) {
|
||||
Intent intent = new Intent(activity, GenreDetailsActivity.class);
|
||||
intent.putExtra(GenreDetailsActivity.EXTRA_GENRE_ID, genre);
|
||||
ActivityCompat.startActivity(activity, intent, null);
|
||||
}
|
||||
|
||||
public static void goToLyrics(@NonNull Activity activity) {
|
||||
Intent intent = new Intent(activity, LyricsActivity.class);
|
||||
ActivityCompat.startActivity(activity, intent, null);
|
||||
}
|
||||
|
||||
public static void goToOpenSource(@NonNull Activity activity) {
|
||||
ActivityCompat.startActivity(activity, new Intent(activity, LicenseActivity.class), null);
|
||||
}
|
||||
|
||||
public static void goToPlayStore(@NonNull Activity activity) {
|
||||
openUrl(activity, RATE_ON_GOOGLE_PLAY);
|
||||
}
|
||||
|
||||
public static void goToPlayingQueue(@NonNull Activity activity) {
|
||||
Intent intent = new Intent(activity, PlayingQueueActivity.class);
|
||||
ActivityCompat.startActivity(activity, intent, null);
|
||||
}
|
||||
|
||||
|
@ -89,6 +118,41 @@ public class NavigationUtil {
|
|||
ActivityCompat.startActivity(activity, intent, null);
|
||||
}
|
||||
|
||||
public static void goToProVersion(@NonNull Context context) {
|
||||
ActivityCompat.startActivity(context, new Intent(context, PurchaseActivity.class), null);
|
||||
}
|
||||
|
||||
public static void goToSearch(@NonNull Activity activity,
|
||||
@NonNull ActivityOptions activityOptions) {
|
||||
ActivityCompat.startActivity(activity, new Intent(activity, SearchActivity.class),
|
||||
activityOptions.toBundle());
|
||||
}
|
||||
|
||||
public static void goToSearch(@NonNull Activity activity, boolean isMicOpen,
|
||||
@NonNull ActivityOptions activityOptions) {
|
||||
ActivityCompat.startActivity(activity, new Intent(activity, SearchActivity.class)
|
||||
.putExtra(SearchActivity.EXTRA_SHOW_MIC, isMicOpen),
|
||||
activityOptions.toBundle());
|
||||
}
|
||||
|
||||
public static void goToSettings(@NonNull Activity activity) {
|
||||
ActivityCompat.startActivity(activity, new Intent(activity, SettingsActivity.class), null);
|
||||
}
|
||||
|
||||
public static void goToSupportDevelopment(@NonNull Activity activity) {
|
||||
ActivityCompat.startActivity(activity, new Intent(activity, SupportDevelopmentActivity.class), null);
|
||||
}
|
||||
|
||||
public static void goToUserInfo(@NonNull Activity activity,
|
||||
@NonNull ActivityOptions activityOptions) {
|
||||
ActivityCompat.startActivity(activity, new Intent(activity, UserInfoActivity.class),
|
||||
activityOptions.toBundle());
|
||||
}
|
||||
|
||||
public static void gotoWhatNews(@NonNull Activity activity) {
|
||||
ActivityCompat.startActivity(activity, new Intent(activity, WhatsNewActivity.class), null);
|
||||
}
|
||||
|
||||
public static void openEqualizer(@NonNull final Activity activity) {
|
||||
stockEqalizer(activity);
|
||||
}
|
||||
|
@ -111,72 +175,5 @@ public class NavigationUtil {
|
|||
}
|
||||
}
|
||||
|
||||
public static void goToPlayingQueue(@NonNull Activity activity) {
|
||||
Intent intent = new Intent(activity, PlayingQueueActivity.class);
|
||||
ActivityCompat.startActivity(activity, intent, null);
|
||||
}
|
||||
|
||||
public static void goToLyrics(@NonNull Activity activity) {
|
||||
Intent intent = new Intent(activity, LyricsActivity.class);
|
||||
ActivityCompat.startActivity(activity, intent, null);
|
||||
}
|
||||
|
||||
public static void goToGenre(@NonNull Activity activity, @NonNull Genre genre) {
|
||||
Intent intent = new Intent(activity, GenreDetailsActivity.class);
|
||||
intent.putExtra(GenreDetailsActivity.EXTRA_GENRE_ID, genre);
|
||||
ActivityCompat.startActivity(activity, intent, null);
|
||||
}
|
||||
|
||||
public static void goToProVersion(@NonNull Context context) {
|
||||
ActivityCompat.startActivity(context, new Intent(context, PurchaseActivity.class), null);
|
||||
}
|
||||
|
||||
public static void goToSettings(@NonNull Activity activity) {
|
||||
ActivityCompat.startActivity(activity, new Intent(activity, SettingsActivity.class), null);
|
||||
}
|
||||
|
||||
public static void goToAbout(@NonNull Activity activity) {
|
||||
ActivityCompat.startActivity(activity, new Intent(activity, AboutActivity.class), null);
|
||||
}
|
||||
|
||||
public static void goToUserInfo(@NonNull Activity activity,
|
||||
@NonNull ActivityOptions activityOptions) {
|
||||
ActivityCompat.startActivity(activity, new Intent(activity, UserInfoActivity.class),
|
||||
activityOptions.toBundle());
|
||||
}
|
||||
|
||||
public static void goToOpenSource(@NonNull Activity activity) {
|
||||
ActivityCompat.startActivity(activity, new Intent(activity, LicenseActivity.class), null);
|
||||
}
|
||||
|
||||
public static void goToSearch(@NonNull Activity activity,
|
||||
@NonNull ActivityOptions activityOptions) {
|
||||
ActivityCompat.startActivity(activity, new Intent(activity, SearchActivity.class),
|
||||
activityOptions.toBundle());
|
||||
}
|
||||
|
||||
public static void goToSearch(@NonNull Activity activity, boolean isMicOpen,
|
||||
@NonNull ActivityOptions activityOptions) {
|
||||
ActivityCompat.startActivity(activity, new Intent(activity, SearchActivity.class)
|
||||
.putExtra(SearchActivity.EXTRA_SHOW_MIC, isMicOpen),
|
||||
activityOptions.toBundle());
|
||||
}
|
||||
|
||||
public static void goToSupportDevelopment(@NonNull Activity activity) {
|
||||
ActivityCompat.startActivity(activity, new Intent(activity, SupportDevelopmentActivity.class), null);
|
||||
}
|
||||
|
||||
public static void goToPlayStore(@NonNull Activity activity) {
|
||||
openUrl(activity, RATE_ON_GOOGLE_PLAY);
|
||||
}
|
||||
|
||||
public static void gotoWhatNews(@NonNull Activity activity) {
|
||||
ActivityCompat.startActivity(activity, new Intent(activity, WhatsNewActivity.class), null);
|
||||
}
|
||||
|
||||
public static void bugReport(@NonNull Activity activity) {
|
||||
ActivityCompat.startActivity(activity, new Intent(activity, BugReportActivity.class), null);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/albumCoverContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="16dp"
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
</FrameLayout>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/artistCoverContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="16dp"
|
||||
|
@ -50,7 +51,7 @@
|
|||
app:cardElevation="8dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/artistImage"
|
||||
android:id="@+id/image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
android:scaleType="centerCrop"
|
||||
tools:srcCompat="@tools:sample/backgrounds/scenic[12]" />
|
||||
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appBarLayout"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -89,6 +88,7 @@
|
|||
android:layout_weight="0">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/albumCoverContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="8dp"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/artistImage"
|
||||
android:id="@+id/image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
android:scaleType="centerCrop"
|
||||
tools:srcCompat="@tools:sample/backgrounds/scenic[15]" />
|
||||
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appBarLayout"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -90,6 +89,7 @@
|
|||
android:layout_weight="0">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/albumCoverContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="8dp"
|
||||
|
@ -134,11 +134,11 @@
|
|||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:freezesText="true"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:paddingTop="4dp"
|
||||
android:scrollHorizontally="true"
|
||||
android:singleLine="true"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
tools:ignore="MissingPrefix"
|
||||
tools:text="Album details" />
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/artistImage"
|
||||
android:id="@+id/image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
android:orientation="vertical">
|
||||
|
||||
<code.name.monkey.retromusic.views.WidthFitSquareCardView
|
||||
android:id="@+id/albumCoverContainer"
|
||||
android:id="@+id/artistCoverContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
|
@ -65,7 +65,7 @@
|
|||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/artistImage"
|
||||
android:id="@+id/image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
|
@ -86,7 +86,7 @@
|
|||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/albumCoverContainer"
|
||||
app:layout_constraintTop_toBottomOf="@id/artistCoverContainer"
|
||||
tools:ignore="MissingPrefix"
|
||||
tools:text="Title" />
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:padding="8dp" >
|
||||
android:padding="8dp">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/title"
|
||||
|
|
|
@ -55,7 +55,6 @@
|
|||
android:id="@+id/imageText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:minHeight="40dp"
|
||||
|
|
Loading…
Reference in a new issue