all: fix formatting
This commit is contained in:
parent
5e7d575efd
commit
dc8cbc74e8
3 changed files with 24 additions and 11 deletions
|
@ -25,8 +25,6 @@ import android.view.LayoutInflater
|
||||||
import androidx.activity.result.ActivityResultLauncher
|
import androidx.activity.result.ActivityResultLauncher
|
||||||
import androidx.activity.result.contract.ActivityResultContracts
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
import androidx.core.view.ViewCompat
|
|
||||||
import androidx.core.view.isVisible
|
|
||||||
import androidx.recyclerview.widget.ConcatAdapter
|
import androidx.recyclerview.widget.ConcatAdapter
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
@ -46,7 +44,9 @@ import timber.log.Timber as L
|
||||||
*/
|
*/
|
||||||
@AndroidEntryPoint
|
@AndroidEntryPoint
|
||||||
class MusicSourcesDialog :
|
class MusicSourcesDialog :
|
||||||
ViewBindingMaterialDialogFragment<DialogMusicLocationsBinding>(), LocationAdapter.Listener, NewLocationFooterAdapter.Listener {
|
ViewBindingMaterialDialogFragment<DialogMusicLocationsBinding>(),
|
||||||
|
LocationAdapter.Listener,
|
||||||
|
NewLocationFooterAdapter.Listener {
|
||||||
private val locationAdapter = LocationAdapter(this)
|
private val locationAdapter = LocationAdapter(this)
|
||||||
private val locationFooterAdapter = NewLocationFooterAdapter(this)
|
private val locationFooterAdapter = NewLocationFooterAdapter(this)
|
||||||
private var openDocumentTreeLauncher: ActivityResultLauncher<Uri?>? = null
|
private var openDocumentTreeLauncher: ActivityResultLauncher<Uri?>? = null
|
||||||
|
@ -105,9 +105,7 @@ class MusicSourcesDialog :
|
||||||
override fun onNewLocation() {
|
override fun onNewLocation() {
|
||||||
L.d("Opening launcher")
|
L.d("Opening launcher")
|
||||||
val launcher =
|
val launcher =
|
||||||
requireNotNull(openDocumentTreeLauncher) {
|
requireNotNull(openDocumentTreeLauncher) { "Document tree launcher was not available" }
|
||||||
"Document tree launcher was not available"
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
launcher.launch(null)
|
launcher.launch(null)
|
||||||
|
|
|
@ -1,10 +1,27 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2024 Auxio Project
|
||||||
|
* NewLocationFooterAdapter.kt is part of Auxio.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
package org.oxycblt.auxio.music.locations
|
package org.oxycblt.auxio.music.locations
|
||||||
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import org.oxycblt.auxio.databinding.ItemNewMusicLocationBinding
|
import org.oxycblt.auxio.databinding.ItemNewMusicLocationBinding
|
||||||
import org.oxycblt.auxio.databinding.ItemNewPlaylistChoiceBinding
|
|
||||||
import org.oxycblt.auxio.list.recycler.DialogRecyclerView
|
import org.oxycblt.auxio.list.recycler.DialogRecyclerView
|
||||||
import org.oxycblt.auxio.music.decision.AddToPlaylistDialog
|
import org.oxycblt.auxio.music.decision.AddToPlaylistDialog
|
||||||
import org.oxycblt.auxio.util.inflater
|
import org.oxycblt.auxio.util.inflater
|
||||||
|
@ -28,9 +45,7 @@ class NewLocationFooterAdapter(private val listener: Listener) :
|
||||||
|
|
||||||
/** A listener for [NewLocationFooterAdapter] interactions. */
|
/** A listener for [NewLocationFooterAdapter] interactions. */
|
||||||
interface Listener {
|
interface Listener {
|
||||||
/**
|
/** Called when the footer has been pressed, requesting to create a new location. */
|
||||||
* Called when the footer has been pressed, requesting to create a new location.
|
|
||||||
*/
|
|
||||||
fun onNewLocation()
|
fun onNewLocation()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ plugins {
|
||||||
id 'com.android.library' version "$agp_version" apply false
|
id 'com.android.library' version "$agp_version" apply false
|
||||||
id "org.jetbrains.kotlin.android" version "$kotlin_version" apply false
|
id "org.jetbrains.kotlin.android" version "$kotlin_version" apply false
|
||||||
id "com.google.devtools.ksp" version '2.0.21-1.0.25' apply false
|
id "com.google.devtools.ksp" version '2.0.21-1.0.25' apply false
|
||||||
// We use spotless in the root build.gradle to apply to all module
|
// We use spotless in the root build.gradle to apply to all modules.
|
||||||
id "com.diffplug.spotless" version "6.25.0" apply true
|
id "com.diffplug.spotless" version "6.25.0" apply true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue