all: cleanup code

Cleanup the codebase in general:
- Remove useless resources
- Upgrade kotlin to 1.5.2
- Upgrade coil to 1.2.2
This commit is contained in:
OxygenCobalt 2021-06-26 19:53:57 -06:00
parent d82952d88d
commit 7b5e817d3b
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
35 changed files with 78 additions and 90 deletions

View file

@ -94,7 +94,7 @@ dependencies {
implementation "com.google.android.exoplayer:exoplayer-core:2.14.1"
// Image loading
implementation "io.coil-kt:coil:1.2.1"
implementation 'io.coil-kt:coil:1.2.2'
// Material
implementation "com.google.android.material:material:1.3.0"

View file

@ -14,7 +14,6 @@ import java.lang.Exception
* The main storage for music items. Use [MusicStore.getInstance] to get the single instance of it.
* @author OxygenCobalt
* TODO: Modernize the blacklist system to Android 10+
* TODO: Investigate issue where flac files have no years
*/
class MusicStore private constructor() {
private var mGenres = listOf<Genre>()

View file

@ -36,9 +36,6 @@ class PlaybackFragment : Fragment(), SeekBar.OnSeekBarChangeListener {
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
// TODO: Add a swipe-to-next-track function using a ViewPager
// Would require writing my own variant though to avoid index updates
val normalTextColor = binding.playbackDurationCurrent.currentTextColor
val accentColor = Accent.get().getStateList(requireContext())
val controlColor = R.color.control_color.toStateList(requireContext())

View file

@ -160,9 +160,11 @@ class PlaybackSessionConnector(
private fun getPlayerState(): Int {
if (playbackManager.song == null) {
// No song, player should be stopped
return PlaybackStateCompat.STATE_STOPPED
}
// Otherwise play/pause
return if (playbackManager.isPlaying) {
PlaybackStateCompat.STATE_PLAYING
} else {

View file

@ -15,7 +15,6 @@ import org.oxycblt.auxio.music.Song
* off the given sorting mode.
* @property iconRes The icon for this [SortMode]
* @author OxygenCobalt
* TODO: Make SortMode use title case [skip the/a(n)]
*/
enum class SortMode(@DrawableRes val iconRes: Int) {
// Icons for each mode are assigned to the enums themselves

View file

@ -92,7 +92,5 @@ class AboutFragment : Fragment() {
private const val LINK_CODEBASE = "https://github.com/oxygencobalt/Auxio"
private const val LINK_FAQ = "$LINK_CODEBASE/blob/master/info/FAQ.md"
private const val LINK_LICENSES = "$LINK_CODEBASE/blob/master/info/LICENSES.md"
const val TAG = "TAG_ABOUT_DIALOG"
}
}

View file

@ -8,7 +8,7 @@ import org.oxycblt.auxio.recycler.DisplayMode
import org.oxycblt.auxio.ui.ACCENTS
import org.oxycblt.auxio.ui.Accent
// A couple of utils for migrating from old settings values to the new the new
// A couple of utils for migrating from old settings values to the new
// formats used in 1.3.2 & 1.4.0
fun handleThemeCompat(prefs: SharedPreferences): Int {

View file

@ -73,7 +73,7 @@ class BlacklistViewModel(context: Context) : ViewModel() {
}
/**
* Check if changes have been made to the viewmodel's paths.
* Check if changes have been made to the ViewModel's paths.
*/
fun isModified() = dbPaths != paths.value

View file

@ -67,7 +67,7 @@
<ProgressBar
android:id="@+id/playback_progress"
style="@style/Widget.Seekbar.Compact"
style="@style/Widget.ProgressBar.Compact"
android:progress="@{playbackModel.positionAsProgress}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

View file

@ -26,7 +26,7 @@
<ProgressBar
android:id="@+id/playback_progress"
style="@style/Widget.Seekbar.Compact"
style="@style/Widget.ProgressBar.Compact"
android:progress="@{playbackModel.positionAsProgress}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"

View file

@ -19,7 +19,6 @@
<string name="label_filter_all">Alles</string>
<string name="label_sort">Sortierung</string>
<string name="label_sort_none">Standard</string>
<string name="label_sort_alpha_down">Aufsteigend</string>
<string name="label_sort_alpha_up">Absteigend</string>

View file

@ -16,7 +16,6 @@
<string name="label_filter_all">Όλα</string>
<string name="label_sort">Σειρά Διάταξης</string>
<string name="label_sort_none">Προεπιλεγμένη</string>
<string name="label_play">Αναπαραγωγή</string>
<string name="label_shuffle">Τυχαία</string>

View file

@ -16,7 +16,6 @@
<string name="label_filter_all">Todo</string>
<string name="label_sort">Ordenamiento</string>
<string name="label_sort_none">Predefinido</string>
<string name="label_sort_alpha_down">Ascendente</string>
<string name="label_sort_alpha_up">Descendente</string>

View file

@ -16,7 +16,6 @@
<string name="label_filter_all">Tout</string>
<string name="label_sort">Tri</string>
<string name="label_sort_none">Défaut</string>
<string name="label_sort_alpha_down">Ascendant</string>
<string name="label_sort_alpha_up">Descendant</string>

View file

@ -15,7 +15,6 @@
<string name="label_filter_all">सारे</string>
<string name="label_sort">क्रमबद्ध</string>
<string name="label_sort_none">डिफ़ॉल्ट</string>
<string name="label_play">चलाएं</string>
<string name="label_shuffle">शफ़ल</string>

View file

@ -16,7 +16,6 @@
<string name="label_filter_all">Összes</string>
<string name="label_sort">Összes</string>
<string name="label_sort_none">Alapértelmezett</string>
<string name="label_sort_alpha_down">Növekvő</string>
<string name="label_sort_alpha_up">Csökkenő</string>

View file

@ -16,7 +16,6 @@
<string name="label_filter_all">Semua</string>
<string name="label_sort">Urutan</string>
<string name="label_sort_none">Bawaan</string>
<string name="label_sort_alpha_down">Naik</string>
<string name="label_sort_alpha_up">Turun</string>

View file

@ -16,7 +16,6 @@
<string name="label_filter_all">Tutto</string>
<string name="label_sort">Ordine</string>
<string name="label_sort_none">Predefinito</string>
<string name="label_sort_alpha_down">Ascendente</string>
<string name="label_sort_alpha_up">Discendente</string>

View file

@ -16,7 +16,6 @@
<string name="label_filter_all">전부</string>
<string name="label_sort">분류</string>
<string name="label_sort_none">기본</string>
<string name="label_sort_alpha_down">오름차순</string>
<string name="label_sort_alpha_up">내림차순</string>

View file

@ -20,7 +20,6 @@
<string name="label_filter_all">Alles</string>
<string name="label_sort">Sorteren</string>
<string name="label_sort_none">Standaard</string>
<string name="label_sort_alpha_down">Oplopend</string>
<string name="label_sort_alpha_up">Aflopend</string>

View file

@ -16,7 +16,6 @@
<string name="label_filter_all">Wszystkie</string>
<string name="label_sort">Sortowanie</string>
<string name="label_sort_none">Domyślne</string>
<string name="label_sort_alpha_down">Rosnąco</string>
<string name="label_sort_alpha_up">Malejąco</string>

View file

@ -16,7 +16,6 @@
<string name="label_filter_all">Tudo</string>
<string name="label_sort">Classificação</string>
<string name="label_sort_none">Padrão</string>
<string name="label_sort_alpha_up">Descendente</string>
<string name="label_play">Reproduzir</string>

View file

@ -16,7 +16,6 @@
<string name="label_filter_all">Tudo</string>
<string name="label_sort">Classificação</string>
<string name="label_sort_none">Padrão</string>
<string name="label_sort_alpha_down">Ascendente</string>
<string name="label_sort_alpha_up">Descendente</string>

View file

@ -16,7 +16,6 @@
<string name="label_filter_all">Tot</string>
<string name="label_sort">Sortare</string>
<string name="label_sort_none">În mod implicit</string>
<string name="label_sort_alpha_down">Crescător</string>
<string name="label_sort_alpha_up">Descrescător</string>

View file

@ -16,7 +16,6 @@
<string name="label_filter_all">Всё</string>
<string name="label_sort">Сортировка</string>
<string name="label_sort_none">По умолчанию</string>
<string name="label_sort_alpha_down">По возрастанию</string>
<string name="label_sort_alpha_up">По убыванию</string>

View file

@ -16,7 +16,6 @@
<string name="label_filter_all">Tümü</string>
<string name="label_sort">Sıralama</string>
<string name="label_sort_none">Varsayılan</string>
<string name="label_sort_alpha_down">Artan</string>
<string name="label_sort_alpha_up">Azalan</string>

View file

@ -16,7 +16,6 @@
<string name="label_filter_all">Усе</string>
<string name="label_sort">Сортування</string>
<string name="label_sort_none">За замовчуванням</string>
<string name="label_play">Відтворити</string>
<string name="label_shuffle">Перемішати</string>

View file

@ -16,7 +16,6 @@
<string name="label_filter_all">全部</string>
<string name="label_sort">排序</string>
<string name="label_sort_none">默認</string>
<string name="label_sort_alpha_down">升序排列</string>
<string name="label_sort_alpha_up">降序排列</string>

View file

@ -21,7 +21,6 @@
<string name="label_filter_all">All</string>
<string name="label_sort">Sort</string>
<string name="label_sort_none">Default</string>
<string name="label_sort_alpha_down">Ascending</string>
<string name="label_sort_alpha_up">Descending</string>

View file

@ -9,6 +9,7 @@
<item name="cornerRadius">0dp</item>
</style>
<!-- Base style for the toolbar popup menu -->
<style name="ThemeOverlay.ToolbarPopup.Base" parent="ThemeOverlay.AppCompat.DayNight">
<item name="android:colorBackground">?attr/colorSurface</item>
</style>

View file

@ -30,7 +30,7 @@
<item name="android:background">@drawable/ui_small_unbounded_ripple</item>
</style>
<!-- Style for the about textviews -->
<!-- Style for the about TextViews -->
<style name="Widget.TextView.About" parent="Widget.AppCompat.TextView">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
@ -40,7 +40,7 @@
<item name="android:textAppearance">@style/TextAppearance.AppCompat.Subhead</item>
</style>
<!-- Style for clickable about textviews -->
<!-- Style for clickable about TextViews -->
<style name="Widget.TextView.About.Clickable" parent="Widget.TextView.About">
<item name="android:clickable">true</item>
<item name="android:focusable">true</item>
@ -53,6 +53,65 @@
<item name="android:textSize">@dimen/text_size_toolbar_header</item>
</style>
<!-- Base style for TextViews used in CompactPlaybackFragment -->
<style name="Widget.TextView.Compact.Base" parent="Widget.AppCompat.TextView">
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginStart">@dimen/spacing_small</item>
<item name="android:layout_marginEnd">@dimen/spacing_small</item>
<item name="android:ellipsize">end</item>
<item name="android:singleLine">true</item>
<item name="android:textAlignment">viewStart</item>
</style>
<!-- Style for the song title in CompactPlaybackFragment -->
<style name="Widget.TextView.Compact.Primary" parent="Widget.TextView.Compact.Base">
<item name="android:fontFamily">@font/inter_semibold</item>
<item name="android:textAppearance">@style/TextAppearance.MaterialComponents.Body2</item>
</style>
<!-- Style for the album/artist view in CompactPlaybackFragment -->
<style name="Widget.TextView.Compact.Secondary" parent="Widget.TextView.Compact.Base">
<item name="android:textAppearance">@style/TextAppearance.MaterialComponents.Caption</item>
</style>
<!-- Style for the ProgressBar on CompactPlaybackFragment -->
<style name="Widget.ProgressBar.Compact" parent="@style/Widget.AppCompat.ProgressBar.Horizontal">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">@dimen/height_compact_progress</item>
<item name="android:progressBackgroundTint">?attr/colorControlNormal</item>
<item name="android:progressTint">?attr/colorPrimary</item>
</style>
<!-- Style for the play/pause button on CompactPlaybackFragment -->
<style name="Widget.Button.Unbounded.PlayPause" parent="Widget.Button.Unbounded">
<item name="android:padding">0dp</item>
<item name="android:layout_marginEnd">@dimen/spacing_small</item>
</style>
<!-- Base style for TextViews in PlaybackFragment -->
<style name="Widget.TextView.Playback.Base" parent="Widget.AppCompat.TextView">
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:singleLine">true</item>
<item name="android:textAlignment">viewStart</item>
</style>
<!-- Style for the title text in PlaybackFragment -->
<style name="Widget.TextView.Playback.Primary" parent="Widget.TextView.Playback.Base">
<item name="android:fontFamily">@font/inter_semibold</item>
<item name="android:ellipsize">marquee</item>
<item name="android:marqueeRepeatLimit">marquee_forever</item>
<item name="android:textAppearance">@style/TextAppearance.MaterialComponents.Headline6</item>
</style>
<!-- Style for the album/artist text in PlaybackFragment -->
<style name="Widget.TextView.Playback.Secondary" parent="Widget.TextView.Playback.Base">
<item name="android:ellipsize">end</item>
<item name="android:textColor">?android:attr/textColorSecondary</item>
<item name="android:textAppearance">@style/TextAppearance.MaterialComponents.Subtitle1</item>
</style>
<!-- Style for the play/pause circle button -->
<style name="PlayPause">
<item name="android:layout_height">@dimen/size_play_pause</item>
@ -69,45 +128,7 @@
<item name="android:padding">@dimen/spacing_medium</item>
</style>
<style name="Widget.TextView.Compact.Base" parent="Widget.AppCompat.TextView">
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginStart">@dimen/spacing_small</item>
<item name="android:layout_marginEnd">@dimen/spacing_small</item>
<item name="android:ellipsize">end</item>
<item name="android:singleLine">true</item>
<item name="android:textAlignment">viewStart</item>
</style>
<style name="Widget.TextView.Compact.Primary" parent="Widget.TextView.Compact.Base">
<item name="android:fontFamily">@font/inter_semibold</item>
<item name="android:textAppearance">@style/TextAppearance.MaterialComponents.Body2</item>
</style>
<style name="Widget.TextView.Compact.Secondary" parent="Widget.TextView.Compact.Base">
<item name="android:textAppearance">@style/TextAppearance.MaterialComponents.Caption</item>
</style>
<style name="Widget.TextView.Playback.Base" parent="Widget.AppCompat.TextView">
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:singleLine">true</item>
<item name="android:textAlignment">viewStart</item>
</style>
<style name="Widget.TextView.Playback.Primary" parent="Widget.TextView.Playback.Base">
<item name="android:fontFamily">@font/inter_semibold</item>
<item name="android:ellipsize">marquee</item>
<item name="android:marqueeRepeatLimit">marquee_forever</item>
<item name="android:textAppearance">@style/TextAppearance.MaterialComponents.Headline6</item>
</style>
<style name="Widget.TextView.Playback.Secondary" parent="Widget.TextView.Playback.Base">
<item name="android:ellipsize">end</item>
<item name="android:textColor">?android:attr/textColorSecondary</item>
<item name="android:textAppearance">@style/TextAppearance.MaterialComponents.Subtitle1</item>
</style>
<!-- Style for a small ImageView-->
<style name="CompactImageView">
<item name="android:layout_width">@dimen/size_cover_compact</item>
<item name="android:layout_height">@dimen/size_cover_compact</item>
@ -115,6 +136,7 @@
<item name="layout_constraintDimensionRatio">1:1</item>
</style>
<!-- Style for a larger, elevated ImageView -->
<style name="ElevatedImageView">
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">0dp</item>
@ -122,13 +144,7 @@
<item name="android:outlineProvider">bounds</item>
</style>
<style name="Widget.Seekbar.Compact" parent="@style/Widget.AppCompat.ProgressBar.Horizontal">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">@dimen/height_compact_progress</item>
<item name="android:progressBackgroundTint">?attr/colorControlNormal</item>
<item name="android:progressTint">?attr/colorPrimary</item>
</style>
<!-- Style for the seekbar on PlaybackFragment -->
<style name="Widget.SeekBar.Full" parent="@style/Widget.AppCompat.SeekBar">
<item name="android:clickable">true</item>
<item name="android:focusable">true</item>
@ -141,10 +157,7 @@
<item name="android:thumbTint">?attr/colorPrimary</item>
</style>
<style name="Widget.Button.Unbounded.PlayPause" parent="Widget.Button.Unbounded">
<item name="android:padding">0dp</item>
<item name="android:layout_marginEnd">@dimen/spacing_small</item>
</style>
<!-- Base style for the material buttons -->
<style name="Widget.MaterialComponents.Button.Base" parent="@style/Widget.MaterialComponents.Button.TextButton">

View file

@ -5,7 +5,8 @@
<!-- Template theme that handles edge-to-edge on other styles variants -->
<style name="Theme.Template" parent="Theme.Master" />
<!-- Redirects to the correct toolbar popup theme [Normal or Black] -->
<!-- Redirects to the correct toolbar popup theme so that it can work on black mode
TODO: I wonder if theres a way to collapse this with the other Toolbar theme. -->
<attr name="toolbarPopupTheme" format="reference" />
<!-- Base theme -->
@ -41,6 +42,7 @@
<!-- @formatter:on -->
</style>
<!-- The basic black theme derived in all black accents. -->
<style name="Theme.Base.Black" parent="Theme.Base">
<item name="colorSurface">@color/surface_color_black</item>
<item name="colorControlHighlight">@color/selection_color_black</item>

View file

@ -93,8 +93,4 @@
<item name="colorSecondary">@color/blue_grey</item>
</style>
<style name="Theme.Neutral.Black" parent="Theme.Base.Black">
<item name="colorPrimary">@color/control_color</item>
<item name="colorSecondary">@color/control_color</item>
</style>
</resources>

View file

@ -1,6 +1,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.5.10"
ext.kotlin_version = "1.5.20"
ext.navigation_version = "2.3.5"
repositories {

View file

@ -25,4 +25,4 @@ Feel free to fork Auxio to add your own feature set however.
- Lyrics [#19]
- Recently added list[#18]
- Folder View/Grouping [#10]
- Replaygain [#7]
- ReplayGain [#7]