diff --git a/app/src/main/java/pl/lambada/songsync/data/remote/lyrics_providers/LyricsProviderService.kt b/app/src/main/java/pl/lambada/songsync/data/remote/lyrics_providers/LyricsProviderService.kt index 87de702..53a129b 100644 --- a/app/src/main/java/pl/lambada/songsync/data/remote/lyrics_providers/LyricsProviderService.kt +++ b/app/src/main/java/pl/lambada/songsync/data/remote/lyrics_providers/LyricsProviderService.kt @@ -64,7 +64,7 @@ class LyricsProviderService { neteaseID = it?.neteaseID ?: 0 } ?: throw NoTrackFoundException() - Providers.APPLE -> AppleAPI().getSongInfo(query).also { + Providers.APPLE -> AppleAPI().getSongInfo(query, offset).also { appleID = it?.appleID ?: 0 } ?: throw NoTrackFoundException() diff --git a/app/src/main/java/pl/lambada/songsync/data/remote/lyrics_providers/others/AppleAPI.kt b/app/src/main/java/pl/lambada/songsync/data/remote/lyrics_providers/others/AppleAPI.kt index 3a796ea..ed6d3a3 100644 --- a/app/src/main/java/pl/lambada/songsync/data/remote/lyrics_providers/others/AppleAPI.kt +++ b/app/src/main/java/pl/lambada/songsync/data/remote/lyrics_providers/others/AppleAPI.kt @@ -16,7 +16,7 @@ import java.net.URLEncoder class AppleAPI { private val baseURL = "https://paxsenix.alwaysdata.net/" - suspend fun getSongInfo(query: SongInfo): SongInfo? { + suspend fun getSongInfo(query: SongInfo, offset: Int = 0): SongInfo? { val search = withContext(Dispatchers.IO) { URLEncoder.encode( "${query.songName} ${query.artistName}", @@ -41,7 +41,11 @@ class AppleAPI { return null } - val result = json[0] + val result = try { + json[offset] + } catch (e: IndexOutOfBoundsException) { + return null + } return SongInfo( songName = result.songName, diff --git a/app/src/main/java/pl/lambada/songsync/domain/model/lyrics_providers/others/Apple.kt b/app/src/main/java/pl/lambada/songsync/domain/model/lyrics_providers/others/Apple.kt index 67fab85..22fcda3 100644 --- a/app/src/main/java/pl/lambada/songsync/domain/model/lyrics_providers/others/Apple.kt +++ b/app/src/main/java/pl/lambada/songsync/domain/model/lyrics_providers/others/Apple.kt @@ -9,7 +9,7 @@ data class AppleSearchResponse( val artistName: String, val albumName: String, val artwork: String, - val releaseDate: String, + val releaseDate: String?, val duration: Int, val isrc: String, val url: String, diff --git a/app/src/main/java/pl/lambada/songsync/ui/Navigator.kt b/app/src/main/java/pl/lambada/songsync/ui/Navigator.kt index 8cc706a..6839247 100644 --- a/app/src/main/java/pl/lambada/songsync/ui/Navigator.kt +++ b/app/src/main/java/pl/lambada/songsync/ui/Navigator.kt @@ -11,8 +11,8 @@ import androidx.navigation.toRoute import kotlinx.serialization.Serializable import pl.lambada.songsync.data.remote.UserSettingsController import pl.lambada.songsync.data.remote.lyrics_providers.LyricsProviderService -import pl.lambada.songsync.ui.screens.about.AboutScreen -import pl.lambada.songsync.ui.screens.about.AboutViewModel +import pl.lambada.songsync.ui.screens.settings.SettingsScreen +import pl.lambada.songsync.ui.screens.settings.SettingsViewModel import pl.lambada.songsync.ui.screens.home.HomeScreen import pl.lambada.songsync.ui.screens.home.HomeViewModel import pl.lambada.songsync.ui.screens.lyricsFetch.LyricsFetchScreen @@ -61,9 +61,9 @@ fun Navigator( animatedVisibilityScope = this, ) } - composable { - AboutScreen( - viewModel = viewModel { AboutViewModel() }, + composable { + SettingsScreen( + viewModel = viewModel { SettingsViewModel() }, userSettingsController, navController = navController ) @@ -96,4 +96,4 @@ data class LocalSong( ) @Serializable -object ScreenAbout \ No newline at end of file +object ScreenSettings \ No newline at end of file diff --git a/app/src/main/java/pl/lambada/songsync/ui/components/AboutItem.kt b/app/src/main/java/pl/lambada/songsync/ui/components/SettingsItem.kt similarity index 98% rename from app/src/main/java/pl/lambada/songsync/ui/components/AboutItem.kt rename to app/src/main/java/pl/lambada/songsync/ui/components/SettingsItem.kt index 24b91ae..f0d77be 100644 --- a/app/src/main/java/pl/lambada/songsync/ui/components/AboutItem.kt +++ b/app/src/main/java/pl/lambada/songsync/ui/components/SettingsItem.kt @@ -10,7 +10,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp @Composable -fun AboutItem( +fun SettingsItem( label: String, modifier: Modifier = Modifier, content: @Composable () -> Unit, diff --git a/app/src/main/java/pl/lambada/songsync/ui/screens/home/HomeScreen.kt b/app/src/main/java/pl/lambada/songsync/ui/screens/home/HomeScreen.kt index 9a08427..10a463b 100644 --- a/app/src/main/java/pl/lambada/songsync/ui/screens/home/HomeScreen.kt +++ b/app/src/main/java/pl/lambada/songsync/ui/screens/home/HomeScreen.kt @@ -15,17 +15,14 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Search -import androidx.compose.material3.Button import androidx.compose.material3.CircularProgressIndicator import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.FloatingActionButton import androidx.compose.material3.Icon import androidx.compose.material3.Scaffold -import androidx.compose.material3.Text import androidx.compose.material3.TopAppBarDefaults import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect -import androidx.compose.runtime.SideEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableStateOf @@ -39,10 +36,8 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.unit.dp import androidx.lifecycle.viewmodel.compose.viewModel import androidx.navigation.NavHostController -import pl.lambada.songsync.domain.model.SortOrders -import pl.lambada.songsync.domain.model.SortValues import pl.lambada.songsync.ui.LyricsFetchScreen -import pl.lambada.songsync.ui.ScreenAbout +import pl.lambada.songsync.ui.ScreenSettings import pl.lambada.songsync.ui.screens.home.components.BatchDownloadLyrics import pl.lambada.songsync.ui.screens.home.components.FilterAndSongCount import pl.lambada.songsync.ui.screens.home.components.FiltersDialog @@ -98,7 +93,7 @@ fun HomeScreen( showing = showing, scrollBehavior = scrollBehavior, onSelectedClearAction = viewModel.selectedSongs::clear, - onNavigateToAboutSectionRequest = { navController.navigate(ScreenAbout) }, + onNavigateToSettingsSectionRequest = { navController.navigate(ScreenSettings) }, onProviderSelectRequest = viewModel.userSettingsController::updateSelectedProviders, onBatchDownloadRequest = { isBatchDownload = true }, selectedProvider = viewModel.userSettingsController.selectedProvider, diff --git a/app/src/main/java/pl/lambada/songsync/ui/screens/home/components/HomeAppBar.kt b/app/src/main/java/pl/lambada/songsync/ui/screens/home/components/HomeAppBar.kt index 58b2075..c7a6333 100644 --- a/app/src/main/java/pl/lambada/songsync/ui/screens/home/components/HomeAppBar.kt +++ b/app/src/main/java/pl/lambada/songsync/ui/screens/home/components/HomeAppBar.kt @@ -35,7 +35,7 @@ fun HomeAppBar( scrollBehavior: TopAppBarScrollBehavior, selectedProvider: Providers, onSelectedClearAction: () -> Unit, - onNavigateToAboutSectionRequest: () -> Unit, + onNavigateToSettingsSectionRequest: () -> Unit, onProviderSelectRequest: (Providers) -> Unit, onBatchDownloadRequest: () -> Unit, onSelectAllSongsRequest: () -> Unit, @@ -120,7 +120,7 @@ fun HomeAppBar( } } else { HomeTopAppBarDropDown( - onNavigateToAboutSectionRequest = onNavigateToAboutSectionRequest, + onNavigateToSettingsSectionRequest = onNavigateToSettingsSectionRequest, selectedProvider = selectedProvider, onProviderSelectRequest = onProviderSelectRequest, onBatchDownloadRequest = onBatchDownloadRequest, diff --git a/app/src/main/java/pl/lambada/songsync/ui/screens/home/components/HomeTopAppBarDropDown.kt b/app/src/main/java/pl/lambada/songsync/ui/screens/home/components/HomeTopAppBarDropDown.kt index cf29fb5..dd1274d 100644 --- a/app/src/main/java/pl/lambada/songsync/ui/screens/home/components/HomeTopAppBarDropDown.kt +++ b/app/src/main/java/pl/lambada/songsync/ui/screens/home/components/HomeTopAppBarDropDown.kt @@ -31,7 +31,7 @@ import pl.lambada.songsync.util.set @Composable fun HomeTopAppBarDropDown( - onNavigateToAboutSectionRequest: () -> Unit, + onNavigateToSettingsSectionRequest: () -> Unit, selectedProvider: Providers, onProviderSelectRequest: (Providers) -> Unit, embedLyrics: Boolean, @@ -98,12 +98,12 @@ fun HomeTopAppBarDropDown( DropdownMenuItem( text = { Text( - text = stringResource(id = R.string.about), + text = stringResource(id = R.string.settings), modifier = Modifier.padding(horizontal = 6.dp), ) }, onClick = { - onNavigateToAboutSectionRequest() + onNavigateToSettingsSectionRequest() expanded = false } ) diff --git a/app/src/main/java/pl/lambada/songsync/ui/screens/lyricsFetch/LyricsFetchScreen.kt b/app/src/main/java/pl/lambada/songsync/ui/screens/lyricsFetch/LyricsFetchScreen.kt index 42e8a9d..82fade2 100644 --- a/app/src/main/java/pl/lambada/songsync/ui/screens/lyricsFetch/LyricsFetchScreen.kt +++ b/app/src/main/java/pl/lambada/songsync/ui/screens/lyricsFetch/LyricsFetchScreen.kt @@ -185,7 +185,6 @@ fun SharedTransitionScope.LyricsFetchScreen( animatedVisibilityScope = animatedVisibilityScope, disableMarquee = viewModel.userSettingsController.disableMarquee, allowTryingAgain = - viewModel.userSettingsController.selectedProvider != Providers.APPLE && viewModel.userSettingsController.selectedProvider != Providers.MUSIXMATCH ) diff --git a/app/src/main/java/pl/lambada/songsync/ui/screens/about/AboutScreen.kt b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/SettingsScreen.kt similarity index 81% rename from app/src/main/java/pl/lambada/songsync/ui/screens/about/AboutScreen.kt rename to app/src/main/java/pl/lambada/songsync/ui/screens/settings/SettingsScreen.kt index 31d23e1..f2d370c 100644 --- a/app/src/main/java/pl/lambada/songsync/ui/screens/about/AboutScreen.kt +++ b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/SettingsScreen.kt @@ -1,6 +1,6 @@ @file:Suppress("SpellCheckingInspection") -package pl.lambada.songsync.ui.screens.about +package pl.lambada.songsync.ui.screens.settings import android.os.Build import androidx.compose.foundation.isSystemInDarkTheme @@ -19,21 +19,21 @@ import androidx.navigation.NavController import pl.lambada.songsync.R import pl.lambada.songsync.data.remote.UpdateState import pl.lambada.songsync.data.remote.UserSettingsController -import pl.lambada.songsync.ui.screens.about.components.AboutScreenTopBar -import pl.lambada.songsync.ui.screens.about.components.AppInfoSection -import pl.lambada.songsync.ui.screens.about.components.ContributorsSection -import pl.lambada.songsync.ui.screens.about.components.CreditsSection -import pl.lambada.songsync.ui.screens.about.components.ExternalLinkSection -import pl.lambada.songsync.ui.screens.about.components.MarqueeSwitch -import pl.lambada.songsync.ui.screens.about.components.MultiPersonSwitch import pl.lambada.songsync.ui.screens.about.components.OffsetModeSwitch -import pl.lambada.songsync.ui.screens.about.components.PureBlackThemeSwitch -import pl.lambada.songsync.ui.screens.about.components.SdCardPathSetting -import pl.lambada.songsync.ui.screens.about.components.ShowPathSwitch -import pl.lambada.songsync.ui.screens.about.components.SupportSection -import pl.lambada.songsync.ui.screens.about.components.SyncedLyricsSwitch -import pl.lambada.songsync.ui.screens.about.components.TranslationSwitch -import pl.lambada.songsync.ui.screens.about.components.UpdateAvailableDialog +import pl.lambada.songsync.ui.screens.settings.components.SettingsScreenTopBar +import pl.lambada.songsync.ui.screens.settings.components.AppInfoSection +import pl.lambada.songsync.ui.screens.settings.components.ContributorsSection +import pl.lambada.songsync.ui.screens.settings.components.CreditsSection +import pl.lambada.songsync.ui.screens.settings.components.ExternalLinkSection +import pl.lambada.songsync.ui.screens.settings.components.MarqueeSwitch +import pl.lambada.songsync.ui.screens.settings.components.MultiPersonSwitch +import pl.lambada.songsync.ui.screens.settings.components.PureBlackThemeSwitch +import pl.lambada.songsync.ui.screens.settings.components.SdCardPathSetting +import pl.lambada.songsync.ui.screens.settings.components.ShowPathSwitch +import pl.lambada.songsync.ui.screens.settings.components.SupportSection +import pl.lambada.songsync.ui.screens.settings.components.SyncedLyricsSwitch +import pl.lambada.songsync.ui.screens.settings.components.TranslationSwitch +import pl.lambada.songsync.ui.screens.settings.components.UpdateAvailableDialog import pl.lambada.songsync.util.ext.getVersion /** @@ -41,8 +41,8 @@ import pl.lambada.songsync.util.ext.getVersion */ @OptIn(ExperimentalMaterial3Api::class) @Composable -fun AboutScreen( - viewModel: AboutViewModel, +fun SettingsScreen( + viewModel: SettingsViewModel, userSettingsController: UserSettingsController, navController: NavController ) { @@ -54,7 +54,7 @@ fun AboutScreen( Scaffold( modifier = Modifier.nestedScroll(scrollBehavior.nestedScrollConnection), topBar = { - AboutScreenTopBar( + SettingsScreenTopBar( navController = navController, scrollBehavior = scrollBehavior ) diff --git a/app/src/main/java/pl/lambada/songsync/ui/screens/about/AboutViewModel.kt b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/SettingsViewModel.kt similarity index 96% rename from app/src/main/java/pl/lambada/songsync/ui/screens/about/AboutViewModel.kt rename to app/src/main/java/pl/lambada/songsync/ui/screens/settings/SettingsViewModel.kt index bee339b..a868645 100644 --- a/app/src/main/java/pl/lambada/songsync/ui/screens/about/AboutViewModel.kt +++ b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/SettingsViewModel.kt @@ -1,4 +1,4 @@ -package pl.lambada.songsync.ui.screens.about +package pl.lambada.songsync.ui.screens.settings import android.content.Context import androidx.compose.runtime.getValue @@ -17,7 +17,7 @@ import pl.lambada.songsync.util.showToast /** * ViewModel class for the main functionality of the app. */ -class AboutViewModel( +class SettingsViewModel( private val updateService: UpdateService = UpdateService() ) : ViewModel() { var updateState by mutableStateOf(UpdateState.Idle) diff --git a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/AppInfoSection.kt b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/AppInfoSection.kt similarity index 89% rename from app/src/main/java/pl/lambada/songsync/ui/screens/about/components/AppInfoSection.kt rename to app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/AppInfoSection.kt index ab57ecf..1a7bd08 100644 --- a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/AppInfoSection.kt +++ b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/AppInfoSection.kt @@ -1,4 +1,4 @@ -package pl.lambada.songsync.ui.screens.about.components +package pl.lambada.songsync.ui.screens.settings.components import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer @@ -10,11 +10,11 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import pl.lambada.songsync.R -import pl.lambada.songsync.ui.components.AboutItem +import pl.lambada.songsync.ui.components.SettingsItem @Composable fun AppInfoSection(version: String, onCheckForUpdates: () -> Unit) { - AboutItem( + SettingsItem( label = stringResource(R.string.about_songsync), modifier = Modifier.padding(horizontal = 22.dp, vertical = 16.dp) ) { diff --git a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/ContributorsSection.kt b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/ContributorsSection.kt similarity index 88% rename from app/src/main/java/pl/lambada/songsync/ui/screens/about/components/ContributorsSection.kt rename to app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/ContributorsSection.kt index a3f3d2e..0d5468b 100644 --- a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/ContributorsSection.kt +++ b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/ContributorsSection.kt @@ -1,4 +1,4 @@ -package pl.lambada.songsync.ui.screens.about.components +package pl.lambada.songsync.ui.screens.settings.components import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Column @@ -13,11 +13,11 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import pl.lambada.songsync.R -import pl.lambada.songsync.ui.components.AboutItem +import pl.lambada.songsync.ui.components.SettingsItem @Composable fun ContributorsSection(uriHandler: UriHandler) { - AboutItem(stringResource(R.string.contributors)) { + SettingsItem(stringResource(R.string.contributors)) { Contributor.entries.forEach { val additionalInfo = stringResource(id = it.contributionLevel.stringResource) Column( diff --git a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/CreditsSection.kt b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/CreditsSection.kt similarity index 91% rename from app/src/main/java/pl/lambada/songsync/ui/screens/about/components/CreditsSection.kt rename to app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/CreditsSection.kt index c43cfd3..18945a4 100644 --- a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/CreditsSection.kt +++ b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/CreditsSection.kt @@ -1,4 +1,4 @@ -package pl.lambada.songsync.ui.screens.about.components +package pl.lambada.songsync.ui.screens.settings.components import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Row @@ -18,12 +18,12 @@ import androidx.compose.ui.platform.UriHandler import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import pl.lambada.songsync.R -import pl.lambada.songsync.ui.components.AboutItem +import pl.lambada.songsync.ui.components.SettingsItem @Composable fun CreditsSection(uriHandler: UriHandler) { - AboutItem(label = stringResource(id = R.string.thanks_to)) { + SettingsItem(label = stringResource(id = R.string.thanks_to)) { val credits = mapOf( stringResource(R.string.spotify_api) to "https://developer.spotify.com/documentation/web-api", stringResource(R.string.spotifylyrics_api) to "https://github.com/akashrchandran/spotify-lyrics-api", diff --git a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/ExternalLinkSection.kt b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/ExternalLinkSection.kt similarity index 87% rename from app/src/main/java/pl/lambada/songsync/ui/screens/about/components/ExternalLinkSection.kt rename to app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/ExternalLinkSection.kt index 119bb6f..cf2f564 100644 --- a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/ExternalLinkSection.kt +++ b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/ExternalLinkSection.kt @@ -1,4 +1,4 @@ -package pl.lambada.songsync.ui.screens.about.components +package pl.lambada.songsync.ui.screens.settings.components import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.padding @@ -11,12 +11,12 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import pl.lambada.songsync.R -import pl.lambada.songsync.ui.components.AboutItem +import pl.lambada.songsync.ui.components.SettingsItem @Composable fun ExternalLinkSection(label: String, description: String, url: String, uriHandler: UriHandler) { - AboutItem( + SettingsItem( label, modifier = Modifier .clickable { uriHandler.openUri(url) } diff --git a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/MarqueeSwitch.kt b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/MarqueeSwitch.kt similarity index 70% rename from app/src/main/java/pl/lambada/songsync/ui/screens/about/components/MarqueeSwitch.kt rename to app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/MarqueeSwitch.kt index 4886542..3e46157 100644 --- a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/MarqueeSwitch.kt +++ b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/MarqueeSwitch.kt @@ -1,15 +1,15 @@ -package pl.lambada.songsync.ui.screens.about.components +package pl.lambada.songsync.ui.screens.settings.components import androidx.compose.runtime.Composable import androidx.compose.ui.res.stringResource import pl.lambada.songsync.R -import pl.lambada.songsync.ui.components.AboutItem +import pl.lambada.songsync.ui.components.SettingsItem import pl.lambada.songsync.ui.components.SwitchItem @Composable fun MarqueeSwitch(selected: Boolean, onToggle: (Boolean) -> Unit) { - AboutItem(label = stringResource(R.string.disable_marquee)) { + SettingsItem(label = stringResource(R.string.disable_marquee)) { SwitchItem( label = stringResource(R.string.disable_marquee_summary), selected = selected, diff --git a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/MultiPersonSwitch.kt b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/MultiPersonSwitch.kt similarity index 69% rename from app/src/main/java/pl/lambada/songsync/ui/screens/about/components/MultiPersonSwitch.kt rename to app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/MultiPersonSwitch.kt index de08faf..75e1ecd 100644 --- a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/MultiPersonSwitch.kt +++ b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/MultiPersonSwitch.kt @@ -1,14 +1,14 @@ -package pl.lambada.songsync.ui.screens.about.components +package pl.lambada.songsync.ui.screens.settings.components import androidx.compose.runtime.Composable import androidx.compose.ui.res.stringResource import pl.lambada.songsync.R -import pl.lambada.songsync.ui.components.AboutItem +import pl.lambada.songsync.ui.components.SettingsItem import pl.lambada.songsync.ui.components.SwitchItem @Composable fun MultiPersonSwitch(selected: Boolean, onToggle: (Boolean) -> Unit) { - AboutItem(label = stringResource(id = R.string.multi_person_word_by_word)) { + SettingsItem(label = stringResource(id = R.string.multi_person_word_by_word)) { SwitchItem( label = stringResource(id = R.string.multi_person_word_by_word_summary), selected = selected, diff --git a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/OffsetModeSwitch.kt b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/OffsetModeSwitch.kt similarity index 80% rename from app/src/main/java/pl/lambada/songsync/ui/screens/about/components/OffsetModeSwitch.kt rename to app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/OffsetModeSwitch.kt index 90102bb..b418ba4 100644 --- a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/OffsetModeSwitch.kt +++ b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/OffsetModeSwitch.kt @@ -3,7 +3,7 @@ package pl.lambada.songsync.ui.screens.about.components import androidx.compose.runtime.Composable import androidx.compose.ui.res.stringResource import pl.lambada.songsync.R -import pl.lambada.songsync.ui.components.AboutItem +import pl.lambada.songsync.ui.components.SettingsItem import pl.lambada.songsync.ui.components.SwitchItem @Composable @@ -11,7 +11,7 @@ fun OffsetModeSwitch( selected: Boolean, onToggle: (Boolean) -> Unit ) { - AboutItem(label = stringResource(R.string.offset_mode)) { + SettingsItem(label = stringResource(R.string.offset_mode)) { SwitchItem( label = stringResource(R.string.offset_mode_summary), selected = selected, diff --git a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/PureBlackThemeSwitch.kt b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/PureBlackThemeSwitch.kt similarity index 71% rename from app/src/main/java/pl/lambada/songsync/ui/screens/about/components/PureBlackThemeSwitch.kt rename to app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/PureBlackThemeSwitch.kt index 40a39c5..ffb053f 100644 --- a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/PureBlackThemeSwitch.kt +++ b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/PureBlackThemeSwitch.kt @@ -1,15 +1,15 @@ -package pl.lambada.songsync.ui.screens.about.components +package pl.lambada.songsync.ui.screens.settings.components import androidx.compose.runtime.Composable import androidx.compose.ui.res.stringResource import pl.lambada.songsync.R -import pl.lambada.songsync.ui.components.AboutItem +import pl.lambada.songsync.ui.components.SettingsItem import pl.lambada.songsync.ui.components.SwitchItem @Composable fun PureBlackThemeSwitch(selected: Boolean, onToggle: (Boolean) -> Unit) { - AboutItem(label = stringResource(R.string.theme)) { + SettingsItem(label = stringResource(R.string.theme)) { SwitchItem( label = stringResource(R.string.pure_black_theme), selected = selected, diff --git a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/SdCardPathSetting.kt b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/SdCardPathSetting.kt similarity index 95% rename from app/src/main/java/pl/lambada/songsync/ui/screens/about/components/SdCardPathSetting.kt rename to app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/SdCardPathSetting.kt index 9d82881..d44b4ce 100644 --- a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/SdCardPathSetting.kt +++ b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/SdCardPathSetting.kt @@ -1,4 +1,4 @@ -package pl.lambada.songsync.ui.screens.about.components +package pl.lambada.songsync.ui.screens.settings.components import android.net.Uri import android.os.Environment @@ -24,13 +24,13 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import pl.lambada.songsync.R -import pl.lambada.songsync.ui.components.AboutItem +import pl.lambada.songsync.ui.components.SettingsItem @Composable fun SdCardPathSetting(sdPath: String?, onClearPath: () -> Unit, onUpdatePath: (String) -> Unit) { var picker by remember { mutableStateOf(false) } - AboutItem( + SettingsItem( label = stringResource(R.string.sd_card), modifier = Modifier.padding(horizontal = 22.dp, vertical = 16.dp) ) { diff --git a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/AboutScreenTopBar.kt b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/SettingsScreenTopBar.kt similarity index 85% rename from app/src/main/java/pl/lambada/songsync/ui/screens/about/components/AboutScreenTopBar.kt rename to app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/SettingsScreenTopBar.kt index ba7993b..97c6a17 100644 --- a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/AboutScreenTopBar.kt +++ b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/SettingsScreenTopBar.kt @@ -1,4 +1,4 @@ -package pl.lambada.songsync.ui.screens.about.components +package pl.lambada.songsync.ui.screens.settings.components import androidx.compose.foundation.layout.padding import androidx.compose.material.icons.Icons @@ -18,7 +18,7 @@ import pl.lambada.songsync.R @OptIn(ExperimentalMaterial3Api::class) @Composable -fun AboutScreenTopBar(navController: NavController, scrollBehavior: TopAppBarScrollBehavior) { +fun SettingsScreenTopBar(navController: NavController, scrollBehavior: TopAppBarScrollBehavior) { MediumTopAppBar( navigationIcon = { IconButton( @@ -35,7 +35,7 @@ fun AboutScreenTopBar(navController: NavController, scrollBehavior: TopAppBarScr title = { Text( modifier = Modifier.padding(start = 6.dp), - text = stringResource(id = R.string.about) + text = stringResource(id = R.string.settings) ) }, scrollBehavior = scrollBehavior diff --git a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/ShowPathSwitch.kt b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/ShowPathSwitch.kt similarity index 71% rename from app/src/main/java/pl/lambada/songsync/ui/screens/about/components/ShowPathSwitch.kt rename to app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/ShowPathSwitch.kt index 3bcc143..9193712 100644 --- a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/ShowPathSwitch.kt +++ b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/ShowPathSwitch.kt @@ -1,14 +1,14 @@ -package pl.lambada.songsync.ui.screens.about.components +package pl.lambada.songsync.ui.screens.settings.components import androidx.compose.runtime.Composable import androidx.compose.ui.res.stringResource import pl.lambada.songsync.R -import pl.lambada.songsync.ui.components.AboutItem +import pl.lambada.songsync.ui.components.SettingsItem import pl.lambada.songsync.ui.components.SwitchItem @Composable fun ShowPathSwitch(selected: Boolean, onToggle: (Boolean) -> Unit) { - AboutItem(label = stringResource(R.string.song_path)) { + SettingsItem(label = stringResource(R.string.song_path)) { SwitchItem( label = stringResource(R.string.song_path_description), selected = selected, diff --git a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/SupportSection.kt b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/SupportSection.kt similarity index 90% rename from app/src/main/java/pl/lambada/songsync/ui/screens/about/components/SupportSection.kt rename to app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/SupportSection.kt index dad70a7..0084406 100644 --- a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/SupportSection.kt +++ b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/SupportSection.kt @@ -1,4 +1,4 @@ -package pl.lambada.songsync.ui.screens.about.components +package pl.lambada.songsync.ui.screens.settings.components import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Column @@ -12,12 +12,12 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import pl.lambada.songsync.R -import pl.lambada.songsync.ui.components.AboutItem +import pl.lambada.songsync.ui.components.SettingsItem @Composable fun SupportSection(uriHandler: UriHandler) { - AboutItem( + SettingsItem( stringResource(R.string.support), ) { Column( diff --git a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/SyncedLyricsSwitch.kt b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/SyncedLyricsSwitch.kt similarity index 70% rename from app/src/main/java/pl/lambada/songsync/ui/screens/about/components/SyncedLyricsSwitch.kt rename to app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/SyncedLyricsSwitch.kt index 3c0aa1d..b954657 100644 --- a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/SyncedLyricsSwitch.kt +++ b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/SyncedLyricsSwitch.kt @@ -1,14 +1,14 @@ -package pl.lambada.songsync.ui.screens.about.components +package pl.lambada.songsync.ui.screens.settings.components import androidx.compose.runtime.Composable import androidx.compose.ui.res.stringResource import pl.lambada.songsync.R -import pl.lambada.songsync.ui.components.AboutItem +import pl.lambada.songsync.ui.components.SettingsItem import pl.lambada.songsync.ui.components.SwitchItem @Composable fun SyncedLyricsSwitch(selected: Boolean, onToggle: (Boolean) -> Unit) { - AboutItem(label = stringResource(id = R.string.synced_lyrics)) { + SettingsItem(label = stringResource(id = R.string.synced_lyrics)) { SwitchItem( label = stringResource(id = R.string.synced_lyrics_summary), selected = selected, diff --git a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/TranslationSwitch.kt b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/TranslationSwitch.kt similarity index 70% rename from app/src/main/java/pl/lambada/songsync/ui/screens/about/components/TranslationSwitch.kt rename to app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/TranslationSwitch.kt index 11d9391..6b76b1c 100644 --- a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/TranslationSwitch.kt +++ b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/TranslationSwitch.kt @@ -1,15 +1,15 @@ -package pl.lambada.songsync.ui.screens.about.components +package pl.lambada.songsync.ui.screens.settings.components import androidx.compose.runtime.Composable import androidx.compose.ui.res.stringResource import pl.lambada.songsync.R -import pl.lambada.songsync.ui.components.AboutItem +import pl.lambada.songsync.ui.components.SettingsItem import pl.lambada.songsync.ui.components.SwitchItem @Composable fun TranslationSwitch(selected: Boolean, onToggle: (Boolean) -> Unit) { - AboutItem(label = stringResource(id = R.string.include_translation)) { + SettingsItem(label = stringResource(id = R.string.include_translation)) { SwitchItem( label = stringResource(id = R.string.include_translation_summary), selected = selected, diff --git a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/UpdateAvailableDialog.kt b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/UpdateAvailableDialog.kt similarity index 95% rename from app/src/main/java/pl/lambada/songsync/ui/screens/about/components/UpdateAvailableDialog.kt rename to app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/UpdateAvailableDialog.kt index 0cee09d..69a607e 100644 --- a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/UpdateAvailableDialog.kt +++ b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/UpdateAvailableDialog.kt @@ -1,4 +1,4 @@ -package pl.lambada.songsync.ui.screens.about.components +package pl.lambada.songsync.ui.screens.settings.components import androidx.compose.foundation.layout.Column import androidx.compose.foundation.rememberScrollState diff --git a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/Utils.kt b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/Utils.kt similarity index 95% rename from app/src/main/java/pl/lambada/songsync/ui/screens/about/components/Utils.kt rename to app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/Utils.kt index 5a7ac86..c1aa67f 100644 --- a/app/src/main/java/pl/lambada/songsync/ui/screens/about/components/Utils.kt +++ b/app/src/main/java/pl/lambada/songsync/ui/screens/settings/components/Utils.kt @@ -1,4 +1,4 @@ -package pl.lambada.songsync.ui.screens.about.components +package pl.lambada.songsync.ui.screens.settings.components import pl.lambada.songsync.R diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f640389..f88c203 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -140,4 +140,5 @@ Sort Offset mode Directly modify the lyrics timestamps instead of using offset LRC tag + Settings