docs: re-write architecture
Create a new ARCHITECTURE document that is up to date with Auxio 2.0.0.
This commit is contained in:
@@ -23,13 +23,13 @@ import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import kotlinx.coroutines.launch
|
||||
import org.oxycblt.auxio.home.tabs.Tab
|
||||
import org.oxycblt.auxio.music.Album
|
||||
import org.oxycblt.auxio.music.Artist
|
||||
import org.oxycblt.auxio.music.Genre
|
||||
import org.oxycblt.auxio.music.MusicStore
|
||||
import org.oxycblt.auxio.music.Song
|
||||
import org.oxycblt.auxio.settings.SettingsManager
|
||||
import org.oxycblt.auxio.settings.tabs.Tab
|
||||
import org.oxycblt.auxio.ui.DisplayMode
|
||||
import org.oxycblt.auxio.ui.Sort
|
||||
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.oxycblt.auxio.settings.tabs
|
||||
package org.oxycblt.auxio.home.tabs
|
||||
|
||||
import org.oxycblt.auxio.ui.DisplayMode
|
||||
import org.oxycblt.auxio.util.logE
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.oxycblt.auxio.settings.tabs
|
||||
package org.oxycblt.auxio.home.tabs
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.view.MotionEvent
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.oxycblt.auxio.settings.tabs
|
||||
package org.oxycblt.auxio.home.tabs
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.oxycblt.auxio.settings.tabs
|
||||
package org.oxycblt.auxio.home.tabs
|
||||
|
||||
import android.graphics.Canvas
|
||||
import androidx.recyclerview.widget.ItemTouchHelper
|
||||
@@ -94,6 +94,10 @@ class PlaybackFragment : Fragment() {
|
||||
binding.playbackSong.isSelected = true
|
||||
binding.playbackSeekBar.onConfirmListener = playbackModel::setPosition
|
||||
|
||||
binding.playbackPlayPause.post {
|
||||
binding.playbackPlayPause.stateListAnimator = null
|
||||
}
|
||||
|
||||
// --- VIEWMODEL SETUP --
|
||||
|
||||
playbackModel.song.observe(viewLifecycleOwner) { song ->
|
||||
@@ -141,10 +145,6 @@ class PlaybackFragment : Fragment() {
|
||||
}
|
||||
}
|
||||
|
||||
binding.playbackPlayPause.post {
|
||||
binding.playbackPlayPause.stateListAnimator = null
|
||||
}
|
||||
|
||||
logD("Fragment Created.")
|
||||
|
||||
return binding.root
|
||||
|
||||
@@ -52,7 +52,7 @@ class PlaybackLayout @JvmOverloads constructor(
|
||||
attrs: AttributeSet? = null,
|
||||
defStyle: Int = 0
|
||||
) : ViewGroup(context, attrs, defStyle) {
|
||||
enum class PanelState {
|
||||
private enum class PanelState {
|
||||
EXPANDED, COLLAPSED, HIDDEN, DRAGGING
|
||||
}
|
||||
|
||||
@@ -85,8 +85,7 @@ class PlaybackLayout @JvmOverloads constructor(
|
||||
private var lastInsets: WindowInsets? = null
|
||||
|
||||
/** The current panel state. Can be [PanelState.DRAGGING]*/
|
||||
var panelState = INIT_PANEL_STATE
|
||||
private set
|
||||
private var panelState = INIT_PANEL_STATE
|
||||
|
||||
/** The last panel state before a drag event began. */
|
||||
private var lastIdlePanelState = INIT_PANEL_STATE
|
||||
|
||||
@@ -163,7 +163,7 @@ class PlaybackStateManager private constructor() {
|
||||
|
||||
when (mode) {
|
||||
PlaybackMode.ALL_SONGS -> {
|
||||
val musicStore = MusicStore.requireInstance()
|
||||
val musicStore = MusicStore.maybeGetInstance() ?: return
|
||||
|
||||
mParent = null
|
||||
mQueue = musicStore.songs.toMutableList()
|
||||
@@ -467,10 +467,9 @@ class PlaybackStateManager private constructor() {
|
||||
* @param useLastSong Whether to use the previous song for the index calculations.
|
||||
*/
|
||||
private fun resetShuffle(keepSong: Boolean, useLastSong: Boolean) {
|
||||
val musicStore = MusicStore.maybeGetInstance() ?: return
|
||||
val lastSong = if (useLastSong) mQueue[mIndex] else mSong
|
||||
|
||||
val musicStore = MusicStore.requireInstance()
|
||||
|
||||
mQueue = when (mPlaybackMode) {
|
||||
PlaybackMode.ALL_SONGS ->
|
||||
settingsManager.libSongSort.sortSongs(musicStore.songs).toMutableList()
|
||||
@@ -605,7 +604,7 @@ class PlaybackStateManager private constructor() {
|
||||
suspend fun restoreFromDatabase(context: Context) {
|
||||
logD("Getting state from DB.")
|
||||
|
||||
val musicStore = MusicStore.requireInstance()
|
||||
val musicStore = MusicStore.maybeGetInstance() ?: return
|
||||
|
||||
val start: Long
|
||||
val playbackState: PlaybackStateDatabase.SavedState?
|
||||
|
||||
@@ -33,10 +33,10 @@ import coil.Coil
|
||||
import org.oxycblt.auxio.R
|
||||
import org.oxycblt.auxio.accent.AccentDialog
|
||||
import org.oxycblt.auxio.excluded.ExcludedDialog
|
||||
import org.oxycblt.auxio.home.tabs.TabCustomizeDialog
|
||||
import org.oxycblt.auxio.playback.PlaybackViewModel
|
||||
import org.oxycblt.auxio.settings.pref.IntListPrefDialog
|
||||
import org.oxycblt.auxio.settings.pref.IntListPreference
|
||||
import org.oxycblt.auxio.settings.tabs.TabCustomizeDialog
|
||||
import org.oxycblt.auxio.util.isNight
|
||||
import org.oxycblt.auxio.util.logD
|
||||
import org.oxycblt.auxio.util.showToast
|
||||
|
||||
@@ -23,8 +23,8 @@ import android.content.SharedPreferences
|
||||
import androidx.core.content.edit
|
||||
import androidx.preference.PreferenceManager
|
||||
import org.oxycblt.auxio.accent.Accent
|
||||
import org.oxycblt.auxio.home.tabs.Tab
|
||||
import org.oxycblt.auxio.playback.state.PlaybackMode
|
||||
import org.oxycblt.auxio.settings.tabs.Tab
|
||||
import org.oxycblt.auxio.ui.DisplayMode
|
||||
import org.oxycblt.auxio.ui.Sort
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ sealed class Sort(open val isAscending: Boolean) {
|
||||
|
||||
companion object {
|
||||
private const val CONST_NAME = 0xA10C
|
||||
private const val CONST_ARTIST = 0xA10d
|
||||
private const val CONST_ARTIST = 0xA10D
|
||||
private const val CONST_ALBUM = 0xA10E
|
||||
private const val CONST_YEAR = 0xA10F
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
This is part of a stopgap animation used by QueueFragment until it's fully integrated
|
||||
into PlaybackLayout.
|
||||
-->
|
||||
<translate xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="@integer/config_navAnimTime"
|
||||
android:duration="500"
|
||||
android:fromYDelta="0%"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in"
|
||||
android:interpolator="@android:interpolator/decelerate_quint"
|
||||
android:toYDelta="100%" />
|
||||
@@ -1,6 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
This is part of a stopgap animation used by QueueFragment until it's fully integrated
|
||||
into PlaybackLayout.
|
||||
-->
|
||||
<translate xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="@integer/config_navAnimTime"
|
||||
android:duration="500"
|
||||
android:fromYDelta="100%"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in"
|
||||
android:interpolator="@android:interpolator/decelerate_quint"
|
||||
android:toYDelta="0%" />
|
||||
@@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Stationary animation used so that PlaybackFragment can slide w/o MainFragment sliding as well.
|
||||
https://stackoverflow.com/a/64314693/14143986
|
||||
This is part of a stopgap animation used by QueueFragment until it's fully integrated
|
||||
into PlaybackLayout.
|
||||
-->
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<translate
|
||||
android:duration="@integer/config_navAnimTime"
|
||||
android:duration="500"
|
||||
android:fromYDelta="0.0%p"
|
||||
android:toYDelta="0.0%p" />
|
||||
</set>
|
||||
|
||||
Reference in New Issue
Block a user