From ce4525fadfd1b82e42d058f461e72972fb64172d Mon Sep 17 00:00:00 2001 From: Mihai-Cristian Condrea Date: Sun, 1 Dec 2024 10:54:51 +0200 Subject: [PATCH] feat(app): Rework app style, Ktor handling, and dynamic lessons (WIP) Reworked the entire app style for a more polished and consistent look. Improved Ktor handling for better network communication and data management. Introduced more dynamic lessons with enhanced content and interactivity. This work is still in progress and further improvements are planned. --- .idea/compiler.xml | 2 +- .idea/deploymentTargetSelector.xml | 8 + .idea/gradle.xml | 1 + .idea/inspectionProfiles/Project_Default.xml | 27 ++ .idea/kotlinc.xml | 2 +- .idea/misc.xml | 3 +- .idea/other.xml | 252 --------------- .idea/runConfigurations.xml | 17 + .idea/studiobot.xml | 6 + CHANGELOG.md | 9 + app/build.gradle.kts | 178 ++++++----- app/proguard-rules.pro | 4 - app/src/main/AndroidManifest.xml | 60 ++-- .../englishwithlidia/plus/MainActivity.kt | 252 --------------- .../englishwithlidia/plus/MainComposable.kt | 165 ---------- .../plus/constants/api/ApiConstants.kt | 5 + .../datastore/DataStoreNamesConstants.kt | 14 + .../plus/constants/error/ErrorType.kt | 5 + .../plus/data/client/KtorClient.kt | 72 +++++ .../plus/data/core/AppCoreManager.kt | 180 ++++------- .../plus/data/core/ads/AdsCoreManager.kt | 121 +++++++ .../core/datastore/DataStoreCoreManager.kt | 25 ++ .../plus/data/datastore/DataStore.kt | 26 +- .../plus/data/model/api/ApiResponse.kt | 25 +- .../model/ui/animations/button/ButtonState.kt | 3 + .../plus/data/model/ui/error/UiErrorModel.kt | 5 + .../data/model/ui/lessons/UiLessonsAsset.kt | 20 -- ...igationItem.kt => NavigationDrawerItem.kt} | 2 +- .../plus/data/model/ui/screens/UiLesson.kt | 13 + .../{lessons => screens}/UiLessonDetails.kt | 6 +- .../data/model/ui/screens/UiLessonsAsset.kt | 17 + .../ui/components/FloatingActionButton.kt | 52 +++ .../components/Preferences.kt} | 129 +++++--- .../plus/ui/components/Snackbar.kt | 34 ++ .../components/ads/BannerAds.kt} | 8 +- .../ui/components/animations/Animations.kt | 129 ++++++++ .../dialogs/LanguageDialogComposable.kt | 2 +- .../dialogs/SelectLanguageAlertDialog.kt | 112 +++++++ .../dialogs/VersionInfoAlertDialog.kt | 66 ++++ .../dialogs/VersionInfoDialogComposable.kt | 4 +- .../components}/drawable/HomeBanner.kt | 2 +- .../components}/drawable/ImageUtils.kt | 2 +- .../components/layouts/LessonContentLayout.kt | 3 + .../ui/components/layouts/LessonListLayout.kt | 182 +++++++++++ .../components/navigation/NavigationDrawer.kt | 139 ++++++++ .../ui/components/navigation/TopAppBar.kt | 117 +++++++ .../plus/ui/help/HelpComposable.kt | 255 --------------- .../plus/ui/help/HelpViewModel.kt | 47 --- .../plus/ui/home/HomeComposable.kt | 222 ------------- .../plus/ui/home/HomeViewModel.kt | 30 -- .../plus/ui/home/HomeViewModelFactory.kt | 16 - .../ui/home/repository/LessonRepository.kt | 44 --- .../plus/ui/lessons/LessonsComposable.kt | 246 --------------- .../ui/{ => screens}/help/HelpActivity.kt | 8 +- .../plus/ui/screens/help/HelpScreen.kt | 296 ++++++++++++++++++ .../plus/ui/screens/help/HelpViewModel.kt | 62 ++++ .../plus/ui/screens/home/HomeScreen.kt | 66 ++++ .../plus/ui/screens/home/HomeViewModel.kt | 47 +++ .../home/repository/LessonRepository.kt | 21 ++ .../LessonRepositoryImplementation.kt | 60 ++++ .../{ => screens}/lessons/LessonsActivity.kt | 6 +- .../ui/screens/lessons/LessonsComposable.kt | 224 +++++++++++++ .../{ => screens}/lessons/LessonsViewModel.kt | 4 +- .../lessons/LessonsViewModelFactory.kt | 4 +- .../plus/ui/screens/main/MainActivity.kt | 147 +++++++++ .../plus/ui/screens/main/MainScreen.kt | 66 ++++ .../plus/ui/screens/main/MainViewModel.kt | 56 ++++ .../screens/main/repository/MainRepository.kt | 76 +++++ .../MainRepositoryImplementation.kt | 92 ++++++ .../settings/SettingsActivity.kt | 8 +- .../ui/screens/settings/SettingsComposable.kt | 106 +++++++ .../settings/about/AboutSettingsActivity.kt | 6 +- .../settings/about/AboutSettingsComposable.kt | 102 ++++++ .../advanced/AdvancedSettingsActivity.kt | 6 +- .../advanced/AdvancedSettingsComposable.kt | 45 +++ .../display/DisplaySettingsActivity.kt | 6 +- .../display/DisplaySettingsComposable.kt | 169 ++++++++++ .../display/theme/ThemeSettingsActivity.kt | 6 +- .../display/theme/ThemeSettingsComposable.kt | 83 +++-- .../settings/display/theme/style/Color.kt | 75 +++++ .../settings/display/theme/style/Theme.kt | 41 +-- .../privacy/PrivacySettingsActivity.kt | 6 +- .../privacy/PrivacySettingsComposable.kt | 107 +++++++ .../privacy/ads/AdsSettingsActivity.kt | 27 +- .../privacy/ads/AdsSettingsComposable.kt | 143 +++++++++ .../PermissionsSettingsActivity.kt | 6 +- .../PermissionsSettingsComposable.kt | 64 ++++ .../usage/UsageAndDiagnosticsActivity.kt | 6 +- .../usage/UsageAndDiagnosticsComposable.kt | 114 +++++++ .../{ => screens}/startup/StartupActivity.kt | 27 +- .../ui/screens/startup/StartupComposable.kt | 139 ++++++++ .../{ => screens}/support/SupportActivity.kt | 18 +- .../support/SupportScreen.kt} | 95 +++--- .../{ => screens}/support/SupportViewModel.kt | 10 +- .../plus/ui/settings/SettingsComposable.kt | 97 ------ .../settings/about/AboutSettingsComposable.kt | 89 ------ .../advanced/AdvancedSettingsComposable.kt | 60 ---- .../display/DisplaySettingsComposable.kt | 159 ---------- .../ui/settings/display/theme/style/Color.kt | 75 ----- .../ui/settings/display/theme/style/Type.kt | 60 ---- .../privacy/PrivacySettingsComposable.kt | 119 ------- .../privacy/ads/AdsSettingsComposable.kt | 137 -------- .../PermissionsSettingsComposable.kt | 85 ----- .../usage/UsageAndDiagnosticsComposable.kt | 117 ------- .../plus/ui/startup/StartupComposable.kt | 138 -------- .../plus/ui/viewmodel/BaseViewModel.kt | 90 ++++++ .../plus/utils/ClipboardUtil.kt | 20 ++ .../plus/utils/IntentUtils.kt | 38 +++ .../plus/utils/OpenSourceLicensesUtils.kt | 103 ++++++ .../plus/utils/compose/AnimationUtils.kt | 47 --- .../plus/utils/error/ErrorHandler.kt | 27 ++ .../plus/utils/helpers/StringsHelper.kt | 8 + .../interfaces/OnShowAdCompleteListener.kt | 6 + .../ic_launcher.xml | 0 .../ic_shortcut_lessons.xml | 0 .../ic_shortcut_settings.xml | 0 .../ic_shortcut_website.xml | 0 app/src/main/res/mipmap-hdpi/ic_launcher.webp | Bin 0 -> 4362 bytes app/src/main/res/mipmap-mdpi/ic_launcher.webp | Bin 0 -> 2758 bytes .../main/res/mipmap-xhdpi/ic_launcher.webp | Bin 0 -> 6096 bytes .../main/res/mipmap-xxhdpi/ic_launcher.webp | Bin 0 -> 9788 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.webp | Bin 0 -> 14124 bytes app/src/main/res/values/strings.xml | 17 +- .../res/values/untranslatable_strings.xml | 9 + build.gradle.kts | 18 +- gradle/libs.versions.toml | 93 +++--- gradle/wrapper/gradle-wrapper.properties | 4 +- 127 files changed, 4318 insertions(+), 3314 deletions(-) delete mode 100644 .idea/other.xml create mode 100644 .idea/runConfigurations.xml create mode 100644 .idea/studiobot.xml delete mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/MainActivity.kt delete mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/MainComposable.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/constants/api/ApiConstants.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/constants/datastore/DataStoreNamesConstants.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/constants/error/ErrorType.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/data/client/KtorClient.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/data/core/ads/AdsCoreManager.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/data/core/datastore/DataStoreCoreManager.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/data/model/ui/animations/button/ButtonState.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/data/model/ui/error/UiErrorModel.kt delete mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/data/model/ui/lessons/UiLessonsAsset.kt rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/data/model/ui/navigation/{NavigationItem.kt => NavigationDrawerItem.kt} (85%) create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/data/model/ui/screens/UiLesson.kt rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/data/model/ui/{lessons => screens}/UiLessonDetails.kt (72%) create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/data/model/ui/screens/UiLessonsAsset.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/components/FloatingActionButton.kt rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/{utils/compose/components/SettingsComposablesUtils.kt => ui/components/Preferences.kt} (74%) create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/components/Snackbar.kt rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/{ads/BannerAdsComposable.kt => ui/components/ads/BannerAds.kt} (86%) create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/components/animations/Animations.kt rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/{ => components}/dialogs/LanguageDialogComposable.kt (98%) create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/components/dialogs/SelectLanguageAlertDialog.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/components/dialogs/VersionInfoAlertDialog.kt rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/{ => components}/dialogs/VersionInfoDialogComposable.kt (94%) rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/{utils => ui/components}/drawable/HomeBanner.kt (99%) rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/{utils => ui/components}/drawable/ImageUtils.kt (93%) create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/components/layouts/LessonContentLayout.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/components/layouts/LessonListLayout.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/components/navigation/NavigationDrawer.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/components/navigation/TopAppBar.kt delete mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/help/HelpComposable.kt delete mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/help/HelpViewModel.kt delete mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/home/HomeComposable.kt delete mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/home/HomeViewModel.kt delete mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/home/HomeViewModelFactory.kt delete mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/home/repository/LessonRepository.kt delete mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/lessons/LessonsComposable.kt rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/{ => screens}/help/HelpActivity.kt (74%) create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/screens/help/HelpScreen.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/screens/help/HelpViewModel.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/screens/home/HomeScreen.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/screens/home/HomeViewModel.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/screens/home/repository/LessonRepository.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/screens/home/repository/LessonRepositoryImplementation.kt rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/{ => screens}/lessons/LessonsActivity.kt (87%) create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/screens/lessons/LessonsComposable.kt rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/{ => screens}/lessons/LessonsViewModel.kt (96%) rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/{ => screens}/lessons/LessonsViewModelFactory.kt (83%) create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/screens/main/MainActivity.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/screens/main/MainScreen.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/screens/main/MainViewModel.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/screens/main/repository/MainRepository.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/screens/main/repository/MainRepositoryImplementation.kt rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/{ => screens}/settings/SettingsActivity.kt (73%) create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/screens/settings/SettingsComposable.kt rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/{ => screens}/settings/about/AboutSettingsActivity.kt (76%) create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/screens/settings/about/AboutSettingsComposable.kt rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/{ => screens}/settings/advanced/AdvancedSettingsActivity.kt (75%) create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/screens/settings/advanced/AdvancedSettingsComposable.kt rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/{ => screens}/settings/display/DisplaySettingsActivity.kt (75%) create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/screens/settings/display/DisplaySettingsComposable.kt rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/{ => screens}/settings/display/theme/ThemeSettingsActivity.kt (75%) rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/{ => screens}/settings/display/theme/ThemeSettingsComposable.kt (53%) create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/screens/settings/display/theme/style/Color.kt rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/{ => screens}/settings/display/theme/style/Theme.kt (80%) rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/{ => screens}/settings/privacy/PrivacySettingsActivity.kt (75%) create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/screens/settings/privacy/PrivacySettingsComposable.kt rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/{ => screens}/settings/privacy/ads/AdsSettingsActivity.kt (67%) create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/screens/settings/privacy/ads/AdsSettingsComposable.kt rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/{ => screens}/settings/privacy/permissions/PermissionsSettingsActivity.kt (74%) create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/screens/settings/privacy/permissions/PermissionsSettingsComposable.kt rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/{ => screens}/settings/privacy/usage/UsageAndDiagnosticsActivity.kt (74%) create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/screens/settings/privacy/usage/UsageAndDiagnosticsComposable.kt rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/{ => screens}/startup/StartupActivity.kt (69%) create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/screens/startup/StartupComposable.kt rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/{ => screens}/support/SupportActivity.kt (62%) rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/{support/SupportComposable.kt => screens/support/SupportScreen.kt} (75%) rename app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/{ => screens}/support/SupportViewModel.kt (81%) delete mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/settings/SettingsComposable.kt delete mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/settings/about/AboutSettingsComposable.kt delete mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/settings/advanced/AdvancedSettingsComposable.kt delete mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/settings/display/DisplaySettingsComposable.kt delete mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/settings/display/theme/style/Color.kt delete mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/settings/display/theme/style/Type.kt delete mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/settings/privacy/PrivacySettingsComposable.kt delete mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/settings/privacy/ads/AdsSettingsComposable.kt delete mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/settings/privacy/permissions/PermissionsSettingsComposable.kt delete mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/settings/privacy/usage/UsageAndDiagnosticsComposable.kt delete mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/startup/StartupComposable.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/ui/viewmodel/BaseViewModel.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/utils/ClipboardUtil.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/utils/OpenSourceLicensesUtils.kt delete mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/utils/compose/AnimationUtils.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/utils/error/ErrorHandler.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/utils/helpers/StringsHelper.kt create mode 100644 app/src/main/kotlin/com/d4rk/englishwithlidia/plus/utils/interfaces/OnShowAdCompleteListener.kt rename app/src/main/res/{mipmap-anydpi => mipmap-anydpi-v26}/ic_launcher.xml (100%) rename app/src/main/res/{mipmap-anydpi => mipmap-anydpi-v26}/ic_shortcut_lessons.xml (100%) rename app/src/main/res/{mipmap-anydpi => mipmap-anydpi-v26}/ic_shortcut_settings.xml (100%) rename app/src/main/res/{mipmap-anydpi => mipmap-anydpi-v26}/ic_shortcut_website.xml (100%) create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp diff --git a/.idea/compiler.xml b/.idea/compiler.xml index b589d56..b86273d 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.idea/deploymentTargetSelector.xml b/.idea/deploymentTargetSelector.xml index b268ef3..34b87bc 100644 --- a/.idea/deploymentTargetSelector.xml +++ b/.idea/deploymentTargetSelector.xml @@ -4,6 +4,14 @@ diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 0897082..7b3006b 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -4,6 +4,7 @@