ui: temporarily remove more menus
Temporarily remove more menus for now. There's just no window to add them for 2.6.2. I'll add multi-select later.
This commit is contained in:
parent
3c5ade33b5
commit
28ba8147f1
8 changed files with 42 additions and 38 deletions
|
@ -24,7 +24,6 @@ buttons
|
|||
detail views after a rotation
|
||||
|
||||
#### What's Changed
|
||||
- Menus are now opened using a new button to the side of all items
|
||||
- ReplayGain can now no longer be disabled. Remove ReplayGain tags from
|
||||
files if such functionality is not desired.
|
||||
|
||||
|
|
|
@ -209,7 +209,11 @@ private class AlbumSongViewHolder private constructor(private val binding: ItemA
|
|||
binding.songName.text = item.resolveName(binding.context)
|
||||
binding.songDuration.text = item.durationSecs.formatDuration(false)
|
||||
|
||||
binding.songMenu.setOnClickListener { listener.onOpenMenu(item, it) }
|
||||
// binding.songMenu.setOnClickListener { listener.onOpenMenu(item, it) }
|
||||
binding.root.setOnLongClickListener {
|
||||
listener.onOpenMenu(item, it)
|
||||
true
|
||||
}
|
||||
binding.root.setOnClickListener { listener.onItemClick(item) }
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,11 @@ private constructor(
|
|||
binding.parentImage.bind(item)
|
||||
binding.parentName.text = item.resolveName(binding.context)
|
||||
binding.parentInfo.text = item.date.resolveYear(binding.context)
|
||||
binding.parentMenu.setOnClickListener { listener.onOpenMenu(item, it) }
|
||||
// binding.parentMenu.setOnClickListener { listener.onOpenMenu(item, it) }
|
||||
binding.root.setOnLongClickListener {
|
||||
listener.onOpenMenu(item, it)
|
||||
true
|
||||
}
|
||||
binding.root.setOnClickListener { listener.onItemClick(item) }
|
||||
}
|
||||
|
||||
|
@ -198,7 +202,11 @@ private constructor(
|
|||
binding.songAlbumCover.bind(item)
|
||||
binding.songName.text = item.resolveName(binding.context)
|
||||
binding.songInfo.text = item.album.resolveName(binding.context)
|
||||
binding.songMenu.setOnClickListener { listener.onOpenMenu(item, it) }
|
||||
// binding.songMenu.setOnClickListener { listener.onOpenMenu(item, it) }
|
||||
binding.root.setOnLongClickListener {
|
||||
listener.onOpenMenu(item, it)
|
||||
true
|
||||
}
|
||||
binding.root.setOnClickListener { listener.onItemClick(item) }
|
||||
}
|
||||
|
||||
|
|
|
@ -22,12 +22,10 @@ import androidx.recyclerview.widget.RecyclerView
|
|||
import org.oxycblt.auxio.IntegerTable
|
||||
import org.oxycblt.auxio.R
|
||||
import org.oxycblt.auxio.databinding.ItemDetailBinding
|
||||
import org.oxycblt.auxio.databinding.ItemSongBinding
|
||||
import org.oxycblt.auxio.music.Genre
|
||||
import org.oxycblt.auxio.music.Song
|
||||
import org.oxycblt.auxio.ui.recycler.BindingViewHolder
|
||||
import org.oxycblt.auxio.ui.recycler.Item
|
||||
import org.oxycblt.auxio.ui.recycler.MenuItemListener
|
||||
import org.oxycblt.auxio.ui.recycler.SimpleItemCallback
|
||||
import org.oxycblt.auxio.ui.recycler.SongViewHolder
|
||||
import org.oxycblt.auxio.util.context
|
||||
|
@ -47,7 +45,7 @@ class GenreDetailAdapter(listener: Listener) :
|
|||
super.getCreatorFromItem(item)
|
||||
?: when (item) {
|
||||
is Genre -> GenreDetailViewHolder.CREATOR
|
||||
is Song -> GenreSongViewHolder.CREATOR
|
||||
is Song -> SongViewHolder.CREATOR
|
||||
else -> null
|
||||
}
|
||||
|
||||
|
@ -55,7 +53,7 @@ class GenreDetailAdapter(listener: Listener) :
|
|||
super.getCreatorFromViewType(viewType)
|
||||
?: when (viewType) {
|
||||
GenreDetailViewHolder.CREATOR.viewType -> GenreDetailViewHolder.CREATOR
|
||||
GenreSongViewHolder.CREATOR.viewType -> GenreSongViewHolder.CREATOR
|
||||
SongViewHolder.CREATOR.viewType -> SongViewHolder.CREATOR
|
||||
else -> null
|
||||
}
|
||||
|
||||
|
@ -69,7 +67,7 @@ class GenreDetailAdapter(listener: Listener) :
|
|||
if (payload.isEmpty()) {
|
||||
when (item) {
|
||||
is Genre -> (viewHolder as GenreDetailViewHolder).bind(item, listener)
|
||||
is Song -> (viewHolder as GenreSongViewHolder).bind(item, listener)
|
||||
is Song -> (viewHolder as SongViewHolder).bind(item, listener)
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
@ -92,7 +90,7 @@ class GenreDetailAdapter(listener: Listener) :
|
|||
oldItem is Genre && newItem is Genre ->
|
||||
GenreDetailViewHolder.DIFFER.areItemsTheSame(oldItem, newItem)
|
||||
oldItem is Song && newItem is Song ->
|
||||
GenreSongViewHolder.DIFFER.areItemsTheSame(oldItem, newItem)
|
||||
SongViewHolder.DIFFER.areItemsTheSame(oldItem, newItem)
|
||||
else -> DetailAdapter.DIFFER.areContentsTheSame(oldItem, newItem)
|
||||
}
|
||||
}
|
||||
|
@ -132,27 +130,3 @@ private class GenreDetailViewHolder private constructor(private val binding: Ite
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
class GenreSongViewHolder private constructor(private val binding: ItemSongBinding) :
|
||||
BindingViewHolder<Song, MenuItemListener>(binding.root) {
|
||||
override fun bind(item: Song, listener: MenuItemListener) {
|
||||
binding.songAlbumCover.bind(item)
|
||||
binding.songName.text = item.resolveName(binding.context)
|
||||
binding.songInfo.text = item.resolveIndividualArtistName(binding.context)
|
||||
binding.songMenu.setOnClickListener { listener.onOpenMenu(item, it) }
|
||||
binding.root.setOnClickListener { listener.onItemClick(item) }
|
||||
}
|
||||
|
||||
companion object {
|
||||
val CREATOR =
|
||||
object : Creator<GenreSongViewHolder> {
|
||||
override val viewType: Int
|
||||
get() = IntegerTable.ITEM_TYPE_GENRE_SONG
|
||||
|
||||
override fun create(context: Context) =
|
||||
GenreSongViewHolder(ItemSongBinding.inflate(context.inflater))
|
||||
}
|
||||
|
||||
val DIFFER = SongViewHolder.DIFFER
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,11 @@ class SongViewHolder private constructor(private val binding: ItemSongBinding) :
|
|||
binding.songAlbumCover.bind(item)
|
||||
binding.songName.text = item.resolveName(binding.context)
|
||||
binding.songInfo.text = item.resolveIndividualArtistName(binding.context)
|
||||
binding.songMenu.setOnClickListener { listener.onOpenMenu(item, it) }
|
||||
// binding.songMenu.setOnClickListener { listener.onOpenMenu(item, it) }
|
||||
binding.root.setOnLongClickListener {
|
||||
listener.onOpenMenu(item, it)
|
||||
true
|
||||
}
|
||||
binding.root.setOnClickListener { listener.onItemClick(item) }
|
||||
}
|
||||
|
||||
|
@ -77,7 +81,11 @@ private constructor(
|
|||
binding.parentImage.bind(item)
|
||||
binding.parentName.text = item.resolveName(binding.context)
|
||||
binding.parentInfo.text = item.artist.resolveName(binding.context)
|
||||
binding.parentMenu.setOnClickListener { listener.onOpenMenu(item, it) }
|
||||
// binding.parentMenu.setOnClickListener { listener.onOpenMenu(item, it) }
|
||||
binding.root.setOnLongClickListener {
|
||||
listener.onOpenMenu(item, it)
|
||||
true
|
||||
}
|
||||
binding.root.setOnClickListener { listener.onItemClick(item) }
|
||||
}
|
||||
|
||||
|
@ -116,7 +124,11 @@ class ArtistViewHolder private constructor(private val binding: ItemParentBindin
|
|||
R.string.fmt_two,
|
||||
binding.context.getPlural(R.plurals.fmt_album_count, item.albums.size),
|
||||
binding.context.getPlural(R.plurals.fmt_song_count, item.songs.size))
|
||||
binding.parentMenu.setOnClickListener { listener.onOpenMenu(item, it) }
|
||||
// binding.parentMenu.setOnClickListener { listener.onOpenMenu(item, it) }
|
||||
binding.root.setOnLongClickListener {
|
||||
listener.onOpenMenu(item, it)
|
||||
true
|
||||
}
|
||||
binding.root.setOnClickListener { listener.onItemClick(item) }
|
||||
}
|
||||
|
||||
|
@ -154,7 +166,11 @@ private constructor(
|
|||
binding.parentName.text = item.resolveName(binding.context)
|
||||
binding.parentInfo.text =
|
||||
binding.context.getPlural(R.plurals.fmt_song_count, item.songs.size)
|
||||
binding.parentMenu.setOnClickListener { listener.onOpenMenu(item, it) }
|
||||
// binding.parentMenu.setOnClickListener { listener.onOpenMenu(item, it) }
|
||||
binding.root.setOnLongClickListener {
|
||||
listener.onOpenMenu(item, it)
|
||||
true
|
||||
}
|
||||
binding.root.setOnClickListener { listener.onItemClick(item) }
|
||||
}
|
||||
|
||||
|
|
|
@ -81,6 +81,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:icon="@drawable/ic_more_24"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:icon="@drawable/ic_more_24"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:icon="@drawable/ic_more_24"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
|
Loading…
Reference in a new issue