all: fix log statements

Fix messy and useless log statements throughout the app.
This commit is contained in:
Alexander Capehart 2023-05-28 10:10:03 -06:00
parent 54724517ae
commit 10d05b1f26
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
8 changed files with 21 additions and 14 deletions

View file

@ -343,7 +343,7 @@ class HomeFragment :
// the current sort of the tab.
if (isCurrentMode || isCurrentlyAscending || isCurrentlyDescending) {
logD(
"Checking $option [mode: $isCurrentMode asc: $$isCurrentlyAscending dec: $isCurrentlyDescending]")
"Checking $option option [mode: $isCurrentMode asc: $isCurrentlyAscending dec: $isCurrentlyDescending]")
// Note: We cannot inline this boolean assignment since it unchecks all other radio
// buttons (even when setting it to false), which would result in nothing being
// selected.
@ -353,7 +353,7 @@ class HomeFragment :
// Disable options that are not allowed by the isVisible lambda
option.isVisible = isVisible(option.itemId)
if (!option.isVisible) {
logD("Hiding $option")
logD("Hiding $option option")
}
}
@ -467,13 +467,11 @@ class HomeFragment :
when (progress) {
is IndexingProgress.Indeterminate -> {
logD("Showing generic progress")
// In a query/initialization state, show a generic loading status.
binding.homeIndexingStatus.text = getString(R.string.lng_indexing)
binding.homeIndexingProgress.isIndeterminate = true
}
is IndexingProgress.Songs -> {
logD("Showing song progress")
// Actively loading songs, show the current progress.
binding.homeIndexingStatus.text =
getString(R.string.fmt_indexing, progress.current, progress.total)
@ -492,7 +490,7 @@ class HomeFragment :
// displaying the shuffle FAB makes no sense. We also don't want the fast scroll
// popup to overlap with the FAB, so we hide the FAB when fast scrolling too.
if (songs.isEmpty() || isFastScrolling) {
logD("Hiding fab: [empty: ${songs.isEmpty()} scrolling: $isFastScrolling")
logD("Hiding fab: [empty: ${songs.isEmpty()} scrolling: $isFastScrolling]")
binding.homeFab.hide()
} else {
logD("Showing fab")

View file

@ -143,7 +143,6 @@ constructor(
override fun onMusicChanges(changes: MusicRepository.Changes) {
val deviceLibrary = musicRepository.deviceLibrary
logD(changes.deviceLibrary)
if (changes.deviceLibrary && deviceLibrary != null) {
logD("Refreshing library")
// Get the each list of items in the library to use as our list data.

View file

@ -41,7 +41,6 @@ import org.oxycblt.auxio.music.resolveNames
import org.oxycblt.auxio.util.context
import org.oxycblt.auxio.util.getPlural
import org.oxycblt.auxio.util.inflater
import org.oxycblt.auxio.util.logD
/**
* A [RecyclerView.ViewHolder] that displays a [Song]. Use [from] to create an instance.
@ -331,7 +330,6 @@ class BasicHeaderViewHolder private constructor(private val binding: ItemHeaderB
* @param basicHeader The new [BasicHeader] to bind.
*/
fun bind(basicHeader: BasicHeader) {
logD(binding.context.getString(basicHeader.titleRes))
binding.title.text = binding.context.getString(basicHeader.titleRes)
}

View file

@ -53,7 +53,8 @@ import org.oxycblt.auxio.util.logW
*
* @author Alexander Capehart (OxygenCobalt)
*
* TODO: Switch listener to set
* TODO: Switch listeners to set when you can confirm there are no order-dependent listener
* configurations
*/
interface MusicRepository {
/** The current music information found on the device. */

View file

@ -49,6 +49,8 @@ import org.oxycblt.auxio.util.logD
* An [ViewModel] that provides a safe UI frontend for the current playback state.
*
* @author Alexander Capehart (OxygenCobalt)
*
* TODO: Debug subtle backwards movement of position on pause
*/
@HiltViewModel
class PlaybackViewModel

View file

@ -232,7 +232,7 @@ class PlaybackService :
return
}
logD("Loading ${song.name}")
logD("Loading $song")
player.setMediaItem(MediaItem.fromUri(song.uri))
player.prepare()
player.playWhenReady = play

View file

@ -33,10 +33,17 @@ import org.oxycblt.auxio.util.logD
*
* @author Alexander Capehart (OxygenCobalt)
*/
class AnimatedMaterialButton
@JvmOverloads
constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) :
RippleFixMaterialButton(context, attrs, defStyleAttr) {
class AnimatedMaterialButton : RippleFixMaterialButton {
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
constructor(
context: Context,
attrs: AttributeSet,
defStyleAttr: Int
) : super(context, attrs, defStyleAttr)
private var currentCornerRadiusRatio = 0f
private var animator: ValueAnimator? = null

View file

@ -35,6 +35,8 @@ import org.oxycblt.auxio.util.logD
* Implements the fuzzy-ish searching algorithm used in the search view.
*
* @author Alexander Capehart
*
* TODO: Handle locale changes
*/
interface SearchEngine {
/**