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. // the current sort of the tab.
if (isCurrentMode || isCurrentlyAscending || isCurrentlyDescending) { if (isCurrentMode || isCurrentlyAscending || isCurrentlyDescending) {
logD( 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 // 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 // buttons (even when setting it to false), which would result in nothing being
// selected. // selected.
@ -353,7 +353,7 @@ class HomeFragment :
// Disable options that are not allowed by the isVisible lambda // Disable options that are not allowed by the isVisible lambda
option.isVisible = isVisible(option.itemId) option.isVisible = isVisible(option.itemId)
if (!option.isVisible) { if (!option.isVisible) {
logD("Hiding $option") logD("Hiding $option option")
} }
} }
@ -467,13 +467,11 @@ class HomeFragment :
when (progress) { when (progress) {
is IndexingProgress.Indeterminate -> { is IndexingProgress.Indeterminate -> {
logD("Showing generic progress")
// In a query/initialization state, show a generic loading status. // In a query/initialization state, show a generic loading status.
binding.homeIndexingStatus.text = getString(R.string.lng_indexing) binding.homeIndexingStatus.text = getString(R.string.lng_indexing)
binding.homeIndexingProgress.isIndeterminate = true binding.homeIndexingProgress.isIndeterminate = true
} }
is IndexingProgress.Songs -> { is IndexingProgress.Songs -> {
logD("Showing song progress")
// Actively loading songs, show the current progress. // Actively loading songs, show the current progress.
binding.homeIndexingStatus.text = binding.homeIndexingStatus.text =
getString(R.string.fmt_indexing, progress.current, progress.total) 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 // 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. // popup to overlap with the FAB, so we hide the FAB when fast scrolling too.
if (songs.isEmpty() || isFastScrolling) { if (songs.isEmpty() || isFastScrolling) {
logD("Hiding fab: [empty: ${songs.isEmpty()} scrolling: $isFastScrolling") logD("Hiding fab: [empty: ${songs.isEmpty()} scrolling: $isFastScrolling]")
binding.homeFab.hide() binding.homeFab.hide()
} else { } else {
logD("Showing fab") logD("Showing fab")

View file

@ -143,7 +143,6 @@ constructor(
override fun onMusicChanges(changes: MusicRepository.Changes) { override fun onMusicChanges(changes: MusicRepository.Changes) {
val deviceLibrary = musicRepository.deviceLibrary val deviceLibrary = musicRepository.deviceLibrary
logD(changes.deviceLibrary)
if (changes.deviceLibrary && deviceLibrary != null) { if (changes.deviceLibrary && deviceLibrary != null) {
logD("Refreshing library") logD("Refreshing library")
// Get the each list of items in the library to use as our list data. // 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.context
import org.oxycblt.auxio.util.getPlural import org.oxycblt.auxio.util.getPlural
import org.oxycblt.auxio.util.inflater 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. * 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. * @param basicHeader The new [BasicHeader] to bind.
*/ */
fun bind(basicHeader: BasicHeader) { fun bind(basicHeader: BasicHeader) {
logD(binding.context.getString(basicHeader.titleRes))
binding.title.text = 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) * @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 { interface MusicRepository {
/** The current music information found on the device. */ /** 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. * An [ViewModel] that provides a safe UI frontend for the current playback state.
* *
* @author Alexander Capehart (OxygenCobalt) * @author Alexander Capehart (OxygenCobalt)
*
* TODO: Debug subtle backwards movement of position on pause
*/ */
@HiltViewModel @HiltViewModel
class PlaybackViewModel class PlaybackViewModel

View file

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

View file

@ -33,10 +33,17 @@ import org.oxycblt.auxio.util.logD
* *
* @author Alexander Capehart (OxygenCobalt) * @author Alexander Capehart (OxygenCobalt)
*/ */
class AnimatedMaterialButton class AnimatedMaterialButton : RippleFixMaterialButton {
@JvmOverloads constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) :
RippleFixMaterialButton(context, attrs, defStyleAttr) { 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 currentCornerRadiusRatio = 0f
private var animator: ValueAnimator? = null 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. * Implements the fuzzy-ish searching algorithm used in the search view.
* *
* @author Alexander Capehart * @author Alexander Capehart
*
* TODO: Handle locale changes
*/ */
interface SearchEngine { interface SearchEngine {
/** /**