diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 381bd2ec..e3d0f4b3 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -38,6 +38,7 @@ android { targetSdk = rootProject.extra["TARGET_SDK"] as Int versionCode = rootProject.extra["VERSION_CODE"] as Int versionName = rootProject.extra["VERSION_NAME"] as String + resourceConfigurations += setOf("en", "ru") } buildTypes { @@ -148,7 +149,7 @@ dependencies { implementation("com.google.android.material:material:1.11.0") // Firebase - implementation("com.google.firebase:firebase-crashlytics-ktx:18.6.0") + implementation("com.google.firebase:firebase-crashlytics-ktx:18.6.1") implementation("com.google.firebase:firebase-messaging:23.4.0") // Koin @@ -182,10 +183,6 @@ dependencies { // https://github.com/coil-kt/coil implementation("io.coil-kt:coil:2.5.0") - // Language - // https://github.com/YarikSOffice/lingver - implementation("com.github.YarikSOffice:lingver:1.3.0") - // MPAndroidChart // https://github.com/PhilJay/MPAndroidChart implementation("com.github.PhilJay:MPAndroidChart:v3.1.0") diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 11338254..8a71db89 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -13,6 +13,7 @@ android:supportsRtl="true" android:theme="@style/AppTheme" android:usesCleartextTraffic="true" + android:localeConfig="@xml/locales_config" tools:ignore="DataExtractionRules,UnusedAttribute"> + + + + () { private val errorHandler: ErrorHandler by inject() private val notifier: Notifier by inject() private val eventDispatcher: EventDispatcher by inject() - private val getUserLanguageUseCase: GetUserLanguageUseCase by inject() - private val setUserLanguageUseCase: SetUserLanguageUseCase by inject() private val getAppThemeUseCase: GetAppThemeUseCase by inject() private val setAppThemeUseCase: SetAppThemeUseCase by inject() private val generateDataUseCase: GenerateDataUseCase by inject() - private var language = Language.EN + private var language = getSelectedLanguage() private var theme = AppTheme.SYSTEM override fun onFirstViewAttach() { initData() } + fun onResume() { + language = getSelectedLanguage() + populateData() + } + private fun initData() { presenterScope.launch { - getUserLanguageUseCase().process( - { result -> - language = result - }, ::onError - ) getAppThemeUseCase().process( { result -> theme = result @@ -61,17 +58,7 @@ class SettingsPresenter : BasePresenter() { theme = theme ) - fun changeLanguage(language: Language) { - presenterScope.launch { - viewState.setProgress(true) - setUserLanguageUseCase(language).process( - { - delay(500) - viewState.updateUiLanguage() - }, ::onError - ) - } - } + fun changeLanguage(language: Language) = setSelectedLanguage(language) fun changeTheme(newTheme: AppTheme) { presenterScope.launch { diff --git a/app/src/main/java/ru/rznnike/eyehealthmanager/app/presentation/main/settings/SettingsView.kt b/app/src/main/java/ru/rznnike/eyehealthmanager/app/presentation/main/settings/SettingsView.kt index 0996cd2e..9060d670 100644 --- a/app/src/main/java/ru/rznnike/eyehealthmanager/app/presentation/main/settings/SettingsView.kt +++ b/app/src/main/java/ru/rznnike/eyehealthmanager/app/presentation/main/settings/SettingsView.kt @@ -12,7 +12,4 @@ interface SettingsView : NavigationMvpView { @AddToEndSingle fun populateData(language: Language, theme: AppTheme) - - @OneExecution - fun updateUiLanguage() } diff --git a/app/src/main/java/ru/rznnike/eyehealthmanager/app/ui/fragment/main/settings/SettingsFragment.kt b/app/src/main/java/ru/rznnike/eyehealthmanager/app/ui/fragment/main/settings/SettingsFragment.kt index 91bfdb85..1d59e96e 100644 --- a/app/src/main/java/ru/rznnike/eyehealthmanager/app/ui/fragment/main/settings/SettingsFragment.kt +++ b/app/src/main/java/ru/rznnike/eyehealthmanager/app/ui/fragment/main/settings/SettingsFragment.kt @@ -17,7 +17,6 @@ import ru.rznnike.eyehealthmanager.app.global.ui.fragment.BaseFragment import ru.rznnike.eyehealthmanager.app.presentation.main.settings.SettingsPresenter import ru.rznnike.eyehealthmanager.app.presentation.main.settings.SettingsView import ru.rznnike.eyehealthmanager.app.utils.extensions.addSystemWindowInsetToPadding -import ru.rznnike.eyehealthmanager.app.utils.extensions.restartApp import ru.rznnike.eyehealthmanager.app.utils.extensions.setScaleOnTouch import ru.rznnike.eyehealthmanager.app.utils.extensions.setVisible import ru.rznnike.eyehealthmanager.databinding.DialogAboutAppBinding @@ -50,6 +49,11 @@ class SettingsFragment : BaseFragment(R.layout.fragment_settings), SettingsView initOnClickListeners() } + override fun onResume() { + super.onResume() + presenter.onResume() + } + private fun initViews() = binding.apply { listOf( buttonTestingSettings, @@ -128,8 +132,6 @@ class SettingsFragment : BaseFragment(R.layout.fragment_settings), SettingsView ) } - override fun updateUiLanguage() = requireActivity().restartApp() - private fun showThemeSelectionBottomDialog(currentTheme: AppTheme) { showBottomDialog( header = getString(R.string.choose_theme), diff --git a/app/src/main/java/ru/rznnike/eyehealthmanager/app/utils/extensions/ActivityUtils.kt b/app/src/main/java/ru/rznnike/eyehealthmanager/app/utils/extensions/ActivityUtils.kt index a1d1d535..370dc965 100644 --- a/app/src/main/java/ru/rznnike/eyehealthmanager/app/utils/extensions/ActivityUtils.kt +++ b/app/src/main/java/ru/rznnike/eyehealthmanager/app/utils/extensions/ActivityUtils.kt @@ -3,7 +3,10 @@ package ru.rznnike.eyehealthmanager.app.utils.extensions import android.app.Activity import android.content.Intent import androidx.appcompat.app.AppCompatDelegate +import androidx.core.os.LocaleListCompat import ru.rznnike.eyehealthmanager.domain.model.enums.AppTheme +import ru.rznnike.eyehealthmanager.domain.model.enums.Language +import java.util.Locale import kotlin.system.exitProcess fun Activity.restartApp() { @@ -21,3 +24,11 @@ fun applyTheme(theme: AppTheme) { } AppCompatDelegate.setDefaultNightMode(flag) } + +fun getSelectedLanguage() = Language[ + (AppCompatDelegate.getApplicationLocales()[0] ?: Locale.getDefault()).language +] + +fun setSelectedLanguage(language: Language) = AppCompatDelegate.setApplicationLocales( + LocaleListCompat.forLanguageTags(language.tag) +) diff --git a/app/src/test/java/ru/rznnike/eyehealthmanager/app/presentation/main/settings/SettingsPresenterTest.kt b/app/src/test/java/ru/rznnike/eyehealthmanager/app/presentation/main/settings/SettingsPresenterTest.kt index b1bee71c..28e98ccd 100644 --- a/app/src/test/java/ru/rznnike/eyehealthmanager/app/presentation/main/settings/SettingsPresenterTest.kt +++ b/app/src/test/java/ru/rznnike/eyehealthmanager/app/presentation/main/settings/SettingsPresenterTest.kt @@ -22,8 +22,8 @@ import org.mockito.junit.jupiter.MockitoExtension import org.mockito.kotlin.any import org.mockito.kotlin.clearInvocations import org.mockito.kotlin.doReturn +import org.mockito.kotlin.eq import org.mockito.kotlin.mock -import org.mockito.kotlin.times import org.mockito.kotlin.verify import org.mockito.kotlin.verifyNoMoreInteractions import org.mockito.kotlin.whenever @@ -39,12 +39,9 @@ import ru.rznnike.eyehealthmanager.app.utils.screenMatcher import ru.rznnike.eyehealthmanager.domain.global.interactor.UseCaseResult import ru.rznnike.eyehealthmanager.domain.interactor.dev.GenerateDataUseCase import ru.rznnike.eyehealthmanager.domain.interactor.user.GetAppThemeUseCase -import ru.rznnike.eyehealthmanager.domain.interactor.user.GetUserLanguageUseCase import ru.rznnike.eyehealthmanager.domain.interactor.user.SetAppThemeUseCase -import ru.rznnike.eyehealthmanager.domain.interactor.user.SetUserLanguageUseCase import ru.rznnike.eyehealthmanager.domain.model.enums.AppTheme import ru.rznnike.eyehealthmanager.domain.model.enums.DataGenerationType -import ru.rznnike.eyehealthmanager.domain.model.enums.Language @ExtendWith(MockitoExtension::class) class SettingsPresenterTest : KoinTest { @@ -54,8 +51,6 @@ class SettingsPresenterTest : KoinTest { private val mockErrorHandler: ErrorHandler by inject() private val mockNotifier: Notifier by inject() private val mockEventDispatcher: EventDispatcher by inject() - private val mockGetUserLanguageUseCase: GetUserLanguageUseCase by inject() - private val mockSetUserLanguageUseCase: SetUserLanguageUseCase by inject() private val mockGetAppThemeUseCase: GetAppThemeUseCase by inject() private val mockSetAppThemeUseCase: SetAppThemeUseCase by inject() private val mockGenerateDataUseCase: GenerateDataUseCase by inject() @@ -70,8 +65,6 @@ class SettingsPresenterTest : KoinTest { single { mock() } single { mock() } single { mock() } - single { mock() } - single { mock() } single { mock() } single { mock() } single { mock() } @@ -99,86 +92,58 @@ class SettingsPresenterTest : KoinTest { @Test fun onFirstViewAttach_success_populateData() = runTest { - val language = Language.RU val theme = AppTheme.SYSTEM - whenever(mockGetUserLanguageUseCase()).doReturn(UseCaseResult(language)) whenever(mockGetAppThemeUseCase()).doReturn(UseCaseResult(theme)) val presenter = SettingsPresenter() presenter.attachView(mockView) testScheduler.advanceUntilIdle() - verify(mockGetUserLanguageUseCase)() verify(mockGetAppThemeUseCase)() verify(mockView).populateData( - language = language, - theme = theme + language = any(), + theme = eq(theme) ) verifyNoMoreInteractionsForAll() } @Test fun onFirstViewAttach_exception_errorHandler() = runTest { - whenever(mockGetUserLanguageUseCase()).doReturn(UseCaseResult(error = Exception())) whenever(mockGetAppThemeUseCase()).doReturn(UseCaseResult(error = Exception())) val presenter = SettingsPresenter() presenter.attachView(mockView) testScheduler.advanceUntilIdle() - verify(mockGetUserLanguageUseCase)() verify(mockGetAppThemeUseCase)() - verify(mockErrorHandler, times(2)).proceed(any(), any()) + verify(mockErrorHandler).proceed(any(), any()) verify(mockView).populateData( - language = Language.EN, - theme = AppTheme.SYSTEM + language = any(), + theme = eq(AppTheme.SYSTEM) ) verifyNoMoreInteractionsForAll() } @Test - fun changeLanguage_success_updateUI() = runTest { - whenever(mockGetUserLanguageUseCase()).doReturn(UseCaseResult(Language.EN)) - whenever(mockGetAppThemeUseCase()).doReturn(UseCaseResult(AppTheme.SYSTEM)) - whenever(mockSetUserLanguageUseCase(any())).doReturn(UseCaseResult(Unit)) - val presenter = SettingsPresenter() - presenter.attachView(mockView) - testScheduler.advanceUntilIdle() - val language = Language.RU - clearInvocationsForAll() - - presenter.changeLanguage(language) - testScheduler.advanceUntilIdle() - - verify(mockView).setProgress(show = true, immediately = true) - verify(mockSetUserLanguageUseCase)(language) - verify(mockView).updateUiLanguage() - verifyNoMoreInteractionsForAll() - } - - @Test - fun changeLanguage_exception_errorHandler() = runTest { - whenever(mockGetUserLanguageUseCase()).doReturn(UseCaseResult(Language.EN)) - whenever(mockGetAppThemeUseCase()).doReturn(UseCaseResult(AppTheme.SYSTEM)) - whenever(mockSetUserLanguageUseCase(any())).doReturn(UseCaseResult(error = Exception())) + fun onResume_populateData() = runTest { + val theme = AppTheme.SYSTEM + whenever(mockGetAppThemeUseCase()).doReturn(UseCaseResult(theme)) val presenter = SettingsPresenter() presenter.attachView(mockView) testScheduler.advanceUntilIdle() - val language = Language.RU clearInvocationsForAll() - presenter.changeLanguage(language) - testScheduler.advanceUntilIdle() + presenter.onResume() - verify(mockView).setProgress(show = true, immediately = true) - verify(mockSetUserLanguageUseCase)(language) - verify(mockErrorHandler).proceed(any(), any()) + verify(mockView).populateData( + language = any(), + theme = eq(theme) + ) verifyNoMoreInteractionsForAll() } @Test fun changeTheme_success_populateData() = runTest { - whenever(mockGetUserLanguageUseCase()).doReturn(UseCaseResult(Language.EN)) whenever(mockGetAppThemeUseCase()).doReturn(UseCaseResult(AppTheme.SYSTEM)) whenever(mockSetAppThemeUseCase(any())).doReturn(UseCaseResult(Unit)) val presenter = SettingsPresenter() @@ -192,15 +157,14 @@ class SettingsPresenterTest : KoinTest { verify(mockSetAppThemeUseCase)(theme) verify(mockView).populateData( - language = Language.EN, - theme = theme + language = any(), + theme = eq(theme) ) verifyNoMoreInteractionsForAll() } @Test fun changeTheme_exception_errorHandler() = runTest { - whenever(mockGetUserLanguageUseCase()).doReturn(UseCaseResult(Language.EN)) whenever(mockGetAppThemeUseCase()).doReturn(UseCaseResult(AppTheme.SYSTEM)) whenever(mockSetAppThemeUseCase(any())).doReturn(UseCaseResult(error = Exception())) val presenter = SettingsPresenter() @@ -219,7 +183,6 @@ class SettingsPresenterTest : KoinTest { @Test fun openTestingSettings_openTestingSettingsScreen() = runTest { - whenever(mockGetUserLanguageUseCase()).doReturn(UseCaseResult(Language.EN)) whenever(mockGetAppThemeUseCase()).doReturn(UseCaseResult(AppTheme.SYSTEM)) val presenter = SettingsPresenter() presenter.attachView(mockView) @@ -234,7 +197,6 @@ class SettingsPresenterTest : KoinTest { @Test fun openAnalysis_openAnalysisFlow() = runTest { - whenever(mockGetUserLanguageUseCase()).doReturn(UseCaseResult(Language.EN)) whenever(mockGetAppThemeUseCase()).doReturn(UseCaseResult(AppTheme.SYSTEM)) val presenter = SettingsPresenter() presenter.attachView(mockView) @@ -249,7 +211,6 @@ class SettingsPresenterTest : KoinTest { @Test fun exportData_openExportJournalScreen() = runTest { - whenever(mockGetUserLanguageUseCase()).doReturn(UseCaseResult(Language.EN)) whenever(mockGetAppThemeUseCase()).doReturn(UseCaseResult(AppTheme.SYSTEM)) val presenter = SettingsPresenter() presenter.attachView(mockView) @@ -264,7 +225,6 @@ class SettingsPresenterTest : KoinTest { @Test fun importData_openImportJournalScreen() = runTest { - whenever(mockGetUserLanguageUseCase()).doReturn(UseCaseResult(Language.EN)) whenever(mockGetAppThemeUseCase()).doReturn(UseCaseResult(AppTheme.SYSTEM)) val presenter = SettingsPresenter() presenter.attachView(mockView) @@ -279,7 +239,6 @@ class SettingsPresenterTest : KoinTest { @Test fun clearJournal_sendEvent() = runTest { - whenever(mockGetUserLanguageUseCase()).doReturn(UseCaseResult(Language.EN)) whenever(mockGetAppThemeUseCase()).doReturn(UseCaseResult(AppTheme.SYSTEM)) val presenter = SettingsPresenter() presenter.attachView(mockView) @@ -294,7 +253,6 @@ class SettingsPresenterTest : KoinTest { @Test fun deleteDuplicatesInJournal_sendEvent() = runTest { - whenever(mockGetUserLanguageUseCase()).doReturn(UseCaseResult(Language.EN)) whenever(mockGetAppThemeUseCase()).doReturn(UseCaseResult(AppTheme.SYSTEM)) val presenter = SettingsPresenter() presenter.attachView(mockView) @@ -309,7 +267,6 @@ class SettingsPresenterTest : KoinTest { @Test fun generateData_success() = runTest { - whenever(mockGetUserLanguageUseCase()).doReturn(UseCaseResult(Language.EN)) whenever(mockGetAppThemeUseCase()).doReturn(UseCaseResult(AppTheme.SYSTEM)) whenever(mockGenerateDataUseCase(any())).doReturn(UseCaseResult(Unit)) val presenter = SettingsPresenter() @@ -334,8 +291,6 @@ class SettingsPresenterTest : KoinTest { mockErrorHandler, mockNotifier, mockEventDispatcher, - mockGetUserLanguageUseCase, - mockSetUserLanguageUseCase, mockGenerateDataUseCase ) } diff --git a/build.gradle.kts b/build.gradle.kts index e721261e..e745b20d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,7 +1,7 @@ buildscript { extra.apply { - set("VERSION_CODE", 16) - set("VERSION_NAME", "2.2.0.${extra["VERSION_CODE"]}") + set("VERSION_CODE", 17) + set("VERSION_NAME", "2.2.1.${extra["VERSION_CODE"]}") set("APK_NAME", "Eye Health Manager") set("MIN_SDK", 24) set("TARGET_SDK", 34) @@ -19,7 +19,7 @@ buildscript { maven(url = "https://jitpack.io") } dependencies { - classpath("com.android.tools.build:gradle:8.2.1") + classpath("com.android.tools.build:gradle:8.2.2") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${rootProject.extra["kotlinVersion"]}") classpath("com.google.firebase:firebase-crashlytics-gradle:2.9.9") classpath("com.google.gms:google-services:4.4.0") diff --git a/data/src/main/java/ru/rznnike/eyehealthmanager/data/gateway/UserGatewayImpl.kt b/data/src/main/java/ru/rznnike/eyehealthmanager/data/gateway/UserGatewayImpl.kt index 61b5b757..f5c812e8 100644 --- a/data/src/main/java/ru/rznnike/eyehealthmanager/data/gateway/UserGatewayImpl.kt +++ b/data/src/main/java/ru/rznnike/eyehealthmanager/data/gateway/UserGatewayImpl.kt @@ -6,7 +6,6 @@ import ru.rznnike.eyehealthmanager.domain.model.AcuityTestingSettings import ru.rznnike.eyehealthmanager.domain.model.TestingSettings import ru.rznnike.eyehealthmanager.domain.model.enums.AcuityTestSymbolsType import ru.rznnike.eyehealthmanager.domain.model.enums.AppTheme -import ru.rznnike.eyehealthmanager.domain.model.enums.Language import ru.rznnike.eyehealthmanager.domain.model.enums.TestEyesType class UserGatewayImpl( @@ -24,12 +23,6 @@ class UserGatewayImpl( override suspend fun setDisplayedChangelogVersion(newValue: Int) = preferences.displayedChangelogVersion.set(newValue) - override suspend fun getLanguage() = - Language[preferences.language.get()] - - override suspend fun setLanguage(newValue: Language) = - preferences.language.set(newValue.tag) - override suspend fun getTestingSettings() = preferences.run { TestingSettings( diff --git a/data/src/main/java/ru/rznnike/eyehealthmanager/data/preference/PreferencesWrapper.kt b/data/src/main/java/ru/rznnike/eyehealthmanager/data/preference/PreferencesWrapper.kt index c97d501b..473b82c2 100644 --- a/data/src/main/java/ru/rznnike/eyehealthmanager/data/preference/PreferencesWrapper.kt +++ b/data/src/main/java/ru/rznnike/eyehealthmanager/data/preference/PreferencesWrapper.kt @@ -7,7 +7,6 @@ import ru.rznnike.eyehealthmanager.domain.model.enums.AppTheme import ru.rznnike.eyehealthmanager.domain.model.enums.Language import ru.rznnike.eyehealthmanager.domain.model.enums.TestEyesType -private const val LANGUAGE = "LANGUAGE" private const val ACUITY_SYMBOLS_TYPE = "ACUITY_SYMBOLS_TYPE_1" private const val TEST_EYES_TYPE = "TEST_EYES_TYPE_1" private const val DOTS_PER_MILLIMETER = "DOTS_PER_MILLIMETER" @@ -28,8 +27,6 @@ private const val NOTIFICATIONS_SOUND_ENABLED = "NOTIFICATIONS_SOUND_ENABLED" private const val APP_THEME = "APP_THEME" class PreferencesWrapper(private val preferences: FlowSharedPreferences) { - val language: Preference - get() = preferences.getString(LANGUAGE, Language.EN.tag) val acuitySymbolsType: Preference get() = preferences.getInt(ACUITY_SYMBOLS_TYPE, AcuityTestSymbolsType.LETTERS_RU.id) val testEyesType: Preference diff --git a/domain/src/main/java/ru/rznnike/eyehealthmanager/domain/gateway/UserGateway.kt b/domain/src/main/java/ru/rznnike/eyehealthmanager/domain/gateway/UserGateway.kt index cf688655..cde3c07a 100644 --- a/domain/src/main/java/ru/rznnike/eyehealthmanager/domain/gateway/UserGateway.kt +++ b/domain/src/main/java/ru/rznnike/eyehealthmanager/domain/gateway/UserGateway.kt @@ -3,7 +3,6 @@ package ru.rznnike.eyehealthmanager.domain.gateway import ru.rznnike.eyehealthmanager.domain.model.AcuityTestingSettings import ru.rznnike.eyehealthmanager.domain.model.TestingSettings import ru.rznnike.eyehealthmanager.domain.model.enums.AppTheme -import ru.rznnike.eyehealthmanager.domain.model.enums.Language interface UserGateway { suspend fun getWelcomeDialogShowed(): Boolean @@ -14,10 +13,6 @@ interface UserGateway { suspend fun setDisplayedChangelogVersion(newValue: Int) - suspend fun getLanguage(): Language - - suspend fun setLanguage(newValue: Language) - suspend fun getTestingSettings(): TestingSettings suspend fun setTestingSettings(newValue: TestingSettings) diff --git a/domain/src/main/java/ru/rznnike/eyehealthmanager/domain/interactor/user/GetUserLanguageUseCase.kt b/domain/src/main/java/ru/rznnike/eyehealthmanager/domain/interactor/user/GetUserLanguageUseCase.kt deleted file mode 100644 index 5088f56a..00000000 --- a/domain/src/main/java/ru/rznnike/eyehealthmanager/domain/interactor/user/GetUserLanguageUseCase.kt +++ /dev/null @@ -1,14 +0,0 @@ -package ru.rznnike.eyehealthmanager.domain.interactor.user - -import ru.rznnike.eyehealthmanager.domain.gateway.UserGateway -import ru.rznnike.eyehealthmanager.domain.global.DispatcherProvider -import ru.rznnike.eyehealthmanager.domain.global.interactor.UseCase -import ru.rznnike.eyehealthmanager.domain.model.enums.Language - -class GetUserLanguageUseCase( - private val userGateway: UserGateway, - dispatcherProvider: DispatcherProvider -) : UseCase(dispatcherProvider.io) { - override suspend fun execute() = - userGateway.getLanguage() -} diff --git a/domain/src/main/java/ru/rznnike/eyehealthmanager/domain/interactor/user/SetUserLanguageUseCase.kt b/domain/src/main/java/ru/rznnike/eyehealthmanager/domain/interactor/user/SetUserLanguageUseCase.kt deleted file mode 100644 index 3441cbc4..00000000 --- a/domain/src/main/java/ru/rznnike/eyehealthmanager/domain/interactor/user/SetUserLanguageUseCase.kt +++ /dev/null @@ -1,14 +0,0 @@ -package ru.rznnike.eyehealthmanager.domain.interactor.user - -import ru.rznnike.eyehealthmanager.domain.gateway.UserGateway -import ru.rznnike.eyehealthmanager.domain.global.DispatcherProvider -import ru.rznnike.eyehealthmanager.domain.global.interactor.UseCaseWithParams -import ru.rznnike.eyehealthmanager.domain.model.enums.Language - -class SetUserLanguageUseCase( - private val userGateway: UserGateway, - dispatcherProvider: DispatcherProvider -) : UseCaseWithParams(dispatcherProvider.io) { - override suspend fun execute(parameters: Language) = - userGateway.setLanguage(parameters) -} diff --git a/resources/src/main/res/values-ru/strings.xml b/resources/src/main/res/values-ru/strings.xml index fb312202..e0c38baf 100644 --- a/resources/src/main/res/values-ru/strings.xml +++ b/resources/src/main/res/values-ru/strings.xml @@ -197,7 +197,7 @@ Здравствуйте Это приложение - проект с открытым исходным кодом, написанный одним человеком на безвозмездной основе. Обо всех проблемах и пожеланиях вы можете писать на почту, указанную в настройках в разделе \"О программе\". Там же вы найдете ссылку на репозиторий с исходным кодом. Список изменений - 2.2.0\n• Добавлена темная тема. Вы можете выбрать темную/светлую тему на вкладке настроек главного экрана.\n• Исправление ошибок.\n\n2.1.1\n• Исправление ошибок.\n\n2.1.0\n• Оптимизация для Android 14.\n• Редизайн и улучшение UI.\n• Улучшен тест цветовосприятия.\n• Исправление ошибок.\n• Улучшение текстов. + 2.2.1\n• Добавлена возможность смены языка приложения из системных настроек (Android 13+).\n\n2.2.0\n• Добавлена темная тема. Вы можете выбрать темную/светлую тему на вкладке настроек главного экрана.\n• Исправление ошибок.\n\n2.1.1\n• Исправление ошибок.\n\n2.1.0\n• Оптимизация для Android 14.\n• Редизайн и улучшение UI.\n• Улучшен тест цветовосприятия.\n• Исправление ошибок.\n• Улучшение текстов. Файл не найден Системные уведомления без звука diff --git a/resources/src/main/res/values/strings.xml b/resources/src/main/res/values/strings.xml index 5eb8102e..18975cdf 100644 --- a/resources/src/main/res/values/strings.xml +++ b/resources/src/main/res/values/strings.xml @@ -220,7 +220,7 @@ Hello This application is an open source project written by one person for free. You can write about all problems and wishes to the email specified in the settings in the \"About app\" section. There you will also find a link to the source code repository. Changelog - 2.2.0\n• Dark theme added. You can choose dark/light theme from the main screen settings tab.\n• Bug fixes.\n\n2.1.1\n• Bug fixes.\n\n2.1.0\n• Optimization for Android 14.\n• Redesign and UI improvements.\n• Color perception test improved.\n• Bug fixes.\n• Improvement of texts. + 2.2.1\n• Added the ability to change the application language from system settings (Android 13+).\n\n2.2.0\n• Dark theme added. You can choose dark/light theme from the main screen settings tab.\n• Bug fixes.\n\n2.1.1\n• Bug fixes.\n\n2.1.0\n• Optimization for Android 14.\n• Redesign and UI improvements.\n• Color perception test improved.\n• Bug fixes.\n• Improvement of texts. File not found System notifications soundless diff --git a/resources/src/main/res/xml/locales_config.xml b/resources/src/main/res/xml/locales_config.xml new file mode 100644 index 00000000..4b25e183 --- /dev/null +++ b/resources/src/main/res/xml/locales_config.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file