Cleanup code
Clean up the formatting/structure of the codebase.
This commit is contained in:
parent
35591c42c7
commit
a849d00248
30 changed files with 104 additions and 119 deletions
|
@ -9,10 +9,10 @@ import androidx.navigation.fragment.navArgs
|
|||
import org.oxycblt.auxio.R
|
||||
import org.oxycblt.auxio.detail.adapters.ArtistDetailAdapter
|
||||
import org.oxycblt.auxio.logD
|
||||
import org.oxycblt.auxio.music.ActionHeader
|
||||
import org.oxycblt.auxio.music.Album
|
||||
import org.oxycblt.auxio.music.Artist
|
||||
import org.oxycblt.auxio.music.BaseModel
|
||||
import org.oxycblt.auxio.music.Header
|
||||
import org.oxycblt.auxio.music.MusicStore
|
||||
import org.oxycblt.auxio.music.Song
|
||||
import org.oxycblt.auxio.playback.state.PlaybackMode
|
||||
|
@ -63,16 +63,6 @@ class ArtistDetailFragment : DetailFragment() {
|
|||
}
|
||||
)
|
||||
|
||||
// We build the action header here since it's both more efficent to keep one action header
|
||||
// and it also prevents the header from being constantly refreshed when the sort is updated.
|
||||
|
||||
val songsHeader = ActionHeader(
|
||||
id = -2,
|
||||
name = getString(R.string.label_songs),
|
||||
icon = detailModel.artistSortMode.value!!.iconRes,
|
||||
action = detailModel::incrementArtistSortMode
|
||||
)
|
||||
|
||||
// --- UI SETUP ---
|
||||
|
||||
binding.lifecycleOwner = this
|
||||
|
@ -80,7 +70,7 @@ class ArtistDetailFragment : DetailFragment() {
|
|||
setupToolbar()
|
||||
setupRecycler(detailAdapter) { pos ->
|
||||
// If the item is an ActionHeader we need to also make the item full-width
|
||||
pos == 0 || detailAdapter.currentList.getOrNull(pos) is ActionHeader
|
||||
pos == 0 || detailAdapter.currentList.getOrNull(pos) is Header
|
||||
}
|
||||
|
||||
// --- VIEWMODEL SETUP ---
|
||||
|
@ -91,8 +81,17 @@ class ArtistDetailFragment : DetailFragment() {
|
|||
val artist = detailModel.currentArtist.value!!
|
||||
|
||||
val data = mutableListOf<BaseModel>(artist)
|
||||
|
||||
data.addAll(SortMode.NUMERIC_DOWN.getSortedAlbumList(artist.albums))
|
||||
data.add(songsHeader)
|
||||
|
||||
data.add(
|
||||
Header(
|
||||
id = -2,
|
||||
name = getString(R.string.label_songs),
|
||||
isAction = true
|
||||
)
|
||||
)
|
||||
|
||||
data.addAll(mode.getSortedArtistSongList(artist.songs))
|
||||
|
||||
detailAdapter.submitList(data)
|
||||
|
|
|
@ -10,10 +10,10 @@ import org.oxycblt.auxio.databinding.ItemArtistHeaderBinding
|
|||
import org.oxycblt.auxio.databinding.ItemArtistSongBinding
|
||||
import org.oxycblt.auxio.detail.DetailViewModel
|
||||
import org.oxycblt.auxio.logD
|
||||
import org.oxycblt.auxio.music.ActionHeader
|
||||
import org.oxycblt.auxio.music.Album
|
||||
import org.oxycblt.auxio.music.Artist
|
||||
import org.oxycblt.auxio.music.BaseModel
|
||||
import org.oxycblt.auxio.music.Header
|
||||
import org.oxycblt.auxio.music.Song
|
||||
import org.oxycblt.auxio.playback.PlaybackViewModel
|
||||
import org.oxycblt.auxio.recycler.DiffCallback
|
||||
|
@ -46,7 +46,7 @@ class ArtistDetailAdapter(
|
|||
return when (getItem(position)) {
|
||||
is Artist -> ARTIST_HEADER_ITEM_TYPE
|
||||
is Album -> ARTIST_ALBUM_ITEM_TYPE
|
||||
is ActionHeader -> ARTIST_SONG_HEADER_ITEM_TYPE
|
||||
is Header -> ARTIST_SONG_HEADER_ITEM_TYPE
|
||||
is Song -> ARTIST_SONG_ITEM_TYPE
|
||||
|
||||
else -> -1
|
||||
|
@ -81,7 +81,7 @@ class ArtistDetailAdapter(
|
|||
when (item) {
|
||||
is Artist -> (holder as ArtistHeaderViewHolder).bind(item)
|
||||
is Album -> (holder as ArtistAlbumViewHolder).bind(item)
|
||||
is ActionHeader -> (holder as ArtistSongHeaderViewHolder).bind(item)
|
||||
is Header -> (holder as ArtistSongHeaderViewHolder).bind(item)
|
||||
is Song -> (holder as ArtistSongViewHolder).bind(item)
|
||||
|
||||
else -> {}
|
||||
|
@ -199,9 +199,9 @@ class ArtistDetailAdapter(
|
|||
|
||||
inner class ArtistSongHeaderViewHolder(
|
||||
private val binding: ItemActionHeaderBinding
|
||||
) : BaseViewHolder<ActionHeader>(binding) {
|
||||
) : BaseViewHolder<Header>(binding) {
|
||||
|
||||
override fun onBind(data: ActionHeader) {
|
||||
override fun onBind(data: Header) {
|
||||
binding.header = data
|
||||
|
||||
binding.headerButton.apply {
|
||||
|
@ -211,7 +211,7 @@ class ArtistDetailAdapter(
|
|||
setImageResource(sortMode.value!!.iconRes)
|
||||
|
||||
setOnClickListener {
|
||||
data.action() // Should call DetailViewModel.incrementArtistSortMode
|
||||
detailModel.incrementArtistSortMode()
|
||||
setImageResource(sortMode.value!!.iconRes)
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package org.oxycblt.auxio.music
|
||||
|
||||
import android.net.Uri
|
||||
import androidx.annotation.DrawableRes
|
||||
|
||||
// --- MUSIC MODELS ---
|
||||
|
||||
|
@ -189,20 +188,10 @@ data class Genre(
|
|||
|
||||
/**
|
||||
* A data object used solely for the "Header" UI element. Inherits [BaseModel].
|
||||
* @param isAction Whether this header corresponds to an action or not
|
||||
*/
|
||||
data class Header(
|
||||
override val id: Long,
|
||||
override val name: String,
|
||||
) : BaseModel()
|
||||
|
||||
/**
|
||||
* A data object for a header with an action button. Inherits [BaseModel].
|
||||
* @property icon The icon ot apply for this header.
|
||||
* @property action The callback that will be called when the action button is clicked.
|
||||
*/
|
||||
data class ActionHeader(
|
||||
override val id: Long,
|
||||
override val name: String,
|
||||
@DrawableRes val icon: Int,
|
||||
val action: () -> Unit,
|
||||
val isAction: Boolean = false
|
||||
) : BaseModel()
|
||||
|
|
|
@ -3,17 +3,19 @@ package org.oxycblt.auxio.playback.queue
|
|||
import android.annotation.SuppressLint
|
||||
import android.view.MotionEvent
|
||||
import android.view.ViewGroup
|
||||
import androidx.appcompat.widget.TooltipCompat
|
||||
import androidx.recyclerview.widget.AsyncListDiffer
|
||||
import androidx.recyclerview.widget.ItemTouchHelper
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import org.oxycblt.auxio.R
|
||||
import org.oxycblt.auxio.databinding.ItemActionHeaderBinding
|
||||
import org.oxycblt.auxio.databinding.ItemQueueSongBinding
|
||||
import org.oxycblt.auxio.logE
|
||||
import org.oxycblt.auxio.music.ActionHeader
|
||||
import org.oxycblt.auxio.music.BaseModel
|
||||
import org.oxycblt.auxio.music.Header
|
||||
import org.oxycblt.auxio.music.Song
|
||||
import org.oxycblt.auxio.playback.PlaybackViewModel
|
||||
import org.oxycblt.auxio.recycler.DiffCallback
|
||||
import org.oxycblt.auxio.recycler.viewholders.ActionHeaderViewHolder
|
||||
import org.oxycblt.auxio.recycler.viewholders.BaseViewHolder
|
||||
import org.oxycblt.auxio.recycler.viewholders.HeaderViewHolder
|
||||
import org.oxycblt.auxio.ui.inflater
|
||||
|
@ -21,10 +23,12 @@ import org.oxycblt.auxio.ui.inflater
|
|||
/**
|
||||
* The single adapter for both the Next Queue and the User Queue.
|
||||
* @param touchHelper The [ItemTouchHelper] ***containing*** [QueueDragCallback] to be used
|
||||
* @param playbackModel The [PlaybackViewModel] for updates to be dispatched to
|
||||
* @author OxygenCobalt
|
||||
*/
|
||||
class QueueAdapter(
|
||||
private val touchHelper: ItemTouchHelper
|
||||
private val touchHelper: ItemTouchHelper,
|
||||
private val playbackModel: PlaybackViewModel
|
||||
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||
private var data = mutableListOf<BaseModel>()
|
||||
private var listDiffer = AsyncListDiffer(this, DiffCallback())
|
||||
|
@ -32,12 +36,15 @@ class QueueAdapter(
|
|||
override fun getItemCount(): Int = data.size
|
||||
|
||||
override fun getItemViewType(position: Int): Int {
|
||||
val item = data[position]
|
||||
return when (val item = data[position]) {
|
||||
is Header -> if (item.isAction) {
|
||||
USER_QUEUE_HEADER_ITEM_TYPE
|
||||
} else {
|
||||
HeaderViewHolder.ITEM_TYPE
|
||||
}
|
||||
|
||||
return when (item) {
|
||||
is Header -> HeaderViewHolder.ITEM_TYPE
|
||||
is ActionHeader -> ActionHeaderViewHolder.ITEM_TYPE
|
||||
is Song -> QUEUE_SONG_ITEM_TYPE
|
||||
|
||||
else -> -1
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +53,9 @@ class QueueAdapter(
|
|||
return when (viewType) {
|
||||
HeaderViewHolder.ITEM_TYPE -> HeaderViewHolder.from(parent.context)
|
||||
|
||||
ActionHeaderViewHolder.ITEM_TYPE -> ActionHeaderViewHolder.from(parent.context)
|
||||
USER_QUEUE_HEADER_ITEM_TYPE -> UserQueueHeaderViewHolder(
|
||||
ItemActionHeaderBinding.inflate(parent.context.inflater)
|
||||
)
|
||||
|
||||
QUEUE_SONG_ITEM_TYPE -> QueueSongViewHolder(
|
||||
ItemQueueSongBinding.inflate(parent.context.inflater)
|
||||
|
@ -58,9 +67,13 @@ class QueueAdapter(
|
|||
|
||||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||
when (val item = data[position]) {
|
||||
is Header -> if (item.isAction) {
|
||||
(holder as UserQueueHeaderViewHolder).bind(item)
|
||||
} else {
|
||||
(holder as HeaderViewHolder).bind(item)
|
||||
}
|
||||
|
||||
is Song -> (holder as QueueSongViewHolder).bind(item)
|
||||
is Header -> (holder as HeaderViewHolder).bind(item)
|
||||
is ActionHeader -> (holder as ActionHeaderViewHolder).bind(item)
|
||||
|
||||
else -> logE("Bad data given to QueueAdapter.")
|
||||
}
|
||||
|
@ -145,7 +158,31 @@ class QueueAdapter(
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* The viewholder for
|
||||
*/
|
||||
inner class UserQueueHeaderViewHolder(
|
||||
private val binding: ItemActionHeaderBinding
|
||||
) : BaseViewHolder<Header>(binding) {
|
||||
|
||||
override fun onBind(data: Header) {
|
||||
binding.header = data
|
||||
|
||||
binding.headerButton.apply {
|
||||
setImageResource(R.drawable.ic_clear)
|
||||
|
||||
contentDescription = context.getString(R.string.description_clear_user_queue)
|
||||
TooltipCompat.setTooltipText(this, contentDescription)
|
||||
|
||||
setOnClickListener {
|
||||
playbackModel.clearUserQueue()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val QUEUE_SONG_ITEM_TYPE = 0xA005
|
||||
const val USER_QUEUE_HEADER_ITEM_TYPE = 0xA006
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@ import androidx.navigation.fragment.findNavController
|
|||
import androidx.recyclerview.widget.ItemTouchHelper
|
||||
import org.oxycblt.auxio.R
|
||||
import org.oxycblt.auxio.databinding.FragmentQueueBinding
|
||||
import org.oxycblt.auxio.music.ActionHeader
|
||||
import org.oxycblt.auxio.music.BaseModel
|
||||
import org.oxycblt.auxio.music.Header
|
||||
import org.oxycblt.auxio.playback.PlaybackViewModel
|
||||
|
@ -37,7 +36,7 @@ class QueueFragment : Fragment() {
|
|||
|
||||
val callback = QueueDragCallback(playbackModel)
|
||||
val helper = ItemTouchHelper(callback)
|
||||
val queueAdapter = QueueAdapter(helper)
|
||||
val queueAdapter = QueueAdapter(helper, playbackModel)
|
||||
var lastShuffle = playbackModel.isShuffling.value
|
||||
|
||||
callback.addQueueAdapter(queueAdapter)
|
||||
|
@ -137,13 +136,10 @@ class QueueFragment : Fragment() {
|
|||
val nextQueue = playbackModel.nextItemsInQueue.value!!
|
||||
|
||||
if (userQueue.isNotEmpty()) {
|
||||
queue += ActionHeader(
|
||||
queue += Header(
|
||||
id = -2,
|
||||
name = getString(R.string.label_next_user_queue),
|
||||
icon = R.drawable.ic_clear,
|
||||
action = {
|
||||
playbackModel.clearUserQueue()
|
||||
}
|
||||
isAction = true
|
||||
)
|
||||
|
||||
queue += userQueue
|
||||
|
@ -151,7 +147,9 @@ class QueueFragment : Fragment() {
|
|||
|
||||
if (nextQueue.isNotEmpty()) {
|
||||
queue += Header(
|
||||
id = -3, name = getString(R.string.format_next_from, getParentName()),
|
||||
id = -3,
|
||||
name = getString(R.string.format_next_from, getParentName()),
|
||||
isAction = false
|
||||
)
|
||||
|
||||
queue += nextQueue
|
||||
|
|
|
@ -2,13 +2,11 @@ package org.oxycblt.auxio.recycler.viewholders
|
|||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import org.oxycblt.auxio.databinding.ItemActionHeaderBinding
|
||||
import org.oxycblt.auxio.databinding.ItemAlbumBinding
|
||||
import org.oxycblt.auxio.databinding.ItemArtistBinding
|
||||
import org.oxycblt.auxio.databinding.ItemGenreBinding
|
||||
import org.oxycblt.auxio.databinding.ItemHeaderBinding
|
||||
import org.oxycblt.auxio.databinding.ItemSongBinding
|
||||
import org.oxycblt.auxio.music.ActionHeader
|
||||
import org.oxycblt.auxio.music.Album
|
||||
import org.oxycblt.auxio.music.Artist
|
||||
import org.oxycblt.auxio.music.Genre
|
||||
|
@ -153,7 +151,9 @@ class GenreViewHolder private constructor(
|
|||
/**
|
||||
* The Shared ViewHolder for a [Header]. Instantiation should be done with [from]
|
||||
*/
|
||||
class HeaderViewHolder(private val binding: ItemHeaderBinding) : BaseViewHolder<Header>(binding) {
|
||||
class HeaderViewHolder private constructor(
|
||||
private val binding: ItemHeaderBinding
|
||||
) : BaseViewHolder<Header>(binding) {
|
||||
|
||||
override fun onBind(data: Header) {
|
||||
binding.header = data
|
||||
|
@ -172,35 +172,3 @@ class HeaderViewHolder(private val binding: ItemHeaderBinding) : BaseViewHolder<
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The Shared ViewHolder for a [ActionHeader]. Instantiation should be done with [from]
|
||||
*/
|
||||
class ActionHeaderViewHolder(
|
||||
private val binding: ItemActionHeaderBinding
|
||||
) : BaseViewHolder<ActionHeader>(binding) {
|
||||
|
||||
override fun onBind(data: ActionHeader) {
|
||||
binding.header = data
|
||||
binding.headerButton.apply {
|
||||
setImageResource(data.icon)
|
||||
|
||||
setOnClickListener {
|
||||
data.action()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val ITEM_TYPE = 0xA006
|
||||
|
||||
/**
|
||||
* Create an instance of [ActionHeaderViewHolder]
|
||||
*/
|
||||
fun from(context: Context): ActionHeaderViewHolder {
|
||||
return ActionHeaderViewHolder(
|
||||
ItemActionHeaderBinding.inflate(context.inflater)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ class BlacklistViewModel(context: Context) : ViewModel() {
|
|||
/**
|
||||
* Load the paths stored in the database to this ViewModel, will erase any pending changes.
|
||||
*/
|
||||
fun loadDatabasePaths() {
|
||||
private fun loadDatabasePaths() {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
dbPaths = blacklistDatabase.readPaths()
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Animator from IndicatorFastScroll (https://github.com/reddit/IndicatorFastScroll) -->
|
||||
<?xml version="1.0" encoding="utf-8"?><!-- Animator from IndicatorFastScroll (https://github.com/reddit/IndicatorFastScroll) -->
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_activated="true">
|
||||
<set>
|
||||
|
|
|
@ -95,9 +95,9 @@
|
|||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/album_shuffle_button"
|
||||
style="@style/Widget.MaterialComponents.Button.Highlighted"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
android:onClick="@{() -> playbackModel.playAlbum(album, true)}"
|
||||
android:text="@string/label_shuffle"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/album_play_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/album_play_button"
|
||||
|
|
|
@ -87,9 +87,9 @@
|
|||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/artist_shuffle_button"
|
||||
style="@style/Widget.MaterialComponents.Button.Highlighted"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
android:onClick="@{() -> playbackModel.playArtist(artist, true)}"
|
||||
android:text="@string/label_shuffle"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/artist_play_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/artist_play_button"
|
||||
|
|
|
@ -78,9 +78,9 @@
|
|||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/genre_shuffle_button"
|
||||
style="@style/Widget.MaterialComponents.Button.Highlighted"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
android:onClick="@{() -> playbackModel.playGenre(genre, true)}"
|
||||
android:text="@string/label_shuffle"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/genre_play_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/genre_play_button"
|
||||
|
|
|
@ -95,9 +95,9 @@
|
|||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/album_shuffle_button"
|
||||
style="@style/Widget.MaterialComponents.Button.Highlighted"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
android:onClick="@{() -> playbackModel.playAlbum(album, true)}"
|
||||
android:text="@string/label_shuffle"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/album_play_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/album_play_button"
|
||||
|
|
|
@ -87,9 +87,9 @@
|
|||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/artist_shuffle_button"
|
||||
style="@style/Widget.MaterialComponents.Button.Highlighted"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
android:onClick="@{() -> playbackModel.playArtist(artist, true)}"
|
||||
android:text="@string/label_shuffle"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/artist_play_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/artist_play_button"
|
||||
|
|
|
@ -78,9 +78,9 @@
|
|||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/genre_shuffle_button"
|
||||
style="@style/Widget.MaterialComponents.Button.Highlighted"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
android:onClick="@{() -> playbackModel.playGenre(genre, true)}"
|
||||
android:text="@string/label_shuffle"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/genre_play_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/genre_play_button"
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
android:id="@+id/accent_recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="@dimen/spacing_medium"
|
||||
android:foregroundGravity="center"
|
||||
android:overScrollMode="never"
|
||||
android:paddingTop="@dimen/spacing_medium"
|
||||
app:layoutManager="org.oxycblt.auxio.settings.accent.AutoGridLayoutManager"
|
||||
app:layout_constraintBottom_toTopOf="@+id/accent_cancel"
|
||||
app:layout_constraintTop_toBottomOf="@+id/accent_header"
|
||||
|
|
|
@ -26,10 +26,10 @@
|
|||
android:id="@+id/search_text_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:boxStrokeWidthFocused="2dp"
|
||||
app:boxStrokeColor="?attr/colorPrimary"
|
||||
app:boxBackgroundMode="filled"
|
||||
app:boxStrokeColor="?attr/colorPrimary"
|
||||
app:boxStrokeWidth="0dp"
|
||||
app:boxStrokeWidthFocused="2dp"
|
||||
app:endIconContentDescription="@string/description_clear_search"
|
||||
app:endIconDrawable="@drawable/ic_close"
|
||||
app:endIconMode="clear_text"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<variable
|
||||
name="header"
|
||||
type="org.oxycblt.auxio.music.ActionHeader" />
|
||||
type="org.oxycblt.auxio.music.Header" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
|
|
|
@ -89,9 +89,9 @@
|
|||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/album_shuffle_button"
|
||||
style="@style/Widget.MaterialComponents.Button.Highlighted"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
android:onClick="@{() -> playbackModel.playAlbum(album, true)}"
|
||||
android:text="@string/label_shuffle"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/album_play_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/album_play_button"
|
||||
|
|
|
@ -84,9 +84,9 @@
|
|||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/artist_shuffle_button"
|
||||
style="@style/Widget.MaterialComponents.Button.Highlighted"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
android:onClick="@{() -> playbackModel.playArtist(artist, true)}"
|
||||
android:text="@string/label_shuffle"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/artist_play_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/artist_play_button"
|
||||
|
|
|
@ -28,8 +28,8 @@
|
|||
<TextView
|
||||
android:id="@+id/song_name"
|
||||
style="@style/ItemText.Primary"
|
||||
android:text="@{song.name}"
|
||||
android:layout_marginEnd="@dimen/spacing_medium"
|
||||
android:text="@{song.name}"
|
||||
app:layout_constraintBottom_toTopOf="@+id/song_info"
|
||||
app:layout_constraintEnd_toStartOf="@+id/song_duration"
|
||||
app:layout_constraintStart_toEndOf="@+id/album_cover"
|
||||
|
@ -40,8 +40,8 @@
|
|||
<TextView
|
||||
android:id="@+id/song_info"
|
||||
style="@style/ItemText.Secondary"
|
||||
android:text="@{song.album.name}"
|
||||
android:layout_marginEnd="@dimen/spacing_medium"
|
||||
android:text="@{song.album.name}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/song_duration"
|
||||
app:layout_constraintStart_toEndOf="@+id/album_cover"
|
||||
|
|
|
@ -89,9 +89,9 @@
|
|||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/genre_shuffle_button"
|
||||
style="@style/Widget.MaterialComponents.Button.Highlighted"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
android:onClick="@{() -> playbackModel.playGenre(genre, true)}"
|
||||
android:text="@string/label_shuffle"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/genre_play_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/genre_play_button"
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
android:layout_width="@dimen/size_scroll_thumb"
|
||||
android:layout_height="@dimen/size_scroll_thumb"
|
||||
android:background="@drawable/ui_circle"
|
||||
android:elevation="@dimen/elevation_small"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
android:elevation="@dimen/elevation_small"
|
||||
android:stateListAnimator="@animator/animator_thumb"
|
||||
app:layout_constraintEnd_toStartOf="@+id/scroll_indicator_text">
|
||||
|
||||
|
@ -22,10 +22,10 @@
|
|||
android:id="@+id/scroll_thumb_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/text_size_thumb"
|
||||
android:textColor="?android:attr/windowBackground"
|
||||
android:fontFamily="@font/inter_semibold"
|
||||
android:gravity="center"
|
||||
android:textColor="?android:attr/windowBackground"
|
||||
android:textSize="@dimen/text_size_thumb"
|
||||
tools:text="A" />
|
||||
|
||||
</FrameLayout>
|
||||
|
@ -38,9 +38,9 @@
|
|||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:lineSpacingExtra="@dimen/spacing_tiny"
|
||||
android:minWidth="@dimen/width_fast_scroll"
|
||||
android:paddingTop="@dimen/spacing_tiny"
|
||||
android:paddingBottom="@dimen/spacing_tiny"
|
||||
android:minWidth="@dimen/width_fast_scroll"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
|
@ -2,7 +2,6 @@
|
|||
<resources>
|
||||
<!-- Info namespace | App labels -->
|
||||
<string name="info_channel_name">Musikwiedergabe</string>
|
||||
<string name="info_service_desc">der Musikwiedergabedienst von Auxio.</string>
|
||||
|
||||
<!-- Label Namespace | Static Labels -->
|
||||
<string name="label_retry">Wieder Versuchen</string>
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
<!-- Info namespace | App labels -->
|
||||
<string name="info_app_desc">Een eenvoudige, rationele muziekspeler voor Android.</string>
|
||||
<string name="info_channel_name">Muziek Afspelen</string>
|
||||
<string name="info_service_desc">De muziekweergaveservice voor Auxio.</string>
|
||||
|
||||
<!-- Label Namespace | Static Labels -->
|
||||
<string name="label_retry">Opnieuw proberen</string>
|
||||
|
|
|
@ -12,13 +12,11 @@
|
|||
|
||||
<!-- Height Namespace | Height for UI elements -->
|
||||
<dimen name="height_compact_progress">2dp</dimen>
|
||||
<dimen name="height_dialog_button">40dp</dimen>
|
||||
|
||||
<!-- Width Namespace | Width for UI elements -->
|
||||
<dimen name="width_track_number">32dp</dimen>
|
||||
<dimen name="width_play_stroke">1dp</dimen>
|
||||
<dimen name="width_fast_scroll">20dp</dimen>
|
||||
<dimen name="width_dialog_button_min">64dp</dimen>
|
||||
|
||||
<!-- Size Namespace | Width & Heights for UI elements -->
|
||||
<dimen name="size_error_icon">48dp</dimen>
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
<!-- Info namespace | App labels -->
|
||||
<string name="info_app_desc">A simple, rational music player for android.</string>
|
||||
<string name="info_channel_name">Music Playback</string>
|
||||
<string name="info_service_desc">The music playback service for Auxio.</string>
|
||||
|
||||
<!-- Label Namespace | Static Labels -->
|
||||
<string name="label_retry">Retry</string>
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
app:defaultValue="@integer/theme_auto"
|
||||
app:entries="@array/entires_theme"
|
||||
app:entryValues="@array/values_theme"
|
||||
app:icon="@drawable/ic_day"
|
||||
app:iconSpaceReserved="false"
|
||||
app:key="KEY_THEME2"
|
||||
app:icon="@drawable/ic_day"
|
||||
app:title="@string/setting_theme" />
|
||||
|
||||
<Preference
|
||||
|
|
|
@ -44,7 +44,7 @@ To prevent any strange bugs, all integer representations must be unique. A table
|
|||
0xA004 | HeaderViewHolder
|
||||
|
||||
0xA005 | QueueSongViewHolder
|
||||
0xA006 | ActionHeaderViewHolder
|
||||
0xA006 | UserQueueHeaderViewHolder
|
||||
|
||||
0xA007 | AlbumHeaderViewHolder
|
||||
0xA008 | AlbumSongViewHolder
|
||||
|
|
Loading…
Reference in a new issue