Fixing animations

This commit is contained in:
h4h13 2020-01-02 09:23:43 +05:30
parent 5a51d0bfc0
commit 44baab2109
25 changed files with 476 additions and 386 deletions

File diff suppressed because one or more lines are too long

View file

@ -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

View file

@ -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)
}

View file

@ -28,16 +28,17 @@ import com.bumptech.glide.Glide
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
open class AlbumAdapter(
protected val activity: AppCompatActivity,
dataSet: ArrayList<Album>,
protected var itemLayoutRes: Int,
usePalette: Boolean,
cabHolder: CabHolder?
protected val activity: AppCompatActivity,
dataSet: ArrayList<Album>,
protected var itemLayoutRes: Int,
usePalette: Boolean,
cabHolder: CabHolder?
) : AbsMultiSelectAdapter<AlbumAdapter.ViewHolder, Album>(
activity,
cabHolder,
R.menu.menu_media_selection
activity,
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)
@ -106,17 +125,17 @@ open class AlbumAdapter(
}
SongGlideRequest.Builder.from(Glide.with(activity), album.safeGetFirstSong())
.checkIgnoreMediaStore(activity).generatePalette(activity).build()
.into(object : RetroMusicColoredTarget(holder.image!!) {
override fun onLoadCleared(placeholder: Drawable?) {
super.onLoadCleared(placeholder)
setColors(defaultFooterColor, holder)
}
.checkIgnoreMediaStore(activity).generatePalette(activity).build()
.into(object : RetroMusicColoredTarget(holder.image!!) {
override fun onLoadCleared(placeholder: Drawable?) {
super.onLoadCleared(placeholder)
setColors(defaultFooterColor, holder)
}
override fun onColorReady(color: Int) {
setColors(color, holder)
}
})
override fun onColorReady(color: Int) {
setColors(color, holder)
}
})
}
override fun getItemCount(): Int {
@ -136,7 +155,7 @@ open class AlbumAdapter(
}
override fun onMultipleItemAction(
menuItem: MenuItem, selection: ArrayList<Album>
menuItem: MenuItem, selection: ArrayList<Album>
) {
SongsMenuHelper.handleMenuClick(activity, getSongList(selection), menuItem.itemId)
}
@ -152,10 +171,11 @@ 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
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)
}
}

View file

@ -16,11 +16,11 @@ 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,
private val dataSet: ArrayList<Song>
fm: FragmentManager,
private val dataSet: ArrayList<Song>
) : CustomFragmentStatePagerAdapter(fm) {
private var currentColorReceiver: AlbumCoverFragment.ColorReceiver? = null
@ -90,9 +90,9 @@ class AlbumCoverPagerAdapter(
}
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val finalLayout = when {
PreferenceUtil.getInstance(activity).carouselEffect() -> R.layout.fragment_album_carousel_cover
@ -119,13 +119,13 @@ class AlbumCoverPagerAdapter(
private fun loadAlbumCover() {
SongGlideRequest.Builder.from(Glide.with(requireContext()), song)
.checkIgnoreMediaStore(requireContext())
.generatePalette(requireContext()).build()
.into(object : RetroMusicColoredTarget(albumCover) {
override fun onColorReady(color: Int) {
setColor(color)
}
})
.checkIgnoreMediaStore(requireContext())
.generatePalette(requireContext()).build()
.into(object : RetroMusicColoredTarget(albumCover) {
override fun onColorReady(color: Int) {
setColor(color)
}
})
}
private fun setColor(color: Int) {

View file

@ -31,9 +31,9 @@ import code.name.monkey.retromusic.views.MetalRecyclerViewPager
import com.bumptech.glide.Glide
class AlbumFullWidthAdapter(
private val activity: Activity,
private val dataSet: ArrayList<Album>,
metrics: DisplayMetrics
private val activity: Activity,
private val dataSet: ArrayList<Album>,
metrics: DisplayMetrics
) : MetalRecyclerViewPager.MetalAdapter<AlbumFullWidthAdapter.FullMetalViewHolder>(metrics) {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): FullMetalViewHolder {
@ -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)
}
@ -63,14 +71,13 @@ class AlbumFullWidthAdapter(
return
}
SongGlideRequest.Builder.from(Glide.with(activity), album.safeGetFirstSong())
.checkIgnoreMediaStore(activity)
.generatePalette(activity)
.build()
.into(object : RetroMusicColoredTarget(holder.image!!) {
override fun onColorReady(color: Int) {
}
})
.checkIgnoreMediaStore(activity)
.generatePalette(activity)
.build()
.into(object : RetroMusicColoredTarget(holder.image!!) {
override fun onColorReady(color: Int) {
}
})
}
override fun getItemCount(): 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)
}
}

View file

@ -3,150 +3,158 @@ 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,
var dataSet: ArrayList<Artist>,
var itemLayoutRes: Int,
var usePalette: Boolean,
cabHolder: CabHolder?
val activity: AppCompatActivity,
var dataSet: ArrayList<Artist>,
var itemLayoutRes: Int,
var usePalette: Boolean,
cabHolder: CabHolder?
) : AbsMultiSelectAdapter<ArtistAdapter.ViewHolder, Artist>(
activity, cabHolder, R.menu.menu_media_selection
activity, cabHolder, R.menu.menu_media_selection
), FastScrollRecyclerView.SectionedAdapter {
fun swapDataSet(dataSet: ArrayList<Artist>) {
this.dataSet = dataSet
notifyDataSetChanged()
}
fun swapDataSet(dataSet: ArrayList<Artist>) {
this.dataSet = dataSet
notifyDataSetChanged()
}
fun usePalette(usePalette: Boolean) {
this.usePalette = usePalette
notifyDataSetChanged()
}
fun usePalette(usePalette: Boolean) {
this.usePalette = usePalette
notifyDataSetChanged()
}
override fun getItemId(position: Int): Long {
return dataSet[position].id.toLong()
}
override fun getItemId(position: Int): Long {
return dataSet[position].id.toLong()
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view = LayoutInflater.from(activity).inflate(itemLayoutRes, parent, false)
return createViewHolder(view)
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view = LayoutInflater.from(activity).inflate(itemLayoutRes, parent, false)
return createViewHolder(view)
}
private fun createViewHolder(view: View): ViewHolder {
return ViewHolder(view)
}
private fun createViewHolder(view: View): ViewHolder {
return ViewHolder(view)
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val artist = dataSet[position]
val isChecked = isChecked(artist)
holder.itemView.isActivated = isChecked
holder.title?.text = artist.name
holder.text?.visibility = View.GONE
loadArtistImage(artist, holder)
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val artist = dataSet[position]
val isChecked = isChecked(artist)
holder.itemView.isActivated = isChecked
holder.title?.text = artist.name
holder.text?.visibility = View.GONE
loadArtistImage(artist, holder)
}
fun setColors(color: Int, holder: ViewHolder) {
if (holder.paletteColorContainer != null) {
holder.paletteColorContainer?.setBackgroundColor(color)
holder.title?.setTextColor(
MaterialValueHelper.getPrimaryTextColor(
activity, ColorUtil.isColorLight(
color
)
)
)
}
fun setColors(color: Int, holder: ViewHolder) {
if (holder.paletteColorContainer != null) {
holder.paletteColorContainer?.setBackgroundColor(color)
holder.title?.setTextColor(
MaterialValueHelper.getPrimaryTextColor(
activity, ColorUtil.isColorLight(
color
)
)
)
}
holder.mask?.backgroundTintList = ColorStateList.valueOf(color)
}
holder.mask?.backgroundTintList = ColorStateList.valueOf(color)
}
private fun loadArtistImage(artist: Artist, holder: ViewHolder) {
if (holder.image == null) {
return
}
ArtistGlideRequest.Builder.from(Glide.with(activity), artist).generatePalette(activity)
.build().into(object : RetroMusicColoredTarget(holder.image!!) {
override fun onLoadCleared(placeholder: Drawable?) {
super.onLoadCleared(placeholder)
setColors(defaultFooterColor, holder)
}
private fun loadArtistImage(artist: Artist, holder: ViewHolder) {
if (holder.image == null) {
return
}
ArtistGlideRequest.Builder.from(Glide.with(activity), artist).generatePalette(activity)
.build().into(object : RetroMusicColoredTarget(holder.image!!) {
override fun onLoadCleared(placeholder: Drawable?) {
super.onLoadCleared(placeholder)
setColors(defaultFooterColor, holder)
}
override fun onColorReady(color: Int) {
setColors(color, holder)
}
})
}
override fun onColorReady(color: Int) {
setColors(color, holder)
}
})
}
override fun getItemCount(): Int {
return dataSet.size
}
override fun getItemCount(): Int {
return dataSet.size
}
override fun getIdentifier(position: Int): Artist? {
return dataSet[position]
}
override fun getIdentifier(position: Int): Artist? {
return dataSet[position]
}
override fun getName(artist: Artist): String {
return artist.name
}
override fun getName(artist: Artist): String {
return artist.name
}
override fun onMultipleItemAction(
menuItem: MenuItem, selection: ArrayList<Artist>
) {
SongsMenuHelper.handleMenuClick(activity, getSongList(selection), menuItem.itemId)
}
override fun onMultipleItemAction(
menuItem: MenuItem, selection: ArrayList<Artist>
) {
SongsMenuHelper.handleMenuClick(activity, getSongList(selection), menuItem.itemId)
}
private fun getSongList(artists: List<Artist>): ArrayList<Song> {
val songs = ArrayList<Song>()
for (artist in artists) {
songs.addAll(artist.songs) // maybe async in future?
}
return songs
}
private fun getSongList(artists: List<Artist>): ArrayList<Song> {
val songs = ArrayList<Song>()
for (artist in artists) {
songs.addAll(artist.songs) // maybe async in future?
}
return songs
}
override fun getSectionName(position: Int): String {
return MusicUtil.getSectionName(dataSet[position].name)
}
override fun getSectionName(position: Int): String {
return MusicUtil.getSectionName(dataSet[position].name)
}
inner class ViewHolder(itemView: View) : MediaEntryViewHolder(itemView) {
inner class ViewHolder(itemView: View) : MediaEntryViewHolder(itemView) {
init {
setImageTransitionName(activity.getString(R.string.transition_artist_image))
menu?.visibility = View.GONE
}
init {
setImageTransitionName(activity.getString(R.string.transition_artist_image))
menu?.visibility = View.GONE
}
override fun onClick(v: View?) {
super.onClick(v)
if (isInQuickSelectMode) {
toggleChecked(adapterPosition)
} else {
val activityOptions = ActivityOptions.makeSceneTransitionAnimation(
activity, image, activity.getString(
R.string.transition_artist_image
)
)
NavigationUtil.goToArtistOptions(
activity, dataSet[adapterPosition].id, activityOptions
)
}
}
override fun onClick(v: View?) {
super.onClick(v)
if (isInQuickSelectMode) {
toggleChecked(adapterPosition)
} else {
val activityOptions = ActivityOptions.makeSceneTransitionAnimation(
activity,
imageContainerCard ?: image,
"${activity.getString(R.string.transition_artist_image)}_${dataSet[adapterPosition].id}"
)
NavigationUtil.goToArtistOptions(
activity, dataSet[adapterPosition].id, activityOptions
)
}
}
override fun onLongClick(v: View?): Boolean {
toggleChecked(adapterPosition)
return super.onLongClick(v)
}
}
override fun onLongClick(v: View?): Boolean {
toggleChecked(adapterPosition)
return super.onLongClick(v)
}
}
}

View file

@ -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);
}

View file

@ -10,14 +10,14 @@ 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,
dataSet: ArrayList<Song>,
itemLayoutRes: Int,
usePalette: Boolean,
cabHolder: CabHolder?
activity: AppCompatActivity,
dataSet: ArrayList<Song>,
itemLayoutRes: Int,
usePalette: Boolean,
cabHolder: CabHolder?
) : AbsOffsetSongAdapter(activity, dataSet, itemLayoutRes, usePalette, cabHolder, false) {
init {
@ -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)

View file

@ -26,22 +26,23 @@ 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.
*/
open class SongAdapter(
protected val activity: AppCompatActivity,
dataSet: ArrayList<Song>,
protected var itemLayoutRes: Int,
usePalette: Boolean,
cabHolder: CabHolder?,
showSectionName: Boolean = true
protected val activity: AppCompatActivity,
dataSet: ArrayList<Song>,
protected var itemLayoutRes: Int,
usePalette: Boolean,
cabHolder: CabHolder?,
showSectionName: Boolean = true
) : AbsMultiSelectAdapter<SongAdapter.ViewHolder, Song>(
activity, cabHolder, R.menu.menu_media_selection
activity, cabHolder, R.menu.menu_media_selection
), MaterialCab.Callback, FastScrollRecyclerView.SectionedAdapter {
var dataSet: ArrayList<Song>
protected var usePalette = false
@ -104,18 +105,18 @@ open class SongAdapter(
return
}
SongGlideRequest.Builder.from(Glide.with(activity), song).checkIgnoreMediaStore(activity)
.generatePalette(activity).build()
.into(object : RetroMusicColoredTarget(holder.image!!) {
override fun onLoadCleared(placeholder: Drawable?) {
super.onLoadCleared(placeholder)
setColors(defaultFooterColor, holder)
}
.generatePalette(activity).build()
.into(object : RetroMusicColoredTarget(holder.image!!) {
override fun onLoadCleared(placeholder: Drawable?) {
super.onLoadCleared(placeholder)
setColors(defaultFooterColor, holder)
}
override fun onColorReady(color: Int) {
if (usePalette) setColors(color, holder)
else setColors(defaultFooterColor, holder)
}
})
override fun onColorReady(color: Int) {
if (usePalette) setColors(color, holder)
else setColors(defaultFooterColor, holder)
}
})
}
private fun getSongTitle(song: Song): String? {
@ -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
}
}

View file

@ -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)
}

View file

@ -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())
}

View file

@ -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

View file

@ -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()
@ -45,8 +49,9 @@ interface AlbumDetailsPresenter : Presenter<AlbumDetailsView> {
fun loadMore(artistId: Int)
class AlbumDetailsPresenterImpl @Inject constructor(
private val repository: Repository
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()
}
}

View file

@ -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()

View file

@ -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);
@ -61,34 +66,93 @@ public class NavigationUtil {
}
public static void goToAlbumOptions(@NonNull Activity activity,
int albumId,
@NonNull ActivityOptions options) {
int albumId,
@NonNull ActivityOptions options) {
Intent intent = new Intent(activity, AlbumDetailsActivity.class);
intent.putExtra(AlbumDetailsActivity.EXTRA_ALBUM_ID, albumId);
ActivityCompat.startActivity(activity, intent, options.toBundle());
}
public static void goToArtistOptions(@NotNull AppCompatActivity activity,
int artistId,
@NonNull ActivityOptions options) {
Intent intent = new Intent(activity, ArtistDetailActivity.class);
intent.putExtra(ArtistDetailActivity.EXTRA_ARTIST_ID, artistId);
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) {
Intent intent = new Intent(activity, ArtistDetailActivity.class);
intent.putExtra(ArtistDetailActivity.EXTRA_ARTIST_ID, artistId);
ActivityCompat.startActivity(activity, intent, options.toBundle());
}
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);
}
public static void goToPlaylistNew(@NonNull Activity activity, @NonNull Playlist playlist) {
Intent intent = new Intent(activity, PlaylistDetailActivity.class);
intent.putExtra(PlaylistDetailActivity.Companion.getEXTRA_PLAYLIST(), playlist);
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);
}
}

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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" />

View file

@ -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"

View file

@ -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" />

View file

@ -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"

View file

@ -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"