Remove dividers
Remove the recyclerview dividers, they made the app too cluttered, so now theyre gone.
This commit is contained in:
parent
2cd45f8350
commit
0627677569
18 changed files with 24 additions and 51 deletions
|
@ -13,7 +13,8 @@ import android.util.Log
|
|||
* has a crippling bug where it will endlessly allocate rows even if you clear the entire db, so...
|
||||
* @author OxygenCobalt
|
||||
*/
|
||||
class PlaybackStateDatabase(context: Context) : SQLiteOpenHelper(context, DB_NAME, null, DB_VERSION) {
|
||||
class PlaybackStateDatabase(context: Context) :
|
||||
SQLiteOpenHelper(context, DB_NAME, null, DB_VERSION) {
|
||||
override fun onCreate(db: SQLiteDatabase) {
|
||||
createTable(db, TABLE_NAME_STATE)
|
||||
createTable(db, TABLE_NAME_QUEUE)
|
||||
|
|
|
@ -15,7 +15,6 @@ import org.oxycblt.auxio.detail.adapters.DetailSongAdapter
|
|||
import org.oxycblt.auxio.music.MusicStore
|
||||
import org.oxycblt.auxio.playback.PlaybackViewModel
|
||||
import org.oxycblt.auxio.playback.state.PlaybackMode
|
||||
import org.oxycblt.auxio.ui.applyDivider
|
||||
import org.oxycblt.auxio.ui.disable
|
||||
import org.oxycblt.auxio.ui.setupAlbumSongActions
|
||||
|
||||
|
@ -28,7 +27,7 @@ class AlbumDetailFragment : DetailFragment() {
|
|||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
): View {
|
||||
val binding = FragmentAlbumDetailBinding.inflate(inflater)
|
||||
|
||||
// If DetailViewModel isn't already storing the album, get it from MusicStore
|
||||
|
@ -85,7 +84,6 @@ class AlbumDetailFragment : DetailFragment() {
|
|||
|
||||
binding.albumSongRecycler.apply {
|
||||
adapter = songAdapter
|
||||
applyDivider()
|
||||
setHasFixedSize(true)
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import org.oxycblt.auxio.databinding.FragmentArtistDetailBinding
|
|||
import org.oxycblt.auxio.detail.adapters.DetailAlbumAdapter
|
||||
import org.oxycblt.auxio.music.MusicStore
|
||||
import org.oxycblt.auxio.playback.PlaybackViewModel
|
||||
import org.oxycblt.auxio.ui.applyDivider
|
||||
|
||||
import org.oxycblt.auxio.ui.disable
|
||||
import org.oxycblt.auxio.ui.setupAlbumActions
|
||||
|
||||
|
@ -26,7 +26,7 @@ class ArtistDetailFragment : DetailFragment() {
|
|||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
): View {
|
||||
val binding = FragmentArtistDetailBinding.inflate(inflater)
|
||||
|
||||
// If DetailViewModel isn't already storing the artist, get it from MusicStore
|
||||
|
@ -92,7 +92,6 @@ class ArtistDetailFragment : DetailFragment() {
|
|||
|
||||
binding.artistAlbumRecycler.apply {
|
||||
adapter = albumAdapter
|
||||
applyDivider()
|
||||
setHasFixedSize(true)
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ import org.oxycblt.auxio.databinding.FragmentGenreDetailBinding
|
|||
import org.oxycblt.auxio.detail.adapters.DetailArtistAdapter
|
||||
import org.oxycblt.auxio.music.MusicStore
|
||||
import org.oxycblt.auxio.playback.PlaybackViewModel
|
||||
import org.oxycblt.auxio.ui.applyDivider
|
||||
import org.oxycblt.auxio.ui.disable
|
||||
import org.oxycblt.auxio.ui.setupArtistActions
|
||||
|
||||
|
@ -27,7 +26,7 @@ class GenreDetailFragment : DetailFragment() {
|
|||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
): View {
|
||||
val binding = FragmentGenreDetailBinding.inflate(inflater)
|
||||
|
||||
// If DetailViewModel isn't already storing the genre, get it from MusicStore
|
||||
|
@ -92,7 +91,6 @@ class GenreDetailFragment : DetailFragment() {
|
|||
|
||||
binding.genreArtistRecycler.apply {
|
||||
adapter = artistAdapter
|
||||
applyDivider()
|
||||
setHasFixedSize(true)
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@ import org.oxycblt.auxio.music.Song
|
|||
import org.oxycblt.auxio.playback.PlaybackViewModel
|
||||
import org.oxycblt.auxio.playback.state.PlaybackMode
|
||||
import org.oxycblt.auxio.ui.applyColor
|
||||
import org.oxycblt.auxio.ui.applyDivider
|
||||
import org.oxycblt.auxio.ui.resolveAttr
|
||||
import org.oxycblt.auxio.ui.setupAlbumActions
|
||||
import org.oxycblt.auxio.ui.setupArtistActions
|
||||
|
@ -93,6 +92,7 @@ class LibraryFragment : Fragment(), SearchView.OnQueryTextListener {
|
|||
searchView.setOnQueryTextListener(this@LibraryFragment)
|
||||
searchView.setOnQueryTextFocusChangeListener { _, hasFocus ->
|
||||
libraryModel.updateSearchFocusStatus(hasFocus)
|
||||
libraryModel.updateSearchQuery(searchView.query.toString(), requireContext())
|
||||
item.isVisible = !hasFocus
|
||||
}
|
||||
|
||||
|
@ -118,8 +118,6 @@ class LibraryFragment : Fragment(), SearchView.OnQueryTextListener {
|
|||
|
||||
binding.libraryRecycler.apply {
|
||||
adapter = libraryAdapter
|
||||
|
||||
applyDivider()
|
||||
setHasFixedSize(true)
|
||||
}
|
||||
|
||||
|
@ -169,7 +167,7 @@ class LibraryFragment : Fragment(), SearchView.OnQueryTextListener {
|
|||
override fun onQueryTextChange(query: String): Boolean {
|
||||
libraryModel.updateSearchQuery(query, requireContext())
|
||||
|
||||
return false
|
||||
return true
|
||||
}
|
||||
|
||||
private fun showActionsForItem(data: BaseModel, view: View) {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package org.oxycblt.auxio.playback
|
||||
|
||||
import android.graphics.drawable.AnimatedVectorDrawable
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
|
|
|
@ -185,7 +185,11 @@ class PlaybackViewModel : ViewModel(), PlaybackStateManager.Callback {
|
|||
}
|
||||
|
||||
// Move queue OR user queue items, given QueueAdapter indices.
|
||||
fun moveQueueAdapterItems(adapterFrom: Int, adapterTo: Int, queueAdapter: QueueAdapter): Boolean {
|
||||
fun moveQueueAdapterItems(
|
||||
adapterFrom: Int,
|
||||
adapterTo: Int,
|
||||
queueAdapter: QueueAdapter
|
||||
): Boolean {
|
||||
var from = adapterFrom.dec()
|
||||
var to = adapterTo.dec()
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ import org.oxycblt.auxio.music.BaseModel
|
|||
import org.oxycblt.auxio.music.Header
|
||||
import org.oxycblt.auxio.playback.PlaybackViewModel
|
||||
import org.oxycblt.auxio.playback.state.PlaybackMode
|
||||
import org.oxycblt.auxio.ui.applyDivider
|
||||
|
||||
/**
|
||||
* A [Fragment] that contains both the user queue and the next queue, with the ability to
|
||||
|
@ -48,7 +47,6 @@ class QueueFragment : Fragment() {
|
|||
|
||||
binding.queueRecycler.apply {
|
||||
setHasFixedSize(true)
|
||||
applyDivider()
|
||||
adapter = queueAdapter
|
||||
helper.attachToRecyclerView(this)
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@ import org.oxycblt.auxio.databinding.FragmentSongsBinding
|
|||
import org.oxycblt.auxio.music.MusicStore
|
||||
import org.oxycblt.auxio.playback.PlaybackViewModel
|
||||
import org.oxycblt.auxio.playback.state.PlaybackMode
|
||||
import org.oxycblt.auxio.ui.applyDivider
|
||||
import org.oxycblt.auxio.ui.setupSongActions
|
||||
|
||||
class SongsFragment : Fragment() {
|
||||
|
@ -50,7 +49,6 @@ class SongsFragment : Fragment() {
|
|||
)
|
||||
}
|
||||
)
|
||||
applyDivider()
|
||||
setHasFixedSize(true)
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package org.oxycblt.auxio.ui
|
|||
|
||||
import android.content.Context
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.text.SpannableString
|
||||
import android.text.style.ForegroundColorSpan
|
||||
import android.view.MenuItem
|
||||
|
@ -11,7 +10,6 @@ import android.widget.Toast
|
|||
import androidx.annotation.ColorInt
|
||||
import androidx.annotation.MenuRes
|
||||
import androidx.appcompat.widget.PopupMenu
|
||||
import androidx.recyclerview.widget.DividerItemDecoration
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import org.oxycblt.auxio.R
|
||||
import org.oxycblt.auxio.detail.DetailViewModel
|
||||
|
@ -47,22 +45,6 @@ fun String.createToast(context: Context) {
|
|||
Toast.makeText(context.applicationContext, this, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
|
||||
// Apply a custom vertical divider
|
||||
fun RecyclerView.applyDivider() {
|
||||
val div = DividerItemDecoration(
|
||||
context,
|
||||
DividerItemDecoration.VERTICAL
|
||||
)
|
||||
|
||||
div.setDrawable(
|
||||
ColorDrawable(
|
||||
R.color.divider_color.toColor(context)
|
||||
)
|
||||
)
|
||||
|
||||
addItemDecoration(div)
|
||||
}
|
||||
|
||||
fun PopupMenu.setupSongActions(song: Song, context: Context, playbackModel: PlaybackViewModel) {
|
||||
setOnMenuItemClickListener {
|
||||
when (it.itemId) {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorPrimary">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2L18,7L6,7v12zM8,9h8v10L8,19L8,9zM15.5,4l-1,-1h-5l-1,1L5,4v2h14L19,4z" />
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2L18,7L6,7v12zM8,9h8v10L8,19L8,9zM15.5,4l-1,-1h-5l-1,1L5,4v2h14L19,4z" />
|
||||
</vector>
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
android:width="32dp"
|
||||
<vector android:width="32dp"
|
||||
android:height="32dp"
|
||||
android:tint="@color/control_color"
|
||||
android:viewportWidth="24"
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<vector
|
||||
android:width="32dp"
|
||||
<vector android:width="32dp"
|
||||
android:height="32dp"
|
||||
android:tint="@color/control_color"
|
||||
android:viewportWidth="24"
|
||||
|
|
|
@ -2,13 +2,12 @@
|
|||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/background"/>
|
||||
<solid android:color="@color/background" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<ripple
|
||||
android:color="@color/selection_color">
|
||||
<ripple android:color="@color/selection_color">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/selection_color" />
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/nav_host"
|
||||
<androidx.fragment.app.FragmentContainerView android:id="@+id/nav_host"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
app:layout_constraintEnd_toStartOf="@+id/header_button"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:background="@drawable/ui_header_dividers"
|
||||
tools:text="Songs" />
|
||||
|
||||
<ImageButton
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
android:paddingEnd="@dimen/padding_small"
|
||||
android:paddingBottom="@dimen/padding_small"
|
||||
android:textSize="19sp"
|
||||
android:background="@drawable/ui_header_dividers"
|
||||
android:text="@{header.name}"
|
||||
tools:text="Songs" />
|
||||
</layout>
|
|
@ -23,7 +23,7 @@
|
|||
<dimen name="size_cover_compact">44dp</dimen>
|
||||
<dimen name="size_cover_normal">56dp</dimen>
|
||||
<dimen name="size_cover_large">68dp</dimen>
|
||||
<dimen name="size_cover_huge">250dp</dimen>
|
||||
<dimen name="size_cover_huge">260dp</dimen>
|
||||
<dimen name="size_play_pause">70dp</dimen>
|
||||
<dimen name="size_play_pause_compact">36dp</dimen>
|
||||
|
||||
|
|
Loading…
Reference in a new issue