diff --git a/CHANGELOG.md b/CHANGELOG.md index 81c82879b..a8a78ecbb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,8 @@ - Added support for date values formatted as "YYYYMMDD" - Pressing the button will now clear the current selection before navigating back - Added support for non-standard `ARTISTS` tags -- Reworked music folders dialog to be more coherent +- Reworked music folders dialog to be more visually straightforward +- Play Next and Add To Queue now start playback if there is no queue to add #### What's Fixed - Fixed unreliable ReplayGain adjustment application in certain situations diff --git a/app/src/main/java/org/oxycblt/auxio/playback/PlaybackBarFragment.kt b/app/src/main/java/org/oxycblt/auxio/playback/PlaybackBarFragment.kt index a268b9feb..5addedb70 100644 --- a/app/src/main/java/org/oxycblt/auxio/playback/PlaybackBarFragment.kt +++ b/app/src/main/java/org/oxycblt/auxio/playback/PlaybackBarFragment.kt @@ -64,7 +64,7 @@ class PlaybackBarFragment : ViewBindingFragment() { binding.playbackInfo.isSelected = true // Set up actions - binding.playbackPlayPause.setOnClickListener { playbackModel.toggleIsPlaying() } + binding.playbackPlayPause.setOnClickListener { playbackModel.togglePlaying() } setupSecondaryActions(binding, playbackModel.currentBarAction) // Load the track color in manually as it's unclear whether the track actually supports @@ -108,7 +108,7 @@ class PlaybackBarFragment : ViewBindingFragment() { setIconResource(R.drawable.sel_shuffle_state_24) contentDescription = getString(R.string.desc_shuffle) iconTint = context.getColorCompat(R.color.sel_activatable_icon) - setOnClickListener { playbackModel.invertShuffled() } + setOnClickListener { playbackModel.toggleShuffled() } collectImmediately(playbackModel.isShuffled, ::updateShuffled) } } 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 f29391284..d5450722d 100644 --- a/app/src/main/java/org/oxycblt/auxio/playback/PlaybackPanelFragment.kt +++ b/app/src/main/java/org/oxycblt/auxio/playback/PlaybackPanelFragment.kt @@ -105,9 +105,9 @@ class PlaybackPanelFragment : // TODO: Add better playback button accessibility binding.playbackRepeat.setOnClickListener { playbackModel.toggleRepeatMode() } binding.playbackSkipPrev.setOnClickListener { playbackModel.prev() } - binding.playbackPlayPause.setOnClickListener { playbackModel.toggleIsPlaying() } + binding.playbackPlayPause.setOnClickListener { playbackModel.togglePlaying() } binding.playbackSkipNext.setOnClickListener { playbackModel.next() } - binding.playbackShuffle.setOnClickListener { playbackModel.invertShuffled() } + binding.playbackShuffle.setOnClickListener { playbackModel.toggleShuffled() } // --- VIEWMODEL SETUP -- collectImmediately(playbackModel.song, ::updateSong) 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 143253b99..097a9fab9 100644 --- a/app/src/main/java/org/oxycblt/auxio/playback/PlaybackViewModel.kt +++ b/app/src/main/java/org/oxycblt/auxio/playback/PlaybackViewModel.kt @@ -325,8 +325,6 @@ class PlaybackViewModel(application: Application) : * @param song The [Song] to add. */ fun playNext(song: Song) { - // TODO: Queue additions without a playing song should map to playing items - // (impossible until queue rework) playbackManager.playNext(song) } @@ -405,12 +403,12 @@ class PlaybackViewModel(application: Application) : // --- STATUS FUNCTIONS --- /** Toggle [isPlaying] (i.e from playing to paused) */ - fun toggleIsPlaying() { + fun togglePlaying() { playbackManager.setPlaying(!playbackManager.playerState.isPlaying) } /** Toggle [isShuffled] (ex. from on to off) */ - fun invertShuffled() { + fun toggleShuffled() { playbackManager.reorder(!playbackManager.queue.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 8b729379c..734966f89 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 @@ -59,7 +59,7 @@ class PlaybackStateManager private constructor() { val queue = Queue() /** The [MusicParent] currently being played. Null if playback is occurring from all songs. */ @Volatile - var parent: MusicParent? = null // TODO: Parent is interpreted wrong when nothing is playing. + var parent: MusicParent? = null // FIXME: Parent is interpreted wrong when nothing is playing. private set /** The current [InternalPlayer] state. */ diff --git a/app/src/main/java/org/oxycblt/auxio/settings/SettingsFragment.kt b/app/src/main/java/org/oxycblt/auxio/settings/SettingsFragment.kt index 03ccaa199..7e585e731 100644 --- a/app/src/main/java/org/oxycblt/auxio/settings/SettingsFragment.kt +++ b/app/src/main/java/org/oxycblt/auxio/settings/SettingsFragment.kt @@ -20,13 +20,12 @@ package org.oxycblt.auxio.settings import android.os.Bundle import android.view.LayoutInflater import androidx.fragment.app.Fragment -import androidx.navigation.fragment.findNavController import com.google.android.material.transition.MaterialFadeThrough import org.oxycblt.auxio.databinding.FragmentSettingsBinding import org.oxycblt.auxio.ui.ViewBindingFragment /** - * A [Fragment] wrapper containing the preference fragment and a companion Toolbar. + * A [Fragment] wrapper wrapping the preference navigation flow. * @author Alexander Capehart (OxygenCobalt) */ class SettingsFragment : ViewBindingFragment() { @@ -39,9 +38,5 @@ class SettingsFragment : ViewBindingFragment() { override fun onCreateBinding(inflater: LayoutInflater) = FragmentSettingsBinding.inflate(inflater) - override fun onBindingCreated(binding: FragmentSettingsBinding, savedInstanceState: Bundle?) { - // Point AppBarLayout to the preference fragment's RecyclerView. - binding.settingsAppbar.liftOnScrollTargetViewId = androidx.preference.R.id.recycler_view - binding.settingsToolbar.setNavigationOnClickListener { findNavController().navigateUp() } - } + override fun onBindingCreated(binding: FragmentSettingsBinding, savedInstanceState: Bundle?) {} } diff --git a/app/src/main/java/org/oxycblt/auxio/settings/prefs/PreferenceFragment.kt b/app/src/main/java/org/oxycblt/auxio/settings/prefs/PreferenceFragment.kt deleted file mode 100644 index b8daa3c7a..000000000 --- a/app/src/main/java/org/oxycblt/auxio/settings/prefs/PreferenceFragment.kt +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Copyright (c) 2021 Auxio Project - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package org.oxycblt.auxio.settings.prefs - -import android.os.Bundle -import android.view.View -import androidx.appcompat.app.AppCompatDelegate -import androidx.core.view.updatePadding -import androidx.fragment.app.activityViewModels -import androidx.navigation.fragment.findNavController -import androidx.preference.Preference -import androidx.preference.PreferenceCategory -import androidx.preference.PreferenceFragmentCompat -import androidx.preference.children -import androidx.recyclerview.widget.RecyclerView -import coil.Coil -import org.oxycblt.auxio.R -import org.oxycblt.auxio.music.MusicViewModel -import org.oxycblt.auxio.playback.PlaybackViewModel -import org.oxycblt.auxio.settings.SettingsFragmentDirections -import org.oxycblt.auxio.ui.UISettings -import org.oxycblt.auxio.util.androidActivityViewModels -import org.oxycblt.auxio.util.isNight -import org.oxycblt.auxio.util.logD -import org.oxycblt.auxio.util.showToast -import org.oxycblt.auxio.util.systemBarInsetsCompat - -/** - * The [PreferenceFragmentCompat] that displays the list of settings. - * @author Alexander Capehart (OxygenCobalt) - */ -class PreferenceFragment : PreferenceFragmentCompat() { - private val playbackModel: PlaybackViewModel by androidActivityViewModels() - private val musicModel: MusicViewModel by activityViewModels() - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - - preferenceManager.onDisplayPreferenceDialogListener = this - preferenceScreen.children.forEach(::setupPreference) - - // Configure the RecyclerView to support edge-to-edge. - view.findViewById(androidx.preference.R.id.recycler_view).apply { - clipToPadding = false - setOnApplyWindowInsetsListener { _, insets -> - updatePadding(bottom = insets.systemBarInsetsCompat.bottom) - insets - } - } - - logD("Fragment created") - } - - override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { - setPreferencesFromResource(R.xml.prefs_main, rootKey) - } - - @Suppress("Deprecation") - override fun onDisplayPreferenceDialog(preference: Preference) { - when (preference) { - is IntListPreference -> { - // Copy the built-in preference dialog launching code into our project so - // we can automatically use the provided preference class. - val dialog = IntListPreferenceDialog.from(preference) - dialog.setTargetFragment(this, 0) - dialog.show(parentFragmentManager, IntListPreferenceDialog.TAG) - } - is WrappedDialogPreference -> { - // WrappedDialogPreference cannot launch a dialog on it's own, it has to - // be handled manually. - val directions = - when (preference.key) { - getString(R.string.set_key_accent) -> - SettingsFragmentDirections.goToAccentDialog() - getString(R.string.set_key_home_tabs) -> - SettingsFragmentDirections.goToTabDialog() - getString(R.string.set_key_pre_amp) -> - SettingsFragmentDirections.goToPreAmpDialog() - getString(R.string.set_key_music_dirs) -> - SettingsFragmentDirections.goToMusicDirsDialog() - getString(R.string.set_key_separators) -> - SettingsFragmentDirections.goToSeparatorsDialog() - else -> error("Unexpected dialog key ${preference.key}") - } - findNavController().navigate(directions) - } - else -> super.onDisplayPreferenceDialog(preference) - } - } - - override fun onPreferenceTreeClick(preference: Preference): Boolean { - // Hook generic preferences to their specified preferences - // TODO: These seem like good things to put into a side navigation view, if I choose to - // do one. - when (preference.key) { - getString(R.string.set_key_save_state) -> { - playbackModel.savePlaybackState { saved -> - // Use the nullable context, as we could try to show a toast when this - // fragment is no longer attached. - if (saved) { - context?.showToast(R.string.lbl_state_saved) - } else { - context?.showToast(R.string.err_did_not_save) - } - } - } - getString(R.string.set_key_wipe_state) -> { - playbackModel.wipePlaybackState { wiped -> - if (wiped) { - // Use the nullable context, as we could try to show a toast when this - // fragment is no longer attached. - context?.showToast(R.string.lbl_state_wiped) - } else { - context?.showToast(R.string.err_did_not_wipe) - } - } - } - getString(R.string.set_key_restore_state) -> - playbackModel.tryRestorePlaybackState { restored -> - if (restored) { - // Use the nullable context, as we could try to show a toast when this - // fragment is no longer attached. - context?.showToast(R.string.lbl_state_restored) - } else { - context?.showToast(R.string.err_did_not_restore) - } - } - getString(R.string.set_key_reindex) -> musicModel.refresh() - getString(R.string.set_key_rescan) -> musicModel.rescan() - else -> return super.onPreferenceTreeClick(preference) - } - - return true - } - - private fun setupPreference(preference: Preference) { - if (!preference.isVisible) { - // Nothing to do. - return - } - - if (preference is PreferenceCategory) { - preference.children.forEach(::setupPreference) - return - } - - when (preference.key) { - getString(R.string.set_key_theme) -> { - preference.onPreferenceChangeListener = - Preference.OnPreferenceChangeListener { _, value -> - AppCompatDelegate.setDefaultNightMode(value as Int) - true - } - } - getString(R.string.set_key_accent) -> { - preference.summary = getString(UISettings.from(requireContext()).accent.name) - } - getString(R.string.set_key_black_theme) -> { - preference.onPreferenceChangeListener = - Preference.OnPreferenceChangeListener { _, _ -> - val activity = requireActivity() - if (activity.isNight) { - activity.recreate() - } - - true - } - } - getString(R.string.set_key_cover_mode) -> { - preference.onPreferenceChangeListener = - Preference.OnPreferenceChangeListener { _, _ -> - Coil.imageLoader(requireContext()).memoryCache?.clear() - true - } - } - } - } -} diff --git a/app/src/main/java/org/oxycblt/auxio/settings/ui/AudioPreferenceFragment.kt b/app/src/main/java/org/oxycblt/auxio/settings/ui/AudioPreferenceFragment.kt new file mode 100644 index 000000000..c1f63755f --- /dev/null +++ b/app/src/main/java/org/oxycblt/auxio/settings/ui/AudioPreferenceFragment.kt @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2023 Auxio Project + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package org.oxycblt.auxio.settings.ui + +import androidx.navigation.fragment.findNavController +import org.oxycblt.auxio.R +import org.oxycblt.auxio.settings.SettingsFragmentDirections + +class AudioPreferenceFragment : BasePreferenceFragment(R.xml.preferences_audio) { + + override fun onOpenDialogPreference(preference: WrappedDialogPreference) { + if (preference.key == getString(R.string.set_key_pre_amp)) { + findNavController().navigate(SettingsFragmentDirections.goToPreAmpDialog()) + } + } +} diff --git a/app/src/main/java/org/oxycblt/auxio/settings/ui/BasePreferenceFragment.kt b/app/src/main/java/org/oxycblt/auxio/settings/ui/BasePreferenceFragment.kt new file mode 100644 index 000000000..e71431ada --- /dev/null +++ b/app/src/main/java/org/oxycblt/auxio/settings/ui/BasePreferenceFragment.kt @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2023 Auxio Project + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package org.oxycblt.auxio.settings.ui + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.annotation.XmlRes +import androidx.appcompat.widget.Toolbar +import androidx.core.view.updatePadding +import androidx.navigation.fragment.findNavController +import androidx.preference.Preference +import androidx.preference.PreferenceCategory +import androidx.preference.PreferenceFragmentCompat +import androidx.preference.children +import com.google.android.material.appbar.AppBarLayout +import com.google.android.material.transition.MaterialSharedAxis +import org.oxycblt.auxio.R +import org.oxycblt.auxio.util.logD +import org.oxycblt.auxio.util.systemBarInsetsCompat + +abstract class BasePreferenceFragment(@XmlRes private val screen: Int) : + PreferenceFragmentCompat() { + /** + * Called when the UI entry of a given [Preference] needs to be configured. + * @param preference The [Preference] to configure. + */ + open fun onSetupPreference(preference: Preference) {} + + /** + * Called when an arbitrary [WrappedDialogPreference] needs to be opened. + * @param preference The [WrappedDialogPreference] to open. + */ + open fun onOpenDialogPreference(preference: WrappedDialogPreference) {} + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + enterTransition = MaterialSharedAxis(MaterialSharedAxis.X, true) + returnTransition = MaterialSharedAxis(MaterialSharedAxis.X, false) + exitTransition = MaterialSharedAxis(MaterialSharedAxis.X, true) + reenterTransition = MaterialSharedAxis(MaterialSharedAxis.X, false) + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + + view.findViewById(R.id.preferences_appbar).liftOnScrollTargetViewId = + androidx.preference.R.id.recycler_view + view.findViewById(R.id.preferences_toolbar).apply { + title = preferenceScreen.title + setNavigationOnClickListener { + val fragmentManager = fragmentManager + if (fragmentManager == null || fragmentManager.backStackEntryCount == 0) { + findNavController().navigateUp() + } else { + fragmentManager.popBackStack() + } + } + } + + preferenceManager.onDisplayPreferenceDialogListener = this + preferenceScreen.children.forEach(::setupPreference) + + logD("Fragment created") + } + + override fun onCreateRecyclerView( + inflater: LayoutInflater, + parent: ViewGroup, + savedInstanceState: Bundle? + ) = + super.onCreateRecyclerView(inflater, parent, savedInstanceState).apply { + clipToPadding = false + setOnApplyWindowInsetsListener { _, insets -> + updatePadding(bottom = insets.systemBarInsetsCompat.bottom) + insets + } + } + + override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { + setPreferencesFromResource(screen, rootKey) + } + + @Suppress("Deprecation") + override fun onDisplayPreferenceDialog(preference: Preference) { + when (preference) { + is IntListPreference -> { + // Copy the built-in preference dialog launching code into our project so + // we can automatically use the provided preference class. + val dialog = IntListPreferenceDialog.from(preference) + dialog.setTargetFragment(this, 0) + dialog.show(parentFragmentManager, IntListPreferenceDialog.TAG) + } + is WrappedDialogPreference -> { + // These dialog preferences cannot launch on their own, delegate to + // implementations. + onOpenDialogPreference(preference) + } + else -> super.onDisplayPreferenceDialog(preference) + } + } + + private fun setupPreference(preference: Preference) { + if (!preference.isVisible) { + // Nothing to do. + return + } + + if (preference is PreferenceCategory) { + preference.children.forEach(::setupPreference) + return + } + + onSetupPreference(preference) + } +} diff --git a/app/src/main/java/org/oxycblt/auxio/settings/prefs/IntListPreference.kt b/app/src/main/java/org/oxycblt/auxio/settings/ui/IntListPreference.kt similarity index 99% rename from app/src/main/java/org/oxycblt/auxio/settings/prefs/IntListPreference.kt rename to app/src/main/java/org/oxycblt/auxio/settings/ui/IntListPreference.kt index 8afa0ec8d..1289e121e 100644 --- a/app/src/main/java/org/oxycblt/auxio/settings/prefs/IntListPreference.kt +++ b/app/src/main/java/org/oxycblt/auxio/settings/ui/IntListPreference.kt @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package org.oxycblt.auxio.settings.prefs +package org.oxycblt.auxio.settings.ui import android.content.Context import android.content.res.TypedArray diff --git a/app/src/main/java/org/oxycblt/auxio/settings/prefs/IntListPreferenceDialog.kt b/app/src/main/java/org/oxycblt/auxio/settings/ui/IntListPreferenceDialog.kt similarity index 98% rename from app/src/main/java/org/oxycblt/auxio/settings/prefs/IntListPreferenceDialog.kt rename to app/src/main/java/org/oxycblt/auxio/settings/ui/IntListPreferenceDialog.kt index 72f8f3383..30deeab85 100644 --- a/app/src/main/java/org/oxycblt/auxio/settings/prefs/IntListPreferenceDialog.kt +++ b/app/src/main/java/org/oxycblt/auxio/settings/ui/IntListPreferenceDialog.kt @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package org.oxycblt.auxio.settings.prefs +package org.oxycblt.auxio.settings.ui import android.os.Bundle import androidx.preference.PreferenceDialogFragmentCompat diff --git a/app/src/main/java/org/oxycblt/auxio/settings/ui/MusicPreferenceFragment.kt b/app/src/main/java/org/oxycblt/auxio/settings/ui/MusicPreferenceFragment.kt new file mode 100644 index 000000000..4fccac950 --- /dev/null +++ b/app/src/main/java/org/oxycblt/auxio/settings/ui/MusicPreferenceFragment.kt @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2023 Auxio Project + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package org.oxycblt.auxio.settings.ui + +import androidx.navigation.fragment.findNavController +import androidx.preference.Preference +import coil.Coil +import org.oxycblt.auxio.R +import org.oxycblt.auxio.settings.SettingsFragmentDirections + +class MusicPreferenceFragment : BasePreferenceFragment(R.xml.preferences_music) { + override fun onOpenDialogPreference(preference: WrappedDialogPreference) { + if (preference.key == getString(R.string.set_key_separators)) { + findNavController().navigate(SettingsFragmentDirections.goToSeparatorsDialog()) + } + } + + override fun onSetupPreference(preference: Preference) { + if (preference.key == getString(R.string.set_key_cover_mode)) { + preference.onPreferenceChangeListener = + Preference.OnPreferenceChangeListener { _, _ -> + Coil.imageLoader(requireContext()).memoryCache?.clear() + true + } + } + } +} diff --git a/app/src/main/java/org/oxycblt/auxio/settings/ui/PersonalizePreferenceFragment.kt b/app/src/main/java/org/oxycblt/auxio/settings/ui/PersonalizePreferenceFragment.kt new file mode 100644 index 000000000..5f6cbeac3 --- /dev/null +++ b/app/src/main/java/org/oxycblt/auxio/settings/ui/PersonalizePreferenceFragment.kt @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023 Auxio Project + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package org.oxycblt.auxio.settings.ui + +import androidx.navigation.fragment.findNavController +import org.oxycblt.auxio.R +import org.oxycblt.auxio.settings.SettingsFragmentDirections + +class PersonalizePreferenceFragment : BasePreferenceFragment(R.xml.preferences_personalize) { + override fun onOpenDialogPreference(preference: WrappedDialogPreference) { + if (preference.key == getString(R.string.set_key_home_tabs)) { + findNavController().navigate(SettingsFragmentDirections.goToTabDialog()) + } + } +} diff --git a/app/src/main/java/org/oxycblt/auxio/settings/ui/RootPreferenceFragment.kt b/app/src/main/java/org/oxycblt/auxio/settings/ui/RootPreferenceFragment.kt new file mode 100644 index 000000000..2856d26b5 --- /dev/null +++ b/app/src/main/java/org/oxycblt/auxio/settings/ui/RootPreferenceFragment.kt @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2021 Auxio Project + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package org.oxycblt.auxio.settings.ui + +import androidx.fragment.app.activityViewModels +import androidx.navigation.fragment.findNavController +import androidx.preference.Preference +import androidx.preference.PreferenceFragmentCompat +import org.oxycblt.auxio.R +import org.oxycblt.auxio.music.MusicViewModel +import org.oxycblt.auxio.playback.PlaybackViewModel +import org.oxycblt.auxio.settings.SettingsFragmentDirections +import org.oxycblt.auxio.util.androidActivityViewModels +import org.oxycblt.auxio.util.showToast + +/** + * The [PreferenceFragmentCompat] that displays the root settings list. + * @author Alexander Capehart (OxygenCobalt) + */ +class RootPreferenceFragment : BasePreferenceFragment(R.xml.preferences_root) { + private val playbackModel: PlaybackViewModel by androidActivityViewModels() + private val musicModel: MusicViewModel by activityViewModels() + + override fun onOpenDialogPreference(preference: WrappedDialogPreference) { + if (preference.key == getString(R.string.set_key_music_dirs)) { + findNavController().navigate(SettingsFragmentDirections.goToMusicDirsDialog()) + } + } + + override fun onPreferenceTreeClick(preference: Preference): Boolean { + // Hook generic preferences to their specified preferences + // TODO: These seem like good things to put into a side navigation view, if I choose to + // do one. + when (preference.key) { + getString(R.string.set_key_reindex) -> musicModel.refresh() + getString(R.string.set_key_rescan) -> musicModel.rescan() + getString(R.string.set_key_save_state) -> { + playbackModel.savePlaybackState { saved -> + // Use the nullable context, as we could try to show a toast when this + // fragment is no longer attached. + if (saved) { + context?.showToast(R.string.lbl_state_saved) + } else { + context?.showToast(R.string.err_did_not_save) + } + } + } + getString(R.string.set_key_wipe_state) -> { + playbackModel.wipePlaybackState { wiped -> + if (wiped) { + // Use the nullable context, as we could try to show a toast when this + // fragment is no longer attached. + context?.showToast(R.string.lbl_state_wiped) + } else { + context?.showToast(R.string.err_did_not_wipe) + } + } + } + getString(R.string.set_key_restore_state) -> + playbackModel.tryRestorePlaybackState { restored -> + if (restored) { + // Use the nullable context, as we could try to show a toast when this + // fragment is no longer attached. + context?.showToast(R.string.lbl_state_restored) + } else { + context?.showToast(R.string.err_did_not_restore) + } + } + else -> return super.onPreferenceTreeClick(preference) + } + + return true + } +} diff --git a/app/src/main/java/org/oxycblt/auxio/settings/ui/UIPreferenceFragment.kt b/app/src/main/java/org/oxycblt/auxio/settings/ui/UIPreferenceFragment.kt new file mode 100644 index 000000000..ccfd5c48e --- /dev/null +++ b/app/src/main/java/org/oxycblt/auxio/settings/ui/UIPreferenceFragment.kt @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2023 Auxio Project + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package org.oxycblt.auxio.settings.ui + +import androidx.appcompat.app.AppCompatDelegate +import androidx.navigation.fragment.findNavController +import androidx.preference.Preference +import org.oxycblt.auxio.R +import org.oxycblt.auxio.settings.SettingsFragmentDirections +import org.oxycblt.auxio.ui.UISettings +import org.oxycblt.auxio.util.isNight + +class UIPreferenceFragment : BasePreferenceFragment(R.xml.preferences_ui) { + override fun onOpenDialogPreference(preference: WrappedDialogPreference) { + if (preference.key == getString(R.string.set_key_accent)) { + findNavController().navigate(SettingsFragmentDirections.goToAccentDialog()) + } + } + + override fun onSetupPreference(preference: Preference) { + when (preference.key) { + getString(R.string.set_key_theme) -> { + preference.onPreferenceChangeListener = + Preference.OnPreferenceChangeListener { _, value -> + AppCompatDelegate.setDefaultNightMode(value as Int) + true + } + } + getString(R.string.set_key_accent) -> { + preference.summary = getString(UISettings.from(requireContext()).accent.name) + } + getString(R.string.set_key_black_theme) -> { + preference.onPreferenceChangeListener = + Preference.OnPreferenceChangeListener { _, _ -> + val activity = requireActivity() + if (activity.isNight) { + activity.recreate() + } + + true + } + } + } + } +} diff --git a/app/src/main/java/org/oxycblt/auxio/settings/prefs/WrappedDialogPreference.kt b/app/src/main/java/org/oxycblt/auxio/settings/ui/WrappedDialogPreference.kt similarity index 96% rename from app/src/main/java/org/oxycblt/auxio/settings/prefs/WrappedDialogPreference.kt rename to app/src/main/java/org/oxycblt/auxio/settings/ui/WrappedDialogPreference.kt index 429364a94..ec5317b4e 100644 --- a/app/src/main/java/org/oxycblt/auxio/settings/prefs/WrappedDialogPreference.kt +++ b/app/src/main/java/org/oxycblt/auxio/settings/ui/WrappedDialogPreference.kt @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package org.oxycblt.auxio.settings.prefs +package org.oxycblt.auxio.settings.ui import android.content.Context import android.util.AttributeSet diff --git a/app/src/main/java/org/oxycblt/auxio/util/LangUtil.kt b/app/src/main/java/org/oxycblt/auxio/util/LangUtil.kt index caf2f811e..6441f94ba 100644 --- a/app/src/main/java/org/oxycblt/auxio/util/LangUtil.kt +++ b/app/src/main/java/org/oxycblt/auxio/util/LangUtil.kt @@ -40,8 +40,7 @@ fun unlikelyToBeNull(value: T?) = * @throws IllegalStateException If the data cannot be casted to [T]. */ inline fun requireIs(data: Any?): T { - requireNotNull(data) { "Unexpected datatype: null" } - check(data is T) { "Unexpected datatype: ${data::class.simpleName}" } + check(data is T) { "Unexpected datatype: ${data?.let { it::class.simpleName }}" } return data } diff --git a/app/src/main/res/drawable/ic_accent_24.xml b/app/src/main/res/drawable/ic_accent_24.xml index 40905e6e4..e4d886ec1 100644 --- a/app/src/main/res/drawable/ic_accent_24.xml +++ b/app/src/main/res/drawable/ic_accent_24.xml @@ -2,7 +2,7 @@ + + + diff --git a/app/src/main/res/drawable/ic_equalizer.xml b/app/src/main/res/drawable/ic_config_24.xml similarity index 100% rename from app/src/main/res/drawable/ic_equalizer.xml rename to app/src/main/res/drawable/ic_config_24.xml diff --git a/app/src/main/res/layout/fragment_preferences.xml b/app/src/main/res/layout/fragment_preferences.xml new file mode 100644 index 000000000..a66497d9d --- /dev/null +++ b/app/src/main/res/layout/fragment_preferences.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + diff --git a/app/src/main/res/layout/fragment_settings.xml b/app/src/main/res/layout/fragment_settings.xml index 3c5880f73..cbe33ddf8 100644 --- a/app/src/main/res/layout/fragment_settings.xml +++ b/app/src/main/res/layout/fragment_settings.xml @@ -8,25 +8,9 @@ android:orientation="vertical" android:transitionGroup="true"> - - - - - - التراخيص تمت برمجة التطبيق من قبل OxygenCobalt - الإعدادات + الإعدادات المظهر السمة تلقائي @@ -58,11 +58,11 @@ جعل اغلفة الابومات ذات زوايا مدورة استخدام نشاط بديل للإشعار صوتيات - صخب الصوت - تفضيل المقطع - تفضيل الالبوم - ديناميكي - سلوك + صخب الصوت + تفضيل المقطع + تفضيل الالبوم + ديناميكي + سلوك عند اختيار اغنية تذكر الخلط إبقاء وضع الخلط عند تشغيل اغنية جديدة diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index b59774f52..a927022b3 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -52,7 +52,7 @@ Vytvořil Alexander Capehart Statistiky knihovny - Nastavení + Nastavení Vzhled Motiv Automatické @@ -70,16 +70,16 @@ Zvuk Automatické přehrávání se sluchátky Při připojení sluchátek vždy spustit přehrávání (nemusí fungovat na všech zařízeních) - Strategie ReplayGain - Preferovat stopu - Preferovat album - Preferovat album, pokud se právě přehrává + Strategie ReplayGain + Preferovat stopu + Preferovat album + Preferovat album, pokud se právě přehrává Předzesilovač ReplayGain Předzesilovač bude použit na existující přizpůsobení při přehrávání Přizpůsobení se štítky Přizpůsobení bez štítků Varování: Změna předzesilovače na vysokou kladnou hodnotu může u některých zvukových stop vést k příliš vysokým hlasitostem. - Chování + Chování Při přehrávání z knihovny Zapamatovat si náhodné přehrávání Ponechat náhodné přehrávání při přehrávání nové skladby @@ -229,8 +229,8 @@ Otevřít frontu Žánr Vlastní akce lišty přehrávání - Přeskočit na další - Režim opakování + Přeskočit na další + Režim opakování Ekvalizér Zastavit přehrávání Ampersand (&) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index e9eb164c7..33ee66402 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -34,7 +34,7 @@ Lizenzen Entwickelt von Alexander Capehart - Einstellungen + Einstellungen Aussehen Farbschema Automatisch @@ -48,14 +48,14 @@ Audio Kopfhörer: automatische Wiedergabe Beginne die Wiedergabe immer, wenn Kopfhörer verbunden sind (funktioniert nicht auf allen Geräten) - ReplayGain-Strategie + ReplayGain-Strategie ReplayGain-Prälautverstärkung Während der Musikwiedergabe, trifft die Prälautverstärkung dem aktuellem Abgleich zu Abgleich mit Metadaten Abgleich ohne Metadaten - Titel bevorzugen - Album bevorzugen - Verhalten + Titel bevorzugen + Album bevorzugen + Verhalten Wenn ein Lied aus der Bibliothek abgespielt wird Zufällig-Einstellung merken Zufällig anlassen, wenn ein neues Lied abgespielt wird @@ -142,7 +142,7 @@ Titel OK Bibliotheksstatistiken - Album bevorzugen, wenn eines abgespielt wird + Album bevorzugen, wenn eines abgespielt wird Dynamische Farbe Schallplatte %d +%.1f dB @@ -222,8 +222,8 @@ Genre Equalizer Angepasste Wiedergabeaktionstaste - Zum nächsten Song gehen - Wiederholungsmodus + Zum nächsten Song gehen + Wiederholungsmodus Wiedergabe anhalten Live-Kompilation Remix-Kompilation diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 35a49bbfa..679e4ae44 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -26,7 +26,7 @@ Πηγαίος κώδικας Άδειες - Ρυθμίσεις + Ρυθμίσεις Εμφάνιση Θέμα Αυτόματο @@ -34,7 +34,7 @@ Σκοτεινό Χρώματα Ήχος - Συμπεριφορά + Συμπεριφορά Κομμάτι %d Αναπαραγωγή/παύση diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 92c10910f..d02dc25d1 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -42,7 +42,7 @@ Licencias Desarrollado por Alexander Capehart - Ajustes + Ajustes Apariencia Tema Automático @@ -58,11 +58,11 @@ Habilite las esquinas redondeadas en los elementos adicionales de la interfaz del usuario (requiere que las portadas de los álbumes estén redondeadas) Usar acciones de notificación alternativas Sonido - Estrategia de la ganancia de la repetición - Por pista - Por álbum - Preferir el álbum si se está en reproducción - Comportamiento + Estrategia de la ganancia de la repetición + Por pista + Por álbum + Preferir el álbum si se está en reproducción + Comportamiento Cuando se está reproduciendo de la biblioteca Recordar mezcla Mantener mezcla cuando se reproduce una nueva canción @@ -237,7 +237,7 @@ Ecualizador Portadas de álbumes Apagado - Modo de repetición + Modo de repetición Más (+) Y (&) Detener la reproducción @@ -246,7 +246,7 @@ Alta calidad Rápido Acción personalizada de la barra de reproducción - Saltar al siguiente + Saltar al siguiente Mostrar solo artistas que estén acreditados directamente en un álbum (funciona mejor en bibliotecas bien etiquetadas) Ocultar colaboradores diff --git a/app/src/main/res/values-fil/strings.xml b/app/src/main/res/values-fil/strings.xml index c3a34959b..73197dd94 100644 --- a/app/src/main/res/values-fil/strings.xml +++ b/app/src/main/res/values-fil/strings.xml @@ -1,6 +1,6 @@ - Naisin ang album + Naisin ang album Subukan muli Nilo-load ang iyong music library… Tinitignan ang iyong music library para sa mga pagbabago… @@ -62,7 +62,7 @@ Mga Lisensya Binuo ni OxygenCobalt Istatistika ng library - Mga Setting + Mga Setting Hitsura Kusa Maliwanag @@ -78,10 +78,10 @@ Kusang pagtugtog ng headset Laging simulan ang pagtugtog tuwing pagkonekta ng headset (maaaring \'di gumana sa lahat ng device) Naisin ang alternatibong aksyong patalastas - Naisin ang album kung may isang tumutugtog + Naisin ang album kung may isang tumutugtog ReplayGain pre-amp Ayos gamit ang mga tag - Ugalian + Ugalian Mga Kanta Isang magaan at makatwirang manunugtog para sa android. Remix EP @@ -97,7 +97,7 @@ Tema Ibahin ang pagkakita at ayos ng mga library tab Inilalapat ang pre-amp sa kasalukuyang ayos habang ito\'y tumutugtog - Naisin ang track + Naisin ang track Babala: Ang pag-iba ng pre-amp sa mataas na positibong ayos ay maaaring magdulot ng karurukan sa ilang mga audio track. Ayos na \'di gamit ang mga tag \ No newline at end of file diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index b59ecb6c7..4507fbea6 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -28,7 +28,7 @@ Licences Développé par OxygenCobalt - Paramètres + Paramètres Apparence Thème Automatique @@ -36,7 +36,7 @@ Sombre Couleur d\'accentuation Audio - Comportement + Comportement Pas de musique trouvée diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml index 9f877fc09..1bb4c20f0 100644 --- a/app/src/main/res/values-hi/strings.xml +++ b/app/src/main/res/values-hi/strings.xml @@ -22,14 +22,14 @@ GitHub में देखें लाइसेंस - सेटिंग्स + सेटिंग्स थीम सफ़ेद गहरा स्वचलित एक्सेंट ऑडियो - चाल चलन + चाल चलन कोई संगीत नहीं मिला diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index bfd011990..dd0452a9e 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -73,10 +73,10 @@ Zvuk Slušalice: odmah reproduciraj Uvijek pokreni reprodukciju kada su slušalice povezane (možda neće raditi na svim uređajima) - Strategija pojačanja - Preferiraj zvučni zapis - Preferiraj album - Ako se reproducira album, preferiraj album + Strategija pojačanja + Preferiraj zvučni zapis + Preferiraj album + Ako se reproducira album, preferiraj album Pretpojačalo pojačanja Pretpojačalo je tijekom reprodukcije primijenjeno postojećoj prilagodbi Prilagođavanje s oznakama @@ -185,12 +185,12 @@ Idi na izvođača Idi na album Ostavi miješanje omogućeno kada se druga pjesma reproducira - Postavke + Postavke Tema Automatski Koristi alternativnu radnju za obavijest Omogući zaobljene rubove na dodatnim elementima korisničkog sučelja (zahtijeva zaobljene omote albuma) - Ponašanje + Ponašanje Premotaj prije preskakanja natrag Spremi trenutno stanje reprodukcije Preskoči na sljedeću pjesmu @@ -228,8 +228,8 @@ Točka-zarez (;) Prilagođena radnja trake reprodukcije Ekvilajzer - Prijeđi na sljedeću - Način ponavljanja + Prijeđi na sljedeću + Način ponavljanja Sakrij suradnike Isključeno Isključi sve što nije glazba diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 39f8dd48f..060647abe 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -27,7 +27,7 @@ Megtekintés GitHubon Engedélyek - Beállítások + Beállítások Megjelenés Téma Automatikus @@ -35,7 +35,7 @@ Sötét Kiemelés Hang - Működés + Működés Nem található zene diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index 7fdacaace..31e96109e 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -27,7 +27,7 @@ Lihat di GitHub Lisensi - Setelan + Setelan Tampilan Tema Otomatis @@ -35,7 +35,7 @@ Gelap Aksen Audio - Perilaku + Perilaku Ingat putar acak Musik tidak ditemukan @@ -64,7 +64,7 @@ Mengubah visibilitas dan urutan tab pustaka Putar otomatis headset Selalu mulai bermain ketika headset tersambung (mungkin tidak berfungsi pada semua perangkat) - ReplayGain + ReplayGain Jalur induk Ukuran Tingkat sampel @@ -87,8 +87,8 @@ Acak Acak Semua Status disimpan - Lebih suka trek - Lebih suka album + Lebih suka trek + Lebih suka album Pra-amp ReplayGain Pre-amp diterapkan ke penyesuaian yang ada selama pemutaran Penyesuaian dengan tag @@ -132,7 +132,7 @@ Lagu yang dimuat: %d Album yang dimuat: %d Artis yang dimuat: %d - Lebih suka album jika ada yang diputar + Lebih suka album jika ada yang diputar Saat bermain dari perpustakaan Putar dari album Ubah mode pengulangan diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index e19fd6327..eac190d80 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -43,7 +43,7 @@ Sviluppato da Alexander Capehart Statistiche libreria - Opzioni + Opzioni Aspetto Tema Automatico @@ -61,11 +61,11 @@ Audio Autoplay cuffie Comincia la riproduzione ogni volta che le cuffie sono inserite (potrebbe non funzionare su tutti i dispositivi) - Strategia ReplayGain - Preferisci traccia - Preferisci disco - Preferisci l\'album se in riproduzione - Comportamento + Strategia ReplayGain + Preferisci traccia + Preferisci disco + Preferisci l\'album se in riproduzione + Comportamento Quando in riproduzione dalla libreria Mantieni mescolamento Mantiene il mescolamento anche se una nuova canzone è selezionata @@ -224,8 +224,8 @@ Genere Stato ripristinato Azione personalizzata barra di riproduzione - Vai alla prossima - Modalità ripetizione + Vai alla prossima + Modalità ripetizione Interrompi riproduzione Nascondi collaboratori Mostra solo artisti che sono direttamente accreditati in un album (funziona meglio su librerie ben taggate) diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index 848e62e5c..39990686b 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -50,7 +50,7 @@ Alexander Capehart가 개발 라이브러리 통계 - 설정 + 설정 모양 테마 자동 @@ -68,16 +68,16 @@ 소리 헤드셋 자동 재생 헤드셋을 연결하면 항상 자동으로 음악 재생 (기기에 따라 작동하지 않을 수 있음) - ReplayGain 계획 - 트랙 선호 - 앨범 선호 - 앨법 재생 중인 경우 앨범 선호 + ReplayGain 계획 + 트랙 선호 + 앨범 선호 + 앨법 재생 중인 경우 앨범 선호 ReplayGain 프리앰프 재생 중에 프리앰프를 적용하여 조정 태그로 조정 태그 없이 조정 주의: 프리앰프를 높게 설정하면 일부 소리 트랙이 왜곡될 수 있습니다. - 동작 + 동작 라이브러리에서 재생할 때 무작위 재생 기억 새로운 곡을 재생할 때 무작위 재생 유지 @@ -199,7 +199,7 @@ 추가된 날짜 상위 경로 맞춤형 재생 동작 버튼 - 반복 방식 + 반복 방식 대기열 열기 라이브 EP 리믹스 싱글 @@ -243,7 +243,7 @@ 경고: 이 설정을 사용하면 일부 태그가 여러 값을 갖는 것으로 잘못 해석될 수 있습니다. 구분자로 읽히지 않도록 하려면 해당 구분자 앞에 백슬래시 (\\)를 붙입니다. 항목 세부 정보에서 재생할 때 음악 라이브러리의 변경사항을 추적하는 중… - 다음 곡으로 건너뛰기 + 다음 곡으로 건너뛰기 팟캐스트와 같이 음악이 아닌 소리 파일 무시 공동작업자 숨기기 앨범에 등장하는 아티스트만 표시 (자세히 태그된 라이브러리에 최적화) diff --git a/app/src/main/res/values-lt/strings.xml b/app/src/main/res/values-lt/strings.xml index 2885c53a1..08359608b 100644 --- a/app/src/main/res/values-lt/strings.xml +++ b/app/src/main/res/values-lt/strings.xml @@ -43,7 +43,7 @@ Išvaizda Formatas Versija - Nustatymai + Nustatymai Temos Naudokti grynai juodą tamsią temą Paprastas, racionalus „Android“ muzikos grotuvas. @@ -80,7 +80,7 @@ Atšaukti Šaltinio kodas Rodyti - „ReplayGain“ strategija + „ReplayGain“ strategija Singlai Gerai Įgalinti papildomų vartotojo sąsajos elementų suapvalintus kampus (reikia, kad albumo viršeliai būtų suapvalinti) @@ -124,7 +124,7 @@ Visada pradėti groti, kai prijungtos ausinės (gali veikti ne visuose įrenginiuose) Ogg garsas Sukūrė Alexanderis Capehartas - Pageidaujamas takeliui + Pageidaujamas takeliui Jokių aplankų Šis aplankas nepalaikomas Groti arba pristabdyti @@ -134,8 +134,8 @@ Mikstapai Bibliotekos skirtukai Keisti bibliotekos skirtukų matomumą ir tvarką - Pageidaujamas albumui - Pageidaujamas albumui, jei vienas groja + Pageidaujamas albumui + Pageidaujamas albumui, jei vienas groja Jokių programų nerasta, kurios galėtų atlikti šią užduotį „Auxio“ piktograma Perkelti šią eilės dainą @@ -167,9 +167,9 @@ Sustabdyti grojimą Nėra takelio numerio Nėra bitų srauto - Pereiti prie kitos + Pereiti prie kitos Automatinis ausinių grojimas - Kartojimo režimas + Kartojimo režimas Atidaryti eilę Išvalyti paieškos užklausą Muzika nebus įkeliama iš pridėtų aplankų jūs pridėsite. @@ -191,7 +191,7 @@ Įkrauti atlikėjai: %d Kraunama jūsų muzikos biblioteka… (%1$d/%2$d) Maišyti visas dainas - Elgesys + Elgesys Įspėjimas: Keičiant išankstinį stiprintuvą į didelę teigiamą vertę, kai kuriuose garso takeliuose gali atsirasti pikų. Albumo viršelis, skirtas %s Atlikėjo vaizdas, skirtas %s diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index ad881c06b..888c0fca4 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -37,7 +37,7 @@ Licenties Ontwikkeld door OxygenCobalt - Instellingen + Instellingen Uiterlijk Thema Automatisch @@ -47,7 +47,7 @@ Scherm Gebruikt een afternatief notification action Audio - Gedrag + Gedrag Bij het afspelen vanuit de bibliotheek Onthoud shuffle Houd shuffle aan bij het afspelen van een nieuw nummer @@ -124,9 +124,9 @@ Ouderpad Lied eigenschappen Bestandsnaam - Voorkeur album als er een speelt - Voorkeur titel - Voorkeur album + Voorkeur album als er een speelt + Voorkeur titel + Voorkeur album De voorversterker wordt toegepast op de bestaande afstelling tijdens weergave Muziek mappen ReplayGain voorversterker @@ -157,7 +157,7 @@ Bibliotheekstatistieken Verander de zichtbaarheid en volgorde van bibliotheek-tabbladen Headset automatisch afspelen - ReplayGain + ReplayGain Waarschuwing: Als u de voorversterker op een hoge positieve waarde zet, kan dit bij sommige audiotracks tot pieken leiden. Afspelen vanaf getoond item Afspeelstatus herstellen diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index bc3dfc4ce..c5de5e67e 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -27,7 +27,7 @@ Kod źródłowy Licencje - Ustawienia + Ustawienia Wygląd Motyw Automatyczny @@ -35,7 +35,7 @@ Ciemny Odcień koloru Dźwięk - Zachowanie + Zachowanie Nie znaleziono muzyki @@ -141,7 +141,7 @@ Załaduj ponownie bibliotekę Może wyczyścić stan odtwarzania Usuń utwór z kolejki - Preferuj album + Preferuj album Automatyczne ponowne załadowanie Free Lossless Audio Codec (FLAC) Et (&) @@ -156,10 +156,10 @@ Zaokrąglone okładki Zaokrąglone rogi okładek Akcja na pasku odtwarzania - Następny utwór - Powtórz - Ustawienie ReplayGain - Preferuj album, jeśli takowy jest odtwarzany + Następny utwór + Powtórz + Ustawienie ReplayGain + Preferuj album, jeśli takowy jest odtwarzany Odtwarzając utwór z widoku biblioteki Zapisz stan odtwarzania Przecinek (,) @@ -180,7 +180,7 @@ Przesuń kartę Wizerunek wykonawcy dla %s Ładuję bibliotekę muzyczną… - Preferuj utwór + Preferuj utwór Przywrócono stan odtwarzania Wyczyszczono stan odtwarzania Zapisano stan odtwarzania diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index eb66c994d..26a16d0a0 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -27,7 +27,7 @@ Licenças Desenvolvido por Alexander Capehart - Configurações + Configurações Aparência Tema Automático @@ -35,7 +35,7 @@ Escuro Paleta de cor Áudio - Comportamento + Comportamento Manter modo aleatório ativado Nenhuma música encontrada @@ -165,16 +165,16 @@ OK Exibição Ativar cantos arredondados em elementos adicionais da interface do usuário (requer que as capas dos álbuns sejam arredondadas) - Modo de normalização de volume (ReplayGain) + Modo de normalização de volume (ReplayGain) Reproduzir a partir do item mostrado Reproduzir de todas as músicas - Preferir álbum - Prefira o álbum se estiver tocando + Preferir álbum + Prefira o álbum se estiver tocando Recarregamento automático Recarrega a biblioteca de músicas sempre que ela mudar (requer notificação fixa) Data adicionada Cancelar - Preferir faixa + Preferir faixa Abrir fila Álbum ao vivo Trilhas sonoras @@ -195,14 +195,14 @@ Carregando música Monitorando a biblioteca de músicas Cantos arredondados - Pular para o próximo + Pular para o próximo Reproduzir do álbum Salvar lista de reprodução Limpar lista de reprodução Restaurar lista de reprodução Visualize e controle a reprodução de música Ação personalizada na barra de reprodução - Modo de repetição + Modo de repetição Limpa a lista de reprodução salva anteriormente (se houver) EPs EP diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index c228f5a9d..303aa5f20 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -28,7 +28,7 @@ Licenças Desenvolvido por Alexander Capehart - Definições + Definições Aparência Tema Claro @@ -36,7 +36,7 @@ Automático Cor de realce Áudio - Comportamento + Comportamento Memorizar aleatorização Nenhuma música encontrada @@ -79,7 +79,7 @@ Duração total: %s Falha no carregamento da música Nome - Prefira o álbum se estiver tocando + Prefira o álbum se estiver tocando Nenhuma aplicação encontrada que possa lidar com esta tarefa Ciano Contagem de músicas @@ -90,7 +90,7 @@ Rápido Qualidade alta Ação da barra de reprodução personalizada - Modo de repetição + Modo de repetição Reproduzir do artista Pausar na repetição O Auxio precisa de permissão para ler a sua biblioteca de músicas @@ -103,7 +103,7 @@ Disco Faixa Taxa de bits - Pular para o próximo + Pular para o próximo Aviso: Alterar o pré-amplificador para um valor positivo alto pode resultar em picos em algumas faixas de áudio. Ajuste com etiquetas Barra (/) @@ -185,8 +185,8 @@ Usar ação de notificação alternativa Reprodução automática do fone de ouvido Sempre comece a tocar quando um fone de ouvido estiver conectado (pode não funcionar em todos os aparelhos) - Estratégia do ganho de repetição - Preferir álbum + Estratégia do ganho de repetição + Preferir álbum O pré-amplificador é aplicado ao ajuste existente durante a reprodução Reproduzir de todas as músicas Pausa quando uma música se repete @@ -238,7 +238,7 @@ Visualize e controle a reprodução de música Use um tema preto Mostrar apenas artistas que foram creditados diretamente no álbum (funciona melhor em músicas com metadados completos) - Preferir faixa + Preferir faixa Pré-amplificação da normalização de volume Ao tocar a partir dos detalhes do item Tocar a partir do gênero diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index 451211899..5e3fe693c 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -28,7 +28,7 @@ Licențe Dezvoltat de OxygenCobalt - Setări + Setări Aspect Temă Automat @@ -36,7 +36,7 @@ Întunecat Paletă de culori Audio - Comportament + Comportament Nu a fost găsită muzică diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index c1794ba74..1b446300b 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -42,7 +42,7 @@ Лицензии Разработано Александром Кейпхартом - Настройки + Настройки Внешний вид Тема Автоматически @@ -60,11 +60,11 @@ Звук Воспроизводить при подключении Всегда начинать воспроизведение при подключении наушников (может работать не на всех устройствах) - Выравнивание громкости - По треку - По альбому - Предпочитать альбом, если он воспроизводится - Поведение + Выравнивание громкости + По треку + По альбому + Предпочитать альбом, если он воспроизводится + Поведение При воспроизведении из библиотеки Запоминать перемешивание Запоминать режим перемешивания для новых треков @@ -224,8 +224,8 @@ Альбомов загружено: %d Загрузка музыкальной библиотеки… (%1$d/%2$d) Жанр - Перейти к следующей - Режим повтора + Перейти к следующей + Режим повтора Эквалайзер Скрыть соавторов Показывать только тех исполнителей, которые напрямую указаны в альбоме diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 6dee9b3a4..5511fe975 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -27,7 +27,7 @@ Kaynak kodu Lisanslar - Ayarlar + Ayarlar Görünüm Tema Otomatik @@ -35,7 +35,7 @@ Koyu Ana Renk Ses - Tercihler + Tercihler Müzik bulunamadı @@ -141,11 +141,11 @@ Yüklenen şarkılar: %d Yüklenen albümler: %d Özel bildirim eylemi - Çalan bir albüm varsa tercih et + Çalan bir albüm varsa tercih et Kulaklıkta otomatik çalma Bir kulaklık takıldığında müzik çalmaya başlar (bütün cihazlarda çalışmayabilir) - Parçayı tercih et - Albümü tercih et + Parçayı tercih et + Albümü tercih et Geri atlamadan önce geriye sar Önceki şarkıya atlamadan önce geri sar Bir şarkı tekrarlandığında duraklat @@ -247,16 +247,16 @@ Viki Müzikleri yeniden tara Özel çalma çubuğu eylemi - Sonrakine geç + Sonrakine geç Eğik çizgi (/) Kuyruğu aç - Tekrar kipi + Tekrar kipi Türden çal Podcast\'ler gibi müzik olmayan ses dosyalarını yok say Uyarı: Bu ayarın kullanılması bazı etiketlerin yanlışlıkla birden fazla değere sahip olarak yorumlanmasına neden olabilir. Bunu, istenmeyen ayırıcı karakterlerin önüne ters eğik çizgi (\\) koyarak çözebilirsiniz. Müzik olmayanları hariç tut Durum temizlenemedi - ReplayGain stratejisi + ReplayGain stratejisi Bu şarkıyı kuyrukta taşı %1$s, %2$s \ No newline at end of file diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index 55b2d78cb..887ff2c6d 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -26,13 +26,13 @@ Вихідний код Ліцензії - Налаштування + Налаштування Вигляд Тема Світла Темна Аудіо - Поведінка + Поведінка Музику не знайдено @@ -87,7 +87,7 @@ Обкладинки альбомів Приховати співавторів Вимкнено - Перейти до наступної + Перейти до наступної Швидкі Вкажіть папки, з яких програма має завантажувати пісні Виключити @@ -140,12 +140,12 @@ Кольоровий акцент Вкладки бібліотеки Автовідтворення в навушниках - Режим повторення + Режим повторення Режим Попередній підсилювач ReplayGain Відтворити альбом При відтворенні з бібліотеки - Віддавати перевагу альбому, якщо він відтворюється + Віддавати перевагу альбому, якщо він відтворюється Стан відтворення очищено Використовувати повністю чорну тему Показувати лише тих виконавців, які безпосередньо зазначені в альбомі (найкраще працює в добре позначених бібліотеках) @@ -157,8 +157,8 @@ Музика не буде завантажена з вибраних папок. Налаштуйте символи, які позначають кілька значень тегів Стан відтворення збережено - За альбомом - За піснею + За альбомом + За піснею Зміст Очистити раніше збережений стан відтворення (якщо є) Відстеження змін в музичній бібліотеці… @@ -177,7 +177,7 @@ Музика буде завантажена тільки з вибраних папок. Відновити раніше збережений стан відтворення (якщо є) Регулювання на основі тегів - Вирівнювання гучності (ReplayGain) + Вирівнювання гучності (ReplayGain) Зберегти стан відтворення Очистити стан відтворення Відновити стан відтворення diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 2b9deb466..2bb249630 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -42,7 +42,7 @@ 许可证 由 Alexander Capehart 开发 - 设置 + 设置 外观 主题 自动 @@ -60,11 +60,11 @@ 音频 自动播放 连接至耳机时总是自动播放(并非在所有设备上都有用) - 回放增益 - 偏好曲目 - 偏好专辑 - 如果已有专辑正在播放则优先增益专辑 - 行为 + 回放增益 + 偏好曲目 + 偏好专辑 + 如果已有专辑正在播放则优先增益专辑 + 行为 从音乐库中选择播放时 记住随机模式 播放新曲目时保留随机播放模式 @@ -221,8 +221,8 @@ 现场 流派 自定义播放栏动作 - 重复模式 - 跳到下一首 + 重复模式 + 跳到下一首 均衡器 停止播放 与号 (&) diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 4ffbb7533..0734c59d5 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -27,7 +27,7 @@ 在 GitHub 上檢視 授權條款 - 設定 + 設定 外觀 主題色調 強調色 @@ -35,7 +35,7 @@ 深色 色彩樣式 音訊 - 行為 + 行為 記住隨機播放 找不到音樂 diff --git a/app/src/main/res/values/settings.xml b/app/src/main/res/values/settings.xml index ff0dbbe2e..591159fad 100644 --- a/app/src/main/res/values/settings.xml +++ b/app/src/main/res/values/settings.xml @@ -77,8 +77,8 @@ - @string/set_bar_action_next - @string/set_bar_action_repeat + @string/set_action_mode_next + @string/set_action_mode_repeat @string/lbl_shuffle @@ -89,7 +89,7 @@ - @string/set_bar_action_repeat + @string/set_action_mode_repeat @string/lbl_shuffle @@ -129,9 +129,9 @@ - @string/set_replay_gain_track - @string/set_replay_gain_album - @string/set_replay_gain_dynamic + @string/set_replay_gain_mode_track + @string/set_replay_gain_mode_album + @string/set_replay_gain_mode_dynamic diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7f71d6208..dd0937b67 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -160,8 +160,10 @@ - Settings - Appearance + Settings + + Look and Feel + Change the theme and colors of the app Theme Automatic Light @@ -169,37 +171,19 @@ Color scheme Black theme Use a pure-black dark theme + Round mode + Enable rounded corners on additional UI elements (requires album covers to be rounded) + Personalize + Customize UI controls and behavior Display Library tabs Change visibility and order of library tabs - Hide collaborators - Only show artists that are directly credited on an album (works best on well-tagged libraries) - Album covers - Off - Fast - High quality - Round mode - Enable rounded corners on additional UI elements (requires album covers to be rounded) - Custom playback bar action - Skip to next - Repeat mode + Custom playback bar action Custom notification action - - Audio - Headset autoplay - Always start playing when a headset is connected (may not work on all devices) - ReplayGain strategy - Prefer track - Prefer album - Prefer album if one is playing - ReplayGain pre-amp - The pre-amp is applied to the existing adjustment during playback - Adjustment with tags - Adjustment without tags - Warning: Changing the pre-amp to a high positive value may result in peaking on some audio tracks. - + Skip to next + Repeat mode Behavior When playing from the library When playing from item details @@ -210,25 +194,51 @@ Play from genre Remember shuffle Keep shuffle on when playing a new song + + Content + Control how music and images are loaded + Music + Automatic reloading + Reload the music library whenever it changes (requires persistent notification) + Exclude non-music + Ignore audio files that are not music, such as podcasts + Multi-value separators + Configure characters that denote multiple tag values + Comma (,) + Semicolon (;) + Slash (/) + Plus (+) + Ampersand (&) + Warning: Using this setting may result in some tags being incorrectly interpreted as having multiple values. You can resolve this by prefixing unwanted separator characters with a backslash (\\). + Hide collaborators + Only show artists that are directly credited on an album (works best on well-tagged libraries) + Images + Album covers + Off + Fast + High quality + + Audio + Configure sound and playback behavior + Playback + Headset autoplay + Always start playing when a headset is connected (may not work on all devices) Rewind before skipping back Rewind before skipping to the previous song Pause on repeat Pause when a song repeats - Save playback state - Save the current playback state now - Clear playback state - Clear the previously saved playback state (if any) - Restore playback state - Restore the previously saved playback state (if any) + ReplayGain + ReplayGain strategy + Prefer track + Prefer album + Prefer album if one is playing + ReplayGain pre-amp + The pre-amp is applied to the existing adjustment during playback + Adjustment with tags + Adjustment without tags + Warning: Changing the pre-amp to a high positive value may result in peaking on some audio tracks. - Content - Refresh music - Reload the music library, using cached tags when possible - - Rescan music - Clear the tag cache and fully reload the music library (slower, but more complete) - Automatic reloading - Reload the music library whenever it changes (requires persistent notification) + Library Music folders Manage where music should be loaded from Folders @@ -240,16 +250,19 @@ Include Music will only be loaded from the folders you add. - Exclude non-music - Ignore audio files that are not music, such as podcasts - Multi-value separators - Configure characters that denote multiple tag values - Warning: Using this setting may result in some tags being incorrectly interpreted as having multiple values. You can resolve this by prefixing unwanted separator characters with a backslash (\\). - Comma (,) - Semicolon (;) - Slash (/) - Plus (+) - Ampersand (&) + Refresh music + Reload the music library, using cached tags when possible + + Rescan music + Clear the tag cache and fully reload the music library (slower, but more complete) + + Persistence + Save playback state + Save the current playback state now + Clear playback state + Clear the previously saved playback state (if any) + Restore playback state + Restore the previously saved playback state (if any) No music found diff --git a/app/src/main/res/values/styles_android.xml b/app/src/main/res/values/styles_android.xml index 559eb1807..98812140d 100644 --- a/app/src/main/res/values/styles_android.xml +++ b/app/src/main/res/values/styles_android.xml @@ -39,9 +39,14 @@ top|bottom + +