all: cleanup
This commit is contained in:
parent
22ddda4e60
commit
7dfaea3a4b
34 changed files with 43 additions and 227 deletions
|
@ -93,7 +93,8 @@
|
||||||
android:foregroundServiceType="mediaPlayback"
|
android:foregroundServiceType="mediaPlayback"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:roundIcon="@mipmap/ic_launcher">
|
android:roundIcon="@mipmap/ic_launcher"
|
||||||
|
tools:ignore="ExportedService">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.media.browse.MediaBrowserService"/>
|
<action android:name="android.media.browse.MediaBrowserService"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
|
@ -36,7 +36,6 @@ import dagger.hilt.android.AndroidEntryPoint
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
import org.oxycblt.auxio.music.service.MusicServiceFragment
|
import org.oxycblt.auxio.music.service.MusicServiceFragment
|
||||||
import org.oxycblt.auxio.playback.service.PlaybackServiceFragment
|
import org.oxycblt.auxio.playback.service.PlaybackServiceFragment
|
||||||
import timber.log.Timber as T
|
|
||||||
|
|
||||||
@AndroidEntryPoint
|
@AndroidEntryPoint
|
||||||
class AuxioService :
|
class AuxioService :
|
||||||
|
@ -150,7 +149,6 @@ class AuxioService :
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun invalidateMusic(mediaId: String) {
|
override fun invalidateMusic(mediaId: String) {
|
||||||
T.d(mediaId)
|
|
||||||
notifyChildrenChanged(mediaId)
|
notifyChildrenChanged(mediaId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,6 @@ import org.oxycblt.auxio.music.resolveNames
|
||||||
import org.oxycblt.auxio.playback.PlaybackDecision
|
import org.oxycblt.auxio.playback.PlaybackDecision
|
||||||
import org.oxycblt.auxio.util.collect
|
import org.oxycblt.auxio.util.collect
|
||||||
import org.oxycblt.auxio.util.collectImmediately
|
import org.oxycblt.auxio.util.collectImmediately
|
||||||
import org.oxycblt.auxio.util.context
|
|
||||||
import org.oxycblt.auxio.util.getPlural
|
import org.oxycblt.auxio.util.getPlural
|
||||||
import org.oxycblt.auxio.util.navigateSafe
|
import org.oxycblt.auxio.util.navigateSafe
|
||||||
import org.oxycblt.auxio.util.showToast
|
import org.oxycblt.auxio.util.showToast
|
||||||
|
|
|
@ -38,7 +38,6 @@ import org.oxycblt.auxio.list.recycler.DividerViewHolder
|
||||||
import org.oxycblt.auxio.music.Music
|
import org.oxycblt.auxio.music.Music
|
||||||
import org.oxycblt.auxio.util.context
|
import org.oxycblt.auxio.util.context
|
||||||
import org.oxycblt.auxio.util.inflater
|
import org.oxycblt.auxio.util.inflater
|
||||||
import timber.log.Timber as T
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A [RecyclerView.Adapter] that implements shared behavior between lists of child items in the
|
* A [RecyclerView.Adapter] that implements shared behavior between lists of child items in the
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
package org.oxycblt.auxio.list
|
package org.oxycblt.auxio.list
|
||||||
|
|
||||||
import androidx.annotation.StringRes
|
import androidx.annotation.StringRes
|
||||||
import timber.log.Timber as T
|
|
||||||
|
|
||||||
// TODO: Consider breaking this up into sealed classes for individual adapters
|
// TODO: Consider breaking this up into sealed classes for individual adapters
|
||||||
/** A marker for something that is a RecyclerView item. Has no functionality on it's own. */
|
/** A marker for something that is a RecyclerView item. Has no functionality on it's own. */
|
||||||
|
|
|
@ -21,7 +21,6 @@ package org.oxycblt.auxio.list
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import androidx.viewbinding.ViewBinding
|
import androidx.viewbinding.ViewBinding
|
||||||
import org.oxycblt.auxio.music.Music
|
import org.oxycblt.auxio.music.Music
|
||||||
import timber.log.Timber as T
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Fragment containing a selectable list.
|
* A Fragment containing a selectable list.
|
||||||
|
|
|
@ -21,7 +21,6 @@ package org.oxycblt.auxio.list
|
||||||
import android.view.MotionEvent
|
import android.view.MotionEvent
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import timber.log.Timber as T
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A basic listener for list interactions.
|
* A basic listener for list interactions.
|
||||||
|
|
|
@ -25,7 +25,6 @@ import androidx.recyclerview.widget.AsyncDifferConfig
|
||||||
import androidx.recyclerview.widget.DiffUtil
|
import androidx.recyclerview.widget.DiffUtil
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import java.util.concurrent.Executor
|
import java.util.concurrent.Executor
|
||||||
import timber.log.Timber as T
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A variant of ListDiffer with more flexible updates.
|
* A variant of ListDiffer with more flexible updates.
|
||||||
|
|
|
@ -21,7 +21,6 @@ package org.oxycblt.auxio.list.adapter
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.recyclerview.widget.DiffUtil
|
import androidx.recyclerview.widget.DiffUtil
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import timber.log.Timber as T
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A [RecyclerView.Adapter] that supports indicating the playback status of a particular item.
|
* A [RecyclerView.Adapter] that supports indicating the playback status of a particular item.
|
||||||
|
|
|
@ -22,7 +22,6 @@ import android.view.View
|
||||||
import androidx.recyclerview.widget.DiffUtil
|
import androidx.recyclerview.widget.DiffUtil
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import org.oxycblt.auxio.music.Music
|
import org.oxycblt.auxio.music.Music
|
||||||
import timber.log.Timber as T
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A [PlayingIndicatorAdapter] that also supports indicating the selection status of a group of
|
* A [PlayingIndicatorAdapter] that also supports indicating the selection status of a group of
|
||||||
|
|
|
@ -20,7 +20,6 @@ package org.oxycblt.auxio.list.adapter
|
||||||
|
|
||||||
import androidx.recyclerview.widget.DiffUtil
|
import androidx.recyclerview.widget.DiffUtil
|
||||||
import org.oxycblt.auxio.list.Item
|
import org.oxycblt.auxio.list.Item
|
||||||
import timber.log.Timber as T
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A [DiffUtil.ItemCallback] that automatically implements the [areItemsTheSame] method. Use this
|
* A [DiffUtil.ItemCallback] that automatically implements the [areItemsTheSame] method. Use this
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
package org.oxycblt.auxio.list.recycler
|
package org.oxycblt.auxio.list.recycler
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.google.android.material.divider.MaterialDivider
|
import com.google.android.material.divider.MaterialDivider
|
||||||
|
@ -382,6 +383,7 @@ class DividerViewHolder private constructor(divider: MaterialDivider) :
|
||||||
/** A comparator that can be used with DiffUtil. */
|
/** A comparator that can be used with DiffUtil. */
|
||||||
val DIFF_CALLBACK =
|
val DIFF_CALLBACK =
|
||||||
object : SimpleDiffCallback<PlainDivider>() {
|
object : SimpleDiffCallback<PlainDivider>() {
|
||||||
|
@SuppressLint("DiffUtilEquals")
|
||||||
override fun areContentsTheSame(oldItem: PlainDivider, newItem: PlainDivider) =
|
override fun areContentsTheSame(oldItem: PlainDivider, newItem: PlainDivider) =
|
||||||
oldItem.anchor == newItem.anchor
|
oldItem.anchor == newItem.anchor
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,9 +22,6 @@ import android.content.Context
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Parcelable
|
import android.os.Parcelable
|
||||||
import androidx.room.TypeConverter
|
import androidx.room.TypeConverter
|
||||||
import java.security.MessageDigest
|
|
||||||
import java.util.UUID
|
|
||||||
import kotlin.math.max
|
|
||||||
import kotlinx.parcelize.IgnoredOnParcel
|
import kotlinx.parcelize.IgnoredOnParcel
|
||||||
import kotlinx.parcelize.Parcelize
|
import kotlinx.parcelize.Parcelize
|
||||||
import org.oxycblt.auxio.image.extractor.Cover
|
import org.oxycblt.auxio.image.extractor.Cover
|
||||||
|
@ -39,7 +36,9 @@ import org.oxycblt.auxio.music.info.ReleaseType
|
||||||
import org.oxycblt.auxio.playback.replaygain.ReplayGainAdjustment
|
import org.oxycblt.auxio.playback.replaygain.ReplayGainAdjustment
|
||||||
import org.oxycblt.auxio.util.concatLocalized
|
import org.oxycblt.auxio.util.concatLocalized
|
||||||
import org.oxycblt.auxio.util.toUuidOrNull
|
import org.oxycblt.auxio.util.toUuidOrNull
|
||||||
import timber.log.Timber as T
|
import java.security.MessageDigest
|
||||||
|
import java.util.UUID
|
||||||
|
import kotlin.math.max
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract music data. This contains universal information about all concrete music
|
* Abstract music data. This contains universal information about all concrete music
|
||||||
|
|
|
@ -261,7 +261,7 @@ constructor(
|
||||||
}
|
}
|
||||||
commonIndex == components.size -> {
|
commonIndex == components.size -> {
|
||||||
// The working directory is deeper in the path, backtrack.
|
// The working directory is deeper in the path, backtrack.
|
||||||
for (i in 0..workingDirectory.components.size - commonIndex - 1) {
|
for (i in 0..<workingDirectory.components.size - commonIndex) {
|
||||||
relativeComponents = relativeComponents.child("..")
|
relativeComponents = relativeComponents.child("..")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -272,7 +272,7 @@ constructor(
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
// The paths are siblings. Backtrack and append as needed.
|
// The paths are siblings. Backtrack and append as needed.
|
||||||
for (i in 0..workingDirectory.components.size - commonIndex - 1) {
|
for (i in 0..<workingDirectory.components.size - commonIndex) {
|
||||||
relativeComponents = relativeComponents.child("..")
|
relativeComponents = relativeComponents.child("..")
|
||||||
}
|
}
|
||||||
relativeComponents = relativeComponents.child(depth(commonIndex))
|
relativeComponents = relativeComponents.child(depth(commonIndex))
|
||||||
|
|
|
@ -38,8 +38,8 @@ import timber.log.Timber as T
|
||||||
*/
|
*/
|
||||||
class Date private constructor(private val tokens: List<Int>) : Comparable<Date> {
|
class Date private constructor(private val tokens: List<Int>) : Comparable<Date> {
|
||||||
val year = tokens[0]
|
val year = tokens[0]
|
||||||
val month = tokens.getOrNull(1)
|
private val month = tokens.getOrNull(1)
|
||||||
val day = tokens.getOrNull(2)
|
private val day = tokens.getOrNull(2)
|
||||||
private val hour = tokens.getOrNull(3)
|
private val hour = tokens.getOrNull(3)
|
||||||
private val minute = tokens.getOrNull(4)
|
private val minute = tokens.getOrNull(4)
|
||||||
private val second = tokens.getOrNull(5)
|
private val second = tokens.getOrNull(5)
|
||||||
|
|
|
@ -23,7 +23,6 @@ import android.os.Bundle
|
||||||
import android.support.v4.media.MediaBrowserCompat.MediaItem
|
import android.support.v4.media.MediaBrowserCompat.MediaItem
|
||||||
import androidx.media.MediaBrowserServiceCompat.BrowserRoot
|
import androidx.media.MediaBrowserServiceCompat.BrowserRoot
|
||||||
import androidx.media.MediaBrowserServiceCompat.Result
|
import androidx.media.MediaBrowserServiceCompat.Result
|
||||||
import javax.inject.Inject
|
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
|
@ -31,12 +30,12 @@ import kotlinx.coroutines.launch
|
||||||
import org.oxycblt.auxio.ForegroundListener
|
import org.oxycblt.auxio.ForegroundListener
|
||||||
import org.oxycblt.auxio.ForegroundServiceNotification
|
import org.oxycblt.auxio.ForegroundServiceNotification
|
||||||
import org.oxycblt.auxio.music.MusicRepository
|
import org.oxycblt.auxio.music.MusicRepository
|
||||||
import timber.log.Timber as T
|
import javax.inject.Inject
|
||||||
|
|
||||||
class MusicServiceFragment
|
class MusicServiceFragment
|
||||||
@Inject
|
@Inject
|
||||||
constructor(
|
constructor(
|
||||||
private val context: Context,
|
context: Context,
|
||||||
foregroundListener: ForegroundListener,
|
foregroundListener: ForegroundListener,
|
||||||
private val invalidator: Invalidator,
|
private val invalidator: Invalidator,
|
||||||
indexerFactory: Indexer.Factory,
|
indexerFactory: Indexer.Factory,
|
||||||
|
|
|
@ -33,7 +33,7 @@ import timber.log.Timber as T
|
||||||
/**
|
/**
|
||||||
* A [ContentObserver] that observes the [MediaStore] music database for changes, a behavior known
|
* A [ContentObserver] that observes the [MediaStore] music database for changes, a behavior known
|
||||||
* to the user as automatic rescanning. The active (and not passive) nature of observing the
|
* to the user as automatic rescanning. The active (and not passive) nature of observing the
|
||||||
* database is what requires [IndexerServiceFragment] to stay foreground when this is enabled.
|
* database is what requires [MusicServiceFragment] to stay foreground when this is enabled.
|
||||||
*/
|
*/
|
||||||
class SystemContentObserver
|
class SystemContentObserver
|
||||||
@Inject
|
@Inject
|
||||||
|
|
|
@ -31,7 +31,7 @@ import timber.log.Timber as T
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A [BroadcastReceiver] that forwards [Intent.ACTION_MEDIA_BUTTON] [Intent]s to
|
* A [BroadcastReceiver] that forwards [Intent.ACTION_MEDIA_BUTTON] [Intent]s to
|
||||||
* [MediaSessionServiceFragment].
|
* [PlaybackServiceFragment].
|
||||||
*
|
*
|
||||||
* @author Alexander Capehart (OxygenCobalt)
|
* @author Alexander Capehart (OxygenCobalt)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -53,7 +53,7 @@ import timber.log.Timber as T
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A component that mirrors the current playback state into the [MediaSessionCompat] and
|
* A component that mirrors the current playback state into the [MediaSessionCompat] and
|
||||||
* [NotificationComponent].
|
* [PlaybackNotification].
|
||||||
*
|
*
|
||||||
* @author Alexander Capehart (OxygenCobalt)
|
* @author Alexander Capehart (OxygenCobalt)
|
||||||
*/
|
*/
|
||||||
|
@ -109,7 +109,7 @@ private constructor(
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Release this instance, closing the [MediaSessionCompat] and preventing any further updates to
|
* Release this instance, closing the [MediaSessionCompat] and preventing any further updates to
|
||||||
* the [NotificationComponent].
|
* the [PlaybackNotification].
|
||||||
*/
|
*/
|
||||||
fun release() {
|
fun release() {
|
||||||
bitmapProvider.release()
|
bitmapProvider.release()
|
||||||
|
@ -202,7 +202,7 @@ private constructor(
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Upload a new [MediaMetadataCompat] based on the current playback state to the
|
* Upload a new [MediaMetadataCompat] based on the current playback state to the
|
||||||
* [MediaSessionCompat] and [NotificationComponent].
|
* [MediaSessionCompat] and [PlaybackNotification].
|
||||||
*
|
*
|
||||||
* @param song The current [Song] to create the [MediaMetadataCompat] from, or null if no [Song]
|
* @param song The current [Song] to create the [MediaMetadataCompat] from, or null if no [Song]
|
||||||
* is currently playing.
|
* is currently playing.
|
||||||
|
|
|
@ -59,25 +59,22 @@ constructor(
|
||||||
) : MediaSessionCompat.Callback() {
|
) : MediaSessionCompat.Callback() {
|
||||||
private val jaroWinkler = JaroWinklerSimilarity()
|
private val jaroWinkler = JaroWinklerSimilarity()
|
||||||
|
|
||||||
override fun onPrepare() {
|
// STUBS: We already automatically prepare playback.
|
||||||
super.onPrepare()
|
// override fun onPrepare() {
|
||||||
// STUB, we already automatically prepare playback.
|
// super.onPrepare()
|
||||||
}
|
// }
|
||||||
|
|
||||||
override fun onPrepareFromMediaId(mediaId: String?, extras: Bundle?) {
|
// override fun onPrepareFromMediaId(mediaId: String?, extras: Bundle?) {
|
||||||
super.onPrepareFromMediaId(mediaId, extras)
|
// super.onPrepareFromMediaId(mediaId, extras)
|
||||||
// STUB, can't tell when this is called
|
// }
|
||||||
}
|
//
|
||||||
|
// override fun onPrepareFromUri(uri: Uri?, extras: Bundle?) {
|
||||||
override fun onPrepareFromUri(uri: Uri?, extras: Bundle?) {
|
// super.onPrepareFromUri(uri, extras)
|
||||||
super.onPrepareFromUri(uri, extras)
|
// }
|
||||||
// STUB, can't tell when this is called
|
//
|
||||||
}
|
// override fun onPlayFromUri(uri: Uri?, extras: Bundle?) {
|
||||||
|
// super.onPlayFromUri(uri, extras)
|
||||||
override fun onPlayFromUri(uri: Uri?, extras: Bundle?) {
|
// }
|
||||||
super.onPlayFromUri(uri, extras)
|
|
||||||
// STUB, can't tell when this is called
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onPlayFromMediaId(mediaId: String?, extras: Bundle?) {
|
override fun onPlayFromMediaId(mediaId: String?, extras: Bundle?) {
|
||||||
super.onPlayFromMediaId(mediaId, extras)
|
super.onPlayFromMediaId(mediaId, extras)
|
||||||
|
|
|
@ -32,14 +32,14 @@ import timber.log.Timber as T
|
||||||
|
|
||||||
class PlaybackServiceFragment
|
class PlaybackServiceFragment
|
||||||
private constructor(
|
private constructor(
|
||||||
private val context: Context,
|
context: Context,
|
||||||
private val foregroundListener: ForegroundListener,
|
private val foregroundListener: ForegroundListener,
|
||||||
private val playbackManager: PlaybackStateManager,
|
private val playbackManager: PlaybackStateManager,
|
||||||
exoHolderFactory: ExoPlaybackStateHolder.Factory,
|
exoHolderFactory: ExoPlaybackStateHolder.Factory,
|
||||||
sessionHolderFactory: MediaSessionHolder.Factory,
|
sessionHolderFactory: MediaSessionHolder.Factory,
|
||||||
widgetComponentFactory: WidgetComponent.Factory,
|
widgetComponentFactory: WidgetComponent.Factory,
|
||||||
systemReceiverFactory: SystemPlaybackReceiver.Factory,
|
systemReceiverFactory: SystemPlaybackReceiver.Factory,
|
||||||
) : MediaSessionCompat.Callback(), PlaybackStateManager.Listener {
|
) : PlaybackStateManager.Listener {
|
||||||
class Factory
|
class Factory
|
||||||
@Inject
|
@Inject
|
||||||
constructor(
|
constructor(
|
||||||
|
|
|
@ -54,6 +54,7 @@ private constructor(
|
||||||
SystemPlaybackReceiver(context, playbackManager, playbackSettings, widgetComponent)
|
SystemPlaybackReceiver(context, playbackManager, playbackSettings, widgetComponent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("WrongConstant")
|
||||||
fun attach() {
|
fun attach() {
|
||||||
ContextCompat.registerReceiver(
|
ContextCompat.registerReceiver(
|
||||||
context, this, INTENT_FILTER, ContextCompat.RECEIVER_EXPORTED)
|
context, this, INTENT_FILTER, ContextCompat.RECEIVER_EXPORTED)
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
|
|
||||||
package org.oxycblt.auxio.playback.state
|
package org.oxycblt.auxio.playback.state
|
||||||
|
|
||||||
import javax.inject.Inject
|
|
||||||
import org.oxycblt.auxio.list.ListSettings
|
import org.oxycblt.auxio.list.ListSettings
|
||||||
import org.oxycblt.auxio.list.sort.Sort
|
import org.oxycblt.auxio.list.sort.Sort
|
||||||
import org.oxycblt.auxio.music.Album
|
import org.oxycblt.auxio.music.Album
|
||||||
|
@ -29,7 +28,7 @@ import org.oxycblt.auxio.music.MusicRepository
|
||||||
import org.oxycblt.auxio.music.Playlist
|
import org.oxycblt.auxio.music.Playlist
|
||||||
import org.oxycblt.auxio.music.Song
|
import org.oxycblt.auxio.music.Song
|
||||||
import org.oxycblt.auxio.playback.PlaybackSettings
|
import org.oxycblt.auxio.playback.PlaybackSettings
|
||||||
import timber.log.Timber as T
|
import javax.inject.Inject
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A playback command that can be passed to [PlaybackStateManager] to start new playback.
|
* A playback command that can be passed to [PlaybackStateManager] to start new playback.
|
||||||
|
|
|
@ -61,7 +61,7 @@ interface SearchEngine {
|
||||||
val artists: Collection<Artist>? = null,
|
val artists: Collection<Artist>? = null,
|
||||||
val genres: Collection<Genre>? = null,
|
val genres: Collection<Genre>? = null,
|
||||||
val playlists: Collection<Playlist>? = null
|
val playlists: Collection<Playlist>? = null
|
||||||
) {}
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
class SearchEngineImpl @Inject constructor(@ApplicationContext private val context: Context) :
|
class SearchEngineImpl @Inject constructor(@ApplicationContext private val context: Context) :
|
||||||
|
|
|
@ -45,7 +45,7 @@ class StartActionHelper(config: TaskerPluginConfig<Unit>) :
|
||||||
}
|
}
|
||||||
|
|
||||||
class ActivityConfigStartAction : Activity(), TaskerPluginConfigNoInput {
|
class ActivityConfigStartAction : Activity(), TaskerPluginConfigNoInput {
|
||||||
override val context
|
override val context: Context
|
||||||
get() = applicationContext
|
get() = applicationContext
|
||||||
|
|
||||||
private val taskerHelper by lazy { StartActionHelper(this) }
|
private val taskerHelper by lazy { StartActionHelper(this) }
|
||||||
|
|
|
@ -40,7 +40,6 @@ import kotlin.reflect.KClass
|
||||||
import org.oxycblt.auxio.IntegerTable
|
import org.oxycblt.auxio.IntegerTable
|
||||||
import org.oxycblt.auxio.MainActivity
|
import org.oxycblt.auxio.MainActivity
|
||||||
import org.oxycblt.auxio.R
|
import org.oxycblt.auxio.R
|
||||||
import timber.log.Timber as T
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a [LayoutInflater] instance from this [Context].
|
* Get a [LayoutInflater] instance from this [Context].
|
||||||
|
|
|
@ -3,7 +3,7 @@ package org.oxycblt.auxio.util
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
|
|
||||||
class CopyleftNoticeTree : Timber.DebugTree() {
|
class CopyleftNoticeTree : Timber.DebugTree() {
|
||||||
// Feel free to remove this if you are forking the project in good faith.
|
// Feel free to remove this logger if you are forking the project in good faith.
|
||||||
//
|
//
|
||||||
// However, if you are stealing the source code to repackage it into a new closed-source app,
|
// However, if you are stealing the source code to repackage it into a new closed-source app,
|
||||||
// I will warn you that the One True, Living, Almighty God HATES thieves and WILL punish you
|
// I will warn you that the One True, Living, Almighty God HATES thieves and WILL punish you
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
package org.oxycblt.auxio.util
|
package org.oxycblt.auxio.util
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
import android.content.ActivityNotFoundException
|
import android.content.ActivityNotFoundException
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
@ -117,6 +118,7 @@ val ViewBinding.context: Context
|
||||||
* Override the behavior of a [MaterialToolbar]'s overflow menu to do something else. This is
|
* Override the behavior of a [MaterialToolbar]'s overflow menu to do something else. This is
|
||||||
* extremely dumb, but required to hook overflow menus to bottom sheet menus.
|
* extremely dumb, but required to hook overflow menus to bottom sheet menus.
|
||||||
*/
|
*/
|
||||||
|
@SuppressLint("RestrictedApi")
|
||||||
fun Toolbar.overrideOnOverflowMenuClick(block: (View) -> Unit) {
|
fun Toolbar.overrideOnOverflowMenuClick(block: (View) -> Unit) {
|
||||||
for (toolbarChild in children) {
|
for (toolbarChild in children) {
|
||||||
if (toolbarChild is ActionMenuView) {
|
if (toolbarChild is ActionMenuView) {
|
||||||
|
|
|
@ -23,7 +23,6 @@ import java.util.UUID
|
||||||
import kotlin.reflect.KClass
|
import kotlin.reflect.KClass
|
||||||
import org.oxycblt.auxio.BuildConfig
|
import org.oxycblt.auxio.BuildConfig
|
||||||
import org.oxycblt.auxio.music.info.Date
|
import org.oxycblt.auxio.music.info.Date
|
||||||
import timber.log.Timber as T
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sanitizes a value that is unlikely to be null. On debug builds, this aliases to [requireNotNull],
|
* Sanitizes a value that is unlikely to be null. On debug builds, this aliases to [requireNotNull],
|
||||||
|
|
|
@ -24,7 +24,7 @@ import coil.size.Size
|
||||||
import coil.transform.Transformation
|
import coil.transform.Transformation
|
||||||
import kotlin.math.sqrt
|
import kotlin.math.sqrt
|
||||||
|
|
||||||
class WidgetBitmapTransformation(private val reduce: Float) : Transformation {
|
class WidgetBitmapTransformation(reduce: Float) : Transformation {
|
||||||
private val metrics = Resources.getSystem().displayMetrics
|
private val metrics = Resources.getSystem().displayMetrics
|
||||||
private val sw = metrics.widthPixels
|
private val sw = metrics.widthPixels
|
||||||
private val sh = metrics.heightPixels
|
private val sh = metrics.heightPixels
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<item android:alpha="0.24" android:color="?attr/colorOnSurface" />
|
|
||||||
</selector>
|
|
|
@ -1,56 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<org.oxycblt.auxio.image.CoverView
|
|
||||||
android:id="@+id/playback_cover"
|
|
||||||
style="@style/Widget.Auxio.Image.Full"
|
|
||||||
android:layout_margin="@dimen/spacing_medium"
|
|
||||||
app:enablePlaybackIndicator="false"
|
|
||||||
app:enableSelectionBadge="false"
|
|
||||||
app:layout_constraintBottom_toTopOf="@id/playback_song"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/playback_song"
|
|
||||||
style="@style/Widget.Auxio.TextView.Primary"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="@dimen/spacing_medium"
|
|
||||||
android:layout_marginEnd="@dimen/spacing_medium"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/playback_artist"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintVertical_chainStyle="packed"
|
|
||||||
tools:text="Song Name" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/playback_artist"
|
|
||||||
style="@style/Widget.Auxio.TextView.Secondary.Marquee"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="@dimen/spacing_medium"
|
|
||||||
android:layout_marginEnd="@dimen/spacing_medium"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/playback_album"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
tools:text="Artist Name" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/playback_album"
|
|
||||||
style="@style/Widget.Auxio.TextView.Secondary.Marquee"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="@dimen/spacing_medium"
|
|
||||||
android:layout_marginEnd="@dimen/spacing_medium"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
tools:text="Album Name" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
|
@ -1,56 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<org.oxycblt.auxio.image.CoverView
|
|
||||||
android:id="@+id/playback_cover"
|
|
||||||
style="@style/Widget.Auxio.Image.Full"
|
|
||||||
android:layout_margin="@dimen/spacing_medium"
|
|
||||||
app:enablePlaybackIndicator="false"
|
|
||||||
app:enableSelectionBadge="false"
|
|
||||||
app:layout_constraintBottom_toTopOf="@id/playback_song"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/playback_song"
|
|
||||||
style="@style/Widget.Auxio.TextView.Primary"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="@dimen/spacing_medium"
|
|
||||||
android:layout_marginEnd="@dimen/spacing_medium"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/playback_artist"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintVertical_chainStyle="packed"
|
|
||||||
tools:text="Song Name" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/playback_artist"
|
|
||||||
style="@style/Widget.Auxio.TextView.Secondary.Marquee"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="@dimen/spacing_medium"
|
|
||||||
android:layout_marginEnd="@dimen/spacing_medium"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/playback_album"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
tools:text="Artist Name" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/playback_album"
|
|
||||||
style="@style/Widget.Auxio.TextView.Secondary.Marquee"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="@dimen/spacing_medium"
|
|
||||||
android:layout_marginEnd="@dimen/spacing_medium"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
tools:text="Album Name" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
|
@ -1,55 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<org.oxycblt.auxio.image.CoverView
|
|
||||||
android:id="@+id/playback_cover"
|
|
||||||
style="@style/Widget.Auxio.Image.Full"
|
|
||||||
android:layout_margin="@dimen/spacing_medium"
|
|
||||||
app:enablePlaybackIndicator="false"
|
|
||||||
app:enableSelectionBadge="false"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<!-- Playback information is wrapped in a container so that marquee doesn't break -->
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/playback_info_container"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginHorizontal="@dimen/spacing_medium"
|
|
||||||
android:orientation="vertical"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintHorizontal_bias="0.5"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/playback_cover"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintVertical_chainStyle="packed">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/playback_song"
|
|
||||||
style="@style/Widget.Auxio.TextView.Primary"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
tools:text="Song Name" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/playback_artist"
|
|
||||||
style="@style/Widget.Auxio.TextView.Secondary.Marquee"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
tools:text="Artist Name" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/playback_album"
|
|
||||||
style="@style/Widget.Auxio.TextView.Secondary.Marquee"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
tools:text="Album Name" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
Loading…
Reference in a new issue