diff --git a/.github/ISSUE_TEMPLATE/bug-crash-report.md b/.github/ISSUE_TEMPLATE/bug-crash-report.md index 9502d72ff..2c93a498a 100644 --- a/.github/ISSUE_TEMPLATE/bug-crash-report.md +++ b/.github/ISSUE_TEMPLATE/bug-crash-report.md @@ -26,12 +26,12 @@ assignees: '' If possible, provide a stack trace or a Logcat. This can help identify the issue. To take a logcat, you must do the following: 1. Use a desktop/laptop to download the android platform tools from https://developer.android.com/studio/releases/platform-tools. -2. Extract the downloaded file to a folder +2. Extract the downloaded file to a folder. 3. Enable USB debugging on your phone [See https://developer.android.com/studio/command-line/adb#Enabling], and then connect your phone to a laptop. You will get a prompt to "Allow USB debugging" when you run the logcat command. Accept this. 4. Open up a terminal/command prompt in that folder and run: - `./adb -d logcat | grep -i "[DWE] Auxio"` in the case of a bug [may require some changes on windows] - - `./adb -d logcat AndroidRuntime:E *:S` in the case of a crash. + - `./adb -d logcat AndroidRuntime:E *:S` in the case of a crash 5. Copy and paste the output to this area of the issue. --> diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md index 463951fd3..24e890b14 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.md +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -7,6 +7,14 @@ assignees: '' --- + + #### Describe the feature you want to implement: diff --git a/app/build.gradle b/app/build.gradle index 309abbf8a..465ca89a9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -67,7 +67,7 @@ dependencies { // UI implementation "androidx.recyclerview:recyclerview:1.2.1" - implementation "androidx.constraintlayout:constraintlayout:2.1.3" + implementation "androidx.constraintlayout:constraintlayout:2.1.4" implementation "androidx.dynamicanimation:dynamicanimation:1.0.0" implementation "androidx.viewpager2:viewpager2:1.1.0-beta01" @@ -99,7 +99,7 @@ dependencies { implementation fileTree(dir: "libs", include: ["extension-*.aar"]) // Image loading - implementation "io.coil-kt:coil:2.0.0-rc03" + implementation "io.coil-kt:coil:2.1.0" // Material implementation "com.google.android.material:material:1.6.0" diff --git a/app/src/main/java/org/oxycblt/auxio/coil/BitmapProvider.kt b/app/src/main/java/org/oxycblt/auxio/coil/BitmapProvider.kt index c69fcb4d7..ec6b3fd04 100644 --- a/app/src/main/java/org/oxycblt/auxio/coil/BitmapProvider.kt +++ b/app/src/main/java/org/oxycblt/auxio/coil/BitmapProvider.kt @@ -32,7 +32,7 @@ import org.oxycblt.auxio.music.Song * Pretty much each service component needs to load bitmaps of some kind, but doing a blind image * request with some target callbacks could result in overlapping requests causing unrelated * updates. This class (to an extent) resolves this by keeping track of the current request and - * disposes of it every time a new request is created. This greatly reduces the surface for race + * disposing of it every time a new request is created. This greatly reduces the surface for race * conditions save the case of instruction-by-instruction data races, which are effectively * impossible to solve. * diff --git a/app/src/main/java/org/oxycblt/auxio/music/Indexer.kt b/app/src/main/java/org/oxycblt/auxio/music/Indexer.kt index 04e50efe2..203ad5249 100644 --- a/app/src/main/java/org/oxycblt/auxio/music/Indexer.kt +++ b/app/src/main/java/org/oxycblt/auxio/music/Indexer.kt @@ -136,7 +136,6 @@ object Indexer { */ private fun loadSongs(context: Context): List { val excludedDatabase = ExcludedDatabase.getInstance(context) - val paths = excludedDatabase.readPaths() var selector = "${MediaStore.Audio.Media.IS_MUSIC}=1" val args = mutableListOf() @@ -189,14 +188,14 @@ object Indexer { val title = cursor.getString(titleIndex) // Try to use the DISPLAY_NAME field to obtain a (probably sane) file name - // from the android system. Once gain though, OEM issues get in our way and + // from the android system. Once again though, OEM issues get in our way and // this field isn't available on some platforms. In that case, see if we can // grok a file name from the DATA field. val fileName = cursor.getStringOrNull(fileIndex) - ?: cursor.getStringOrNull(dataIndex)?.run { - substringAfterLast('/', "").ifEmpty { null } - } + ?: cursor + .getStringOrNull(dataIndex) + ?.substringAfterLast('/', MediaStore.UNKNOWN_STRING) ?: MediaStore.UNKNOWN_STRING // The TRACK field is for some reason formatted as DTTT, where D is the disk diff --git a/app/src/main/java/org/oxycblt/auxio/music/Music.kt b/app/src/main/java/org/oxycblt/auxio/music/Music.kt index a1d2a8dd4..3ec1dca0d 100644 --- a/app/src/main/java/org/oxycblt/auxio/music/Music.kt +++ b/app/src/main/java/org/oxycblt/auxio/music/Music.kt @@ -51,6 +51,7 @@ sealed class Music : Item() { * [Album] or [Artist] */ sealed class MusicParent : Music() { + /** The songs that this parent owns. */ abstract val songs: List } diff --git a/app/src/main/java/org/oxycblt/auxio/playback/PlaybackPanelFragment.kt b/app/src/main/java/org/oxycblt/auxio/playback/PlaybackPanelFragment.kt index 036a42be0..0fd2f082b 100644 --- a/app/src/main/java/org/oxycblt/auxio/playback/PlaybackPanelFragment.kt +++ b/app/src/main/java/org/oxycblt/auxio/playback/PlaybackPanelFragment.kt @@ -36,7 +36,6 @@ import org.oxycblt.auxio.playback.state.RepeatMode import org.oxycblt.auxio.ui.MainNavigationAction import org.oxycblt.auxio.ui.NavigationViewModel import org.oxycblt.auxio.ui.ViewBindingFragment -import org.oxycblt.auxio.util.clamp import org.oxycblt.auxio.util.formatDuration import org.oxycblt.auxio.util.getAttrColorSafe import org.oxycblt.auxio.util.logD @@ -187,8 +186,7 @@ class PlaybackPanelFragment : binding.playbackDuration.textSafe = seconds.formatDuration(false) binding.playbackSeekBar.apply { isEnabled = seconds > 0L - valueTo = max(seconds, 1L).toFloat() - value = seconds.clamp(0, valueTo.toLong()).toFloat() + valueToSafe = max(seconds, 1L).toFloat() } } @@ -202,7 +200,7 @@ class PlaybackPanelFragment : // around. val binding = requireBinding() if (!binding.playbackPosition.isActivated) { - binding.playbackSeekBar.value = position.toFloat() + binding.playbackSeekBar.valueSafe = position.toFloat() binding.playbackPosition.textSafe = position.formatDuration(true) } } @@ -221,4 +219,26 @@ class PlaybackPanelFragment : private fun updateShuffled(isShuffled: Boolean) { requireBinding().playbackShuffle.isActivated = isShuffled } + + private var Slider.valueSafe: Float + get() = value + set(v) { + value = + if (v > valueTo) { + valueTo + } else { + v + } + } + + private var Slider.valueToSafe: Float + get() = valueTo + set(v) { + valueTo = + if (value > v) { + value + } else { + v + } + } } diff --git a/app/src/main/java/org/oxycblt/auxio/playback/PlaybackViewModel.kt b/app/src/main/java/org/oxycblt/auxio/playback/PlaybackViewModel.kt index 2a2fbb1c9..ea3366d28 100644 --- a/app/src/main/java/org/oxycblt/auxio/playback/PlaybackViewModel.kt +++ b/app/src/main/java/org/oxycblt/auxio/playback/PlaybackViewModel.kt @@ -294,6 +294,7 @@ class PlaybackViewModel : ViewModel(), PlaybackStateManager.Callback { private fun restorePlaybackState() { logD("Attempting to restore playback state") + onNewPlayback(playbackManager.index, playbackManager.queue, playbackManager.parent) onPositionChanged(playbackManager.positionMs) onPlayingChanged(playbackManager.isPlaying) onShuffledChanged(playbackManager.isShuffled) diff --git a/app/src/main/java/org/oxycblt/auxio/playback/state/PlaybackStateManager.kt b/app/src/main/java/org/oxycblt/auxio/playback/state/PlaybackStateManager.kt index a35cdb550..03cb52825 100644 --- a/app/src/main/java/org/oxycblt/auxio/playback/state/PlaybackStateManager.kt +++ b/app/src/main/java/org/oxycblt/auxio/playback/state/PlaybackStateManager.kt @@ -127,7 +127,6 @@ class PlaybackStateManager private constructor() { applyNewQueue(library, settingsManager.keepShuffle && isShuffled, song) notifyNewPlayback() notifyShuffledChanged() - seekTo(0) isPlaying = true isInitialized = true } @@ -142,7 +141,6 @@ class PlaybackStateManager private constructor() { applyNewQueue(library, shuffled, null) notifyNewPlayback() notifyShuffledChanged() - seekTo(0) isPlaying = true isInitialized = true } @@ -154,7 +152,6 @@ class PlaybackStateManager private constructor() { applyNewQueue(library, true, null) notifyNewPlayback() notifyShuffledChanged() - seekTo(0) isPlaying = true isInitialized = true } @@ -186,7 +183,6 @@ class PlaybackStateManager private constructor() { private fun goto(idx: Int, play: Boolean) { index = idx notifyIndexMoved() - seekTo(0) isPlaying = play } @@ -262,9 +258,11 @@ class PlaybackStateManager private constructor() { sort.songsInPlace(newQueue) - newIndex = keep?.let(queue::indexOf) ?: 0 + newIndex = keep?.let(newQueue::indexOf) ?: 0 } + logD("$newIndex $newQueue") + _queue = newQueue index = newIndex isShuffled = shuffled diff --git a/app/src/main/java/org/oxycblt/auxio/playback/system/MediaSessionComponent.kt b/app/src/main/java/org/oxycblt/auxio/playback/system/MediaSessionComponent.kt index c4e9f7563..ffcad28d4 100644 --- a/app/src/main/java/org/oxycblt/auxio/playback/system/MediaSessionComponent.kt +++ b/app/src/main/java/org/oxycblt/auxio/playback/system/MediaSessionComponent.kt @@ -24,7 +24,6 @@ import android.os.SystemClock import android.support.v4.media.MediaMetadataCompat import android.support.v4.media.session.MediaSessionCompat import android.support.v4.media.session.PlaybackStateCompat -import androidx.media.session.MediaButtonReceiver import com.google.android.exoplayer2.Player import org.oxycblt.auxio.coil.BitmapProvider import org.oxycblt.auxio.music.MusicParent @@ -56,10 +55,6 @@ class MediaSessionComponent(private val context: Context, private val player: Pl mediaSession.setCallback(this) } - fun handleMediaButtonIntent(intent: Intent) { - MediaButtonReceiver.handleIntent(mediaSession, intent) - } - fun release() { provider.release() player.removeListener(this) diff --git a/app/src/main/java/org/oxycblt/auxio/playback/system/PlaybackService.kt b/app/src/main/java/org/oxycblt/auxio/playback/system/PlaybackService.kt index a0b3c3c08..5e5eaee19 100644 --- a/app/src/main/java/org/oxycblt/auxio/playback/system/PlaybackService.kt +++ b/app/src/main/java/org/oxycblt/auxio/playback/system/PlaybackService.kt @@ -262,6 +262,7 @@ class PlaybackService : } logD("Loading ${song.rawName}") + player.seekTo(0) player.setMediaItem(MediaItem.fromUri(song.uri)) player.prepare() notificationComponent.updateMetadata(song, playbackManager.parent) diff --git a/info/ADDITIONS.md b/info/ADDITIONS.md index f0474d5d5..a45c4a3ca 100644 --- a/info/ADDITIONS.md +++ b/info/ADDITIONS.md @@ -16,12 +16,6 @@ This does not rule out these additions, but they are not accepted as often as ot Feel free to fork Auxio to add your own feature set however. -#### Additions that have already been rejected (and why): -- Folder View/Grouping [#10] (Out of scope) -- Recently added list [#18] (Out of scope) -- Lyrics [#19] (Out of scope) -- Tag editing [#33] (Out of scope) -- Gapless Playback [#35] (Technical issues, may change in the future) -- Reduce leading instrument [#45] (Technical issues, Out of scope) -- Opening music through a provider [#30] (Out of scope) -- Cuesheet support [#83] +## Additions that have already been rejected + +To see an up-to-date list on all of the features that have been rejected, see [this link](https://github.com/OxygenCobalt/Auxio/issues?q=label%3Awontadd-technical%2Cwontadd-out-of-scope+) \ No newline at end of file