From 89ad88bc812c52658c4eb021a48a124b2b34bba4 Mon Sep 17 00:00:00 2001 From: Yahya Hassani Date: Fri, 23 Dec 2022 14:22:05 +0100 Subject: [PATCH 01/64] Initial commit --- .github/workflows/deployment.yml | 49 +++++ .github/workflows/output.yml | 8 + .gitignore | 15 ++ .idea/.gitignore | 3 + .idea/codeStyles/Project.xml | 123 ++++++++++++ .idea/codeStyles/codeStyleConfig.xml | 5 + .idea/compiler.xml | 6 + .idea/gradle.xml | 33 ++++ .idea/inspectionProfiles/Project_Default.xml | 37 ++++ .idea/misc.xml | 10 + .idea/vcs.xml | 6 + README.md | 17 +- app/.gitignore | 1 + app/build.gradle.kts | 75 +++++++ app/proguard-rules.pro | 21 ++ .../compose/ExampleInstrumentedTest.kt | 22 +++ app/src/main/AndroidManifest.xml | 34 ++++ .../java/com/example/compose/AppLauncher.kt | 12 ++ .../com/example/compose/nav/AppNavigation.kt | 36 ++++ .../java/com/example/compose/ui/BottomBar.kt | 109 ++++++++++ .../com/example/compose/ui/MainActivity.kt | 47 +++++ .../java/com/example/compose/ui/MainScreen.kt | 57 ++++++ .../com/example/compose/ui/MainViewModel.kt | 174 ++++++++++++++++ .../com/example/compose/ui/NetStatusView.kt | 100 ++++++++++ .../com/example/compose/ui/theme/Color.kt | 69 +++++++ .../com/example/compose/ui/theme/Shape.kt | 11 ++ .../com/example/compose/ui/theme/Theme.kt | 92 +++++++++ .../java/com/example/compose/ui/theme/Type.kt | 94 +++++++++ .../drawable-v24/ic_launcher_foreground.xml | 30 +++ .../res/drawable/ic_launcher_background.xml | 170 ++++++++++++++++ .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 + .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 + app/src/main/res/mipmap-hdpi/ic_launcher.webp | Bin 0 -> 1404 bytes .../res/mipmap-hdpi/ic_launcher_round.webp | Bin 0 -> 2898 bytes app/src/main/res/mipmap-mdpi/ic_launcher.webp | Bin 0 -> 982 bytes .../res/mipmap-mdpi/ic_launcher_round.webp | Bin 0 -> 1772 bytes .../main/res/mipmap-xhdpi/ic_launcher.webp | Bin 0 -> 1900 bytes .../res/mipmap-xhdpi/ic_launcher_round.webp | Bin 0 -> 3918 bytes .../main/res/mipmap-xxhdpi/ic_launcher.webp | Bin 0 -> 2884 bytes .../res/mipmap-xxhdpi/ic_launcher_round.webp | Bin 0 -> 5914 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.webp | Bin 0 -> 3844 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.webp | Bin 0 -> 7778 bytes app/src/main/res/values/colors.xml | 10 + app/src/main/res/values/strings.xml | 9 + app/src/main/res/values/themes.xml | 7 + app/src/main/res/xml/backup_rules.xml | 13 ++ .../main/res/xml/data_extraction_rules.xml | 19 ++ .../com/example/compose/ExampleUnitTest.kt | 16 ++ build.gradle.kts | 8 + buildSrc/.gitignore | 1 + buildSrc/build.gradle.kts | 8 + buildSrc/src/main/kotlin/AppConfig.kt | 15 ++ buildSrc/src/main/kotlin/Dependencies.kt | 187 ++++++++++++++++++ buildSrc/src/main/kotlin/Version.kt | 52 +++++ core/.gitignore | 1 + core/build.gradle.kts | 51 +++++ core/consumer-rules.pro | 0 core/proguard-rules.pro | 21 ++ .../example/core/ExampleInstrumentedTest.kt | 22 +++ core/src/main/AndroidManifest.xml | 5 + .../java/com/example/core/base/Annotation.kt | 16 ++ .../com/example/core/base/BaseViewModel.kt | 26 +++ .../example/core/component/BaseLazyColumn.kt | 33 ++++ .../java/com/example/core/component/Column.kt | 40 ++++ .../com/example/core/component/EmptyView.kt | 67 +++++++ .../com/example/core/component/ErrorView.kt | 140 +++++++++++++ .../com/example/core/component/LoadingView.kt | 33 ++++ .../example/core/component/bar/SearchBar.kt | 161 +++++++++++++++ .../example/core/component/bar/TopAppBar.kt | 140 +++++++++++++ .../com/example/core/component/icon/Icons.kt | 41 ++++ .../main/java/com/example/core/ext/FlowExt.kt | 46 +++++ .../example/core/network/NetworkMonitor.kt | 10 + .../core/network/NetworkMonitorImpl.kt | 74 +++++++ .../core/network/di/NetworkMonitorModule.kt | 20 ++ core/src/main/res/values/strings.xml | 9 + .../java/com/example/core/ExampleUnitTest.kt | 16 ++ data/common/.gitignore | 1 + data/common/build.gradle.kts | 44 +++++ data/common/consumer-rules.pro | 0 data/common/proguard-rules.pro | 21 ++ .../example/common/ExampleInstrumentedTest.kt | 22 +++ data/common/src/main/AndroidManifest.xml | 4 + .../com/example/common/api/CoinCapRetrofit.kt | 17 ++ .../com/example/common/api/RetrofitBuilder.kt | 15 ++ .../example/common/api/di/NetworkModule.kt | 52 +++++ .../example/common/database/AppDatabase.kt | 10 + .../common/database/ExchangeRateDao.kt | 24 +++ .../common/database/ExchangeRateEntity.kt | 10 + .../common/database/di/DatabaseModule.kt | 32 +++ .../common/model/ExchangeDetailRate.kt | 20 ++ .../com/example/common/model/ExchangeRate.kt | 22 +++ .../com/example/common/ExampleUnitTest.kt | 16 ++ data/datastore/.gitignore | 1 + data/datastore/build.gradle.kts | 41 ++++ data/datastore/consumer-rules.pro | 0 data/datastore/proguard-rules.pro | 21 ++ .../datastore/ExampleInstrumentedTest.kt | 24 +++ data/datastore/src/main/AndroidManifest.xml | 4 + .../example/datastore/DatastoreInteractor.kt | 22 +++ .../example/datastore/DatastoreRepository.kt | 24 +++ .../com/example/datastore/PreferencesKeys.kt | 10 + .../example/datastore/di/DataStoreModule.kt | 51 +++++ .../com/example/datastore/ExampleUnitTest.kt | 17 ++ data/exchangerate/.gitignore | 1 + data/exchangerate/build.gradle.kts | 44 +++++ data/exchangerate/consumer-rules.pro | 0 data/exchangerate/proguard-rules.pro | 21 ++ .../example/rate/ExampleInstrumentedTest.kt | 22 +++ .../exchangerate/src/main/AndroidManifest.xml | 4 + .../com/example/rate/api/ExchangeRateApi.kt | 20 ++ .../com/example/rate/di/ExchangeRateModule.kt | 37 ++++ .../rate/interactor/ExchangeRateInteractor.kt | 16 ++ .../interactor/ExchangeRateInteractorImpl.kt | 33 ++++ .../example/rate/model/ExchangeRateModel.kt | 47 +++++ .../rate/repository/ExchangeRateRepository.kt | 15 ++ .../repository/ExchangeRateRepositoryImpl.kt | 21 ++ .../java/com/example/rate/ExampleUnitTest.kt | 16 ++ data/favorite/.gitignore | 1 + data/favorite/build.gradle.kts | 43 ++++ data/favorite/consumer-rules.pro | 0 data/favorite/proguard-rules.pro | 21 ++ .../favorite/ExampleInstrumentedTest.kt | 24 +++ data/favorite/src/main/AndroidManifest.xml | 4 + .../favorite/FavoriteRatesInteractor.kt | 53 +++++ .../example/favorite/FavoriteRepository.kt | 29 +++ .../com/example/favorite/di/FavoriteModule.kt | 21 ++ .../com/example/favorite/ExampleUnitTest.kt | 17 ++ gradle.properties | 23 +++ gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 59203 bytes gradle/wrapper/gradle-wrapper.properties | 6 + gradlew | 185 +++++++++++++++++ gradlew.bat | 89 +++++++++ settings.gradle.kts | 27 +++ ui/common/.gitignore | 1 + ui/common/build.gradle.kts | 45 +++++ ui/common/consumer-rules.pro | 0 ui/common/proguard-rules.pro | 21 ++ .../example/common/ExampleInstrumentedTest.kt | 24 +++ ui/common/src/main/AndroidManifest.xml | 4 + .../main/java/com/example/common/RateCell.kt | 130 ++++++++++++ .../java/com/example/common/SharedState.kt | 8 + .../main/java/com/example/common/ThemeType.kt | 12 ++ .../com/example/common/ExampleUnitTest.kt | 17 ++ ui/detail/.gitignore | 1 + ui/detail/build.gradle.kts | 56 ++++++ ui/detail/consumer-rules.pro | 0 ui/detail/proguard-rules.pro | 21 ++ .../example/detail/ExampleInstrumentedTest.kt | 22 +++ ui/detail/src/main/AndroidManifest.xml | 4 + .../java/com/example/detail/DetailScreen.kt | 147 ++++++++++++++ .../com/example/detail/DetailViewModel.kt | 125 ++++++++++++ .../java/com/example/detail/nav/DetailNav.kt | 29 +++ ui/detail/src/main/res/values/strings.xml | 5 + .../com/example/detail/ExampleUnitTest.kt | 16 ++ ui/favorite/.gitignore | 1 + ui/favorite/build.gradle.kts | 53 +++++ ui/favorite/consumer-rules.pro | 0 ui/favorite/proguard-rules.pro | 21 ++ .../favorite/ExampleInstrumentedTest.kt | 24 +++ ui/favorite/src/main/AndroidManifest.xml | 4 + .../com/example/favorite/FavoriteScreen.kt | 101 ++++++++++ .../com/example/favorite/FavoriteViewModel.kt | 101 ++++++++++ .../com/example/favorite/nav/FavoriteNav.kt | 20 ++ ui/favorite/src/main/res/values/strings.xml | 6 + .../com/example/favorite/ExampleUnitTest.kt | 17 ++ ui/home/.gitignore | 1 + ui/home/build.gradle.kts | 60 ++++++ ui/home/consumer-rules.pro | 0 ui/home/proguard-rules.pro | 21 ++ .../example/home/ExampleInstrumentedTest.kt | 22 +++ ui/home/src/main/AndroidManifest.xml | 4 + .../main/java/com/example/home/HomeScreen.kt | 167 ++++++++++++++++ .../java/com/example/home/HomeViewModel.kt | 107 ++++++++++ .../com/example/home/nav/HomeNavigation.kt | 26 +++ .../java/com/example/home/util/Constant.kt | 5 + ui/home/src/main/res/values/strings.xml | 5 + .../java/com/example/home/ExampleUnitTest.kt | 16 ++ ui/search/.gitignore | 1 + ui/search/build.gradle.kts | 57 ++++++ ui/search/consumer-rules.pro | 0 ui/search/proguard-rules.pro | 21 ++ .../example/search/ExampleInstrumentedTest.kt | 22 +++ ui/search/src/main/AndroidManifest.xml | 4 + .../java/com/example/search/SearchScreen.kt | 122 ++++++++++++ .../com/example/search/SearchViewModel.kt | 172 ++++++++++++++++ .../java/com/example/search/nav/SearchNav.kt | 26 +++ ui/search/src/main/res/values/strings.xml | 4 + .../com/example/search/ExampleUnitTest.kt | 16 ++ ui/setting/.gitignore | 1 + ui/setting/build.gradle.kts | 58 ++++++ ui/setting/consumer-rules.pro | 0 ui/setting/proguard-rules.pro | 21 ++ .../setting/ExampleInstrumentedTest.kt | 24 +++ ui/setting/src/main/AndroidManifest.xml | 4 + .../java/com/example/setting/SettingScreen.kt | 104 ++++++++++ .../com/example/setting/SettingViewModel.kt | 52 +++++ .../com/example/setting/nav/SettingNav.kt | 20 ++ ui/setting/src/main/res/values/strings.xml | 5 + .../com/example/setting/ExampleUnitTest.kt | 17 ++ 199 files changed, 6378 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deployment.yml create mode 100644 .github/workflows/output.yml create mode 100644 .gitignore create mode 100644 .idea/.gitignore create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 .idea/compiler.xml create mode 100644 .idea/gradle.xml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/vcs.xml create mode 100644 app/.gitignore create mode 100644 app/build.gradle.kts create mode 100644 app/proguard-rules.pro create mode 100644 app/src/androidTest/java/com/example/compose/ExampleInstrumentedTest.kt create mode 100644 app/src/main/AndroidManifest.xml create mode 100644 app/src/main/java/com/example/compose/AppLauncher.kt create mode 100644 app/src/main/java/com/example/compose/nav/AppNavigation.kt create mode 100644 app/src/main/java/com/example/compose/ui/BottomBar.kt create mode 100644 app/src/main/java/com/example/compose/ui/MainActivity.kt create mode 100644 app/src/main/java/com/example/compose/ui/MainScreen.kt create mode 100644 app/src/main/java/com/example/compose/ui/MainViewModel.kt create mode 100644 app/src/main/java/com/example/compose/ui/NetStatusView.kt create mode 100644 app/src/main/java/com/example/compose/ui/theme/Color.kt create mode 100644 app/src/main/java/com/example/compose/ui/theme/Shape.kt create mode 100644 app/src/main/java/com/example/compose/ui/theme/Theme.kt create mode 100644 app/src/main/java/com/example/compose/ui/theme/Type.kt create mode 100644 app/src/main/res/drawable-v24/ic_launcher_foreground.xml create mode 100644 app/src/main/res/drawable/ic_launcher_background.xml create mode 100644 app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher_round.webp create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher_round.webp create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp create mode 100644 app/src/main/res/values/colors.xml create mode 100644 app/src/main/res/values/strings.xml create mode 100644 app/src/main/res/values/themes.xml create mode 100644 app/src/main/res/xml/backup_rules.xml create mode 100644 app/src/main/res/xml/data_extraction_rules.xml create mode 100644 app/src/test/java/com/example/compose/ExampleUnitTest.kt create mode 100644 build.gradle.kts create mode 100644 buildSrc/.gitignore create mode 100644 buildSrc/build.gradle.kts create mode 100644 buildSrc/src/main/kotlin/AppConfig.kt create mode 100644 buildSrc/src/main/kotlin/Dependencies.kt create mode 100644 buildSrc/src/main/kotlin/Version.kt create mode 100644 core/.gitignore create mode 100644 core/build.gradle.kts create mode 100644 core/consumer-rules.pro create mode 100644 core/proguard-rules.pro create mode 100644 core/src/androidTest/java/com/example/core/ExampleInstrumentedTest.kt create mode 100644 core/src/main/AndroidManifest.xml create mode 100644 core/src/main/java/com/example/core/base/Annotation.kt create mode 100644 core/src/main/java/com/example/core/base/BaseViewModel.kt create mode 100644 core/src/main/java/com/example/core/component/BaseLazyColumn.kt create mode 100644 core/src/main/java/com/example/core/component/Column.kt create mode 100644 core/src/main/java/com/example/core/component/EmptyView.kt create mode 100644 core/src/main/java/com/example/core/component/ErrorView.kt create mode 100644 core/src/main/java/com/example/core/component/LoadingView.kt create mode 100644 core/src/main/java/com/example/core/component/bar/SearchBar.kt create mode 100644 core/src/main/java/com/example/core/component/bar/TopAppBar.kt create mode 100644 core/src/main/java/com/example/core/component/icon/Icons.kt create mode 100644 core/src/main/java/com/example/core/ext/FlowExt.kt create mode 100644 core/src/main/java/com/example/core/network/NetworkMonitor.kt create mode 100644 core/src/main/java/com/example/core/network/NetworkMonitorImpl.kt create mode 100644 core/src/main/java/com/example/core/network/di/NetworkMonitorModule.kt create mode 100644 core/src/main/res/values/strings.xml create mode 100644 core/src/test/java/com/example/core/ExampleUnitTest.kt create mode 100644 data/common/.gitignore create mode 100644 data/common/build.gradle.kts create mode 100644 data/common/consumer-rules.pro create mode 100644 data/common/proguard-rules.pro create mode 100644 data/common/src/androidTest/java/com/example/common/ExampleInstrumentedTest.kt create mode 100644 data/common/src/main/AndroidManifest.xml create mode 100644 data/common/src/main/java/com/example/common/api/CoinCapRetrofit.kt create mode 100644 data/common/src/main/java/com/example/common/api/RetrofitBuilder.kt create mode 100644 data/common/src/main/java/com/example/common/api/di/NetworkModule.kt create mode 100644 data/common/src/main/java/com/example/common/database/AppDatabase.kt create mode 100644 data/common/src/main/java/com/example/common/database/ExchangeRateDao.kt create mode 100644 data/common/src/main/java/com/example/common/database/ExchangeRateEntity.kt create mode 100644 data/common/src/main/java/com/example/common/database/di/DatabaseModule.kt create mode 100644 data/common/src/main/java/com/example/common/model/ExchangeDetailRate.kt create mode 100644 data/common/src/main/java/com/example/common/model/ExchangeRate.kt create mode 100644 data/common/src/test/java/com/example/common/ExampleUnitTest.kt create mode 100644 data/datastore/.gitignore create mode 100644 data/datastore/build.gradle.kts create mode 100644 data/datastore/consumer-rules.pro create mode 100644 data/datastore/proguard-rules.pro create mode 100644 data/datastore/src/androidTest/java/com/example/datastore/ExampleInstrumentedTest.kt create mode 100644 data/datastore/src/main/AndroidManifest.xml create mode 100644 data/datastore/src/main/java/com/example/datastore/DatastoreInteractor.kt create mode 100644 data/datastore/src/main/java/com/example/datastore/DatastoreRepository.kt create mode 100644 data/datastore/src/main/java/com/example/datastore/PreferencesKeys.kt create mode 100644 data/datastore/src/main/java/com/example/datastore/di/DataStoreModule.kt create mode 100644 data/datastore/src/test/java/com/example/datastore/ExampleUnitTest.kt create mode 100644 data/exchangerate/.gitignore create mode 100644 data/exchangerate/build.gradle.kts create mode 100644 data/exchangerate/consumer-rules.pro create mode 100644 data/exchangerate/proguard-rules.pro create mode 100644 data/exchangerate/src/androidTest/java/com/example/rate/ExampleInstrumentedTest.kt create mode 100644 data/exchangerate/src/main/AndroidManifest.xml create mode 100644 data/exchangerate/src/main/java/com/example/rate/api/ExchangeRateApi.kt create mode 100644 data/exchangerate/src/main/java/com/example/rate/di/ExchangeRateModule.kt create mode 100644 data/exchangerate/src/main/java/com/example/rate/interactor/ExchangeRateInteractor.kt create mode 100644 data/exchangerate/src/main/java/com/example/rate/interactor/ExchangeRateInteractorImpl.kt create mode 100644 data/exchangerate/src/main/java/com/example/rate/model/ExchangeRateModel.kt create mode 100644 data/exchangerate/src/main/java/com/example/rate/repository/ExchangeRateRepository.kt create mode 100644 data/exchangerate/src/main/java/com/example/rate/repository/ExchangeRateRepositoryImpl.kt create mode 100644 data/exchangerate/src/test/java/com/example/rate/ExampleUnitTest.kt create mode 100644 data/favorite/.gitignore create mode 100644 data/favorite/build.gradle.kts create mode 100644 data/favorite/consumer-rules.pro create mode 100644 data/favorite/proguard-rules.pro create mode 100644 data/favorite/src/androidTest/java/com/example/favorite/ExampleInstrumentedTest.kt create mode 100644 data/favorite/src/main/AndroidManifest.xml create mode 100644 data/favorite/src/main/java/com/example/favorite/FavoriteRatesInteractor.kt create mode 100644 data/favorite/src/main/java/com/example/favorite/FavoriteRepository.kt create mode 100644 data/favorite/src/main/java/com/example/favorite/di/FavoriteModule.kt create mode 100644 data/favorite/src/test/java/com/example/favorite/ExampleUnitTest.kt create mode 100644 gradle.properties create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100755 gradlew create mode 100644 gradlew.bat create mode 100644 settings.gradle.kts create mode 100644 ui/common/.gitignore create mode 100644 ui/common/build.gradle.kts create mode 100644 ui/common/consumer-rules.pro create mode 100644 ui/common/proguard-rules.pro create mode 100644 ui/common/src/androidTest/java/com/example/common/ExampleInstrumentedTest.kt create mode 100644 ui/common/src/main/AndroidManifest.xml create mode 100644 ui/common/src/main/java/com/example/common/RateCell.kt create mode 100644 ui/common/src/main/java/com/example/common/SharedState.kt create mode 100644 ui/common/src/main/java/com/example/common/ThemeType.kt create mode 100644 ui/common/src/test/java/com/example/common/ExampleUnitTest.kt create mode 100644 ui/detail/.gitignore create mode 100644 ui/detail/build.gradle.kts create mode 100644 ui/detail/consumer-rules.pro create mode 100644 ui/detail/proguard-rules.pro create mode 100644 ui/detail/src/androidTest/java/com/example/detail/ExampleInstrumentedTest.kt create mode 100644 ui/detail/src/main/AndroidManifest.xml create mode 100644 ui/detail/src/main/java/com/example/detail/DetailScreen.kt create mode 100644 ui/detail/src/main/java/com/example/detail/DetailViewModel.kt create mode 100644 ui/detail/src/main/java/com/example/detail/nav/DetailNav.kt create mode 100644 ui/detail/src/main/res/values/strings.xml create mode 100644 ui/detail/src/test/java/com/example/detail/ExampleUnitTest.kt create mode 100644 ui/favorite/.gitignore create mode 100644 ui/favorite/build.gradle.kts create mode 100644 ui/favorite/consumer-rules.pro create mode 100644 ui/favorite/proguard-rules.pro create mode 100644 ui/favorite/src/androidTest/java/com/example/favorite/ExampleInstrumentedTest.kt create mode 100644 ui/favorite/src/main/AndroidManifest.xml create mode 100644 ui/favorite/src/main/java/com/example/favorite/FavoriteScreen.kt create mode 100644 ui/favorite/src/main/java/com/example/favorite/FavoriteViewModel.kt create mode 100644 ui/favorite/src/main/java/com/example/favorite/nav/FavoriteNav.kt create mode 100644 ui/favorite/src/main/res/values/strings.xml create mode 100644 ui/favorite/src/test/java/com/example/favorite/ExampleUnitTest.kt create mode 100644 ui/home/.gitignore create mode 100644 ui/home/build.gradle.kts create mode 100644 ui/home/consumer-rules.pro create mode 100644 ui/home/proguard-rules.pro create mode 100644 ui/home/src/androidTest/java/com/example/home/ExampleInstrumentedTest.kt create mode 100644 ui/home/src/main/AndroidManifest.xml create mode 100644 ui/home/src/main/java/com/example/home/HomeScreen.kt create mode 100644 ui/home/src/main/java/com/example/home/HomeViewModel.kt create mode 100644 ui/home/src/main/java/com/example/home/nav/HomeNavigation.kt create mode 100644 ui/home/src/main/java/com/example/home/util/Constant.kt create mode 100644 ui/home/src/main/res/values/strings.xml create mode 100644 ui/home/src/test/java/com/example/home/ExampleUnitTest.kt create mode 100644 ui/search/.gitignore create mode 100644 ui/search/build.gradle.kts create mode 100644 ui/search/consumer-rules.pro create mode 100644 ui/search/proguard-rules.pro create mode 100644 ui/search/src/androidTest/java/com/example/search/ExampleInstrumentedTest.kt create mode 100644 ui/search/src/main/AndroidManifest.xml create mode 100644 ui/search/src/main/java/com/example/search/SearchScreen.kt create mode 100644 ui/search/src/main/java/com/example/search/SearchViewModel.kt create mode 100644 ui/search/src/main/java/com/example/search/nav/SearchNav.kt create mode 100644 ui/search/src/main/res/values/strings.xml create mode 100644 ui/search/src/test/java/com/example/search/ExampleUnitTest.kt create mode 100644 ui/setting/.gitignore create mode 100644 ui/setting/build.gradle.kts create mode 100644 ui/setting/consumer-rules.pro create mode 100644 ui/setting/proguard-rules.pro create mode 100644 ui/setting/src/androidTest/java/com/example/setting/ExampleInstrumentedTest.kt create mode 100644 ui/setting/src/main/AndroidManifest.xml create mode 100644 ui/setting/src/main/java/com/example/setting/SettingScreen.kt create mode 100644 ui/setting/src/main/java/com/example/setting/SettingViewModel.kt create mode 100644 ui/setting/src/main/java/com/example/setting/nav/SettingNav.kt create mode 100644 ui/setting/src/main/res/values/strings.xml create mode 100644 ui/setting/src/test/java/com/example/setting/ExampleUnitTest.kt diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml new file mode 100644 index 0000000..6b29156 --- /dev/null +++ b/.github/workflows/deployment.yml @@ -0,0 +1,49 @@ +name: Test Workflow +on: + push: + branches: + - master + - dev + + workflow_dispatch: + pull_request: + types: [opened, closed] + +jobs: + Detekt: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v3 + - name: Run Detekt + uses: natiginfo/action-detekt-all@1.22.0 + + Lint: + needs: Detekt + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v3 + - name: Run Lint + run: ./gradlew lint + + Test: + needs: Lint + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v3 + - name: Run tests + run: ./gradlew test + + Build: + needs: Test # it will be run after test job, we can use a list of jobs here. + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v3 + - name: Build App + uses: sparkfabrik/android-build-action@v1.0.0 + with: + project-path: ./ + output-path: my-app.apk \ No newline at end of file diff --git a/.github/workflows/output.yml b/.github/workflows/output.yml new file mode 100644 index 0000000..e793b8d --- /dev/null +++ b/.github/workflows/output.yml @@ -0,0 +1,8 @@ +name: Output Information +on: workflow_dispatch +jobs: + Info: + runs-on: ubuntu-latest + steps: + - name: Output github context + run: echo "${{ toJSON(github) }}" \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..7643783 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,123 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..fb7f4a8 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..f3a4007 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,33 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..ed76bea --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,37 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..bdd9278 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index a850934..3c47266 100644 --- a/README.md +++ b/README.md @@ -1 +1,16 @@ -# ComposeApp \ No newline at end of file +# Compose App + +This is a sample modularized android application with clean architecture and compose + +## Technologies + +- Kotlin +- MVVM +- Compose +- Coroutines +- Clean architecture +- Compose navigation +- Reactive programing + +## To Do +- Writing unit tests \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 0000000..c715f99 --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,75 @@ +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") + kotlin("kapt") + id("com.google.dagger.hilt.android") + +} + +android { + namespace = "com.example.compose" + compileSdk = AppConfig.compileSdk + + defaultConfig { + applicationId = "com.example.compose" + minSdk = AppConfig.minSdk + targetSdk = AppConfig.targetSdk + versionCode = AppConfig.versionCode + versionName = AppConfig.versionName + + testInstrumentationRunner = AppConfig.androidTestInstrumentation + vectorDrawables { + useSupportLibrary = true + } + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } + buildFeatures { + compose = true + } + composeOptions { + kotlinCompilerExtensionVersion = Version.KOTLIN_COMPILER_EXTENSION_VERSION + } + packagingOptions { + resources { + excludes += "/META-INF/{AL2.0,LGPL2.1}" + } + } +} + +dependencies { + androidxCore() + lifecycle() + compose() + composeMaterial() + composeNavigation() + hilt() + junit() + espresso() + composeTest() + retrofit() + + moduleDependency(":data:datastore") + implementation(project(":core")) + implementation(project(":ui:home")) + implementation(project(":ui:detail")) + implementation(project(":ui:search")) + implementation(project(":ui:common")) + implementation(project(":ui:setting")) + implementation(project(":ui:favorite")) +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..ff59496 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle.kts. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/app/src/androidTest/java/com/example/compose/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/example/compose/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..18ada15 --- /dev/null +++ b/app/src/androidTest/java/com/example/compose/ExampleInstrumentedTest.kt @@ -0,0 +1,22 @@ +package com.example.compose + +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.platform.app.InstrumentationRegistry +import org.junit.Assert.* +import org.junit.Test +import org.junit.runner.RunWith + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.examole.compose", appContext.packageName) + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..6ca3233 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/example/compose/AppLauncher.kt b/app/src/main/java/com/example/compose/AppLauncher.kt new file mode 100644 index 0000000..55b966d --- /dev/null +++ b/app/src/main/java/com/example/compose/AppLauncher.kt @@ -0,0 +1,12 @@ +package com.example.compose + +import android.app.Application +import dagger.hilt.android.HiltAndroidApp + +/** + * @author yaya (@yahyalmh) + * @since 28th October 2022 + */ + +@HiltAndroidApp +class AppLauncher : Application() \ No newline at end of file diff --git a/app/src/main/java/com/example/compose/nav/AppNavigation.kt b/app/src/main/java/com/example/compose/nav/AppNavigation.kt new file mode 100644 index 0000000..6927223 --- /dev/null +++ b/app/src/main/java/com/example/compose/nav/AppNavigation.kt @@ -0,0 +1,36 @@ +package com.example.compose.nav + +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.navigation.NavHostController +import androidx.navigation.compose.NavHost +import com.example.favorite.nav.favoriteGraph +import com.example.setting.nav.settingGraph +import com.example.detail.nav.detailGraph +import com.example.home.nav.homeGraph +import com.example.home.nav.homeRoute +import com.example.search.nav.searchGraph + +/** + * @author yaya (@yahyalmh) + * @since 29th October 2022 + */ +@Composable +fun AppNavigation( + navController: NavHostController, + modifier: Modifier = Modifier, + startDestination: String = homeRoute +) { + + NavHost( + navController = navController, + startDestination = startDestination, + modifier = modifier, + ) { + homeGraph(navController) + detailGraph(navController) + searchGraph(navController) + settingGraph(navController) + favoriteGraph(navController) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/compose/ui/BottomBar.kt b/app/src/main/java/com/example/compose/ui/BottomBar.kt new file mode 100644 index 0000000..849586b --- /dev/null +++ b/app/src/main/java/com/example/compose/ui/BottomBar.kt @@ -0,0 +1,109 @@ +package com.example.compose.ui + +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.Favorite +import androidx.compose.material.icons.filled.FavoriteBorder +import androidx.compose.material.icons.filled.Home +import androidx.compose.material.icons.filled.Settings +import androidx.compose.material3.* +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp +import androidx.navigation.NavDestination +import androidx.navigation.NavDestination.Companion.hierarchy +import com.example.compose.R +import com.example.compose.ui.NiaNavigationDefaults.navigationContentColor +import com.example.compose.ui.NiaNavigationDefaults.navigationSelectedItemColor +import com.example.core.component.icon.Icon + +@Composable +fun AppBottomBar( + destinations: List, + onNavigateToDestination: (BottomBarTab) -> Unit, + currentDestination: NavDestination?, + modifier: Modifier = Modifier +) { + NavigationBar( + modifier = modifier, + contentColor = navigationContentColor(), + tonalElevation = 0.dp + ) { + destinations.forEach { destination -> + val selected = currentDestination.isInHierarchy(destination) + NavigationBarItem( + enabled = true, + selected = selected, + onClick = { onNavigateToDestination(destination) }, + icon = { + val icon = if (selected) { + destination.selectedIcon + } else { + destination.unselectedIcon + } + when (icon) { + is Icon.ImageVectorIcon -> Icon( + imageVector = icon.imageVector, + contentDescription = null + ) + is Icon.DrawableResourceIcon -> Icon( + painter = painterResource(id = icon.id), + contentDescription = null + ) + } + }, + colors = NavigationBarItemDefaults.colors( + selectedIconColor = navigationSelectedItemColor(), + unselectedIconColor = navigationContentColor(), + selectedTextColor = navigationSelectedItemColor(), + unselectedTextColor = navigationContentColor(), + indicatorColor = NiaNavigationDefaults.navigationIndicatorColor() + ), + label = { Text(stringResource(destination.iconTextId)) } + ) + } + } +} + +private fun NavDestination?.isInHierarchy(destination: BottomBarTab) = + this?.hierarchy?.any { + it.route?.contains(destination.name, true) ?: false + } ?: false + +object NiaNavigationDefaults { + @Composable + fun navigationContentColor() = MaterialTheme.colorScheme.onSurfaceVariant + + @Composable + fun navigationSelectedItemColor() = MaterialTheme.colorScheme.onPrimaryContainer + + @Composable + fun navigationIndicatorColor() = MaterialTheme.colorScheme.primaryContainer +} + +enum class BottomBarTab( + val selectedIcon: Icon, + val unselectedIcon: Icon, + val iconTextId: Int, + val titleTextId: Int +) { + Home( + selectedIcon = Icon.ImageVectorIcon(Icons.Default.Home), + unselectedIcon = Icon.ImageVectorIcon(Icons.Default.Home), + iconTextId = R.string.home, + titleTextId = R.string.app_name + ), + FAVORITE( + selectedIcon = Icon.ImageVectorIcon(Icons.Default.Favorite), + unselectedIcon = Icon.ImageVectorIcon(Icons.Default.FavoriteBorder), + iconTextId = R.string.favorite, + titleTextId = R.string.favorite + ), + SETTING( + selectedIcon = Icon.ImageVectorIcon(Icons.Default.Settings), + unselectedIcon = Icon.ImageVectorIcon(Icons.Default.Settings), + iconTextId = R.string.setting, + titleTextId = R.string.setting + ) +} \ No newline at end of file diff --git a/app/src/main/java/com/example/compose/ui/MainActivity.kt b/app/src/main/java/com/example/compose/ui/MainActivity.kt new file mode 100644 index 0000000..1226667 --- /dev/null +++ b/app/src/main/java/com/example/compose/ui/MainActivity.kt @@ -0,0 +1,47 @@ +package com.example.compose.ui + +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import androidx.activity.viewModels +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.material.MaterialTheme +import androidx.compose.material.Surface +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.navigation.compose.rememberNavController +import com.example.common.ThemeType +import com.example.compose.ui.theme.AppTheme +import dagger.hilt.android.AndroidEntryPoint + +@AndroidEntryPoint +class MainActivity : ComponentActivity() { + + private val viewModel: MainViewModel by viewModels() + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContent { + val navController = rememberNavController() + val darkTheme = shouldUseDarkTheme(viewModel.state.value) + AppTheme(useDarkTheme = darkTheme) { + Surface( + modifier = Modifier.fillMaxSize(), + color = MaterialTheme.colors.background + ) { + MainScreen(navController) + } + } + } + } + + @Composable + private fun shouldUseDarkTheme(uiState: MainUiState): Boolean = + when (uiState.themeType) { + ThemeType.SYSTEM -> isSystemInDarkTheme() + ThemeType.LIGHT -> false + ThemeType.DARK -> true + else -> isSystemInDarkTheme() + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/compose/ui/MainScreen.kt b/app/src/main/java/com/example/compose/ui/MainScreen.kt new file mode 100644 index 0000000..972892b --- /dev/null +++ b/app/src/main/java/com/example/compose/ui/MainScreen.kt @@ -0,0 +1,57 @@ +package com.example.compose.ui + +import androidx.compose.animation.* +import androidx.compose.foundation.layout.* +import androidx.compose.material.* +import androidx.compose.runtime.* +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.testTag +import androidx.hilt.navigation.compose.hiltViewModel +import androidx.navigation.NavHostController +import androidx.navigation.compose.currentBackStackEntryAsState +import com.example.compose.nav.AppNavigation + +/** + * @author yaya (@yahyalmh) + * @since 29th October 2022 + */ +@Composable +fun MainScreen(navController: NavHostController, viewModel: MainViewModel = hiltViewModel()) { + val uiState = viewModel.state.value + + Column { + NetStatusView(uiState.showOnlineView, uiState.showOfflineView) + Scaffold( + contentColor = MaterialTheme.colors.onBackground, + bottomBar = { + AnimatedVisibility(visible = uiState.isBottomBarVisible) { + AppBottomBar( + destinations = viewModel.bottomBarTabs, + onNavigateToDestination = { tab -> + viewModel.onEvent(MainUiEvent.ChangeTab(navController, tab)) + }, + currentDestination = navController.currentBackStackEntryAsState().value?.destination, + modifier = Modifier.testTag("AppBottomBar") + ) + } + } + ) { padding -> + SetupAppNavigation(navController, padding) + } + } +} + +@Composable +@OptIn(ExperimentalLayoutApi::class) +private fun SetupAppNavigation( + navHostController: NavHostController, + padding: PaddingValues = PaddingValues.Absolute() +) { + AppNavigation( + navController = navHostController, + modifier = Modifier + .padding(padding) + .consumedWindowInsets(padding) + ) +} + diff --git a/app/src/main/java/com/example/compose/ui/MainViewModel.kt b/app/src/main/java/com/example/compose/ui/MainViewModel.kt new file mode 100644 index 0000000..9d8ff64 --- /dev/null +++ b/app/src/main/java/com/example/compose/ui/MainViewModel.kt @@ -0,0 +1,174 @@ +package com.example.compose.ui + +import androidx.lifecycle.viewModelScope +import androidx.navigation.NavController +import androidx.navigation.NavGraph.Companion.findStartDestination +import androidx.navigation.navOptions +import com.example.common.SharedState +import com.example.common.ThemeType +import com.example.common.toThemeType +import com.example.datastore.DatastoreInteractor +import com.example.favorite.nav.navigateToFavorite +import com.example.setting.nav.navigateToSetting +import com.example.core.base.BaseViewModel +import com.example.core.base.UIEvent +import com.example.core.base.UIState +import com.example.core.network.NetworkMonitor +import com.example.home.nav.navigateToHome +import dagger.hilt.android.lifecycle.HiltViewModel +import kotlinx.coroutines.delay +import kotlinx.coroutines.flow.distinctUntilChanged +import kotlinx.coroutines.flow.launchIn +import kotlinx.coroutines.flow.onEach +import kotlinx.coroutines.launch +import javax.inject.Inject + +@HiltViewModel +class MainViewModel @Inject constructor( + private val networkMonitor: NetworkMonitor, + private val datastoreInteractor: DatastoreInteractor, +) : BaseViewModel(MainUiState.None) { + private var isAppLaunchedForFirstTime: Boolean = true + val bottomBarTabs: List = BottomBarTab.values().asList() + + init { + observeBottomBarState() + observeNetworkState() + observeThemeChange() + } + + private fun observeBottomBarState() { + SharedState.bottomBarVisible.onEach { + setState( + MainUiState.BottomVisibleChange( + state.value.showOnlineView, + state.value.showOfflineView, + isBottomBarVisible = it, + themeType = state.value.themeType ?: ThemeType.SYSTEM + ) + ) + }.launchIn(viewModelScope) + } + + private fun observeNetworkState() { + networkMonitor.isOnline + .distinctUntilChanged() + .onEach { isOnline -> + if (isOnline) { + handelOnlineState() + } else { + setState(MainUiState.Offline) + } + }.launchIn(viewModelScope) + } + + private fun observeThemeChange() { + datastoreInteractor + .getThemeType() + .onEach { + val themeType = it?.toThemeType() ?: ThemeType.SYSTEM + setState( + MainUiState.ChangeTheme( + state.value.showOnlineView, + state.value.showOfflineView, + themeType + ) + ) + } + .launchIn(viewModelScope) + + } + + private fun handelOnlineState() { + if (isAppLaunchedForFirstTime) { + isAppLaunchedForFirstTime = false + return + } + setState(MainUiState.Online) + hideOnlineViewAfterWhile() + } + + private fun hideOnlineViewAfterWhile() { + val hideOnlineViewDelay: Long = 2000 + viewModelScope.launch { + delay(hideOnlineViewDelay) + setState(MainUiState.None) + } + } + + override fun onEvent(event: MainUiEvent) { + when (event) { + is MainUiEvent.ChangeTab -> changeBottomBarDestination( + event.navController, + destination = event.destination + ) + } + } + + private fun changeBottomBarDestination( + navController: NavController, + destination: BottomBarTab + ) { + val id = navController.graph.findStartDestination().id + val navOptions = navOptions { + popUpTo(id) { +// saveState = true + } + launchSingleTop = true +// restoreState = true + } + + when (destination) { + BottomBarTab.Home -> navController.navigateToHome(navOptions) + BottomBarTab.FAVORITE -> navController.navigateToFavorite(navOptions) + BottomBarTab.SETTING -> navController.navigateToSetting(navOptions) + } + } +} + +sealed interface MainUiEvent : UIEvent { + class ChangeTab(val navController: NavController, val destination: BottomBarTab) : MainUiEvent +} + +sealed class MainUiState( + val showOnlineView: Boolean, + val showOfflineView: Boolean, + val themeType: ThemeType? = null, + val isBottomBarVisible: Boolean = true, +) : UIState { + + object None : MainUiState(false, false) + + object Offline : MainUiState( + showOnlineView = false, + showOfflineView = true, + ) + + object Online : MainUiState( + showOnlineView = true, + showOfflineView = false, + ) + + class BottomVisibleChange( + showOnlineView: Boolean, + showOfflineView: Boolean, + isBottomBarVisible: Boolean, + themeType: ThemeType + ) : MainUiState( + showOnlineView = showOnlineView, + showOfflineView = showOfflineView, + isBottomBarVisible = isBottomBarVisible, + themeType = themeType + ) + + class ChangeTheme( + showOnlineView: Boolean, + showOfflineView: Boolean, + themeType: ThemeType + ) : MainUiState( + showOnlineView = showOnlineView, + showOfflineView = showOfflineView, + themeType = themeType + ) +} + diff --git a/app/src/main/java/com/example/compose/ui/NetStatusView.kt b/app/src/main/java/com/example/compose/ui/NetStatusView.kt new file mode 100644 index 0000000..2d06e83 --- /dev/null +++ b/app/src/main/java/com/example/compose/ui/NetStatusView.kt @@ -0,0 +1,100 @@ +package com.example.compose.ui + +import androidx.compose.animation.* +import androidx.compose.animation.core.tween +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.wrapContentHeight +import androidx.compose.material.Text +import androidx.compose.runtime.* +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.unit.sp +import com.example.compose.R + +/** + * @author yaya (@yahyalmh) + * @since 02th November 2022 + */ + +@Composable +fun NetStatusView( + showOnlineView: Boolean, + showOfflineView: Boolean, +) { + OfflineView(isOffline = showOfflineView) + OnlineView(isOnline = showOnlineView) +} + +@Composable +fun OfflineView(isOffline: Boolean) { + Row( + modifier = Modifier + .fillMaxWidth() + .wrapContentHeight(), + verticalAlignment = Alignment.Top, + horizontalArrangement = Arrangement.Center + ) { + AnimatedVisibility( + visible = isOffline, + enter = fadeIn(animationSpec = tween(500)) + + expandVertically( + animationSpec = tween(500) + ), + exit = fadeOut(animationSpec = tween(500)) + + shrinkVertically( + animationSpec = tween(500) + ) + ) { + val message = stringResource(R.string.offline) + val color = Color.Red + Text( + modifier = Modifier + .fillMaxWidth() + .background(color), + fontSize = 12.sp, + textAlign = TextAlign.Center, + text = message + ) + } + } +} + +@Composable +fun OnlineView(isOnline: Boolean) { + Row( + modifier = Modifier + .fillMaxWidth() + .wrapContentHeight(), + verticalAlignment = Alignment.Top, + horizontalArrangement = Arrangement.Center + ) { + val message = stringResource(id = R.string.online) + val color = Color.Green + AnimatedVisibility( + visible = isOnline, + enter = fadeIn(animationSpec = tween(500)) + + expandVertically( + animationSpec = tween(500) + ), + exit = fadeOut(animationSpec = tween(500)) + + shrinkVertically( + animationSpec = tween(500) + ) + ) { + Text( + modifier = Modifier + .fillMaxWidth() + .background(color), + fontSize = 12.sp, + textAlign = TextAlign.Center, + text = message + ) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/compose/ui/theme/Color.kt b/app/src/main/java/com/example/compose/ui/theme/Color.kt new file mode 100644 index 0000000..38b577f --- /dev/null +++ b/app/src/main/java/com/example/compose/ui/theme/Color.kt @@ -0,0 +1,69 @@ +package com.example.compose.ui.theme +import androidx.compose.ui.graphics.Color + +val md_theme_light_primary = Color(0xFF6750A4) +val md_theme_light_onPrimary = Color(0xFFFFFFFF) +val md_theme_light_primaryContainer = Color(0xFFEADDFF) +val md_theme_light_onPrimaryContainer = Color(0xFF21005D) +val md_theme_light_secondary = Color(0xFF625B71) +val md_theme_light_onSecondary = Color(0xFFFFFFFF) +val md_theme_light_secondaryContainer = Color(0xFFE8DEF8) +val md_theme_light_onSecondaryContainer = Color(0xFF1D192B) +val md_theme_light_tertiary = Color(0xFF7D5260) +val md_theme_light_onTertiary = Color(0xFFFFFFFF) +val md_theme_light_tertiaryContainer = Color(0xFFFFD8E4) +val md_theme_light_onTertiaryContainer = Color(0xFF31111D) +val md_theme_light_error = Color(0xFFB3261E) +val md_theme_light_onError = Color(0xFFFFFFFF) +val md_theme_light_errorContainer = Color(0xFFF9DEDC) +val md_theme_light_onErrorContainer = Color(0xFF410E0B) +val md_theme_light_outline = Color(0xFF79747E) +val md_theme_light_outline_variant = Color(0xFFCAC4D0) +val md_theme_light_background = Color(0xFFFFFBFE) +val md_theme_light_onBackground = Color(0xFF1C1B1F) +val md_theme_light_surface = Color(0xFFFFFBFE) +val md_theme_light_onSurface = Color(0xFF1C1B1F) +val md_theme_light_surfaceVariant = Color(0xFFE7E0EC) +val md_theme_light_onSurfaceVariant = Color(0xFF49454F) +val md_theme_light_inverseSurface = Color(0xFF313033) +val md_theme_light_inverseOnSurface = Color(0xFFF4EFF4) +val md_theme_light_inversePrimary = Color(0xFFD0BCFF) +val md_theme_light_shadow = Color(0xFF000000) +val md_theme_light_surfaceTint = Color(0xFF6750A4) +val md_theme_light_outlineVariant = Color(0xFFCAC4D0) +val md_theme_light_scrim = Color(0xFF000000) + +val md_theme_dark_primary = Color(0xFFD0BCFF) +val md_theme_dark_onPrimary = Color(0xFF381E72) +val md_theme_dark_primaryContainer = Color(0xFF4F378B) +val md_theme_dark_onPrimaryContainer = Color(0xFFEADDFF) +val md_theme_dark_secondary = Color(0xFFCCC2DC) +val md_theme_dark_onSecondary = Color(0xFF332D41) +val md_theme_dark_secondaryContainer = Color(0xFF4A4458) +val md_theme_dark_onSecondaryContainer = Color(0xFFE8DEF8) +val md_theme_dark_tertiary = Color(0xFFEFB8C8) +val md_theme_dark_onTertiary = Color(0xFF492532) +val md_theme_dark_tertiaryContainer = Color(0xFF633B48) +val md_theme_dark_onTertiaryContainer = Color(0xFFFFD8E4) +val md_theme_dark_error = Color(0xFFF2B8B5) +val md_theme_dark_onError = Color(0xFF601410) +val md_theme_dark_errorContainer = Color(0xFF8C1D18) +val md_theme_dark_onErrorContainer = Color(0xFFF9DEDC) +val md_theme_dark_outline = Color(0xFF938F99) +val md_theme_dark_outline_variant = Color(0xFF49454F) +val md_theme_dark_background = Color(0xFF1C1B1F) +val md_theme_dark_onBackground = Color(0xFFE6E1E5) +val md_theme_dark_surface = Color(0xFF1C1B1F) +val md_theme_dark_onSurface = Color(0xFFE6E1E5) +val md_theme_dark_surfaceVariant = Color(0xFF49454F) +val md_theme_dark_onSurfaceVariant = Color(0xFFCAC4D0) +val md_theme_dark_inverseSurface = Color(0xFFE6E1E5) +val md_theme_dark_inverseOnSurface = Color(0xFF313033) +val md_theme_dark_inversePrimary = Color(0xFF6750A4) +val md_theme_dark_shadow = Color(0xFF000000) +val md_theme_dark_surfaceTint = Color(0xFFD0BCFF) +val md_theme_dark_outlineVariant = Color(0xFF49454F) +val md_theme_dark_scrim = Color(0xFF000000) + + +val seed = Color(0xFF6750A4) diff --git a/app/src/main/java/com/example/compose/ui/theme/Shape.kt b/app/src/main/java/com/example/compose/ui/theme/Shape.kt new file mode 100644 index 0000000..b56b210 --- /dev/null +++ b/app/src/main/java/com/example/compose/ui/theme/Shape.kt @@ -0,0 +1,11 @@ +package com.example.compose.ui.theme + +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.Shapes +import androidx.compose.ui.unit.dp + +val Shapes = Shapes( + small = RoundedCornerShape(4.dp), + medium = RoundedCornerShape(4.dp), + large = RoundedCornerShape(0.dp) +) \ No newline at end of file diff --git a/app/src/main/java/com/example/compose/ui/theme/Theme.kt b/app/src/main/java/com/example/compose/ui/theme/Theme.kt new file mode 100644 index 0000000..947e11e --- /dev/null +++ b/app/src/main/java/com/example/compose/ui/theme/Theme.kt @@ -0,0 +1,92 @@ +package com.example.compose.ui.theme + +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.darkColorScheme +import androidx.compose.material3.lightColorScheme +import androidx.compose.runtime.Composable + + +private val LightColors = lightColorScheme( + primary = md_theme_light_primary, + onPrimary = md_theme_light_onPrimary, + primaryContainer = md_theme_light_primaryContainer, + onPrimaryContainer = md_theme_light_onPrimaryContainer, + secondary = md_theme_light_secondary, + onSecondary = md_theme_light_onSecondary, + secondaryContainer = md_theme_light_secondaryContainer, + onSecondaryContainer = md_theme_light_onSecondaryContainer, + tertiary = md_theme_light_tertiary, + onTertiary = md_theme_light_onTertiary, + tertiaryContainer = md_theme_light_tertiaryContainer, + onTertiaryContainer = md_theme_light_onTertiaryContainer, + error = md_theme_light_error, + onError = md_theme_light_onError, + errorContainer = md_theme_light_errorContainer, + onErrorContainer = md_theme_light_onErrorContainer, + outline = md_theme_light_outline, + background = md_theme_light_background, + onBackground = md_theme_light_onBackground, + surface = md_theme_light_surface, + onSurface = md_theme_light_onSurface, + surfaceVariant = md_theme_light_surfaceVariant, + onSurfaceVariant = md_theme_light_onSurfaceVariant, + inverseSurface = md_theme_light_inverseSurface, + inverseOnSurface = md_theme_light_inverseOnSurface, + inversePrimary = md_theme_light_inversePrimary, + surfaceTint = md_theme_light_surfaceTint, + outlineVariant = md_theme_light_outlineVariant, + scrim = md_theme_light_scrim, +) + + +private val DarkColors = darkColorScheme( + primary = md_theme_dark_primary, + onPrimary = md_theme_dark_onPrimary, + primaryContainer = md_theme_dark_primaryContainer, + onPrimaryContainer = md_theme_dark_onPrimaryContainer, + secondary = md_theme_dark_secondary, + onSecondary = md_theme_dark_onSecondary, + secondaryContainer = md_theme_dark_secondaryContainer, + onSecondaryContainer = md_theme_dark_onSecondaryContainer, + tertiary = md_theme_dark_tertiary, + onTertiary = md_theme_dark_onTertiary, + tertiaryContainer = md_theme_dark_tertiaryContainer, + onTertiaryContainer = md_theme_dark_onTertiaryContainer, + error = md_theme_dark_error, + onError = md_theme_dark_onError, + errorContainer = md_theme_dark_errorContainer, + onErrorContainer = md_theme_dark_onErrorContainer, + outline = md_theme_dark_outline, + background = md_theme_dark_background, + onBackground = md_theme_dark_onBackground, + surface = md_theme_dark_surface, + onSurface = md_theme_dark_onSurface, + surfaceVariant = md_theme_dark_surfaceVariant, + onSurfaceVariant = md_theme_dark_onSurfaceVariant, + inverseSurface = md_theme_dark_inverseSurface, + inverseOnSurface = md_theme_dark_inverseOnSurface, + inversePrimary = md_theme_dark_inversePrimary, + surfaceTint = md_theme_dark_surfaceTint, + outlineVariant = md_theme_dark_outlineVariant, + scrim = md_theme_dark_scrim, +) + +@Composable +fun AppTheme( + useDarkTheme: Boolean = isSystemInDarkTheme(), + content: @Composable () -> Unit +) { + val colors = if (!useDarkTheme) { + LightColors + } else { + DarkColors + } + + MaterialTheme( + colorScheme = colors, + typography = Typography, + shapes = Shapes, + content = content + ) +} \ No newline at end of file diff --git a/app/src/main/java/com/example/compose/ui/theme/Type.kt b/app/src/main/java/com/example/compose/ui/theme/Type.kt new file mode 100644 index 0000000..7f392c4 --- /dev/null +++ b/app/src/main/java/com/example/compose/ui/theme/Type.kt @@ -0,0 +1,94 @@ +package com.example.compose.ui.theme + +import androidx.compose.material3.Typography +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.sp + +internal val Typography = Typography( + displayLarge = TextStyle( + fontWeight = FontWeight.W400, + fontSize = 57.sp, + lineHeight = 64.sp, + letterSpacing = (-0.25).sp + ), + displayMedium = TextStyle( + fontWeight = FontWeight.W400, + fontSize = 45.sp, + lineHeight = 52.sp + ), + displaySmall = TextStyle( + fontWeight = FontWeight.W400, + fontSize = 36.sp, + lineHeight = 44.sp + ), + headlineLarge = TextStyle( + fontWeight = FontWeight.W400, + fontSize = 32.sp, + lineHeight = 40.sp + ), + headlineMedium = TextStyle( + fontWeight = FontWeight.W400, + fontSize = 28.sp, + lineHeight = 36.sp + ), + headlineSmall = TextStyle( + fontWeight = FontWeight.W400, + fontSize = 24.sp, + lineHeight = 32.sp + ), + titleLarge = TextStyle( + fontWeight = FontWeight.W700, + fontSize = 22.sp, + lineHeight = 28.sp + ), + titleMedium = TextStyle( + fontWeight = FontWeight.W700, + fontSize = 16.sp, + lineHeight = 24.sp, + letterSpacing = 0.1.sp + ), + titleSmall = TextStyle( + fontWeight = FontWeight.W500, + fontSize = 14.sp, + lineHeight = 20.sp, + letterSpacing = 0.1.sp + ), + bodyLarge = TextStyle( + fontWeight = FontWeight.W400, + fontSize = 16.sp, + lineHeight = 24.sp, + letterSpacing = 0.5.sp + ), + bodyMedium = TextStyle( + fontWeight = FontWeight.W400, + fontSize = 14.sp, + lineHeight = 20.sp, + letterSpacing = 0.25.sp + ), + bodySmall = TextStyle( + fontWeight = FontWeight.W400, + fontSize = 12.sp, + lineHeight = 16.sp, + letterSpacing = 0.4.sp + ), + labelLarge = TextStyle( + fontWeight = FontWeight.W400, + fontSize = 14.sp, + lineHeight = 20.sp, + letterSpacing = 0.1.sp + ), + labelMedium = TextStyle( + fontWeight = FontWeight.W400, + fontSize = 12.sp, + lineHeight = 16.sp, + letterSpacing = 0.5.sp + ), + labelSmall = TextStyle( + fontFamily = FontFamily.Monospace, + fontWeight = FontWeight.W500, + fontSize = 10.sp, + lineHeight = 16.sp + ) +) \ No newline at end of file diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000000000000000000000000000000000000..c209e78ecd372343283f4157dcfd918ec5165bb3 GIT binary patch literal 1404 zcmV-?1%vuhNk&F=1pok7MM6+kP&il$0000G0000-002h-06|PpNX!5L00Dqw+t%{r zzW2vH!KF=w&cMnnN@{whkTw+#mAh0SV?YL=)3MimFYCWp#fpdtz~8$hD5VPuQgtcN zXl<@<#Cme5f5yr2h%@8TWh?)bSK`O z^Z@d={gn7J{iyxL_y_%J|L>ep{dUxUP8a{byupH&!UNR*OutO~0{*T4q5R6@ApLF! z5{w?Z150gC7#>(VHFJZ-^6O@PYp{t!jH(_Z*nzTK4 zkc{fLE4Q3|mA2`CWQ3{8;gxGizgM!zccbdQoOLZc8hThi-IhN90RFT|zlxh3Ty&VG z?Fe{#9RrRnxzsu|Lg2ddugg7k%>0JeD+{XZ7>Z~{=|M+sh1MF7~ zz>To~`~LVQe1nNoR-gEzkpe{Ak^7{{ZBk2i_<+`Bq<^GB!RYG+z)h;Y3+<{zlMUYd zrd*W4w&jZ0%kBuDZ1EW&KLpyR7r2=}fF2%0VwHM4pUs}ZI2egi#DRMYZPek*^H9YK zay4Iy3WXFG(F14xYsoDA|KXgGc5%2DhmQ1gFCkrgHBm!lXG8I5h*uf{rn48Z!_@ z4Bk6TJAB2CKYqPjiX&mWoW>OPFGd$wqroa($ne7EUK;#3VYkXaew%Kh^3OrMhtjYN?XEoY`tRPQsAkH-DSL^QqyN0>^ zmC>{#F14jz4GeW{pJoRpLFa_*GI{?T93^rX7SPQgT@LbLqpNA}<@2wH;q493)G=1Y z#-sCiRNX~qf3KgiFzB3I>4Z%AfS(3$`-aMIBU+6?gbgDb!)L~A)je+;fR0jWLL-Fu z4)P{c7{B4Hp91&%??2$v9iRSFnuckHUm}or9seH6 z>%NbT+5*@L5(I9j@06@(!{ZI?U0=pKn8uwIg&L{JV14+8s2hnvbRrU|hZCd}IJu7*;;ECgO%8_*W Kmw_-CKmY()leWbG literal 0 HcmV?d00001 diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000000000000000000000000000000000000..b2dfe3d1ba5cf3ee31b3ecc1ced89044a1f3b7a9 GIT binary patch literal 2898 zcmV-Y3$650Nk&FW3jhFDMM6+kP&il$0000G0000-002h-06|PpNWB9900E$G+qN-D z+81ABX7q?;bwx%xBg?kcwr$(C-Tex-ZCkHUw(Y9#+`E5-zuONG5fgw~E2WDng@Bc@ z24xy+R1n%~6xI#u9vJ8zREI)sb<&Il(016}Z~V1n^PU3-_H17A*Bf^o)&{_uBv}Py zulRfeE8g(g6HFhk_?o_;0@tz?1I+l+Y#Q*;RVC?(ud`_cU-~n|AX-b`JHrOIqn(-t&rOg-o`#C zh0LPxmbOAEb;zHTu!R3LDh1QO zZTf-|lJNUxi-PpcbRjw3n~n-pG;$+dIF6eqM5+L();B2O2tQ~|p{PlpNcvDbd1l%c zLtXn%lu(3!aNK!V#+HNn_D3lp z2%l+hK-nsj|Bi9;V*WIcQRTt5j90A<=am+cc`J zTYIN|PsYAhJ|=&h*4wI4ebv-C=Be#u>}%m;a{IGmJDU`0snWS&$9zdrT(z8#{OZ_Y zxwJx!ZClUi%YJjD6Xz@OP8{ieyJB=tn?>zaI-4JN;rr`JQbb%y5h2O-?_V@7pG_+y z(lqAsqYr!NyVb0C^|uclHaeecG)Sz;WV?rtoqOdAAN{j%?Uo%owya(F&qps@Id|Of zo@~Y-(YmfB+chv^%*3g4k3R0WqvuYUIA+8^SGJ{2Bl$X&X&v02>+0$4?di(34{pt* zG=f#yMs@Y|b&=HyH3k4yP&goF2LJ#tBLJNNDo6lG06r}ghC-pC4Q*=x3;|+W04zte zAl>l4kzUBQFYF(E`KJy?ZXd1tnfbH+Z~SMmA21KokJNs#eqcXWKUIC>{TuoKe^vhF z);H)o`t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H%?^Rm*LVz`lkULs)%idDX^O)SxQol(3jDRyBVR!7d`;ar+D7do)jQ}m`g$TevUD5@?*P8)voa?kEe@_hl{_h8j&5eB-5FrYW&*FHVt$ z$kRF9Nstj%KRzpjdd_9wO=4zO8ritN*NPk_9avYrsF(!4))tm{Ga#OY z(r{0buexOzu7+rw8E08Gxd`LTOID{*AC1m*6Nw@osfB%0oBF5sf<~wH1kL;sd zo)k6^VyRFU`)dt*iX^9&QtWbo6yE8XXH?`ztvpiOLgI3R+=MOBQ9=rMVgi<*CU%+d1PQQ0a1U=&b0vkF207%xU0ssI2 literal 0 HcmV?d00001 diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000000000000000000000000000000000000..4f0f1d64e58ba64d180ce43ee13bf9a17835fbca GIT binary patch literal 982 zcmV;{11bDcNk&G_0{{S5MM6+kP&il$0000G0000l001ul06|PpNU8t;00Dqo+t#w^ z^1csucXz7-Qrhzl9HuHB%l>&>1tG2^vb*E&k^T3$FG1eQZ51g$uv4V+kI`0<^1Z@N zk?Jjh$olyC%l>)Xq;7!>{iBj&BjJ`P&$fsCfpve_epJOBkTF?nu-B7D!hO=2ZR}

C%4 zc_9eOXvPbC4kzU8YowIA8cW~Uv|eB&yYwAObSwL2vY~UYI7NXPvf3b+c^?wcs~_t{ ze_m66-0)^{JdOMKPwjpQ@Sna!*?$wTZ~su*tNv7o!gXT!GRgivP}ec?5>l1!7<(rT zds|8x(qGc673zrvYIz;J23FG{9nHMnAuP}NpAED^laz3mAN1sy+NXK)!6v1FxQ;lh zOBLA>$~P3r4b*NcqR;y6pwyhZ3_PiDb|%n1gGjl3ZU}ujInlP{eks-#oA6>rh&g+!f`hv#_%JrgYPu z(U^&XLW^QX7F9Z*SRPpQl{B%x)_AMp^}_v~?j7 zapvHMKxSf*Mtyx8I}-<*UGn3)oHd(nn=)BZ`d$lDBwq_GL($_TPaS{UeevT(AJ`p0 z9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`JZoQFz0n*7ZG@Fv@kZk`gzO$HoA9kN z8U5{-yY zvV{`&WKU2$mZeoBmiJrEdzUZAv1sRxpePdg1)F*X^Y)zp^Y*R;;z~vOv-z&)&G)JQ{m!C9cmziu1^nHA z`#`0c>@PnQ9CJKgC5NjJD8HM3|KC(g5nnCq$n0Gsu_DXk36@ql%npEye|?%RmG)

FJ$wK}0tWNB{uH;AM~i literal 0 HcmV?d00001 diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000000000000000000000000000000000000..948a3070fe34c611c42c0d3ad3013a0dce358be0 GIT binary patch literal 1900 zcmV-y2b1_xNk&Fw2LJ$9MM6+kP&il$0000G0001A003VA06|PpNH75a00DqwTbm-~ zullQTcXxO9ki!OCRx^i?oR|n!<8G0=kI^!JSjFi-LL*`V;ET0H2IXfU0*i>o6o6Gy zRq6Ap5(_{XLdXcL-MzlN`ugSdZY_`jXhcENAu)N_0?GhF))9R;E`!bo9p?g?SRgw_ zEXHhFG$0{qYOqhdX<(wE4N@es3VIo$%il%6xP9gjiBri+2pI6aY4 zJbgh-Ud|V%3O!IcHKQx1FQH(_*TK;1>FQWbt^$K1zNn^cczkBs=QHCYZ8b&l!UV{K z{L0$KCf_&KR^}&2Fe|L&?1I7~pBENnCtCuH3sjcx6$c zwqkNkru);ie``q+_QI;IYLD9OV0ZxkuyBz|5<$1BH|vtey$> z5oto4=l-R-Aaq`Dk0}o9N0VrkqW_#;!u{!bJLDq%0092{Ghe=F;(kn} z+sQ@1=UlX30+2nWjkL$B^b!H2^QYO@iFc0{(-~yXj2TWz?VG{v`Jg zg}WyYnwGgn>{HFaG7E~pt=)sOO}*yd(UU-D(E&x{xKEl6OcU?pl)K%#U$dn1mDF19 zSw@l8G!GNFB3c3VVK0?uyqN&utT-D5%NM4g-3@Sii9tSXKtwce~uF zS&Jn746EW^wV~8zdQ1XC28~kXu8+Yo9p!<8h&(Q({J*4DB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bp;vlyE5&E_6!fzx9pwrdz474!~g(M6R?N? literal 0 HcmV?d00001 diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000000000000000000000000000000000000..1b9a6956b3acdc11f40ce2bb3f6efbd845cc243f GIT binary patch literal 3918 zcmV-U53%r4Nk&FS4*&pHMM6+kP&il$0000G0001A003VA06|PpNSy@$00HoY|G(*G z+qV7x14$dSO^Re!iqt-AAIE9iwr$(CZQJL$blA4B`>;C3fBY6Q8_YSjb2%a=fc}4E zrSzssacq<^nmW|Rs93PJni30R<8w<(bK_$LO4L?!_OxLl$}K$MUEllnMK|rg=f3;y z*?;3j|Nh>)p0JQ3A~rf(MibH2r+)3cyV1qF&;8m{w-S*y+0mM){KTK^M5}ksc`qX3 zy>rf^b>~l>SSHds8(I@hz3&PD@LmEs4&prkT=BjsBCXTMhN$_)+kvnl0bLKW5rEsj z*d#KXGDB4P&>etx0X+`R19yC=LS)j!mgs5M0L~+o-T~Jl!p!AJxnGAhV%~rhYUL4hlWhgES3Kb5oA&X z{}?3OBSS-{!v$nCIGj->(-TAG)8LR{htr41^gxsT8yqt2@DEG6Yl`Uma3Nd4;YUoW zTbkYl3CMU5ypMF3EIkYmWL|*BknM`0+Kq6CpvO(y$#j94e+q{vI{Zp8cV_6RK!`&C zob$*5Q|$IZ09dW=L!V zw@#2wviu|<#3lgGE8GEhcx+zBt`} zOwP8j9X%^f7i_bth4PiJ$LYtFJSCN$3xwDN;8mr*B;CJwBP2G0TMq0uNt7S^DO_wE zepk!Wrn#Z#03j{`c*Rf~y3o7?J}w?tEELRUR2cgxB*Y{LzA#pxHgf}q?u5idu>077 zd^=p)`nA}6e`|@`p?u}YU66PP_MA}Zqqe!c{nK&z%Jwq1N4e_q<#4g^xaz=ao;u|6 zwpRcW2Lax=ZGbx=Q*HhlJ`Ns#Y*r0*%!T?P*TTiX;rb)$CGLz=rSUum$)3Qyv{BL2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&Qe+rBa7eq}Q(bq|tn(RrJAk|ztj2(i{d>nmQnM?;HF2k&9sA6up5tmjl z7lySlzMbifH17-m-Lwa_F&e7nOH?ESi3#ckR3tsM+jsck3`oG!uMS}|eAwVXv>}qxwq?QY%QJ0}r@^;fhuUA9W z*BVl>TGo&N004@xSiwDUXUvp51sVmqO3m)=B55aPwf@0=e}cN+$-BdKxY`YrT_4)0 z_d10#i44Q*rFr8MC>*)v$EJvz``(pb{e&*6k+b zsMz%($|1+8hn8c2?P(l@;Rb&CsZeYoCI3?2!LqjbwPXW3z4G$Qfj=cT5Yb%vY0(AX oeb?AaKtwrnc|$|zzw9vfvn^aJJ!zd)XFXqqy0000001=f@-~a#s literal 0 HcmV?d00001 diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..f8c6127 --- /dev/null +++ b/app/src/main/res/values/colors.xml @@ -0,0 +1,10 @@ + + + #FFBB86FC + #FF6200EE + #FF3700B3 + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..513d78d --- /dev/null +++ b/app/src/main/res/values/strings.xml @@ -0,0 +1,9 @@ + + Compose + No Internet connection + online + offline + Favorite + Home + Setting + \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..95302db --- /dev/null +++ b/app/src/main/res/values/themes.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/xml/backup_rules.xml b/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..fa0f996 --- /dev/null +++ b/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/xml/data_extraction_rules.xml b/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..9ee9997 --- /dev/null +++ b/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/test/java/com/example/compose/ExampleUnitTest.kt b/app/src/test/java/com/example/compose/ExampleUnitTest.kt new file mode 100644 index 0000000..a83bd2d --- /dev/null +++ b/app/src/test/java/com/example/compose/ExampleUnitTest.kt @@ -0,0 +1,16 @@ +package com.example.compose + +import org.junit.Assert.assertEquals +import org.junit.Test + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..30c55fa --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,8 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + id("com.android.application") version "7.3.1" apply false + id("com.android.library") version "7.3.1" apply false + id("org.jetbrains.kotlin.android") version "1.6.10" apply false + id("org.jetbrains.kotlin.jvm") version "1.7.20" apply false + id("com.google.dagger.hilt.android") version Version.Hilt.HILT_ANDROID apply false +} \ No newline at end of file diff --git a/buildSrc/.gitignore b/buildSrc/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/buildSrc/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts new file mode 100644 index 0000000..9cb33dd --- /dev/null +++ b/buildSrc/build.gradle.kts @@ -0,0 +1,8 @@ +plugins { + `kotlin-dsl` +} + +repositories { + mavenCentral() + google() +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/AppConfig.kt b/buildSrc/src/main/kotlin/AppConfig.kt new file mode 100644 index 0000000..0baf997 --- /dev/null +++ b/buildSrc/src/main/kotlin/AppConfig.kt @@ -0,0 +1,15 @@ +/** + * @author yaya (@yahyalmh) + * @since 28th October 2022 + */ + +object AppConfig { + + const val compileSdk = 33 + const val minSdk = 21 + const val targetSdk = 33 + const val versionCode = 1 + const val versionName = "1.0.0" + + const val androidTestInstrumentation = "androidx.test.runner.AndroidJUnitRunner" +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt new file mode 100644 index 0000000..f9f47ef --- /dev/null +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -0,0 +1,187 @@ + +import Dependencies.ROOM_COMPILER +import Dependencies.ROOM_KTX +import Dependencies.ROOM_RUNTIME +import Dependencies.ROOM_TEST +import org.gradle.api.artifacts.Dependency +import org.gradle.api.artifacts.dsl.DependencyHandler +import org.gradle.kotlin.dsl.project + +/** + * @author yaya (@yahyalmh) + * @since 28th October 2022 + */ + +object Dependencies { + const val ANDROIDX_CORE_KTX = "androidx.core:core-ktx:${Version.Androidx.CORE_KTX}" + const val ANDROID_LIFECYCLE_RUNTIME = + "androidx.lifecycle:lifecycle-runtime-ktx:${Version.Androidx.LIFECYCLE}" + + const val COMPOSE_BOM = "androidx.compose:compose-bom:${Version.Compose.BOM}" + const val ANDROID_ACTIVITY_COMPOSE = + "androidx.activity:activity-compose:${Version.Compose.ACTIVITY_COMPOSE}" + const val ANDROIDX_COMPOSE_PREVIEW = "androidx.compose.ui:ui-tooling-preview" + const val ANDROIDX_COMPOSE_UI_TOOLING = "androidx.compose.ui:ui-tooling" + const val ANDROIDX_COMPOSE_LIFECYCLE = + "androidx.lifecycle:lifecycle-runtime-compose:${Version.Androidx.LIFECYCLE}" + const val COMPOSE_UI = "androidx.compose.ui:ui" + const val COMPOSE_MATERIAL = "androidx.compose.material:material" + const val COMPOSE_MATERIAL3 = "androidx.compose.material3:material3" + const val COMPOSE_MATERIAL3_WINDOW_SIZE = + "androidx.compose.material3:material3-window-size-class" + const val COMPOSE_NAVIGATION = + "androidx.navigation:navigation-compose:${Version.Compose.NAVIGATION}" + const val COMPOSE_VIEWMODEL = "androidx.lifecycle:lifecycle-viewmodel-compose" + const val COMPOSE_HILT_NAVIGATION = + "androidx.hilt:hilt-navigation-compose:${Version.Compose.HILT_NAVIGATION}" + const val COMPOSE_UI_TEST = "androidx.compose.ui:ui-test-junit4" + const val COMPOSE_UI_TEST_MANIFEST = "androidx.compose.ui:ui-test-manifest" + const val COMPOSE_CONSTRAINTLAYOUT = + "androidx.constraintlayout:constraintlayout-compose:${Version.Compose.CONSTRAINTLAYOUT}" + + + const val HILT_ANDROID = "com.google.dagger:hilt-android:${Version.Hilt.HILT_ANDROID}" + const val HILT_COMPILER = "com.google.dagger:hilt-compiler:${Version.Hilt.HILT_COMPILER}" + + const val JUNIT = "junit:junit:${Version.Junit.JUNIT}" + const val ANDROIDX_JUNIT = "androidx.test.ext:junit:${Version.Junit.ANDROIDX_JUNIT}" + + const val ANDROIDX_ESPRESSO_CORE = + "androidx.test.espresso:espresso-core:${Version.ESPRESSO_CORE}" + + + const val RETROFIT = "com.squareup.retrofit2:retrofit:${Version.Retrofit.RETROFIT}" + const val RETROFIT_GSON_CONVERTER = + "com.squareup.retrofit2:converter-gson:${Version.Retrofit.RETROFIT}" + const val GSON = "com.google.code.gson:gson:${Version.Retrofit.GSON}" + const val RETROFIT_COROUTINES_ADAPTER = + "com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:${Version.Retrofit.COROUTINES_ADAPTER}" + const val OKHTTP_LOGGING = + "com.squareup.okhttp3:logging-interceptor:${Version.Retrofit.OKHTTP_LOGGING}" + + const val COROUTINES_CORE = + "org.jetbrains.kotlinx:kotlinx-coroutines-core:${Version.COROUTINES}" + const val COROUTINES_ANDROID = + "org.jetbrains.kotlinx:kotlinx-coroutines-android:${Version.COROUTINES}" + const val COROUTINES_TEST = + "org.jetbrains.kotlinx:kotlinx-coroutines-test:${Version.COROUTINES}" + + const val KOTLIN_REFLECTION = "org.jetbrains.kotlin:kotlin-reflect:${Version.KOTLIN_REFLECTION}" + + const val DATA_STORE = "androidx.datastore:datastore-preferences:${Version.DATA_STORE}" + + const val ROOM_RUNTIME = "androidx.room:room-runtime:${Version.ROOM_VERSION}" + const val ROOM_COMPILER = "androidx.room:room-compiler:${Version.ROOM_VERSION}" + const val ROOM_TEST = "androidx.room:room-testing:${Version.ROOM_VERSION}" + const val ROOM_COROUTINE = "androidx.room:room-coroutines:${Version.ROOM_VERSION}" + const val ROOM_COMMON = "androidx.room:room-common:${Version.ROOM_VERSION}" + const val ROOM_KTX = "androidx.room:room-ktx:${Version.ROOM_VERSION}" + +} + +fun DependencyHandler.androidxCore() = implementation(Dependencies.ANDROIDX_CORE_KTX) +fun DependencyHandler.kotlinReflection() = runtimeOnly(Dependencies.KOTLIN_REFLECTION) + +fun DependencyHandler.compose() { + implementation(platform(Dependencies.COMPOSE_BOM)) + implementation(Dependencies.COMPOSE_HILT_NAVIGATION) + implementation(Dependencies.ANDROID_ACTIVITY_COMPOSE) + implementation(Dependencies.ANDROIDX_COMPOSE_PREVIEW) + implementation(Dependencies.ANDROIDX_COMPOSE_UI_TOOLING) + implementation(Dependencies.ANDROIDX_COMPOSE_LIFECYCLE) + implementation(Dependencies.COMPOSE_UI) +} + +fun DependencyHandler.room() { + implementation(ROOM_RUNTIME) +// implementation(ROOM_COROUTINE) + annotationProcessor(ROOM_COMPILER) + kapt(ROOM_COMPILER) +// ksp(ROOM_COMPILER) + testImplementation(ROOM_TEST) + implementation(ROOM_KTX) +} + +fun DependencyHandler.composeMaterial() { + implementation(Dependencies.COMPOSE_MATERIAL) + implementation(Dependencies.COMPOSE_MATERIAL3) + implementation(Dependencies.COMPOSE_MATERIAL3_WINDOW_SIZE) +} + +fun DependencyHandler.composeTest() { + androidTestImplementation(platform(Dependencies.COMPOSE_BOM)) + androidTestImplementation(Dependencies.COMPOSE_UI_TEST) + debugImplementation(Dependencies.COMPOSE_UI_TEST_MANIFEST) +} + +fun DependencyHandler.composeNavigation() { + implementation(Dependencies.COMPOSE_NAVIGATION) +} + +fun DependencyHandler.composeViewmodel() { + implementation(Dependencies.COMPOSE_VIEWMODEL) +} + +fun DependencyHandler.composeConstraintlayout() { + implementation(Dependencies.COMPOSE_CONSTRAINTLAYOUT) +} + +fun DependencyHandler.coroutines() { + implementation(Dependencies.COROUTINES_CORE) + implementation(Dependencies.COROUTINES_ANDROID) + implementation(Dependencies.COROUTINES_TEST) +} + +fun DependencyHandler.retrofit() { + implementation(Dependencies.RETROFIT) + implementation(Dependencies.RETROFIT_GSON_CONVERTER) + implementation(Dependencies.GSON) + implementation(Dependencies.OKHTTP_LOGGING) + implementation(Dependencies.RETROFIT_COROUTINES_ADAPTER) +} + +fun DependencyHandler.hilt() { + implementation(Dependencies.HILT_ANDROID) + kapt(Dependencies.HILT_COMPILER) +} + +fun DependencyHandler.datastore() { + implementation(Dependencies.DATA_STORE) +} + +fun DependencyHandler.junit() { + testImplementation(Dependencies.JUNIT) + androidTestImplementation(Dependencies.ANDROIDX_JUNIT) +} + +fun DependencyHandler.moduleDependency(path: String) { + implementation(project(path)) +} + +fun DependencyHandler.espresso() = androidTestImplementation(Dependencies.ANDROIDX_ESPRESSO_CORE) + +fun DependencyHandler.lifecycle() = implementation(Dependencies.ANDROID_LIFECYCLE_RUNTIME) + +private fun DependencyHandler.kapt(depName: String) = add("kapt", depName) + +fun DependencyHandler.implementation(depName: String) = add("implementation", depName) +fun DependencyHandler.implementation(dependency: Dependency) = add("implementation", dependency) + +fun DependencyHandler.androidTestImplementation(depName: String) = + add("androidTestImplementation", depName) + +fun DependencyHandler.androidTestImplementation(dependency: Dependency) = + add("androidTestImplementation", dependency) + +fun DependencyHandler.testImplementation(depName: String) = add("testImplementation", depName) + +fun DependencyHandler.debugImplementation(depName: String) = add("debugImplementation", depName) + +private fun DependencyHandler.compileOnly(depName: String) = add("compileOnly", depName) +private fun DependencyHandler.runtimeOnly(depName: String) = add("runtimeOnly", depName) + +private fun DependencyHandler.api(depName: String) = add("api", depName) + +//private fun DependencyHandler.ksp(depName: String) = add("ksp", depName) +private fun DependencyHandler.annotationProcessor(depName: String) = + add("annotationProcessor", depName) diff --git a/buildSrc/src/main/kotlin/Version.kt b/buildSrc/src/main/kotlin/Version.kt new file mode 100644 index 0000000..059cb6f --- /dev/null +++ b/buildSrc/src/main/kotlin/Version.kt @@ -0,0 +1,52 @@ +/** + * @author yaya (@yahyalmh) + * @since 28th October 2022 + */ + +object Version { + const val ROOM_VERSION = "2.4.3" + + const val ESPRESSO_CORE = "3.4.0" + + const val KOTLIN_COMPILER_EXTENSION_VERSION = "1.3.2" + + const val DATA_STORE = "1.0.0" + + object Retrofit { + const val RETROFIT = "2.9.0" + const val OKHTTP_LOGGING = "5.0.0-alpha.8" + const val GSON = "2.10" + const val COROUTINES_ADAPTER = "0.9.2" + } + + const val KOTLIN_REFLECTION = "1.7.20" + + const val COROUTINES = "1.6.4" + + object Androidx { + const val CORE_KTX = "1.9.0" + const val LIFECYCLE = "2.6.0-alpha03" + } + + object Compose { + const val CONSTRAINTLAYOUT = "1.0.1" + const val BOM = "2022.10.00" + const val ACTIVITY_COMPOSE = "1.6.1" + const val UI_VERSION = "1.3.0" + const val MATERIAL = "1.3.0" + const val MATERIAL3 = "1.1.0-alpha01" + const val NAVIGATION = "2.6.0-alpha03" + const val HILT_NAVIGATION = "1.0.0" + const val VIEWMODEL = "2.6.0-alpha03" + } + + object Hilt { + const val HILT_ANDROID = "2.44" + const val HILT_COMPILER = "2.44" + } + + object Junit { + const val JUNIT = "4.13.2" + const val ANDROIDX_JUNIT = "1.1.3" + } +} \ No newline at end of file diff --git a/core/.gitignore b/core/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/core/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/core/build.gradle.kts b/core/build.gradle.kts new file mode 100644 index 0000000..5450612 --- /dev/null +++ b/core/build.gradle.kts @@ -0,0 +1,51 @@ +plugins { + id("com.android.library") + id("org.jetbrains.kotlin.android") + kotlin("kapt") + id("com.google.dagger.hilt.android") +} + +android { + namespace = "com.example.core" + compileSdk = AppConfig.compileSdk + + defaultConfig { + minSdk = AppConfig.minSdk + targetSdk = AppConfig.targetSdk + + testInstrumentationRunner = AppConfig.androidTestInstrumentation + } + + buildFeatures { + compose = true + } + composeOptions { + kotlinCompilerExtensionVersion = Version.KOTLIN_COMPILER_EXTENSION_VERSION + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } +} + +dependencies { + androidxCore() + compose() + composeMaterial() + junit() + espresso() + hilt() +} \ No newline at end of file diff --git a/core/consumer-rules.pro b/core/consumer-rules.pro new file mode 100644 index 0000000..e69de29 diff --git a/core/proguard-rules.pro b/core/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/core/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/core/src/androidTest/java/com/example/core/ExampleInstrumentedTest.kt b/core/src/androidTest/java/com/example/core/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..b75c9c6 --- /dev/null +++ b/core/src/androidTest/java/com/example/core/ExampleInstrumentedTest.kt @@ -0,0 +1,22 @@ +package com.example.core + +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.platform.app.InstrumentationRegistry +import org.junit.Assert.* +import org.junit.Test +import org.junit.runner.RunWith + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.example.core.test", appContext.packageName) + } +} \ No newline at end of file diff --git a/core/src/main/AndroidManifest.xml b/core/src/main/AndroidManifest.xml new file mode 100644 index 0000000..8c4c982 --- /dev/null +++ b/core/src/main/AndroidManifest.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/core/src/main/java/com/example/core/base/Annotation.kt b/core/src/main/java/com/example/core/base/Annotation.kt new file mode 100644 index 0000000..a79603e --- /dev/null +++ b/core/src/main/java/com/example/core/base/Annotation.kt @@ -0,0 +1,16 @@ +package com.example.core.base + +import androidx.compose.ui.tooling.preview.Devices +import androidx.compose.ui.tooling.preview.Preview + +/** + * @author yaya (@yahyalmh) + * @since 12th November 2022 + */ + +@Preview(showSystemUi = true, name = "phone", device = Devices.PHONE) +@Preview(showSystemUi = true, name = "foldable", device = Devices.FOLDABLE) +@Preview(showSystemUi = true,name = "custom", device = "spec:width=1280dp, height=800dp,dpi=480") +@Preview(showSystemUi = true,name = "tablet", device = Devices.TABLET) +@Preview(showSystemUi = true,name = "desktop", device = "id:desktop_medium") +annotation class ReferenceDevices \ No newline at end of file diff --git a/core/src/main/java/com/example/core/base/BaseViewModel.kt b/core/src/main/java/com/example/core/base/BaseViewModel.kt new file mode 100644 index 0000000..1c0a081 --- /dev/null +++ b/core/src/main/java/com/example/core/base/BaseViewModel.kt @@ -0,0 +1,26 @@ +package com.example.core.base + +import androidx.compose.runtime.MutableState +import androidx.compose.runtime.State +import androidx.compose.runtime.mutableStateOf +import androidx.lifecycle.ViewModel + +/** + * @author yaya (@yahyalmh) + * @since 29th September 2022 + */ + +abstract class BaseViewModel(initialState: T) : ViewModel() { + private var internalSate: MutableState = mutableStateOf(initialState) + var state: State = internalSate + + abstract fun onEvent(event: E) + + protected fun setState(state: T) { + internalSate.value = state + } +} + +interface UIState + +interface UIEvent diff --git a/core/src/main/java/com/example/core/component/BaseLazyColumn.kt b/core/src/main/java/com/example/core/component/BaseLazyColumn.kt new file mode 100644 index 0000000..2eaf3be --- /dev/null +++ b/core/src/main/java/com/example/core/component/BaseLazyColumn.kt @@ -0,0 +1,33 @@ +package com.example.core.component + +import androidx.compose.animation.AnimatedVisibility +import androidx.compose.animation.fadeIn +import androidx.compose.animation.fadeOut +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.LazyListState +import androidx.compose.foundation.lazy.items +import androidx.compose.foundation.lazy.rememberLazyListState +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier + +@Composable +fun BaseLazyColumn( + modifier: Modifier = Modifier, + lazyListState: LazyListState = rememberLazyListState(), + items: List, + isVisible: Boolean = true, + cell: @Composable (T) -> Unit +) { + AnimatedVisibility( + visible = isVisible, + enter = fadeIn(), + exit = fadeOut() + ) { + LazyColumn( + state = lazyListState, + modifier = modifier + ) { + items(items) { cell(it) } + } + } +} \ No newline at end of file diff --git a/core/src/main/java/com/example/core/component/Column.kt b/core/src/main/java/com/example/core/component/Column.kt new file mode 100644 index 0000000..fda65c3 --- /dev/null +++ b/core/src/main/java/com/example/core/component/Column.kt @@ -0,0 +1,40 @@ +package com.example.core.component + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp + +@Composable +fun BaseColumn( + modifier: Modifier = Modifier, + content: @Composable () -> Unit +) { + Column( + modifier = modifier + .fillMaxSize() + .padding(16.dp) + ) { + content() + } +} + +@Composable +fun BaseCenterColumn( + modifier: Modifier = Modifier, + content: @Composable () -> Unit +) { + Column( + modifier = modifier + .fillMaxSize() + .padding(16.dp), + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.Center + ) { + content() + } +} \ No newline at end of file diff --git a/core/src/main/java/com/example/core/component/EmptyView.kt b/core/src/main/java/com/example/core/component/EmptyView.kt new file mode 100644 index 0000000..c19b843 --- /dev/null +++ b/core/src/main/java/com/example/core/component/EmptyView.kt @@ -0,0 +1,67 @@ +package com.example.core.component + +import androidx.compose.animation.AnimatedVisibility +import androidx.compose.animation.fadeIn +import androidx.compose.animation.fadeOut +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.* +import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.font.FontStyle +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import com.example.core.R +import com.example.core.component.icon.Icons + +@Composable +fun EmptyView( + modifier: Modifier = Modifier, + isVisible: Boolean = true, + icon: ImageVector, + message: String, +) { + AnimatedVisibility( + visible = isVisible, + enter = fadeIn(), + exit = fadeOut() + ) { + Column( + modifier = modifier + .background(MaterialTheme.colorScheme.background) + .fillMaxSize(), + verticalArrangement = Arrangement.Center, + horizontalAlignment = Alignment.CenterHorizontally + ) { + + Icon( + modifier = Modifier + .padding(12.dp) + .size(80.dp), + imageVector = icon, + contentDescription = stringResource(id = R.string.emptyIcon), + tint = MaterialTheme.colorScheme.onBackground + ) + + Text( + modifier = Modifier.padding(top = 10.dp), + color = MaterialTheme.colorScheme.onBackground, + fontSize = 16.sp, + fontStyle = FontStyle.Italic, + text = message + ) + } + } +} + +@Preview(showSystemUi = true) +@Composable +fun Preview() { + EmptyView(isVisible = true, icon = Icons.ThumbUp, message = "Not Found") +} \ No newline at end of file diff --git a/core/src/main/java/com/example/core/component/ErrorView.kt b/core/src/main/java/com/example/core/component/ErrorView.kt new file mode 100644 index 0000000..782f36f --- /dev/null +++ b/core/src/main/java/com/example/core/component/ErrorView.kt @@ -0,0 +1,140 @@ +package com.example.core.component + +import androidx.compose.animation.AnimatedVisibility +import androidx.compose.animation.fadeIn +import androidx.compose.animation.fadeOut +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.* +import androidx.compose.material.Button +import androidx.compose.material.Text +import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.example.core.R +import com.example.core.component.icon.Icons + +/** + * @author yaya (@yahyalmh) + * @since 10th November 2022 + */ + +@Composable +fun RetryView( + modifier: Modifier = Modifier, + isVisible: Boolean = true, + errorMessage: String, + icon: ImageVector, onRetry: () -> Unit +) { + AnimatedVisibility(visible = isVisible, + enter = fadeIn(), + exit = fadeOut()) { + Column( + modifier = modifier + .background(MaterialTheme.colorScheme.background) + .padding(10.dp) + .fillMaxSize(), + verticalArrangement = Arrangement.Center, + horizontalAlignment = Alignment.CenterHorizontally + ) { + Icon( + modifier = modifier + .padding(12.dp) + .size(80.dp), + imageVector = icon, + contentDescription = "retry icon", + tint = MaterialTheme.colorScheme.errorContainer + ) + + Spacer(modifier = modifier.height(10.dp)) + + + Text( + text = errorMessage, + modifier = modifier.fillMaxWidth(), + textAlign = TextAlign.Center, + style = MaterialTheme.typography.bodyMedium, + color = MaterialTheme.colorScheme.error + ) + + Spacer(modifier = modifier.height(10.dp)) + + Button(onClick = onRetry) { + Text(text = stringResource(R.string.txt_retry)) + } + } + } +} + + +@Composable +fun AutoRetryView( + modifier: Modifier = Modifier, + isVisible: Boolean = true, + errorMessage: String, + icon: ImageVector, + hint: String, +) { + AnimatedVisibility( + visible = isVisible, enter = fadeIn(), exit = fadeOut() + ) { + Column( + modifier = modifier + .background(MaterialTheme.colorScheme.background) + .padding(10.dp) + .fillMaxSize(), + verticalArrangement = Arrangement.Center, + horizontalAlignment = Alignment.CenterHorizontally + ) { + Icon( + modifier = modifier + .padding(12.dp) + .size(80.dp), + imageVector = icon, + contentDescription = "Auto retry icon", + tint = MaterialTheme.colorScheme.errorContainer + ) + + Text( + text = errorMessage, + modifier = modifier + .fillMaxWidth() + .padding(12.dp), + textAlign = TextAlign.Center, + style = MaterialTheme.typography.bodyMedium, + color = MaterialTheme.colorScheme.error + ) + + Spacer(modifier = modifier.height(10.dp)) + + Text( + text = hint, + modifier = modifier.fillMaxWidth(), + textAlign = TextAlign.Center, + style = MaterialTheme.typography.bodyMedium, + color = MaterialTheme.colorScheme.onBackground + ) + + } + } +} + +@Preview(showBackground = true, showSystemUi = true) +@Composable +fun RetryPreview() { + RetryView(icon = Icons.Warning, errorMessage = "This is a error message") {} +} + +@Preview(showBackground = true, showSystemUi = true) +@Composable +fun AutoRetryPreview() { + AutoRetryView( + icon = Icons.Warning, errorMessage = "This is a error message", hint = "Go online to try again" + ) +} diff --git a/core/src/main/java/com/example/core/component/LoadingView.kt b/core/src/main/java/com/example/core/component/LoadingView.kt new file mode 100644 index 0000000..5fe8ca5 --- /dev/null +++ b/core/src/main/java/com/example/core/component/LoadingView.kt @@ -0,0 +1,33 @@ +package com.example.core.component + +import androidx.compose.foundation.background +import androidx.compose.material.CircularProgressIndicator +import androidx.compose.material3.MaterialTheme +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview + +/** + * @author yaya (@yahyalmh) + * @since 10th November 2022 + */ + +@Composable +fun LoadingView( + isLoading: Boolean, + modifier: Modifier = Modifier, +) { + if (isLoading) { + BaseCenterColumn( + modifier = modifier + .background(MaterialTheme.colorScheme.background) + ) + { CircularProgressIndicator(color = MaterialTheme.colorScheme.onBackground) } + } +} + +@Preview(showBackground = true) +@Composable +fun LoadingPreview() { + LoadingView(isLoading = true) +} diff --git a/core/src/main/java/com/example/core/component/bar/SearchBar.kt b/core/src/main/java/com/example/core/component/bar/SearchBar.kt new file mode 100644 index 0000000..22a73fb --- /dev/null +++ b/core/src/main/java/com/example/core/component/bar/SearchBar.kt @@ -0,0 +1,161 @@ +package com.example.core.component.bar + +import android.content.res.Configuration.UI_MODE_NIGHT_MASK +import android.content.res.Configuration.UI_MODE_NIGHT_YES +import androidx.compose.animation.AnimatedVisibility +import androidx.compose.animation.fadeIn +import androidx.compose.animation.fadeOut +import androidx.compose.foundation.background +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.* +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.text.BasicTextField +import androidx.compose.foundation.text.KeyboardActions +import androidx.compose.foundation.text.KeyboardOptions +import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.material3.TextButton +import androidx.compose.runtime.* +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.shadow +import androidx.compose.ui.focus.FocusRequester +import androidx.compose.ui.focus.focusRequester +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.platform.LocalFocusManager +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.input.ImeAction +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import androidx.compose.ui.zIndex +import com.example.core.R +import com.example.core.component.icon.Icons + +@Composable +fun SearchBar( + modifier: Modifier = Modifier, + onQueryChange: (query: String) -> Unit, + onCancelClick: () -> Unit +) { + val focusRequester = FocusRequester() + val focusManager = LocalFocusManager.current + var value by remember { mutableStateOf("") } + + Row( + modifier = modifier + .shadow( + elevation = 5.dp, + spotColor = MaterialTheme.colorScheme.onBackground + ) + .background(MaterialTheme.colorScheme.background) + .padding(3.dp) + .zIndex(1F), + horizontalArrangement = Arrangement.Center, + verticalAlignment = Alignment.CenterVertically, + ) { + Row( + modifier = Modifier + .weight(1f) + .padding(start = 4.dp) + .background( + MaterialTheme.colorScheme.secondary, + RoundedCornerShape(20) + ) + .padding(6.dp) + .shadow(elevation = (-5).dp) + .zIndex(-1f), + verticalAlignment = Alignment.CenterVertically + + ) { + Icon( + modifier = Modifier.size(20.dp), + imageVector = Icons.Search, + contentDescription = stringResource(id = R.string.search), + tint = MaterialTheme.colorScheme.onSecondary + ) + BasicTextField(modifier = Modifier + .focusRequester(focusRequester) + .weight(1f) + .padding(start = 2.dp) + .height(24.dp) + .background(color = Color.Transparent, shape = RoundedCornerShape(20)), + singleLine = true, + keyboardActions = KeyboardActions(onSearch = { focusManager.clearFocus() }), + keyboardOptions = KeyboardOptions.Default.copy(imeAction = ImeAction.Search), + cursorBrush = SolidColor(MaterialTheme.colorScheme.onSecondary), + value = value, + textStyle = MaterialTheme.typography.bodyLarge + .copy(color = MaterialTheme.colorScheme.onSecondary), + onValueChange = { + value = it + onQueryChange(it) + }, + decorationBox = { innerTextField -> + Row( + modifier = Modifier + .fillMaxWidth(), + verticalAlignment = Alignment.CenterVertically, + + ) { + AnimatedVisibility( + visible = value.isEmpty(), + enter = fadeIn(initialAlpha = 0.3f), + exit = fadeOut() + ) { + Text( + text = "Search Currencies", + style = MaterialTheme.typography.bodyLarge, + color = MaterialTheme.colorScheme.onSecondary, + ) + } + } + innerTextField() + } + ) + AnimatedVisibility( + visible = value.isNotEmpty(), + enter = fadeIn(initialAlpha = 0.3f), + exit = fadeOut() + ) { + Icon( + modifier = Modifier + .clickable { + value = "" + onQueryChange(value) + } + .size(20.dp), + imageVector = Icons.Close, + contentDescription = stringResource(id = R.string.search), + tint = MaterialTheme.colorScheme.onSecondary + ) + } + } + TextButton( + modifier = Modifier + .wrapContentSize() + .padding(start = 4.dp, end = 4.dp), + contentPadding = PaddingValues(4.dp), + onClick = onCancelClick + ) { + Text( + color = MaterialTheme.colorScheme.onSurface, + style = MaterialTheme.typography.bodyLarge, text = "Cancel" + ) + } + } + SideEffect { focusRequester.requestFocus() } +} + +@Preview(uiMode = UI_MODE_NIGHT_YES) +@Composable +fun SearchPreviewDark() { + SearchBar(onQueryChange = {}) {} +} + +@Preview(showBackground = true, showSystemUi = false, uiMode = UI_MODE_NIGHT_MASK) +@Composable +fun SearchPreviewLight() { + SearchBar(onQueryChange = {}) {} +} \ No newline at end of file diff --git a/core/src/main/java/com/example/core/component/bar/TopAppBar.kt b/core/src/main/java/com/example/core/component/bar/TopAppBar.kt new file mode 100644 index 0000000..5bc0c67 --- /dev/null +++ b/core/src/main/java/com/example/core/component/bar/TopAppBar.kt @@ -0,0 +1,140 @@ +package com.example.core.component.bar + +import android.R +import androidx.annotation.StringRes +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.Menu +import androidx.compose.material.icons.filled.Search +import androidx.compose.material3.* +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.shadow +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import androidx.compose.ui.zIndex + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun AppBar( + @StringRes titleRes: Int, + navigationIcon: ImageVector, + navigationIconContentDescription: String?, + actionIcon: ImageVector, + actionIconContentDescription: String?, + modifier: Modifier = Modifier, + colors: TopAppBarColors = TopAppBarDefaults.centerAlignedTopAppBarColors(), + onNavigationClick: () -> Unit = {}, + onActionClick: () -> Unit = {} +) { + CenterAlignedTopAppBar( + title = { Text(text = stringResource(id = titleRes)) }, + navigationIcon = { + IconButton(onClick = onNavigationClick) { + Icon( + imageVector = navigationIcon, + contentDescription = navigationIconContentDescription, + tint = MaterialTheme.colorScheme.onSurface + ) + } + }, + actions = { + IconButton(onClick = onActionClick) { + Icon( + imageVector = actionIcon, + contentDescription = actionIconContentDescription, + tint = MaterialTheme.colorScheme.onSurface + ) + } + }, + colors = colors, + modifier = modifier + .zIndex(1F) + .shadow( + elevation = 5.dp, + spotColor = MaterialTheme.colorScheme.onBackground + ) + ) +} + +/** + * Top app bar with action, displayed on the right + */ +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun AppBar( + @StringRes titleRes: Int, + modifier: Modifier = Modifier, + actionIcon: ImageVector? = null, + actionIconContentDescription: String? = null, + colors: TopAppBarColors = TopAppBarDefaults.centerAlignedTopAppBarColors(), + onActionClick: () -> Unit = {} +) { + CenterAlignedTopAppBar( + title = { Text(text = stringResource(id = titleRes)) }, + actions = { + if (actionIcon != null) { + IconButton(onClick = onActionClick) { + Icon( + imageVector = actionIcon, + contentDescription = actionIconContentDescription, + tint = MaterialTheme.colorScheme.onSurface + ) + } + } + }, + colors = colors, + modifier = modifier + .zIndex(1F) + .shadow( + elevation = 5.dp, + spotColor = MaterialTheme.colorScheme.onBackground + ), + ) +} + + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun AppBar( + @StringRes titleRes: Int, + navigationIcon: ImageVector, + navigationIconContentDescription: String?, + modifier: Modifier = Modifier, + colors: TopAppBarColors = TopAppBarDefaults.centerAlignedTopAppBarColors(), + onNavigationClick: () -> Unit = {} +) { + CenterAlignedTopAppBar( + title = { Text(text = stringResource(id = titleRes)) }, + navigationIcon = { + IconButton(onClick = onNavigationClick) { + Icon( + imageVector = navigationIcon, + contentDescription = navigationIconContentDescription, + tint = MaterialTheme.colorScheme.onSurface + ) + } + }, + colors = colors, + modifier = modifier + .zIndex(1F) + .shadow( + elevation = 5.dp, + spotColor = MaterialTheme.colorScheme.onBackground + ), + ) +} + +@OptIn(ExperimentalMaterial3Api::class) +@Preview("Top App Bar") +@Composable +fun TopAppBarPreview() { + AppBar( + titleRes = R.string.untitled, + navigationIcon = Icons.Default.Menu, + navigationIconContentDescription = "Navigation icon", + actionIcon = Icons.Default.Search, + actionIconContentDescription = "Action icon" + ) +} diff --git a/core/src/main/java/com/example/core/component/icon/Icons.kt b/core/src/main/java/com/example/core/component/icon/Icons.kt new file mode 100644 index 0000000..fe3d11c --- /dev/null +++ b/core/src/main/java/com/example/core/component/icon/Icons.kt @@ -0,0 +1,41 @@ +package com.example.core.component.icon + +import androidx.annotation.DrawableRes +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.Favorite +import androidx.compose.material.icons.filled.FavoriteBorder +import androidx.compose.material.icons.filled.MoreVert +import androidx.compose.material.icons.outlined.AccountCircle +import androidx.compose.material.icons.rounded.* +import androidx.compose.ui.graphics.vector.ImageVector + +/** + * Material icons are [ImageVector]s, custom icons are drawable resource IDs. + */ +object Icons { + val AccountCircle = Icons.Outlined.AccountCircle + val Add = Icons.Rounded.Add + val ArrowBack = Icons.Rounded.ArrowBack + val ArrowDropDown = Icons.Rounded.ArrowDropDown + val Check = Icons.Rounded.Check + val Close = Icons.Rounded.Close + val MoreVert = Icons.Default.MoreVert + val Person = Icons.Rounded.Person + val PlayArrow = Icons.Rounded.PlayArrow + val Search = Icons.Rounded.Search + val Menu = Icons.Rounded.Menu + val Settings = Icons.Rounded.Settings + val ThumbUp = Icons.Rounded.ThumbUp + val Face = Icons.Rounded.Face + val Warning = Icons.Rounded.Warning + val Favorite = Icons.Default.Favorite + val FavoriteBorder = Icons.Default.FavoriteBorder +} + +/** + * A sealed class to make dealing with [ImageVector] and [DrawableRes] icons easier. + */ +sealed class Icon { + data class ImageVectorIcon(val imageVector: ImageVector) : Icon() + data class DrawableResourceIcon(@DrawableRes val id: Int) : Icon() +} diff --git a/core/src/main/java/com/example/core/ext/FlowExt.kt b/core/src/main/java/com/example/core/ext/FlowExt.kt new file mode 100644 index 0000000..67e2495 --- /dev/null +++ b/core/src/main/java/com/example/core/ext/FlowExt.kt @@ -0,0 +1,46 @@ +package com.example.core.ext + +import kotlinx.coroutines.delay +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.flow +import kotlinx.coroutines.flow.retryWhen +import java.io.IOException + +/** + * @author yaya (@yahyalmh) + * @since 09th November 2022 + */ + +fun repeatFlow(interval: Long, block: suspend () -> T): Flow = + flow { + while (true) { + emit(block.invoke()) + delay(interval) + } + } + +fun Flow.retryWithPolicy( + retryPolicy: RetryPolicy = RetryPolicy.DefaultRetryPolicy, + retryHandler: () -> Unit +): Flow { + var currentDelay = retryPolicy.delayMillis + + return retryWhen { cause, attempt -> + retryHandler() + if (cause is IOException && attempt < retryPolicy.numRetries) { + delay(currentDelay) + currentDelay *= retryPolicy.delayFactor + return@retryWhen true + } else { + return@retryWhen false + } + } +} + +sealed class RetryPolicy( + val numRetries: Long, + val delayMillis: Long, + val delayFactor: Long +) { + object DefaultRetryPolicy : RetryPolicy(numRetries = 6, delayMillis = 1000, delayFactor = 1) +} \ No newline at end of file diff --git a/core/src/main/java/com/example/core/network/NetworkMonitor.kt b/core/src/main/java/com/example/core/network/NetworkMonitor.kt new file mode 100644 index 0000000..d0fafbe --- /dev/null +++ b/core/src/main/java/com/example/core/network/NetworkMonitor.kt @@ -0,0 +1,10 @@ +package com.example.core.network + +import kotlinx.coroutines.flow.Flow + +/** + * Utility for reporting app connectivity status + */ +interface NetworkMonitor { + val isOnline: Flow +} diff --git a/core/src/main/java/com/example/core/network/NetworkMonitorImpl.kt b/core/src/main/java/com/example/core/network/NetworkMonitorImpl.kt new file mode 100644 index 0000000..a463e86 --- /dev/null +++ b/core/src/main/java/com/example/core/network/NetworkMonitorImpl.kt @@ -0,0 +1,74 @@ +package com.example.core.network + +import android.content.Context +import android.net.ConnectivityManager +import android.net.ConnectivityManager.NetworkCallback +import android.net.Network +import android.net.NetworkCapabilities +import android.net.NetworkRequest.Builder +import android.os.Build.VERSION +import android.os.Build.VERSION_CODES +import androidx.core.content.getSystemService +import dagger.hilt.android.qualifiers.ApplicationContext +import kotlinx.coroutines.channels.awaitClose +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.callbackFlow +import kotlinx.coroutines.flow.conflate +import javax.inject.Inject + +class NetworkMonitorImpl @Inject constructor( + @ApplicationContext private val context: Context +) : NetworkMonitor { + override val isOnline: Flow = callbackFlow { + val connectivityManager = context.getSystemService() + + /** + * The callback's methods are invoked on changes to *any* network, not just the active + * network. So to check for network connectivity, one must query the active network of the + * ConnectivityManager. + */ + val callback = object : NetworkCallback() { + override fun onAvailable(network: Network) { + channel.trySend(connectivityManager.isCurrentlyConnected()) + } + + override fun onLost(network: Network) { + channel.trySend(connectivityManager.isCurrentlyConnected()) + } + + override fun onCapabilitiesChanged( + network: Network, + networkCapabilities: NetworkCapabilities + ) { + channel.trySend(connectivityManager.isCurrentlyConnected()) + } + } + + connectivityManager?.registerNetworkCallback( + Builder() + .addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET) + .build(), + callback + ) + + channel.trySend(connectivityManager.isCurrentlyConnected()) + + awaitClose { + connectivityManager?.unregisterNetworkCallback(callback) + } + } + .conflate() + + @Suppress("DEPRECATION") + private fun ConnectivityManager?.isCurrentlyConnected() = when (this) { + null -> false + else -> when { + VERSION.SDK_INT >= VERSION_CODES.M -> + activeNetwork + ?.let(::getNetworkCapabilities) + ?.hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET) + ?: false + else -> activeNetworkInfo?.isConnected ?: false + } + } +} diff --git a/core/src/main/java/com/example/core/network/di/NetworkMonitorModule.kt b/core/src/main/java/com/example/core/network/di/NetworkMonitorModule.kt new file mode 100644 index 0000000..3b8cb3f --- /dev/null +++ b/core/src/main/java/com/example/core/network/di/NetworkMonitorModule.kt @@ -0,0 +1,20 @@ +package com.example.core.network.di + +import com.example.core.network.NetworkMonitor +import com.example.core.network.NetworkMonitorImpl +import dagger.Binds +import dagger.Module +import dagger.hilt.InstallIn +import dagger.hilt.components.SingletonComponent + +/** + * @author yaya (@yahyalmh) + * @since 04th November 2022 + */ + +@Module +@InstallIn(SingletonComponent::class) +interface NetworkMonitorModule { + @Binds + fun bindNetworkMonitor(networkMonitor: NetworkMonitorImpl): NetworkMonitor +} \ No newline at end of file diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml new file mode 100644 index 0000000..df6393a --- /dev/null +++ b/core/src/main/res/values/strings.xml @@ -0,0 +1,9 @@ + + + Retry + Search + Menu + Empty Icon + Auto Retry Icon + Go online and try again + \ No newline at end of file diff --git a/core/src/test/java/com/example/core/ExampleUnitTest.kt b/core/src/test/java/com/example/core/ExampleUnitTest.kt new file mode 100644 index 0000000..d452e9d --- /dev/null +++ b/core/src/test/java/com/example/core/ExampleUnitTest.kt @@ -0,0 +1,16 @@ +package com.example.core + +import org.junit.Assert.assertEquals +import org.junit.Test + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file diff --git a/data/common/.gitignore b/data/common/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/data/common/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/data/common/build.gradle.kts b/data/common/build.gradle.kts new file mode 100644 index 0000000..10a61c7 --- /dev/null +++ b/data/common/build.gradle.kts @@ -0,0 +1,44 @@ +plugins { + id("com.android.library") + id("org.jetbrains.kotlin.android") + kotlin("kapt") + id("com.google.dagger.hilt.android") +} + +android { + namespace = "com.example.data.common" + compileSdk = AppConfig.compileSdk + + defaultConfig { + minSdk = AppConfig.minSdk + targetSdk = AppConfig.targetSdk + + testInstrumentationRunner = AppConfig.androidTestInstrumentation + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = "1.8" + } +} + +dependencies { + retrofit() + hilt() + junit() + room() +} \ No newline at end of file diff --git a/data/common/consumer-rules.pro b/data/common/consumer-rules.pro new file mode 100644 index 0000000..e69de29 diff --git a/data/common/proguard-rules.pro b/data/common/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/data/common/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/data/common/src/androidTest/java/com/example/common/ExampleInstrumentedTest.kt b/data/common/src/androidTest/java/com/example/common/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..45d3ec2 --- /dev/null +++ b/data/common/src/androidTest/java/com/example/common/ExampleInstrumentedTest.kt @@ -0,0 +1,22 @@ +package com.example.common + +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.platform.app.InstrumentationRegistry +import org.junit.Assert.* +import org.junit.Test +import org.junit.runner.RunWith + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.example.data.common.test", appContext.packageName) + } +} \ No newline at end of file diff --git a/data/common/src/main/AndroidManifest.xml b/data/common/src/main/AndroidManifest.xml new file mode 100644 index 0000000..44008a4 --- /dev/null +++ b/data/common/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/data/common/src/main/java/com/example/common/api/CoinCapRetrofit.kt b/data/common/src/main/java/com/example/common/api/CoinCapRetrofit.kt new file mode 100644 index 0000000..6766e87 --- /dev/null +++ b/data/common/src/main/java/com/example/common/api/CoinCapRetrofit.kt @@ -0,0 +1,17 @@ +package com.example.common.api + +import retrofit2.Retrofit +import javax.inject.Inject + +/** + * @author yaya (@yahyalmh) + * @since 25th November 2022 + */ + +class CoinCapRetrofit @Inject constructor(builder: Retrofit.Builder) : RetrofitBuilder { + companion object { + private const val COINCAP_BASE_URL = "https://api.coincap.io/" + } + + override val retrofit: Retrofit = builder.baseUrl(COINCAP_BASE_URL).build() +} \ No newline at end of file diff --git a/data/common/src/main/java/com/example/common/api/RetrofitBuilder.kt b/data/common/src/main/java/com/example/common/api/RetrofitBuilder.kt new file mode 100644 index 0000000..b7c45bb --- /dev/null +++ b/data/common/src/main/java/com/example/common/api/RetrofitBuilder.kt @@ -0,0 +1,15 @@ +package com.example.common.api + +import retrofit2.Retrofit + +/** + * @author yaya (@yahyalmh) + * @since 25th November 2022 + */ + +interface RetrofitBuilder { + + val retrofit: Retrofit + + fun create(service: Class): T = retrofit.create(service) +} \ No newline at end of file diff --git a/data/common/src/main/java/com/example/common/api/di/NetworkModule.kt b/data/common/src/main/java/com/example/common/api/di/NetworkModule.kt new file mode 100644 index 0000000..16076f5 --- /dev/null +++ b/data/common/src/main/java/com/example/common/api/di/NetworkModule.kt @@ -0,0 +1,52 @@ +package com.example.common.api.di + +import com.example.data.common.BuildConfig +import com.example.common.api.CoinCapRetrofit +import com.example.common.api.RetrofitBuilder +import com.jakewharton.retrofit2.adapter.kotlin.coroutines.CoroutineCallAdapterFactory +import dagger.Binds +import dagger.Module +import dagger.Provides +import dagger.hilt.InstallIn +import dagger.hilt.components.SingletonComponent +import okhttp3.OkHttpClient +import okhttp3.logging.HttpLoggingInterceptor +import retrofit2.Retrofit +import retrofit2.converter.gson.GsonConverterFactory +import java.util.concurrent.TimeUnit +import javax.inject.Singleton + +/** + * @author yaya (@yahyalmh) + * @since 04th November 2022 + */ + +@Module +@InstallIn(SingletonComponent::class) +interface NetworkModule { + @Binds + fun bindCoincapRetrofit(coincapRetrofit: CoinCapRetrofit): RetrofitBuilder + + companion object { + @Provides + fun provideHttpClient(): OkHttpClient = if (BuildConfig.DEBUG) { + val logging = HttpLoggingInterceptor() + logging.setLevel(HttpLoggingInterceptor.Level.BODY) + OkHttpClient.Builder() + .readTimeout(60, TimeUnit.SECONDS) + .writeTimeout(60, TimeUnit.SECONDS) + .addInterceptor(logging) + .build() + } else OkHttpClient.Builder().build() + + @Provides + @Singleton + fun provideBaseRetrofit( + httpClient: OkHttpClient, + ): Retrofit.Builder = Retrofit + .Builder() + .client(httpClient) + .addConverterFactory(GsonConverterFactory.create()) + .addCallAdapterFactory(CoroutineCallAdapterFactory()) + } +} \ No newline at end of file diff --git a/data/common/src/main/java/com/example/common/database/AppDatabase.kt b/data/common/src/main/java/com/example/common/database/AppDatabase.kt new file mode 100644 index 0000000..e8f48d7 --- /dev/null +++ b/data/common/src/main/java/com/example/common/database/AppDatabase.kt @@ -0,0 +1,10 @@ +package com.example.common.database + +import androidx.room.Database +import androidx.room.RoomDatabase + +@Database(version = 1, entities = [ExchangeRateEntity::class]) +abstract class AppDatabase: RoomDatabase() { + + abstract fun exchangeRateDao(): ExchangeRateDao +} \ No newline at end of file diff --git a/data/common/src/main/java/com/example/common/database/ExchangeRateDao.kt b/data/common/src/main/java/com/example/common/database/ExchangeRateDao.kt new file mode 100644 index 0000000..1c0110a --- /dev/null +++ b/data/common/src/main/java/com/example/common/database/ExchangeRateDao.kt @@ -0,0 +1,24 @@ +package com.example.common.database + +import androidx.room.Dao +import androidx.room.Delete +import androidx.room.Insert +import androidx.room.OnConflictStrategy.REPLACE +import androidx.room.Query +import kotlinx.coroutines.flow.Flow + +@Dao +interface ExchangeRateDao { + + @Query("SELECT * FROM favorite_rates order by symbol ASC") + fun getAll(): Flow> + + @Insert(onConflict = REPLACE) + suspend fun insertAll(rates: List) + + @Insert(onConflict = REPLACE) + suspend fun insert(rate: ExchangeRateEntity) + + @Delete + suspend fun delete(rate: ExchangeRateEntity) +} \ No newline at end of file diff --git a/data/common/src/main/java/com/example/common/database/ExchangeRateEntity.kt b/data/common/src/main/java/com/example/common/database/ExchangeRateEntity.kt new file mode 100644 index 0000000..c3cd579 --- /dev/null +++ b/data/common/src/main/java/com/example/common/database/ExchangeRateEntity.kt @@ -0,0 +1,10 @@ +package com.example.common.database + +import androidx.room.Entity +import androidx.room.PrimaryKey + +@Entity(tableName = "favorite_rates") +data class ExchangeRateEntity( + @PrimaryKey val id: String, + val symbol: String, +) \ No newline at end of file diff --git a/data/common/src/main/java/com/example/common/database/di/DatabaseModule.kt b/data/common/src/main/java/com/example/common/database/di/DatabaseModule.kt new file mode 100644 index 0000000..efadc41 --- /dev/null +++ b/data/common/src/main/java/com/example/common/database/di/DatabaseModule.kt @@ -0,0 +1,32 @@ +package com.example.common.database.di + +import android.content.Context +import androidx.room.Room +import com.example.common.database.AppDatabase +import dagger.Module +import dagger.Provides +import dagger.hilt.InstallIn +import dagger.hilt.android.qualifiers.ApplicationContext +import dagger.hilt.components.SingletonComponent +import javax.inject.Singleton + +@Module +@InstallIn(SingletonComponent::class) +class DatabaseModule { + + @Provides + @Singleton + fun provideExchangeRateDao(database: AppDatabase) = database.exchangeRateDao() + + @Provides + @Singleton + fun provideAppDatabase(@ApplicationContext context: Context) = Room.databaseBuilder( + context, + AppDatabase::class.java, + DATABASE_NAME + ).build() + + companion object { + const val DATABASE_NAME = "app_database" + } +} \ No newline at end of file diff --git a/data/common/src/main/java/com/example/common/model/ExchangeDetailRate.kt b/data/common/src/main/java/com/example/common/model/ExchangeDetailRate.kt new file mode 100644 index 0000000..9eff43e --- /dev/null +++ b/data/common/src/main/java/com/example/common/model/ExchangeDetailRate.kt @@ -0,0 +1,20 @@ +package com.example.common.model + +import java.math.BigDecimal + +data class ExchangeDetailRate( + val id: String, + val symbol: String, + val currencySymbol: String?, + val type: String, + val rateUsd: BigDecimal, + val timestamp: Long +) + +fun ExchangeDetailRate.toExchangeRate() = ExchangeRate( + id = id, + symbol = symbol, + currencySymbol = currencySymbol, + type = type, + rateUsd = rateUsd +) \ No newline at end of file diff --git a/data/common/src/main/java/com/example/common/model/ExchangeRate.kt b/data/common/src/main/java/com/example/common/model/ExchangeRate.kt new file mode 100644 index 0000000..88c6c8b --- /dev/null +++ b/data/common/src/main/java/com/example/common/model/ExchangeRate.kt @@ -0,0 +1,22 @@ +package com.example.common.model + +import com.example.common.database.ExchangeRateEntity +import java.math.BigDecimal + +/** + * @author yaya (@yahyalmh) + * @since 02th November 2022 + */ + +data class ExchangeRate( + val id: String, + val symbol: String, + val currencySymbol: String?, + val type: String, + val rateUsd: BigDecimal +) + +fun ExchangeRate.toEntity() = ExchangeRateEntity( + id = id, + symbol = symbol +) diff --git a/data/common/src/test/java/com/example/common/ExampleUnitTest.kt b/data/common/src/test/java/com/example/common/ExampleUnitTest.kt new file mode 100644 index 0000000..96cdc7b --- /dev/null +++ b/data/common/src/test/java/com/example/common/ExampleUnitTest.kt @@ -0,0 +1,16 @@ +package com.example.common + +import org.junit.Assert.assertEquals +import org.junit.Test + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file diff --git a/data/datastore/.gitignore b/data/datastore/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/data/datastore/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/data/datastore/build.gradle.kts b/data/datastore/build.gradle.kts new file mode 100644 index 0000000..ce3bb4a --- /dev/null +++ b/data/datastore/build.gradle.kts @@ -0,0 +1,41 @@ +plugins { + id("com.android.library") + id("org.jetbrains.kotlin.android") + kotlin("kapt") + id("com.google.dagger.hilt.android") +} +android { + namespace = "com.example.datastore" + compileSdk = AppConfig.compileSdk + + defaultConfig { + minSdk = AppConfig.minSdk + targetSdk = AppConfig.targetSdk + + testInstrumentationRunner = AppConfig.androidTestInstrumentation + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } +} + +dependencies { + coroutines() + hilt() + junit() + datastore() +} \ No newline at end of file diff --git a/data/datastore/consumer-rules.pro b/data/datastore/consumer-rules.pro new file mode 100644 index 0000000..e69de29 diff --git a/data/datastore/proguard-rules.pro b/data/datastore/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/data/datastore/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/data/datastore/src/androidTest/java/com/example/datastore/ExampleInstrumentedTest.kt b/data/datastore/src/androidTest/java/com/example/datastore/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..202cb87 --- /dev/null +++ b/data/datastore/src/androidTest/java/com/example/datastore/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.example.datastore + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.example.datastore.test", appContext.packageName) + } +} \ No newline at end of file diff --git a/data/datastore/src/main/AndroidManifest.xml b/data/datastore/src/main/AndroidManifest.xml new file mode 100644 index 0000000..a5918e6 --- /dev/null +++ b/data/datastore/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/data/datastore/src/main/java/com/example/datastore/DatastoreInteractor.kt b/data/datastore/src/main/java/com/example/datastore/DatastoreInteractor.kt new file mode 100644 index 0000000..efbb5f7 --- /dev/null +++ b/data/datastore/src/main/java/com/example/datastore/DatastoreInteractor.kt @@ -0,0 +1,22 @@ +package com.example.datastore + +import androidx.datastore.preferences.core.Preferences +import kotlinx.coroutines.flow.Flow +import javax.inject.Inject + +interface DatastoreInteractor { + fun getThemeType(): Flow + suspend fun setThemeType(themeType: String): Preferences +} + +class DatastoreInteractorImpl @Inject constructor( + private val repository: DatastoreRepository +) : + DatastoreInteractor { + + override fun getThemeType() = repository.getValue(PreferencesKeys.THEME_TYPE_KEY) + + override suspend fun setThemeType(themeType: String) = + repository.setValue(PreferencesKeys.THEME_TYPE_KEY, themeType) + +} \ No newline at end of file diff --git a/data/datastore/src/main/java/com/example/datastore/DatastoreRepository.kt b/data/datastore/src/main/java/com/example/datastore/DatastoreRepository.kt new file mode 100644 index 0000000..2ddbe7e --- /dev/null +++ b/data/datastore/src/main/java/com/example/datastore/DatastoreRepository.kt @@ -0,0 +1,24 @@ +package com.example.datastore + +import androidx.datastore.core.DataStore +import androidx.datastore.preferences.core.Preferences +import androidx.datastore.preferences.core.edit +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.map +import javax.inject.Inject + +interface DatastoreRepository { + fun getValue(key: Preferences.Key): Flow + suspend fun setValue(key: Preferences.Key, value: T): Preferences +} + +class DatastoreRepositoryImpl @Inject constructor( + private val dataStore: DataStore +) : DatastoreRepository { + + override fun getValue(key: Preferences.Key): Flow = dataStore.data + .map { preferences -> preferences[key] } + + override suspend fun setValue(key: Preferences.Key, value: T) = + dataStore.edit { preferences -> preferences[key] = value } +} \ No newline at end of file diff --git a/data/datastore/src/main/java/com/example/datastore/PreferencesKeys.kt b/data/datastore/src/main/java/com/example/datastore/PreferencesKeys.kt new file mode 100644 index 0000000..6513a33 --- /dev/null +++ b/data/datastore/src/main/java/com/example/datastore/PreferencesKeys.kt @@ -0,0 +1,10 @@ +package com.example.datastore + +import androidx.datastore.preferences.core.stringPreferencesKey + +object PreferencesKeys { + + const val PREFERENCES_FILE_NAME = "app_preferences_file" + val THEME_TYPE_KEY = stringPreferencesKey("theme_type") + +} \ No newline at end of file diff --git a/data/datastore/src/main/java/com/example/datastore/di/DataStoreModule.kt b/data/datastore/src/main/java/com/example/datastore/di/DataStoreModule.kt new file mode 100644 index 0000000..e9612b6 --- /dev/null +++ b/data/datastore/src/main/java/com/example/datastore/di/DataStoreModule.kt @@ -0,0 +1,51 @@ +package com.example.datastore.di + +import android.content.Context +import androidx.datastore.core.DataStore +import androidx.datastore.core.handlers.ReplaceFileCorruptionHandler +import androidx.datastore.preferences.SharedPreferencesMigration +import androidx.datastore.preferences.core.PreferenceDataStoreFactory +import androidx.datastore.preferences.core.Preferences +import androidx.datastore.preferences.core.emptyPreferences +import androidx.datastore.preferences.preferencesDataStoreFile +import com.example.datastore.* +import dagger.Binds +import dagger.Module +import dagger.Provides +import dagger.hilt.InstallIn +import dagger.hilt.android.qualifiers.ApplicationContext +import dagger.hilt.components.SingletonComponent +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.SupervisorJob +import javax.inject.Singleton + +@Module +@InstallIn(SingletonComponent::class) +interface DataStoreModule { + + companion object { + @Provides + @Singleton + fun provideDatastore( + @ApplicationContext appContext: Context, + ): DataStore { + val fileName: String = PreferencesKeys.PREFERENCES_FILE_NAME + + return PreferenceDataStoreFactory.create( + corruptionHandler = ReplaceFileCorruptionHandler( + produceNewData = { emptyPreferences() } + ), + migrations = listOf(SharedPreferencesMigration(appContext, fileName)), + scope = CoroutineScope(Dispatchers.IO + SupervisorJob()), + produceFile = { appContext.preferencesDataStoreFile(fileName) } + ) + } + } + + @Binds + fun bindDatastoreRepository(repository: DatastoreRepositoryImpl): DatastoreRepository + + @Binds + fun bindDatastoreInteractor(interactor: DatastoreInteractorImpl): DatastoreInteractor +} \ No newline at end of file diff --git a/data/datastore/src/test/java/com/example/datastore/ExampleUnitTest.kt b/data/datastore/src/test/java/com/example/datastore/ExampleUnitTest.kt new file mode 100644 index 0000000..0de8cb7 --- /dev/null +++ b/data/datastore/src/test/java/com/example/datastore/ExampleUnitTest.kt @@ -0,0 +1,17 @@ +package com.example.datastore + +import org.junit.Test + +import org.junit.Assert.* + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file diff --git a/data/exchangerate/.gitignore b/data/exchangerate/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/data/exchangerate/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/data/exchangerate/build.gradle.kts b/data/exchangerate/build.gradle.kts new file mode 100644 index 0000000..023ed80 --- /dev/null +++ b/data/exchangerate/build.gradle.kts @@ -0,0 +1,44 @@ +plugins { + id("com.android.library") + id("org.jetbrains.kotlin.android") + kotlin("kapt") + id("com.google.dagger.hilt.android") +} + +android { + namespace = "com.example.data.rate" + compileSdk = AppConfig.compileSdk + + defaultConfig { + minSdk = AppConfig.minSdk + targetSdk = AppConfig.targetSdk + + testInstrumentationRunner = AppConfig.androidTestInstrumentation + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } +} + +dependencies { + retrofit() + coroutines() + hilt() + junit() + implementation(project(":core")) + implementation(project(":data:common")) +} \ No newline at end of file diff --git a/data/exchangerate/consumer-rules.pro b/data/exchangerate/consumer-rules.pro new file mode 100644 index 0000000..e69de29 diff --git a/data/exchangerate/proguard-rules.pro b/data/exchangerate/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/data/exchangerate/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/data/exchangerate/src/androidTest/java/com/example/rate/ExampleInstrumentedTest.kt b/data/exchangerate/src/androidTest/java/com/example/rate/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..22678b6 --- /dev/null +++ b/data/exchangerate/src/androidTest/java/com/example/rate/ExampleInstrumentedTest.kt @@ -0,0 +1,22 @@ +package com.example.rate + +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.platform.app.InstrumentationRegistry +import org.junit.Assert.* +import org.junit.Test +import org.junit.runner.RunWith + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.example.data.rate.test", appContext.packageName) + } +} \ No newline at end of file diff --git a/data/exchangerate/src/main/AndroidManifest.xml b/data/exchangerate/src/main/AndroidManifest.xml new file mode 100644 index 0000000..a5918e6 --- /dev/null +++ b/data/exchangerate/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/data/exchangerate/src/main/java/com/example/rate/api/ExchangeRateApi.kt b/data/exchangerate/src/main/java/com/example/rate/api/ExchangeRateApi.kt new file mode 100644 index 0000000..6ff321c --- /dev/null +++ b/data/exchangerate/src/main/java/com/example/rate/api/ExchangeRateApi.kt @@ -0,0 +1,20 @@ +package com.example.rate.api + +import com.example.rate.model.ExchangeRateDetailModel +import com.example.rate.model.ExchangeRatesModel +import retrofit2.http.GET +import retrofit2.http.Path + +/** + * @author yaya (@yahyalmh) + * @since 02th November 2022 + */ + +interface ExchangeRateApi { + + @GET("v2/rates") + suspend fun getExchangeRates(): ExchangeRatesModel + + @GET("v2/rates/{id}") + suspend fun getExchangeRate(@Path("id") id: String): ExchangeRateDetailModel +} \ No newline at end of file diff --git a/data/exchangerate/src/main/java/com/example/rate/di/ExchangeRateModule.kt b/data/exchangerate/src/main/java/com/example/rate/di/ExchangeRateModule.kt new file mode 100644 index 0000000..4c9e309 --- /dev/null +++ b/data/exchangerate/src/main/java/com/example/rate/di/ExchangeRateModule.kt @@ -0,0 +1,37 @@ +package com.example.rate.di + +import com.example.common.api.CoinCapRetrofit +import com.example.rate.api.ExchangeRateApi +import com.example.rate.interactor.ExchangeRateInteractor +import com.example.rate.interactor.ExchangeRateInteractorImpl +import com.example.rate.repository.ExchangeRateRepository +import com.example.rate.repository.ExchangeRateRepositoryImpl +import dagger.Binds +import dagger.Module +import dagger.Provides +import dagger.hilt.InstallIn +import dagger.hilt.components.SingletonComponent +import javax.inject.Singleton + +/** + * @author yaya (@yahyalmh) + * @since 02th November 2022 + */ +@Module +@InstallIn(SingletonComponent::class) +interface ExchangeRateModule { + + companion object { + @Provides + @Singleton + fun provideExchangeRateApi(coinCapRetrofit: CoinCapRetrofit): ExchangeRateApi = + coinCapRetrofit.create(ExchangeRateApi::class.java) + } + + @Binds + @Singleton + fun bindExchangeRateRepository(repository: ExchangeRateRepositoryImpl): ExchangeRateRepository + + @Binds + fun bindExchangeInteractor(exchangeRateInteractor: ExchangeRateInteractorImpl): ExchangeRateInteractor +} \ No newline at end of file diff --git a/data/exchangerate/src/main/java/com/example/rate/interactor/ExchangeRateInteractor.kt b/data/exchangerate/src/main/java/com/example/rate/interactor/ExchangeRateInteractor.kt new file mode 100644 index 0000000..880545e --- /dev/null +++ b/data/exchangerate/src/main/java/com/example/rate/interactor/ExchangeRateInteractor.kt @@ -0,0 +1,16 @@ +package com.example.rate.interactor + +import com.example.common.model.ExchangeDetailRate +import com.example.common.model.ExchangeRate +import kotlinx.coroutines.flow.Flow + +/** + * @author yaya (@yahyalmh) + * @since 04th November 2022 + */ + +interface ExchangeRateInteractor { + fun getRates(): Flow> + fun getLiveRates(interval: Long): Flow> + fun getLiveRate(id: String, interval: Long = 3000L): Flow +} \ No newline at end of file diff --git a/data/exchangerate/src/main/java/com/example/rate/interactor/ExchangeRateInteractorImpl.kt b/data/exchangerate/src/main/java/com/example/rate/interactor/ExchangeRateInteractorImpl.kt new file mode 100644 index 0000000..aad5464 --- /dev/null +++ b/data/exchangerate/src/main/java/com/example/rate/interactor/ExchangeRateInteractorImpl.kt @@ -0,0 +1,33 @@ +package com.example.rate.interactor + +import com.example.common.model.ExchangeDetailRate +import com.example.core.ext.repeatFlow +import com.example.rate.model.toExternalModel +import com.example.rate.repository.ExchangeRateRepository +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.flow +import kotlinx.coroutines.flow.flowOn +import javax.inject.Inject + +/** + * @author yaya (@yahyalmh) + * @since 04th November 2022 + */ + +class ExchangeRateInteractorImpl @Inject constructor(private val exchangeRateRepository: ExchangeRateRepository) : + ExchangeRateInteractor { + + override fun getRates() = flow { emit(exchangeRates()) }.flowOn(Dispatchers.IO) + + override fun getLiveRates(interval: Long) = + repeatFlow(interval) { exchangeRates() }.flowOn(Dispatchers.IO) + + override fun getLiveRate(id: String, interval: Long): Flow = + repeatFlow(interval) { exchangeRateRepository.getExchangeRate(id).toExternalModel() } + .flowOn(Dispatchers.IO) + + private suspend fun exchangeRates() = exchangeRateRepository.getExchangeRates() + .rates.map { rate -> rate.toExternalModel() } + .sortedByDescending { it.symbol } +} \ No newline at end of file diff --git a/data/exchangerate/src/main/java/com/example/rate/model/ExchangeRateModel.kt b/data/exchangerate/src/main/java/com/example/rate/model/ExchangeRateModel.kt new file mode 100644 index 0000000..375fd7d --- /dev/null +++ b/data/exchangerate/src/main/java/com/example/rate/model/ExchangeRateModel.kt @@ -0,0 +1,47 @@ +package com.example.rate.model + +import com.example.common.model.ExchangeDetailRate +import com.example.common.model.ExchangeRate +import com.google.gson.annotations.SerializedName +import java.math.BigDecimal + +/** + * @author yaya (@yahyalmh) + * @since 02th November 2022 + */ + +data class ExchangeRateModel( + val id: String, + val symbol: String, + val currencySymbol: String?, + val type: String, + val rateUsd: String +) + +fun ExchangeRateModel.toExternalModel() = ExchangeRate( + id = id, + symbol = symbol, + currencySymbol = currencySymbol, + type = type, + rateUsd = BigDecimal(rateUsd) +) + +fun ExchangeRateDetailModel.toExternalModel() = ExchangeDetailRate( + id = rateDetail.id, + symbol = rateDetail.symbol, + currencySymbol = rateDetail.currencySymbol, + type = rateDetail.type, + rateUsd = BigDecimal(rateDetail.rateUsd), + timestamp = timestamp.toLong() +) + +data class ExchangeRatesModel( + @SerializedName("data") + val rates: List +) + +data class ExchangeRateDetailModel( + @SerializedName("data") + val rateDetail: ExchangeRateModel, + val timestamp: String +) \ No newline at end of file diff --git a/data/exchangerate/src/main/java/com/example/rate/repository/ExchangeRateRepository.kt b/data/exchangerate/src/main/java/com/example/rate/repository/ExchangeRateRepository.kt new file mode 100644 index 0000000..daf63d3 --- /dev/null +++ b/data/exchangerate/src/main/java/com/example/rate/repository/ExchangeRateRepository.kt @@ -0,0 +1,15 @@ +package com.example.rate.repository + +import com.example.rate.model.ExchangeRateDetailModel +import com.example.rate.model.ExchangeRatesModel + +/** + * @author yaya (@yahyalmh) + * @since 04th November 2022 + */ + +interface ExchangeRateRepository { + suspend fun getExchangeRates(): ExchangeRatesModel + + suspend fun getExchangeRate(id: String): ExchangeRateDetailModel +} \ No newline at end of file diff --git a/data/exchangerate/src/main/java/com/example/rate/repository/ExchangeRateRepositoryImpl.kt b/data/exchangerate/src/main/java/com/example/rate/repository/ExchangeRateRepositoryImpl.kt new file mode 100644 index 0000000..ab9a926 --- /dev/null +++ b/data/exchangerate/src/main/java/com/example/rate/repository/ExchangeRateRepositoryImpl.kt @@ -0,0 +1,21 @@ +package com.example.rate.repository + +import com.example.rate.api.ExchangeRateApi +import com.example.rate.model.ExchangeRateDetailModel +import com.example.rate.model.ExchangeRatesModel +import javax.inject.Inject + +/** + * @author yaya (@yahyalmh) + * @since 04th November 2022 + */ + +class ExchangeRateRepositoryImpl @Inject constructor(private val exchangeRateApi: ExchangeRateApi) : + ExchangeRateRepository { + + override suspend fun getExchangeRates(): ExchangeRatesModel = exchangeRateApi.getExchangeRates() + + override suspend fun getExchangeRate(id: String): ExchangeRateDetailModel { + return exchangeRateApi.getExchangeRate(id) + } +} diff --git a/data/exchangerate/src/test/java/com/example/rate/ExampleUnitTest.kt b/data/exchangerate/src/test/java/com/example/rate/ExampleUnitTest.kt new file mode 100644 index 0000000..6d3d2db --- /dev/null +++ b/data/exchangerate/src/test/java/com/example/rate/ExampleUnitTest.kt @@ -0,0 +1,16 @@ +package com.example.rate + +import org.junit.Assert.assertEquals +import org.junit.Test + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file diff --git a/data/favorite/.gitignore b/data/favorite/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/data/favorite/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/data/favorite/build.gradle.kts b/data/favorite/build.gradle.kts new file mode 100644 index 0000000..139885d --- /dev/null +++ b/data/favorite/build.gradle.kts @@ -0,0 +1,43 @@ +plugins { + id("com.android.library") + id("org.jetbrains.kotlin.android") + kotlin("kapt") + id("com.google.dagger.hilt.android") +} + +android { + namespace = "com.example.data.favorite" + compileSdk = AppConfig.compileSdk + + defaultConfig { + minSdk = AppConfig.minSdk + targetSdk = AppConfig.targetSdk + + testInstrumentationRunner = AppConfig.androidTestInstrumentation + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } +} + +dependencies { + coroutines() + hilt() + junit() + moduleDependency(":data:exchangerate") + moduleDependency(":data:common") +} \ No newline at end of file diff --git a/data/favorite/consumer-rules.pro b/data/favorite/consumer-rules.pro new file mode 100644 index 0000000..e69de29 diff --git a/data/favorite/proguard-rules.pro b/data/favorite/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/data/favorite/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/data/favorite/src/androidTest/java/com/example/favorite/ExampleInstrumentedTest.kt b/data/favorite/src/androidTest/java/com/example/favorite/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..0ccd38b --- /dev/null +++ b/data/favorite/src/androidTest/java/com/example/favorite/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.example.favorite + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.example.favorite.test", appContext.packageName) + } +} \ No newline at end of file diff --git a/data/favorite/src/main/AndroidManifest.xml b/data/favorite/src/main/AndroidManifest.xml new file mode 100644 index 0000000..a5918e6 --- /dev/null +++ b/data/favorite/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/data/favorite/src/main/java/com/example/favorite/FavoriteRatesInteractor.kt b/data/favorite/src/main/java/com/example/favorite/FavoriteRatesInteractor.kt new file mode 100644 index 0000000..7de4466 --- /dev/null +++ b/data/favorite/src/main/java/com/example/favorite/FavoriteRatesInteractor.kt @@ -0,0 +1,53 @@ +package com.example.favorite + +import com.example.common.database.ExchangeRateEntity +import com.example.common.model.ExchangeRate +import com.example.rate.interactor.ExchangeRateInteractor +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.combine +import javax.inject.Inject + +interface FavoriteRatesInteractor { + fun getLiveFavoriteRates(interval: Long = 4000L): Flow> + fun getFavoriteRates(): Flow> + fun getFavoriteRatesEntities(): Flow> + suspend fun addFavorite(rate: ExchangeRate) + suspend fun removeFavorite(rate: ExchangeRate) +} + +class FavoriteRatesInteractorImpl @Inject constructor( + private val favoriteRepository: FavoriteRepository, + private val rateInteractor: ExchangeRateInteractor, +) : FavoriteRatesInteractor { + + override fun getLiveFavoriteRates(interval: Long): Flow> { + return combine( + rateInteractor.getLiveRates(interval), + favoriteRepository.getFavoriteRates() + ) { rates, favoriteRates -> + rates.filter { rate -> + favoriteRates.any { it.id == rate.id && it.symbol == rate.symbol } + } + } + } + + + override fun getFavoriteRates(): Flow> { + return combine( + rateInteractor.getRates(), + favoriteRepository.getFavoriteRates() + ) { rates, favoriteRates -> + rates.filter { rate -> + favoriteRates.any { it.id == rate.id && it.symbol == rate.symbol } + } + } + } + + override fun getFavoriteRatesEntities(): Flow> = + favoriteRepository.getFavoriteRates() + + override suspend fun addFavorite(rate: ExchangeRate) = favoriteRepository.addFavorite(rate) + + override suspend fun removeFavorite(rate: ExchangeRate) = + favoriteRepository.removeFavorite(rate) +} \ No newline at end of file diff --git a/data/favorite/src/main/java/com/example/favorite/FavoriteRepository.kt b/data/favorite/src/main/java/com/example/favorite/FavoriteRepository.kt new file mode 100644 index 0000000..df9a32a --- /dev/null +++ b/data/favorite/src/main/java/com/example/favorite/FavoriteRepository.kt @@ -0,0 +1,29 @@ +package com.example.favorite; + +import com.example.common.database.ExchangeRateDao +import com.example.common.database.ExchangeRateEntity +import com.example.common.model.ExchangeRate +import com.example.common.model.toEntity +import kotlinx.coroutines.flow.Flow +import javax.inject.Inject + +interface FavoriteRepository { + suspend fun addFavorite(rate: ExchangeRate) + suspend fun removeFavorite(rate: ExchangeRate) + fun getFavoriteRates(): Flow> +} + +class FavoriteRepositoryImpl @Inject constructor( + private val exchangeRateDao: ExchangeRateDao +) : FavoriteRepository { + + override fun getFavoriteRates(): Flow> { + return exchangeRateDao.getAll() + } + + override suspend fun addFavorite(rate: ExchangeRate) = exchangeRateDao.insert(rate.toEntity()) + + override suspend fun removeFavorite(rate: ExchangeRate) = + exchangeRateDao.delete(rate.toEntity()) + +} diff --git a/data/favorite/src/main/java/com/example/favorite/di/FavoriteModule.kt b/data/favorite/src/main/java/com/example/favorite/di/FavoriteModule.kt new file mode 100644 index 0000000..6840b6e --- /dev/null +++ b/data/favorite/src/main/java/com/example/favorite/di/FavoriteModule.kt @@ -0,0 +1,21 @@ +package com.example.favorite.di + +import com.example.favorite.FavoriteRatesInteractor +import com.example.favorite.FavoriteRatesInteractorImpl +import com.example.favorite.FavoriteRepository +import com.example.favorite.FavoriteRepositoryImpl +import dagger.Binds +import dagger.Module +import dagger.hilt.InstallIn +import dagger.hilt.components.SingletonComponent + +@Module +@InstallIn(SingletonComponent::class) +interface FavoriteModule { + + @Binds + fun bindFavoriteRatesRepository(repository: FavoriteRepositoryImpl): FavoriteRepository + + @Binds + fun bindFavoriteRatesInteractor(favoriteRatesInteractor: FavoriteRatesInteractorImpl): FavoriteRatesInteractor +} \ No newline at end of file diff --git a/data/favorite/src/test/java/com/example/favorite/ExampleUnitTest.kt b/data/favorite/src/test/java/com/example/favorite/ExampleUnitTest.kt new file mode 100644 index 0000000..e5f6c3a --- /dev/null +++ b/data/favorite/src/test/java/com/example/favorite/ExampleUnitTest.kt @@ -0,0 +1,17 @@ +package com.example.favorite + +import org.junit.Test + +import org.junit.Assert.* + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..3c5031e --- /dev/null +++ b/gradle.properties @@ -0,0 +1,23 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Kotlin code style for this project: "official" or "obsolete": +kotlin.code.style=official +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.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rapper.properties new file mode 100644 index 0000000..7c2367c --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Fri Oct 28 17:11:42 CEST 2022 +distributionBase=GRADLE_USER_HOME +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionPath=wrapper/dists +zipStorePath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..4f906e0 --- /dev/null +++ b/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..ac1b06f --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..c028cb8 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,27 @@ +pluginManagement { + repositories { + gradlePluginPortal() + google() + mavenCentral() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} +rootProject.name = "ComposeApp" +include(":app") +include(":core") +include(":data:exchangerate") +include(":ui:home") +include(":ui:detail") +include(":data:common") +include(":ui:search") +include(":ui:common") +include(":data:datastore") +include(":ui:setting") +include(":ui:favorite") +include(":data:favorite") diff --git a/ui/common/.gitignore b/ui/common/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/ui/common/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/ui/common/build.gradle.kts b/ui/common/build.gradle.kts new file mode 100644 index 0000000..ae1294e --- /dev/null +++ b/ui/common/build.gradle.kts @@ -0,0 +1,45 @@ +plugins { + id("com.android.library") + id("org.jetbrains.kotlin.android") + kotlin("kapt") +} +android { + namespace = "com.example.common" + compileSdk = AppConfig.compileSdk + + defaultConfig { + minSdk = AppConfig.minSdk + targetSdk = AppConfig.targetSdk + + testInstrumentationRunner = AppConfig.androidTestInstrumentation + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } + buildFeatures { + compose = true + } + composeOptions { + kotlinCompilerExtensionVersion = Version.KOTLIN_COMPILER_EXTENSION_VERSION + } +} + +dependencies { + compose() + junit() + composeMaterial() +} \ No newline at end of file diff --git a/ui/common/consumer-rules.pro b/ui/common/consumer-rules.pro new file mode 100644 index 0000000..e69de29 diff --git a/ui/common/proguard-rules.pro b/ui/common/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/ui/common/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/ui/common/src/androidTest/java/com/example/common/ExampleInstrumentedTest.kt b/ui/common/src/androidTest/java/com/example/common/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..0886bf6 --- /dev/null +++ b/ui/common/src/androidTest/java/com/example/common/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.example.common + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.example.common.test", appContext.packageName) + } +} \ No newline at end of file diff --git a/ui/common/src/main/AndroidManifest.xml b/ui/common/src/main/AndroidManifest.xml new file mode 100644 index 0000000..a5918e6 --- /dev/null +++ b/ui/common/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ui/common/src/main/java/com/example/common/RateCell.kt b/ui/common/src/main/java/com/example/common/RateCell.kt new file mode 100644 index 0000000..89f8efa --- /dev/null +++ b/ui/common/src/main/java/com/example/common/RateCell.kt @@ -0,0 +1,130 @@ +package com.example.common + +import androidx.compose.foundation.background +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.* +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.material.Card +import androidx.compose.material.Text +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.FavoriteBorder +import androidx.compose.material3.* +import androidx.compose.runtime.Composable +import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp + +@Composable +fun RateCell( + rate: String, + symbol: String, + currencySymbol: String, + type: String, + onClick: () -> Unit, + modifier: Modifier = Modifier, + leadingIcon: @Composable (() -> Unit)? = null, +) { + Card(modifier = modifier + .clickable { onClick() } + .padding(8.dp)) + { Content(modifier, currencySymbol, rate, symbol, type, leadingIcon) } +} + +@Composable +private fun Content( + modifier: Modifier, + currencySymbol: String, + rate: String, + symbol: String, + type: String, + leadingIcon: @Composable (() -> Unit)? +) { + Row( + modifier = modifier + .background(MaterialTheme.colorScheme.secondaryContainer) + .padding(12.dp) + .wrapContentSize() + .fillMaxWidth(), + verticalAlignment = Alignment.CenterVertically + ) { + Box( + modifier = modifier + .size(68.dp) + .clip(CircleShape) + .background(MaterialTheme.colorScheme.onSecondaryContainer), + contentAlignment = Alignment.Center + ) { + Text( + textAlign = TextAlign.Center, + text = currencySymbol, + style = MaterialTheme.typography.headlineMedium, + fontWeight = FontWeight.Bold, + color = MaterialTheme.colorScheme.secondary + ) + } + Column(modifier = modifier.padding(12.dp)) { + Text( + text = rate, + style = MaterialTheme.typography.titleMedium, + fontWeight = FontWeight.Bold, + color = MaterialTheme.colorScheme.onSurfaceVariant + ) + + Spacer(modifier = modifier.height(10.dp)) + + Text( + text = symbol, + style = MaterialTheme.typography.titleSmall, + fontWeight = FontWeight.Bold, + color = MaterialTheme.colorScheme.onSurfaceVariant + ) + + Spacer(modifier = modifier.height(10.dp)) + + Text( + text = type, + style = MaterialTheme.typography.titleSmall, + fontWeight = FontWeight.ExtraBold, + color = MaterialTheme.colorScheme.onSurfaceVariant + ) + } + Spacer(modifier = Modifier.weight(1f)) + if (leadingIcon != null) { + Column( + modifier = Modifier.fillMaxHeight(), + verticalArrangement = Arrangement.Top, + horizontalAlignment = Alignment.CenterHorizontally + ) { + CompositionLocalProvider( + LocalContentColor provides Color.Red, content = leadingIcon + ) + } + } + } +} + +@OptIn(ExperimentalMaterial3Api::class) +@Preview(heightDp = 150) +@Composable +fun RateCellPreview() { + RateCell( + rate = "3.343234342", + symbol = "$$", + currencySymbol = "USD", + type = "Fiat", + onClick = {}, + leadingIcon = { + Icon( + Icons.Filled.FavoriteBorder, + contentDescription = "Check Icon", + Modifier.size(AssistChipDefaults.IconSize) + ) + } + ) +} diff --git a/ui/common/src/main/java/com/example/common/SharedState.kt b/ui/common/src/main/java/com/example/common/SharedState.kt new file mode 100644 index 0000000..f3c3561 --- /dev/null +++ b/ui/common/src/main/java/com/example/common/SharedState.kt @@ -0,0 +1,8 @@ +package com.example.common + +import kotlinx.coroutines.flow.MutableSharedFlow + +object SharedState { + val bottomBarVisible = MutableSharedFlow() + +} \ No newline at end of file diff --git a/ui/common/src/main/java/com/example/common/ThemeType.kt b/ui/common/src/main/java/com/example/common/ThemeType.kt new file mode 100644 index 0000000..b0823af --- /dev/null +++ b/ui/common/src/main/java/com/example/common/ThemeType.kt @@ -0,0 +1,12 @@ +package com.example.common + +enum class ThemeType { + LIGHT, DARK, SYSTEM +} + +fun String.toThemeType(): ThemeType { + val themeType = ThemeType.values().firstOrNull { this == it.name } + return themeType ?: throw UnknownThemeType("$this is unknown theme type") +} + +class UnknownThemeType(override val message: String): Exception() \ No newline at end of file diff --git a/ui/common/src/test/java/com/example/common/ExampleUnitTest.kt b/ui/common/src/test/java/com/example/common/ExampleUnitTest.kt new file mode 100644 index 0000000..6c9f3e0 --- /dev/null +++ b/ui/common/src/test/java/com/example/common/ExampleUnitTest.kt @@ -0,0 +1,17 @@ +package com.example.common + +import org.junit.Test + +import org.junit.Assert.* + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file diff --git a/ui/detail/.gitignore b/ui/detail/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/ui/detail/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/ui/detail/build.gradle.kts b/ui/detail/build.gradle.kts new file mode 100644 index 0000000..6bf8f26 --- /dev/null +++ b/ui/detail/build.gradle.kts @@ -0,0 +1,56 @@ +plugins { + id("com.android.library") + id("org.jetbrains.kotlin.android") + kotlin("kapt") + id("com.google.dagger.hilt.android") +} + +android { + namespace = "com.example.ui.detail" + compileSdk = AppConfig.compileSdk + + defaultConfig { + minSdk = AppConfig.minSdk + targetSdk = AppConfig.targetSdk + + testInstrumentationRunner = AppConfig.androidTestInstrumentation + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } + buildFeatures { + compose = true + } + composeOptions { + kotlinCompilerExtensionVersion = Version.KOTLIN_COMPILER_EXTENSION_VERSION + } +} + +dependencies { + compose() + composeNavigation() + composeViewmodel() + composeMaterial() + hilt() + junit() + + implementation(project(":data:exchangerate")) + implementation(project(":data:favorite")) + implementation(project(":data:common")) + implementation(project(":ui:common")) + implementation(project(":core")) +} \ No newline at end of file diff --git a/ui/detail/consumer-rules.pro b/ui/detail/consumer-rules.pro new file mode 100644 index 0000000..e69de29 diff --git a/ui/detail/proguard-rules.pro b/ui/detail/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/ui/detail/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/ui/detail/src/androidTest/java/com/example/detail/ExampleInstrumentedTest.kt b/ui/detail/src/androidTest/java/com/example/detail/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..0ab8ebe --- /dev/null +++ b/ui/detail/src/androidTest/java/com/example/detail/ExampleInstrumentedTest.kt @@ -0,0 +1,22 @@ +package com.example.detail + +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.platform.app.InstrumentationRegistry +import org.junit.Assert.* +import org.junit.Test +import org.junit.runner.RunWith + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.example.ui.detail.test", appContext.packageName) + } +} \ No newline at end of file diff --git a/ui/detail/src/main/AndroidManifest.xml b/ui/detail/src/main/AndroidManifest.xml new file mode 100644 index 0000000..a5918e6 --- /dev/null +++ b/ui/detail/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ui/detail/src/main/java/com/example/detail/DetailScreen.kt b/ui/detail/src/main/java/com/example/detail/DetailScreen.kt new file mode 100644 index 0000000..27f8833 --- /dev/null +++ b/ui/detail/src/main/java/com/example/detail/DetailScreen.kt @@ -0,0 +1,147 @@ +package com.example.detail + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.* +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.material.Scaffold +import androidx.compose.material.Text +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.TopAppBarDefaults +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.unit.dp +import androidx.hilt.navigation.compose.hiltViewModel +import androidx.navigation.NavController +import com.example.common.model.ExchangeDetailRate +import com.example.core.base.ReferenceDevices +import com.example.core.component.LoadingView +import com.example.core.component.RetryView +import com.example.core.component.bar.AppBar +import com.example.core.component.icon.Icons +import com.example.ui.detail.R + +/** + * @author yaya (@yahyalmh) + * @since 10th November 2022 + */ + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun DetailScreen( + modifier: Modifier = Modifier, + navController: NavController, + viewModel: DetailViewModel = hiltViewModel() +) { + val state = viewModel.state.value + Scaffold( + contentColor = MaterialTheme.colorScheme.surface, + topBar = { + AppBar( + titleRes = R.string.detail, + colors = TopAppBarDefaults.centerAlignedTopAppBarColors( + containerColor = MaterialTheme.colorScheme.background + ), + actionIcon = if (state.isFavorite) { + Icons.Favorite + } else { + Icons.FavoriteBorder + }, + onActionClick = {viewModel.onEvent(DetailUiEvent.OnFavorite(state.rate)) }, + actionIconContentDescription = stringResource(id = R.string.favoriteIcon), + navigationIcon = Icons.ArrowBack, + navigationIconContentDescription = "Back", + onNavigationClick = { + viewModel.onEvent(DetailUiEvent.NavigationBack) + navController.popBackStack() + } + ) + } + ) { padding -> + + LoadingView(isLoading = state.isLoading) + + RetryView( + isVisible = state.isError, + errorMessage = state.errorMsg, + icon = Icons.Warning + ) { viewModel.onEvent(DetailUiEvent.Retry) } + + ContentView(modifier.padding(padding), state) + } +} + +@Composable +private fun ContentView( + modifier: Modifier, + state: DetailUiState +) { + if (state is DetailUiState.Loaded) { + Column( + modifier = modifier + .background(MaterialTheme.colorScheme.background) + .fillMaxSize(), + verticalArrangement = Arrangement.Center, + horizontalAlignment = Alignment.CenterHorizontally + ) { + Box( + modifier = Modifier + .clip(CircleShape) + .size(150.dp) + .background(MaterialTheme.colorScheme.secondaryContainer) + .padding(vertical = 15.dp), + contentAlignment = Alignment.Center + ) { + Text(text = state.rate?.let { it.currencySymbol ?: it.symbol } ?: "", + style = MaterialTheme.typography.headlineLarge.copy(fontWeight = FontWeight.ExtraBold), + color = MaterialTheme.colorScheme.onSecondaryContainer) + } + state.rate?.run { + Text( + modifier = modifier.padding(top = 10.dp), + textAlign = TextAlign.Center, + text = "Rate Usd: ${rateUsd.toPlainString()}", + style = MaterialTheme.typography.headlineMedium.copy(fontWeight = FontWeight.ExtraBold), + color = MaterialTheme.colorScheme.onBackground, + ) + Text( + modifier = Modifier.padding(vertical = 20.dp), + text = "Symbol: $symbol", + style = MaterialTheme.typography.headlineMedium.copy(fontWeight = FontWeight.ExtraBold), + color = MaterialTheme.colorScheme.onBackground, + ) + Text( + modifier = Modifier.padding(bottom = 10.dp), + text = "Type: $type", + style = MaterialTheme.typography.headlineMedium.copy(fontWeight = FontWeight.ExtraBold), + color = MaterialTheme.colorScheme.onBackground, + ) + Text( + text = "TimeStamp: $timestamp", + style = MaterialTheme.typography.headlineMedium.copy(fontWeight = FontWeight.ExtraBold), + color = MaterialTheme.colorScheme.onBackground, + ) + } + } + } +} + +@Composable +@ReferenceDevices +fun ContentPreview() { + val rateDetail = ExchangeDetailRate( + "Id", + symbol = "$", + currencySymbol = "##", + type = "Fiat", + rateUsd = 0.16544654.toBigDecimal(), + timestamp = 1324654312 + ) + val state = DetailUiState.Loaded(rateDetail, true) + ContentView(modifier = Modifier, state = state) +} \ No newline at end of file diff --git a/ui/detail/src/main/java/com/example/detail/DetailViewModel.kt b/ui/detail/src/main/java/com/example/detail/DetailViewModel.kt new file mode 100644 index 0000000..ab413bd --- /dev/null +++ b/ui/detail/src/main/java/com/example/detail/DetailViewModel.kt @@ -0,0 +1,125 @@ +package com.example.detail + +import androidx.lifecycle.SavedStateHandle +import androidx.lifecycle.viewModelScope +import com.example.common.SharedState +import com.example.common.model.ExchangeDetailRate +import com.example.common.model.toExchangeRate +import com.example.core.base.BaseViewModel +import com.example.core.base.UIEvent +import com.example.core.base.UIState +import com.example.detail.nav.DetailArgs +import com.example.favorite.FavoriteRatesInteractor +import com.example.rate.interactor.ExchangeRateInteractor +import dagger.hilt.android.lifecycle.HiltViewModel +import kotlinx.coroutines.flow.catch +import kotlinx.coroutines.flow.combine +import kotlinx.coroutines.flow.firstOrNull +import kotlinx.coroutines.flow.launchIn +import kotlinx.coroutines.launch +import javax.inject.Inject + +/** + * @author yaya (@yahyalmh) + * @since 10th November 2022 + */ + +@HiltViewModel +class DetailViewModel @Inject constructor( + savedStateHandle: SavedStateHandle, + private val exchangeRateInteractor: ExchangeRateInteractor, + private val favoriteRatesInteractor: FavoriteRatesInteractor, +) : BaseViewModel(DetailUiState.Loading) { + private val detailArgs: DetailArgs = DetailArgs(savedStateHandle) + + init { + changeBottomBarVisibility(false) + fetchRate() + } + + private fun changeBottomBarVisibility(enabled: Boolean) { + viewModelScope.launch { + SharedState.bottomBarVisible.emit(enabled) + } + } + + private fun fetchRate() { + combine( + exchangeRateInteractor.getLiveRate(detailArgs.rateId), + favoriteRatesInteractor.getFavoriteRates() + ) { rate, favoritesRate -> + setState( + DetailUiState.Loaded( + rate = rate, + favoritesRate.any { it.id == rate.id }) + ) + } + .catch { e -> + handleError(e) + }.launchIn(viewModelScope) + } + + private fun handleError(e: Throwable) { + val errorMessage = e.message ?: "Error while fetching the exchange rate" + setState(DetailUiState.Error(errorMessage)) + } + + private fun handleFavorite(rate: ExchangeDetailRate?) { + viewModelScope.launch { + rate?.toExchangeRate()?.let { exchangeRate -> + val favoriteRates = favoriteRatesInteractor.getFavoriteRates().firstOrNull() + when { + favoriteRates.isNullOrEmpty() -> favoriteRatesInteractor.addFavorite( + exchangeRate + ) + else -> { + if (favoriteRates.any { it.id == exchangeRate.id }) { + favoriteRatesInteractor.removeFavorite(exchangeRate) + } else { + favoriteRatesInteractor.addFavorite(exchangeRate) + } + } + } + } + } + } + + override fun onEvent(event: DetailUiEvent) { + when (event) { + DetailUiEvent.Retry -> { + fetchRate() + setState(DetailUiState.Loading) + } + DetailUiEvent.NavigationBack -> changeBottomBarVisibility(true) + is DetailUiEvent.OnFavorite -> handleFavorite(event.rate) + + } + } +} + +sealed interface DetailUiEvent : UIEvent { + object Retry : DetailUiEvent + object NavigationBack : DetailUiEvent + class OnFavorite(val rate: ExchangeDetailRate?) : DetailUiEvent + +} + +sealed class DetailUiState( + val rate: ExchangeDetailRate? = null, + val isFavorite: Boolean = false, + val isLoading: Boolean = false, + val isError: Boolean = false, + val errorMsg: String = "", +) : UIState { + object Loading : DetailUiState(isLoading = true) + + class Error(errorMsg: String) : DetailUiState( + isError = true, + errorMsg = errorMsg + ) + + class Loaded(rate: ExchangeDetailRate, isFavorite: Boolean) : DetailUiState( + rate = rate, + isFavorite = isFavorite, + ) +} \ No newline at end of file diff --git a/ui/detail/src/main/java/com/example/detail/nav/DetailNav.kt b/ui/detail/src/main/java/com/example/detail/nav/DetailNav.kt new file mode 100644 index 0000000..34ac4d0 --- /dev/null +++ b/ui/detail/src/main/java/com/example/detail/nav/DetailNav.kt @@ -0,0 +1,29 @@ +package com.example.detail.nav + +import androidx.annotation.VisibleForTesting +import androidx.lifecycle.SavedStateHandle +import androidx.navigation.* +import androidx.navigation.compose.composable +import com.example.detail.DetailScreen + +const val detailRoute = "detail_route" + +@VisibleForTesting +internal const val rateIdArgKey = "rateId" + +internal class DetailArgs(savedStateHandle: SavedStateHandle) { + var rateId: String = savedStateHandle.get(rateIdArgKey).toString() +} + +fun NavController.navigateToDetail(rateId: String, navOptions: NavOptions? = null) { + this.navigate("$detailRoute/$rateId", navOptions) +} + +fun NavGraphBuilder.detailGraph(navController: NavHostController) { + composable( + route = "$detailRoute/{$rateIdArgKey}", + arguments = listOf(navArgument(rateIdArgKey) { type = NavType.StringType }) + ) { + DetailScreen(navController = navController) + } +} \ No newline at end of file diff --git a/ui/detail/src/main/res/values/strings.xml b/ui/detail/src/main/res/values/strings.xml new file mode 100644 index 0000000..a4a55e2 --- /dev/null +++ b/ui/detail/src/main/res/values/strings.xml @@ -0,0 +1,5 @@ + + + Detail + Favorite Icon + \ No newline at end of file diff --git a/ui/detail/src/test/java/com/example/detail/ExampleUnitTest.kt b/ui/detail/src/test/java/com/example/detail/ExampleUnitTest.kt new file mode 100644 index 0000000..b008de4 --- /dev/null +++ b/ui/detail/src/test/java/com/example/detail/ExampleUnitTest.kt @@ -0,0 +1,16 @@ +package com.example.detail + +import org.junit.Assert.assertEquals +import org.junit.Test + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file diff --git a/ui/favorite/.gitignore b/ui/favorite/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/ui/favorite/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/ui/favorite/build.gradle.kts b/ui/favorite/build.gradle.kts new file mode 100644 index 0000000..1ef3e03 --- /dev/null +++ b/ui/favorite/build.gradle.kts @@ -0,0 +1,53 @@ +plugins { + id("com.android.library") + id("org.jetbrains.kotlin.android") + kotlin("kapt") + id("com.google.dagger.hilt.android") +} +android { + namespace = "com.example.ui.favorite" + compileSdk = AppConfig.compileSdk + + defaultConfig { + minSdk = AppConfig.minSdk + targetSdk = AppConfig.targetSdk + + testInstrumentationRunner = AppConfig.androidTestInstrumentation + } + + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { jvmTarget = "1.8" } + + buildFeatures { compose = true } + composeOptions { kotlinCompilerExtensionVersion = Version.KOTLIN_COMPILER_EXTENSION_VERSION } +} + +dependencies { + + compose() + composeNavigation() + composeViewmodel() + composeMaterial() + hilt() + junit() + + implementation(project(":data:favorite")) + implementation(project(":ui:detail")) + implementation(project(":ui:common")) + implementation(project(":data:common")) + implementation(project(":core")) + +} \ No newline at end of file diff --git a/ui/favorite/consumer-rules.pro b/ui/favorite/consumer-rules.pro new file mode 100644 index 0000000..e69de29 diff --git a/ui/favorite/proguard-rules.pro b/ui/favorite/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/ui/favorite/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/ui/favorite/src/androidTest/java/com/example/favorite/ExampleInstrumentedTest.kt b/ui/favorite/src/androidTest/java/com/example/favorite/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..0ccd38b --- /dev/null +++ b/ui/favorite/src/androidTest/java/com/example/favorite/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.example.favorite + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.example.favorite.test", appContext.packageName) + } +} \ No newline at end of file diff --git a/ui/favorite/src/main/AndroidManifest.xml b/ui/favorite/src/main/AndroidManifest.xml new file mode 100644 index 0000000..a5918e6 --- /dev/null +++ b/ui/favorite/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ui/favorite/src/main/java/com/example/favorite/FavoriteScreen.kt b/ui/favorite/src/main/java/com/example/favorite/FavoriteScreen.kt new file mode 100644 index 0000000..61a8d1b --- /dev/null +++ b/ui/favorite/src/main/java/com/example/favorite/FavoriteScreen.kt @@ -0,0 +1,101 @@ +package com.example.favorite + +import androidx.compose.foundation.background +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.material3.* +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.hilt.navigation.compose.hiltViewModel +import androidx.navigation.NavController +import com.example.common.RateCell +import com.example.core.component.* +import com.example.ui.favorite.R +import com.example.common.model.ExchangeRate +import com.example.core.component.bar.AppBar +import com.example.core.component.icon.Icons +import com.example.detail.nav.navigateToDetail + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun FavoriteScreen( + navController: NavController, + viewModel: FavoriteViewModel = hiltViewModel() +) { + val uiState = viewModel.state.value + androidx.compose.material.Scaffold( + contentColor = androidx.compose.material.MaterialTheme.colors.onBackground, + topBar = { + AppBar( + titleRes = R.string.favorite, + colors = TopAppBarDefaults.centerAlignedTopAppBarColors( + containerColor = MaterialTheme.colorScheme.background + ), + ) + } + ) { padding -> + + LoadingView(isLoading = uiState.isLoading) + + EmptyView( + modifier = Modifier, isVisible = uiState.isEmpty, + icon = Icons.Face, + message = stringResource(id = R.string.noFavoriteItemFound) + ) + + RetryView( + isVisible = uiState.isRetry, + errorMessage = uiState.retryMsg, + icon = Icons.Warning + ) { + viewModel.onEvent(FavoriteUiEvent.Retry) + } + + AutoRetryView( + isVisible = uiState.isAutoRetry, + errorMessage = uiState.retryMsg, + icon = Icons.Warning, + hint = stringResource(id = R.string.autoRetryHint) + ) + + ContentView( + isVisible = uiState is FavoriteUiState.Loaded, + modifier = Modifier.padding(padding), + rates = uiState.rates, + navigateToDetail = { rateId -> navController.navigateToDetail(rateId) }, + onFavoriteClick = { rate -> viewModel.onEvent(FavoriteUiEvent.OnFavorite(rate)) } + ) + } +} + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun ContentView( + modifier: Modifier = Modifier, + isVisible: Boolean, + rates: List, + navigateToDetail: (id: String) -> Unit, + onFavoriteClick: (rate: ExchangeRate) -> Unit +) { + BaseLazyColumn(isVisible = isVisible, items = rates, modifier = modifier.background(MaterialTheme.colorScheme.surface)) { rate -> + RateCell( + rate = rate.rateUsd.toString(), + symbol = rate.symbol, + currencySymbol = rate.currencySymbol ?: rate.symbol, + type = rate.type, + onClick = { navigateToDetail(rate.id) }, + leadingIcon = { + Icon( + modifier = Modifier + .size(AssistChipDefaults.IconSize) + .clickable { onFavoriteClick(rate) }, + imageVector = Icons.Favorite, + contentDescription = "Like Icon", + ) + } + ) + } + +} \ No newline at end of file diff --git a/ui/favorite/src/main/java/com/example/favorite/FavoriteViewModel.kt b/ui/favorite/src/main/java/com/example/favorite/FavoriteViewModel.kt new file mode 100644 index 0000000..61ce535 --- /dev/null +++ b/ui/favorite/src/main/java/com/example/favorite/FavoriteViewModel.kt @@ -0,0 +1,101 @@ +package com.example.favorite + +import androidx.lifecycle.viewModelScope +import com.example.common.model.ExchangeRate +import com.example.core.base.BaseViewModel +import com.example.core.base.UIEvent +import com.example.core.base.UIState +import com.example.core.ext.retryWithPolicy +import dagger.hilt.android.lifecycle.HiltViewModel +import kotlinx.coroutines.flow.catch +import kotlinx.coroutines.flow.firstOrNull +import kotlinx.coroutines.flow.launchIn +import kotlinx.coroutines.flow.onEach +import kotlinx.coroutines.launch +import javax.inject.Inject + +@HiltViewModel +class FavoriteViewModel @Inject constructor( + private val favoriteRatesInteractor: FavoriteRatesInteractor +) : BaseViewModel(FavoriteUiState.Loading) { + init { + fetchFavorite() + } + + private fun fetchFavorite() { + viewModelScope.launch { + favoriteRatesInteractor.getLiveFavoriteRates() + .retryWithPolicy { handleRetry() } + .catch { e -> handleError(e) } + .onEach {result -> + when { + result.isEmpty() -> setState(FavoriteUiState.Empty()) + else -> setState(FavoriteUiState.Loaded(rates = result)) + } + }.launchIn(viewModelScope) + } + } + + private fun handleFavorite(rate: ExchangeRate) { + viewModelScope.launch { + val favoriteRates = favoriteRatesInteractor.getFavoriteRates().firstOrNull() + if (favoriteRates.isNullOrEmpty()){ + favoriteRatesInteractor.addFavorite(rate) + }else{ + if (favoriteRates.any { it.id == rate.id }){ + favoriteRatesInteractor.removeFavorite(rate) + }else{ + favoriteRatesInteractor.addFavorite(rate) + } + } + } + } + + + private fun handleError(e: Throwable) { + val errorMessage = e.message ?: "Error while fetching the exchange rates" + setState(FavoriteUiState.Retry(retryMsg = errorMessage)) + } + + private fun handleRetry() { + val retryMsg = "Loading data is failed" + setState(FavoriteUiState.AutoRetry(retryMsg)) + } + + override fun onEvent(event: FavoriteUiEvent) { + when (event) { + FavoriteUiEvent.Retry -> { + fetchFavorite() + setState(FavoriteUiState.Loading) + } + is FavoriteUiEvent.OnFavorite -> handleFavorite(event.rate) + } + } +} + +sealed interface FavoriteUiEvent : UIEvent { + object Retry : FavoriteUiEvent + class OnFavorite(val rate: ExchangeRate) : FavoriteUiEvent +} + +sealed class FavoriteUiState( + val isLoading: Boolean = false, + val rates: List = emptyList(), + val isRetry: Boolean = false, + val retryMsg: String = "", + val isAutoRetry: Boolean = false, + val autoRetryMsg: String = "", + val isEmpty: Boolean = false +) : UIState { + + object Loading : FavoriteUiState(isLoading = true) + + class Retry(retryMsg: String) : FavoriteUiState(isRetry = true, retryMsg = retryMsg) + + class AutoRetry(autoRetryMsg: String) : FavoriteUiState(isAutoRetry = true, retryMsg = autoRetryMsg) + + class Loaded(rates: List) : FavoriteUiState(rates = rates) + + class Empty(query: String = "") : FavoriteUiState(isEmpty = true) + +} diff --git a/ui/favorite/src/main/java/com/example/favorite/nav/FavoriteNav.kt b/ui/favorite/src/main/java/com/example/favorite/nav/FavoriteNav.kt new file mode 100644 index 0000000..f17eea7 --- /dev/null +++ b/ui/favorite/src/main/java/com/example/favorite/nav/FavoriteNav.kt @@ -0,0 +1,20 @@ +package com.example.favorite.nav + +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.NavHostController +import androidx.navigation.NavOptions +import androidx.navigation.compose.composable +import com.example.favorite.FavoriteScreen + +const val favoriteRoute = "favorite_route" + +fun NavController.navigateToFavorite(navOptions: NavOptions? = null) { + this.navigate(favoriteRoute, navOptions) +} + +fun NavGraphBuilder.favoriteGraph(navController: NavHostController) { + composable(route = favoriteRoute) { + FavoriteScreen(navController = navController) + } +} \ No newline at end of file diff --git a/ui/favorite/src/main/res/values/strings.xml b/ui/favorite/src/main/res/values/strings.xml new file mode 100644 index 0000000..9368911 --- /dev/null +++ b/ui/favorite/src/main/res/values/strings.xml @@ -0,0 +1,6 @@ + + + Favorite + Go online to try again + No Favorite Item was found! + \ No newline at end of file diff --git a/ui/favorite/src/test/java/com/example/favorite/ExampleUnitTest.kt b/ui/favorite/src/test/java/com/example/favorite/ExampleUnitTest.kt new file mode 100644 index 0000000..e5f6c3a --- /dev/null +++ b/ui/favorite/src/test/java/com/example/favorite/ExampleUnitTest.kt @@ -0,0 +1,17 @@ +package com.example.favorite + +import org.junit.Test + +import org.junit.Assert.* + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file diff --git a/ui/home/.gitignore b/ui/home/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/ui/home/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/ui/home/build.gradle.kts b/ui/home/build.gradle.kts new file mode 100644 index 0000000..ae40be5 --- /dev/null +++ b/ui/home/build.gradle.kts @@ -0,0 +1,60 @@ +plugins { + id("com.android.library") + id("org.jetbrains.kotlin.android") + kotlin("kapt") + id("com.google.dagger.hilt.android") +} + +android { + namespace = "com.example.ui.home" + compileSdk = AppConfig.compileSdk + + defaultConfig { + minSdk = AppConfig.minSdk + targetSdk = AppConfig.targetSdk + + testInstrumentationRunner = AppConfig.androidTestInstrumentation + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } + buildFeatures { + compose = true + } + composeOptions { + kotlinCompilerExtensionVersion = Version.KOTLIN_COMPILER_EXTENSION_VERSION + } +} + +dependencies { + compose() + composeNavigation() + composeViewmodel() + composeMaterial() + junit() + + composeConstraintlayout() + hilt() + + implementation(project(":data:exchangerate")) + implementation(project(":data:common")) + implementation(project(":data:favorite")) + implementation(project(":core")) + implementation(project(":ui:detail")) + implementation(project(":ui:search")) + moduleDependency(":ui:common") +} \ No newline at end of file diff --git a/ui/home/consumer-rules.pro b/ui/home/consumer-rules.pro new file mode 100644 index 0000000..e69de29 diff --git a/ui/home/proguard-rules.pro b/ui/home/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/ui/home/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/ui/home/src/androidTest/java/com/example/home/ExampleInstrumentedTest.kt b/ui/home/src/androidTest/java/com/example/home/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..63d01a0 --- /dev/null +++ b/ui/home/src/androidTest/java/com/example/home/ExampleInstrumentedTest.kt @@ -0,0 +1,22 @@ +package com.example.home + +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.platform.app.InstrumentationRegistry +import org.junit.Assert.* +import org.junit.Test +import org.junit.runner.RunWith + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.example.home.test", appContext.packageName) + } +} \ No newline at end of file diff --git a/ui/home/src/main/AndroidManifest.xml b/ui/home/src/main/AndroidManifest.xml new file mode 100644 index 0000000..a5918e6 --- /dev/null +++ b/ui/home/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ui/home/src/main/java/com/example/home/HomeScreen.kt b/ui/home/src/main/java/com/example/home/HomeScreen.kt new file mode 100644 index 0000000..b79e0f6 --- /dev/null +++ b/ui/home/src/main/java/com/example/home/HomeScreen.kt @@ -0,0 +1,167 @@ +package com.example.home + +import androidx.compose.foundation.background +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.material.icons.filled.* +import androidx.compose.material3.* +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.shadow +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp +import androidx.compose.ui.zIndex +import androidx.hilt.navigation.compose.hiltViewModel +import androidx.navigation.NavHostController +import com.example.common.RateCell +import com.example.common.database.ExchangeRateEntity +import com.example.common.model.ExchangeRate +import com.example.core.base.ReferenceDevices +import com.example.core.component.AutoRetryView +import com.example.core.component.BaseLazyColumn +import com.example.core.component.LoadingView +import com.example.core.component.RetryView +import com.example.core.component.bar.AppBar +import com.example.core.component.icon.Icons +import com.example.detail.nav.navigateToDetail +import com.example.search.nav.navigateToSearch +import com.example.ui.home.R +import com.example.core.R.string as coreR + + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun HomeScreen( + navController: NavHostController, + modifier: Modifier = Modifier, + viewModel: HomeViewModel = hiltViewModel(), +) { + Scaffold( + containerColor = MaterialTheme.colorScheme.surface, + topBar = { + AppBar( + titleRes = R.string.home, + modifier = Modifier + .zIndex(1F) + .shadow( + elevation = 5.dp, + spotColor = MaterialTheme.colorScheme.onBackground + ), + colors = TopAppBarDefaults.centerAlignedTopAppBarColors( + containerColor = MaterialTheme.colorScheme.background + ), + navigationIcon = Icons.Menu, + navigationIconContentDescription = stringResource(id = coreR.menu), + actionIcon = Icons.Search, + actionIconContentDescription = stringResource(id = R.string.searchIcon), + onActionClick = { navController.navigateToSearch() } + ) + } + ) { padding -> + val uiState = viewModel.state.value + + LoadingView(isLoading = uiState.isLoading) + + RetryView( + isVisible = uiState.isRetry, + errorMessage = uiState.retryMsg, + icon = Icons.Warning + ) { + viewModel.onEvent(HomeUiEvent.Retry) + } + + AutoRetryView( + isVisible = uiState.isAutoRetry, + errorMessage = uiState.retryMsg, + icon = Icons.Warning, + hint = stringResource(id = coreR.autoRetryHint) + ) + + ContentView( + isVisible = uiState is HomeUiState.Loaded, + modifier = modifier + .padding(padding), + rates = uiState.rates, + favoritesRates = uiState.favoriteRates, + navigateToDetail = { rateId -> navController.navigateToDetail(rateId) } + ) { rate -> viewModel.onEvent(HomeUiEvent.OnFavorite(rate)) } + } +} + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +private fun ContentView( + modifier: Modifier, + isVisible: Boolean, + rates: List, + favoritesRates: List, + navigateToDetail: (id: String) -> Unit, + onFavoriteClick: (rate: ExchangeRate) -> Unit +) { + BaseLazyColumn( + isVisible = isVisible, items = rates, + modifier = modifier.background(MaterialTheme.colorScheme.surface) + ) { rate -> + val leadingIcon = if (favoritesRates.any { it.id == rate.id && it.symbol == rate.symbol }) { + Icons.Favorite + } else { + Icons.FavoriteBorder + } + RateCell( + rate = rate.rateUsd.toString(), + symbol = rate.symbol, + currencySymbol = rate.currencySymbol ?: rate.symbol, + type = rate.type, + leadingIcon = { + Icon( + modifier = Modifier + .size(AssistChipDefaults.IconSize) + .clickable { onFavoriteClick(rate) }, + imageVector = leadingIcon, + contentDescription = "Like Icon", + ) + }, + onClick = { navigateToDetail(rate.id) } + ) + } +} + +@Composable +@ReferenceDevices +fun ContentPreview() = ContentView( + modifier = Modifier, + rates = ratesStub(), + favoritesRates = ratesStub(10), + isVisible = true, + navigateToDetail = {} +) {} + +@Composable +private fun ratesStub(count: Int = 20): MutableList { + val rates = mutableListOf() + repeat(count) { rates.add(rateStub()) } + return rates +} + +@Composable +private fun favoriteRatesStub(count: Int = 10): MutableList { + val rates = mutableListOf() + repeat(count) { rates.add(favoriteRateStub()) } + return rates +} + +@Composable +internal fun rateStub(): ExchangeRate = ExchangeRate( + id = "1", + symbol = "$", + currencySymbol = "USD", + type = "fiat", + rateUsd = 0.165451654889.toBigDecimal() +) + +@Composable +internal fun favoriteRateStub() = ExchangeRateEntity( + id = "1", + symbol = "$", +) \ No newline at end of file diff --git a/ui/home/src/main/java/com/example/home/HomeViewModel.kt b/ui/home/src/main/java/com/example/home/HomeViewModel.kt new file mode 100644 index 0000000..868fa69 --- /dev/null +++ b/ui/home/src/main/java/com/example/home/HomeViewModel.kt @@ -0,0 +1,107 @@ +package com.example.home + +import androidx.lifecycle.viewModelScope +import com.example.common.model.ExchangeRate +import com.example.core.base.BaseViewModel +import com.example.core.base.UIEvent +import com.example.core.base.UIState +import com.example.core.ext.retryWithPolicy +import com.example.favorite.FavoriteRatesInteractor +import com.example.home.util.Constant +import com.example.rate.interactor.ExchangeRateInteractor +import dagger.hilt.android.lifecycle.HiltViewModel +import kotlinx.coroutines.flow.catch +import kotlinx.coroutines.flow.combine +import kotlinx.coroutines.flow.firstOrNull +import kotlinx.coroutines.flow.launchIn +import kotlinx.coroutines.launch +import javax.inject.Inject + +/** + * @author yaya (@yahyalmh) + * @since 05th November 2022 + */ + +@HiltViewModel +class HomeViewModel @Inject constructor( + private val exchangeRateInteractor: ExchangeRateInteractor, + private val favoriteRatesInteractor: FavoriteRatesInteractor +) : BaseViewModel(HomeUiState.Loading) { + + init { + fetchRates() + } + + private fun fetchRates() { + viewModelScope.launch { + combine( + exchangeRateInteractor.getLiveRates(Constant.liveRateFetchInterval), + favoriteRatesInteractor.getFavoriteRates() + ) { rates, favoriteRates -> + setState(HomeUiState.Loaded(rates = rates, favoriteRates = favoriteRates)) + } + .retryWithPolicy { handleRetry() } + .catch { e -> handleError(e) } + .launchIn(viewModelScope) + } + } + + private fun handleFavorite(rate: ExchangeRate) { + viewModelScope.launch { + val favoriteRates = favoriteRatesInteractor.getFavoriteRates().firstOrNull() + if (favoriteRates.isNullOrEmpty()) { + favoriteRatesInteractor.addFavorite(rate) + } else { + if (favoriteRates.any { it.id == rate.id }) { + favoriteRatesInteractor.removeFavorite(rate) + } else { + favoriteRatesInteractor.addFavorite(rate) + } + } + } + } + + private fun handleError(e: Throwable) { + val errorMessage = e.message ?: "Error while fetching the exchange rates" + setState(HomeUiState.Retry(retryMsg = errorMessage)) + } + + private fun handleRetry() { + val retryMsg = "Loading data is failed" + setState(HomeUiState.AutoRetry(retryMsg)) + } + + override fun onEvent(event: HomeUiEvent) { + when (event) { + HomeUiEvent.Retry -> { + fetchRates() + setState(HomeUiState.Loading) + } + is HomeUiEvent.OnFavorite -> handleFavorite(event.rate) + } + } +} + +sealed class HomeUiState( + val rates: List = emptyList(), + val favoriteRates: List = emptyList(), + val isLoading: Boolean = false, + val isRetry: Boolean = false, + val retryMsg: String = "", + val isAutoRetry: Boolean = false, + val autoRetryMsg: String = "", +) : UIState { + object Loading : HomeUiState(isLoading = true) + + class Retry(retryMsg: String) : HomeUiState(isRetry = true, retryMsg = retryMsg) + + class AutoRetry(autoRetryMsg: String) : HomeUiState(isAutoRetry = true, retryMsg = autoRetryMsg) + + class Loaded(rates: List, favoriteRates: List) : + HomeUiState(rates = rates, favoriteRates = favoriteRates) +} + +sealed interface HomeUiEvent : UIEvent { + object Retry : HomeUiEvent + class OnFavorite(val rate: ExchangeRate) : HomeUiEvent +} \ No newline at end of file diff --git a/ui/home/src/main/java/com/example/home/nav/HomeNavigation.kt b/ui/home/src/main/java/com/example/home/nav/HomeNavigation.kt new file mode 100644 index 0000000..81ce103 --- /dev/null +++ b/ui/home/src/main/java/com/example/home/nav/HomeNavigation.kt @@ -0,0 +1,26 @@ +package com.example.home.nav + +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.NavHostController +import androidx.navigation.NavOptions +import androidx.navigation.compose.composable +import com.example.home.HomeScreen + +/** + * @author yaya (@yahyalmh) + * @since 05th November 2022 + */ + + +const val homeRoute = "home_route" + +fun NavController.navigateToHome(navOptions: NavOptions? = null) { + this.navigate(homeRoute, navOptions) +} + +fun NavGraphBuilder.homeGraph(navController: NavHostController) { + composable(route = homeRoute) { + HomeScreen(navController) + } +} \ No newline at end of file diff --git a/ui/home/src/main/java/com/example/home/util/Constant.kt b/ui/home/src/main/java/com/example/home/util/Constant.kt new file mode 100644 index 0000000..d03ed53 --- /dev/null +++ b/ui/home/src/main/java/com/example/home/util/Constant.kt @@ -0,0 +1,5 @@ +package com.example.home.util + +object Constant { + const val liveRateFetchInterval = 3000L +} \ No newline at end of file diff --git a/ui/home/src/main/res/values/strings.xml b/ui/home/src/main/res/values/strings.xml new file mode 100644 index 0000000..0e0184e --- /dev/null +++ b/ui/home/src/main/res/values/strings.xml @@ -0,0 +1,5 @@ + + + Home + Search Icon + \ No newline at end of file diff --git a/ui/home/src/test/java/com/example/home/ExampleUnitTest.kt b/ui/home/src/test/java/com/example/home/ExampleUnitTest.kt new file mode 100644 index 0000000..7611e81 --- /dev/null +++ b/ui/home/src/test/java/com/example/home/ExampleUnitTest.kt @@ -0,0 +1,16 @@ +package com.example.home + +import org.junit.Assert.assertEquals +import org.junit.Test + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file diff --git a/ui/search/.gitignore b/ui/search/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/ui/search/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/ui/search/build.gradle.kts b/ui/search/build.gradle.kts new file mode 100644 index 0000000..38d9f5d --- /dev/null +++ b/ui/search/build.gradle.kts @@ -0,0 +1,57 @@ +plugins { + id("com.android.library") + id("org.jetbrains.kotlin.android") + kotlin("kapt") + id("com.google.dagger.hilt.android") +} +android { + namespace = "com.example.ui.search" + compileSdk = AppConfig.compileSdk + + defaultConfig { + minSdk = AppConfig.minSdk + targetSdk = AppConfig.targetSdk + + testInstrumentationRunner = AppConfig.androidTestInstrumentation + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } + + buildFeatures { + compose = true + } + composeOptions { + kotlinCompilerExtensionVersion = Version.KOTLIN_COMPILER_EXTENSION_VERSION + } +} + +dependencies { + compose() + composeNavigation() + composeViewmodel() + composeMaterial() + hilt() + junit() + + implementation(project(":data:exchangerate")) + implementation(project(":data:favorite")) + implementation(project(":data:common")) + implementation(project(":ui:detail")) + implementation(project(":core")) + moduleDependency(":ui:common") +} \ No newline at end of file diff --git a/ui/search/consumer-rules.pro b/ui/search/consumer-rules.pro new file mode 100644 index 0000000..e69de29 diff --git a/ui/search/proguard-rules.pro b/ui/search/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/ui/search/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/ui/search/src/androidTest/java/com/example/search/ExampleInstrumentedTest.kt b/ui/search/src/androidTest/java/com/example/search/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..346385a --- /dev/null +++ b/ui/search/src/androidTest/java/com/example/search/ExampleInstrumentedTest.kt @@ -0,0 +1,22 @@ +package com.example.search + +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.platform.app.InstrumentationRegistry +import org.junit.Assert.* +import org.junit.Test +import org.junit.runner.RunWith + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.example.ui.search.test", appContext.packageName) + } +} \ No newline at end of file diff --git a/ui/search/src/main/AndroidManifest.xml b/ui/search/src/main/AndroidManifest.xml new file mode 100644 index 0000000..a5918e6 --- /dev/null +++ b/ui/search/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ui/search/src/main/java/com/example/search/SearchScreen.kt b/ui/search/src/main/java/com/example/search/SearchScreen.kt new file mode 100644 index 0000000..74ea2eb --- /dev/null +++ b/ui/search/src/main/java/com/example/search/SearchScreen.kt @@ -0,0 +1,122 @@ +package com.example.search + +import androidx.compose.foundation.background +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.lazy.rememberLazyListState +import androidx.compose.material3.AssistChipDefaults +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme +import androidx.compose.runtime.Composable +import androidx.compose.ui.ExperimentalComposeUiApi +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalSoftwareKeyboardController +import androidx.compose.ui.res.stringResource +import androidx.hilt.navigation.compose.hiltViewModel +import androidx.navigation.NavController +import com.example.common.RateCell +import com.example.common.model.ExchangeRate +import com.example.core.component.* +import com.example.core.component.bar.SearchBar +import com.example.core.component.icon.Icons +import com.example.detail.nav.navigateToDetail +import com.example.ui.search.R +import com.example.core.R.string as coreR + +@Composable +fun SearchScreen( + modifier: Modifier = Modifier, + navController: NavController, + viewModel: SearchViewModel = hiltViewModel() +) { + val state = viewModel.state.value + + LoadingView(isLoading = state.isLoading) + + AutoRetryView( + isVisible = state.isAutoRetry, + errorMessage = state.retryMsg, + icon = Icons.Warning, + hint = stringResource(id = coreR.autoRetryHint) + ) + + RetryView( + isVisible = state.isRetry, + errorMessage = state.errorMsg, + icon = Icons.Warning + ) { viewModel.onEvent(SearchUiEvent.Retry) } + + EmptyView( + modifier = modifier, + isVisible = state.isEmpty, + icon = Icons.Face, + message = stringResource(id = R.string.noItemFound) + ) + + Column(modifier = modifier.background(MaterialTheme.colorScheme.surface)) { + SearchBar( + modifier = modifier.background(MaterialTheme.colorScheme.surface), + onQueryChange = { query -> viewModel.onEvent(SearchUiEvent.QueryChange(query)) }, + onCancelClick = { + viewModel.onEvent(SearchUiEvent.NavigationBack) + navController.popBackStack() + }) + + ContentView( + modifier = modifier + .background(MaterialTheme.colorScheme.surface) + .fillMaxSize(), + state = state, + navigateToDetail = { id -> navController.navigateToDetail(id) } + ) { rate -> viewModel.onEvent(SearchUiEvent.OnFavorite(rate)) } + } + +} + +@OptIn(ExperimentalMaterial3Api::class, ExperimentalComposeUiApi::class) +@Composable +private fun ContentView( + modifier: Modifier = Modifier, + state: SearchUiState, + navigateToDetail: (id: String) -> Unit, + onFavoriteClick: (rate: ExchangeRate) -> Unit +) { + val keyboardController = LocalSoftwareKeyboardController.current + val lazyListState = rememberLazyListState() + if (lazyListState.isScrollInProgress) { + keyboardController?.hide() + } + + BaseLazyColumn( + modifier = modifier, + lazyListState = lazyListState, + isVisible = state is SearchUiState.Loaded, + items = state.result, + ) { rate -> + val leadingIcon = + if (state.favoriteRates.any { it.id == rate.id && it.symbol == rate.symbol }) { + Icons.Favorite + } else { + Icons.FavoriteBorder + } + RateCell( + rate = rate.rateUsd.toString(), + symbol = rate.symbol, + currencySymbol = rate.currencySymbol ?: rate.symbol, + type = rate.type, + leadingIcon = { + Icon( + modifier = Modifier + .size(AssistChipDefaults.IconSize) + .clickable { onFavoriteClick(rate) }, + imageVector = leadingIcon, + contentDescription = "Like Icon", + ) + }, + onClick = { navigateToDetail(rate.id) } + ) + } +} diff --git a/ui/search/src/main/java/com/example/search/SearchViewModel.kt b/ui/search/src/main/java/com/example/search/SearchViewModel.kt new file mode 100644 index 0000000..f0fe962 --- /dev/null +++ b/ui/search/src/main/java/com/example/search/SearchViewModel.kt @@ -0,0 +1,172 @@ +package com.example.search + +import androidx.lifecycle.viewModelScope +import com.example.common.SharedState +import com.example.common.model.ExchangeRate +import com.example.core.base.BaseViewModel +import com.example.core.base.UIEvent +import com.example.core.base.UIState +import com.example.core.ext.retryWithPolicy +import com.example.favorite.FavoriteRatesInteractor +import com.example.rate.interactor.ExchangeRateInteractor +import dagger.hilt.android.lifecycle.HiltViewModel +import kotlinx.coroutines.Job +import kotlinx.coroutines.flow.* +import kotlinx.coroutines.launch +import javax.inject.Inject + +@HiltViewModel +class SearchViewModel @Inject constructor( + private val exchangeRateInteractor: ExchangeRateInteractor, + private val favoriteRatesInteractor: FavoriteRatesInteractor, +) : BaseViewModel(SearchUiState.Empty()) { + private val searchFlow = MutableStateFlow(state.value.query) + lateinit var job: Job + + init { + changeBottomBarVisibility(false) + observeQueryChange() + } + + private fun changeBottomBarVisibility(enabled: Boolean) { + viewModelScope.launch { + SharedState.bottomBarVisible.emit(enabled) + } + } + + private fun observeQueryChange() { + searchFlow + .debounce(300) + .distinctUntilChanged() + .onEach { query -> + if (::job.isInitialized && job.isActive) { + job.cancel() + } + + when { + query.isBlank() && query.isEmpty() -> setState(SearchUiState.Empty()) + query.isNotResetState() -> searchQuery(query) + } + }.launchIn(viewModelScope) + } + + private fun searchQuery(query: String) { + job = + viewModelScope.launch { + combine( + exchangeRateInteractor.getRates(), + favoriteRatesInteractor.getFavoriteRates() + ) { rates, favoriteRates -> + val result = rates.filter { + it.symbol.contains(query, ignoreCase = true) + } + when { + result.isEmpty() -> setState(SearchUiState.Empty(state.value.query)) + else -> setState( + SearchUiState.Loaded( + result = result, + favoriteRates = favoriteRates, + state.value.query + ) + ) + } + } + .retryWithPolicy { handleRetry() } + .catch { e -> handleError(e) } + .launchIn(viewModelScope) + } + } + + private fun handleError(e: Throwable) { + searchFlow.value = restString + val errorMessage = e.message ?: "Error while fetching the exchange rate" + setState(SearchUiState.Error(errorMessage, query = state.value.query)) + } + + private fun handleRetry() { + val retryMsg = "No result for \"${state.value.query}\"" + setState(SearchUiState.Retry(retryMsg, query = state.value.query)) + } + + private fun handleFavorite(rate: ExchangeRate) { + viewModelScope.launch { + val favoriteRates = favoriteRatesInteractor.getFavoriteRates().firstOrNull() + if (favoriteRates.isNullOrEmpty()) { + favoriteRatesInteractor.addFavorite(rate) + } else { + if (favoriteRates.any { it.id == rate.id }) { + favoriteRatesInteractor.removeFavorite(rate) + } else { + favoriteRatesInteractor.addFavorite(rate) + } + } + } + } + + override fun onEvent(event: SearchUiEvent) { + when (event) { + SearchUiEvent.NavigationBack -> changeBottomBarVisibility(true) + SearchUiEvent.Retry -> { + searchFlow.value = state.value.query + setState(SearchUiState.Search(state.value.query)) + } + is SearchUiEvent.QueryChange -> { + searchFlow.tryEmit(event.text) + setState(SearchUiState.Search(event.text)) + } + SearchUiEvent.ClearSearch -> { + searchFlow.value = "" + setState(SearchUiState.Empty()) + } + is SearchUiEvent.OnFavorite -> handleFavorite(event.rate) + } + } +} + +fun String.isNotResetState() = this != restString +const val restString = "__ResetString__" + +sealed interface SearchUiEvent : UIEvent { + object Retry : SearchUiEvent + class QueryChange(val text: String) : SearchUiEvent + object ClearSearch : SearchUiEvent + object NavigationBack : SearchUiEvent + class OnFavorite(val rate: ExchangeRate) : SearchUiEvent +} + +sealed class SearchUiState( + val result: List = emptyList(), + val favoriteRates: List = emptyList(), + val isLoading: Boolean = false, + val isRetry: Boolean = false, + val isAutoRetry: Boolean = false, + val isEmpty: Boolean = false, + val errorMsg: String = "", + val retryMsg: String = "", + var query: String +) : UIState { + class Loading(query: String) : SearchUiState(isLoading = true, query = query) + + class Error(errorMsg: String, query: String) : SearchUiState( + isRetry = true, + errorMsg = errorMsg, + query = query + ) + + class Retry(retryMsg: String, query: String) : SearchUiState( + isAutoRetry = true, + retryMsg = retryMsg, + query = query + ) + + class Search(text: String) : SearchUiState(query = text, isLoading = true) + + class Empty(query: String = "") : SearchUiState(isEmpty = true, query = query) + + class Loaded( + result: List, + favoriteRates: List, + query: String + ) : + SearchUiState(result = result, favoriteRates = favoriteRates, query = query) +} \ No newline at end of file diff --git a/ui/search/src/main/java/com/example/search/nav/SearchNav.kt b/ui/search/src/main/java/com/example/search/nav/SearchNav.kt new file mode 100644 index 0000000..98435b7 --- /dev/null +++ b/ui/search/src/main/java/com/example/search/nav/SearchNav.kt @@ -0,0 +1,26 @@ +package com.example.search.nav + +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.NavHostController +import androidx.navigation.NavOptions +import androidx.navigation.compose.composable +import com.example.search.SearchScreen + +/** + * @author yaya (@yahyalmh) + * @since 05th November 2022 + */ + + +const val searchRoute = "search_route" + +fun NavController.navigateToSearch(navOptions: NavOptions? = null) { + this.navigate(searchRoute, navOptions) +} + +fun NavGraphBuilder.searchGraph(navController: NavHostController) { + composable(route = searchRoute) { + SearchScreen(navController = navController) + } +} \ No newline at end of file diff --git a/ui/search/src/main/res/values/strings.xml b/ui/search/src/main/res/values/strings.xml new file mode 100644 index 0000000..1897a81 --- /dev/null +++ b/ui/search/src/main/res/values/strings.xml @@ -0,0 +1,4 @@ + + + No Item Found + \ No newline at end of file diff --git a/ui/search/src/test/java/com/example/search/ExampleUnitTest.kt b/ui/search/src/test/java/com/example/search/ExampleUnitTest.kt new file mode 100644 index 0000000..0cd716b --- /dev/null +++ b/ui/search/src/test/java/com/example/search/ExampleUnitTest.kt @@ -0,0 +1,16 @@ +package com.example.search + +import org.junit.Assert.assertEquals +import org.junit.Test + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file diff --git a/ui/setting/.gitignore b/ui/setting/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/ui/setting/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/ui/setting/build.gradle.kts b/ui/setting/build.gradle.kts new file mode 100644 index 0000000..7af837b --- /dev/null +++ b/ui/setting/build.gradle.kts @@ -0,0 +1,58 @@ +plugins { + id("com.android.library") + id("org.jetbrains.kotlin.android") + kotlin("kapt") + id("com.google.dagger.hilt.android") +} +android { + namespace = "com.example.setting" + compileSdk = AppConfig.compileSdk + + defaultConfig { + minSdk = AppConfig.minSdk + targetSdk = AppConfig.targetSdk + + testInstrumentationRunner = AppConfig.androidTestInstrumentation + } + + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } + + buildFeatures { + compose = true + } + composeOptions { + kotlinCompilerExtensionVersion = Version.KOTLIN_COMPILER_EXTENSION_VERSION + } +} + +dependencies { + + compose() + composeNavigation() + composeViewmodel() + composeMaterial() + junit() + + datastore() + + hilt() + moduleDependency(":core") + moduleDependency(":ui:common") + moduleDependency(":data:datastore") +} \ No newline at end of file diff --git a/ui/setting/consumer-rules.pro b/ui/setting/consumer-rules.pro new file mode 100644 index 0000000..e69de29 diff --git a/ui/setting/proguard-rules.pro b/ui/setting/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/ui/setting/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/ui/setting/src/androidTest/java/com/example/setting/ExampleInstrumentedTest.kt b/ui/setting/src/androidTest/java/com/example/setting/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..ba3b870 --- /dev/null +++ b/ui/setting/src/androidTest/java/com/example/setting/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.example.setting + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.example.setting.test", appContext.packageName) + } +} \ No newline at end of file diff --git a/ui/setting/src/main/AndroidManifest.xml b/ui/setting/src/main/AndroidManifest.xml new file mode 100644 index 0000000..a5918e6 --- /dev/null +++ b/ui/setting/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ui/setting/src/main/java/com/example/setting/SettingScreen.kt b/ui/setting/src/main/java/com/example/setting/SettingScreen.kt new file mode 100644 index 0000000..cbed1e1 --- /dev/null +++ b/ui/setting/src/main/java/com/example/setting/SettingScreen.kt @@ -0,0 +1,104 @@ +package com.example.setting + +import androidx.compose.animation.AnimatedVisibility +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.* +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.Check +import androidx.compose.material3.* +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import androidx.hilt.navigation.compose.hiltViewModel +import androidx.navigation.NavHostController +import com.example.common.ThemeType +import com.example.core.component.LoadingView +import com.example.core.component.bar.AppBar + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun SettingScreen( + navController: NavHostController, + viewModel: SettingViewModel = hiltViewModel() +) { + val uiState = viewModel.state.value + androidx.compose.material.Scaffold( + topBar = { + AppBar( + titleRes = R.string.setting, + colors = TopAppBarDefaults + .centerAlignedTopAppBarColors(containerColor = MaterialTheme.colorScheme.background), + ) + } + ) { padding -> + + LoadingView(isLoading = uiState.isLoading) + + ContentView( + modifier = Modifier.padding(padding), + uiState.currentThemeType + ) { + viewModel.onEvent(SettingUiEvent.ChangeTheme(it)) + } + } +} + +@Composable +@OptIn(ExperimentalMaterial3Api::class) +private fun ContentView( + modifier: Modifier = Modifier, + currentThemeType: ThemeType?, + onChangeTheme: (theme: ThemeType) -> Unit +) { + val themeTypes = ThemeType.values().asList() + + Column( + modifier = Modifier + .fillMaxSize() + .background(MaterialTheme.colorScheme.background) + .padding(12.dp), + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.Top + ) { + + Text( + modifier = Modifier + .fillMaxWidth() + .padding(12.dp), + color = MaterialTheme.colorScheme.onBackground, + text = stringResource(id = R.string.theme), + style = MaterialTheme.typography.titleLarge + ) + + + Row { + themeTypes.forEach { type -> + AssistChip( + modifier = Modifier.padding(8.dp), + onClick = { onChangeTheme(type) }, + label = { Text(type.name) }, + leadingIcon = { + AnimatedVisibility(visible = currentThemeType == type) { + Icon( + Icons.Filled.Check, + contentDescription = "Check Icon", + Modifier.size(AssistChipDefaults.IconSize) + ) + } + } + ) + } + } + + Divider(modifier = Modifier.padding(top = 6.dp)) + } +} + +@Preview(showSystemUi = true) +@Composable +fun ContentPreview() { + ContentView(currentThemeType = ThemeType.SYSTEM) {} +} \ No newline at end of file diff --git a/ui/setting/src/main/java/com/example/setting/SettingViewModel.kt b/ui/setting/src/main/java/com/example/setting/SettingViewModel.kt new file mode 100644 index 0000000..5eec6cd --- /dev/null +++ b/ui/setting/src/main/java/com/example/setting/SettingViewModel.kt @@ -0,0 +1,52 @@ +package com.example.setting + +import androidx.lifecycle.viewModelScope +import com.example.common.ThemeType +import com.example.common.toThemeType +import com.example.datastore.DatastoreInteractor +import com.example.core.base.BaseViewModel +import com.example.core.base.UIEvent +import com.example.core.base.UIState +import dagger.hilt.android.lifecycle.HiltViewModel +import kotlinx.coroutines.flow.launchIn +import kotlinx.coroutines.flow.onEach +import kotlinx.coroutines.launch +import javax.inject.Inject + +@HiltViewModel +class SettingViewModel @Inject constructor( + private val datastoreInteractor: DatastoreInteractor +) : BaseViewModel(SettingUiState.Loading) { + + init { + datastoreInteractor + .getThemeType() + .onEach { + val themeType = it?.toThemeType() ?: ThemeType.SYSTEM + setState(SettingUiState.SetSetting(themeType)) + } + .launchIn(viewModelScope) + } + + override fun onEvent(event: SettingUiEvent) { + when (event) { + is SettingUiEvent.ChangeTheme -> { + viewModelScope.launch { datastoreInteractor.setThemeType(event.type.name) } + } + } + } +} + + +sealed interface SettingUiEvent : UIEvent { + class ChangeTheme(val type: ThemeType) : SettingUiEvent +} + +sealed class SettingUiState( + val isLoading: Boolean = false, + val currentThemeType: ThemeType? = null +) : UIState { + object Loading : SettingUiState(isLoading = true) + class SetSetting(currentThemeType: ThemeType?) : + SettingUiState(currentThemeType = currentThemeType) +} \ No newline at end of file diff --git a/ui/setting/src/main/java/com/example/setting/nav/SettingNav.kt b/ui/setting/src/main/java/com/example/setting/nav/SettingNav.kt new file mode 100644 index 0000000..b778fda --- /dev/null +++ b/ui/setting/src/main/java/com/example/setting/nav/SettingNav.kt @@ -0,0 +1,20 @@ +package com.example.setting.nav + +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.NavHostController +import androidx.navigation.NavOptions +import androidx.navigation.compose.composable +import com.example.setting.SettingScreen + +const val settingRoute = "setting_route" + +fun NavController.navigateToSetting(navOptions: NavOptions? = null) { + this.navigate(settingRoute, navOptions) +} + +fun NavGraphBuilder.settingGraph(navController: NavHostController) { + composable(route = settingRoute) { + SettingScreen(navController = navController) + } +} \ No newline at end of file diff --git a/ui/setting/src/main/res/values/strings.xml b/ui/setting/src/main/res/values/strings.xml new file mode 100644 index 0000000..217ca9d --- /dev/null +++ b/ui/setting/src/main/res/values/strings.xml @@ -0,0 +1,5 @@ + + + Setting + Theme + \ No newline at end of file diff --git a/ui/setting/src/test/java/com/example/setting/ExampleUnitTest.kt b/ui/setting/src/test/java/com/example/setting/ExampleUnitTest.kt new file mode 100644 index 0000000..44b9f31 --- /dev/null +++ b/ui/setting/src/test/java/com/example/setting/ExampleUnitTest.kt @@ -0,0 +1,17 @@ +package com.example.setting + +import org.junit.Test + +import org.junit.Assert.* + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file From ad24218aea772da053318215656857f8f0ecd756 Mon Sep 17 00:00:00 2001 From: Yahya Hassani Date: Fri, 23 Dec 2022 16:57:02 +0100 Subject: [PATCH 02/64] Fix Favorite screen background color --- .../com/example/favorite/FavoriteScreen.kt | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/ui/favorite/src/main/java/com/example/favorite/FavoriteScreen.kt b/ui/favorite/src/main/java/com/example/favorite/FavoriteScreen.kt index 61a8d1b..c02d9eb 100644 --- a/ui/favorite/src/main/java/com/example/favorite/FavoriteScreen.kt +++ b/ui/favorite/src/main/java/com/example/favorite/FavoriteScreen.kt @@ -2,6 +2,7 @@ package com.example.favorite import androidx.compose.foundation.background import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.material3.* @@ -11,12 +12,12 @@ import androidx.compose.ui.res.stringResource import androidx.hilt.navigation.compose.hiltViewModel import androidx.navigation.NavController import com.example.common.RateCell -import com.example.core.component.* -import com.example.ui.favorite.R import com.example.common.model.ExchangeRate +import com.example.core.component.* import com.example.core.component.bar.AppBar import com.example.core.component.icon.Icons import com.example.detail.nav.navigateToDetail +import com.example.ui.favorite.R @OptIn(ExperimentalMaterial3Api::class) @Composable @@ -25,8 +26,8 @@ fun FavoriteScreen( viewModel: FavoriteViewModel = hiltViewModel() ) { val uiState = viewModel.state.value - androidx.compose.material.Scaffold( - contentColor = androidx.compose.material.MaterialTheme.colors.onBackground, + Scaffold( + contentColor = MaterialTheme.colorScheme.surface, topBar = { AppBar( titleRes = R.string.favorite, @@ -62,7 +63,9 @@ fun FavoriteScreen( ContentView( isVisible = uiState is FavoriteUiState.Loaded, - modifier = Modifier.padding(padding), + modifier = Modifier + .fillMaxSize() + .padding(padding), rates = uiState.rates, navigateToDetail = { rateId -> navController.navigateToDetail(rateId) }, onFavoriteClick = { rate -> viewModel.onEvent(FavoriteUiEvent.OnFavorite(rate)) } @@ -79,7 +82,11 @@ fun ContentView( navigateToDetail: (id: String) -> Unit, onFavoriteClick: (rate: ExchangeRate) -> Unit ) { - BaseLazyColumn(isVisible = isVisible, items = rates, modifier = modifier.background(MaterialTheme.colorScheme.surface)) { rate -> + BaseLazyColumn( + isVisible = isVisible, + items = rates, + modifier = modifier.background(MaterialTheme.colorScheme.surface) + ) { rate -> RateCell( rate = rate.rateUsd.toString(), symbol = rate.symbol, @@ -97,5 +104,4 @@ fun ContentView( } ) } - } \ No newline at end of file From 5257ea85a8a265a7048962c77ff58ff72c31c7da Mon Sep 17 00:00:00 2001 From: Yahya Hassani Date: Fri, 23 Dec 2022 16:57:48 +0100 Subject: [PATCH 03/64] Update workflow --- .github/workflows/deployment.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 6b29156..b2981b4 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -2,8 +2,8 @@ name: Test Workflow on: push: branches: - - master - - dev + - main + - develop workflow_dispatch: pull_request: From d0c04e6b4a8f4707848fb7c1338080788e555291 Mon Sep 17 00:00:00 2001 From: Yahya Hassani Date: Fri, 23 Dec 2022 17:05:33 +0100 Subject: [PATCH 04/64] Round the rate cell --- ui/common/src/main/java/com/example/common/RateCell.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/common/src/main/java/com/example/common/RateCell.kt b/ui/common/src/main/java/com/example/common/RateCell.kt index 89f8efa..8bc938f 100644 --- a/ui/common/src/main/java/com/example/common/RateCell.kt +++ b/ui/common/src/main/java/com/example/common/RateCell.kt @@ -4,6 +4,7 @@ import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.* import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Card import androidx.compose.material.Text import androidx.compose.material.icons.Icons @@ -32,7 +33,8 @@ fun RateCell( ) { Card(modifier = modifier .clickable { onClick() } - .padding(8.dp)) + .padding(8.dp), + shape = RoundedCornerShape(12.dp)) { Content(modifier, currencySymbol, rate, symbol, type, leadingIcon) } } From 6325dbd7c262db61c3872da9422bb2fff31a9544 Mon Sep 17 00:00:00 2001 From: Yahya Hassani Date: Fri, 23 Dec 2022 17:19:54 +0100 Subject: [PATCH 05/64] Update empty screen icons --- .../java/com/example/core/component/EmptyView.kt | 4 ++-- .../java/com/example/core/component/ErrorView.kt | 6 +++--- .../com/example/core/component/bar/SearchBar.kt | 6 +++--- .../core/component/icon/{Icons.kt => AppIcons.kt} | 2 +- .../main/java/com/example/detail/DetailScreen.kt | 10 +++++----- .../java/com/example/favorite/FavoriteScreen.kt | 10 +++++----- .../src/main/java/com/example/home/HomeScreen.kt | 14 +++++++------- .../main/java/com/example/search/SearchScreen.kt | 12 ++++++------ 8 files changed, 32 insertions(+), 32 deletions(-) rename core/src/main/java/com/example/core/component/icon/{Icons.kt => AppIcons.kt} (98%) diff --git a/core/src/main/java/com/example/core/component/EmptyView.kt b/core/src/main/java/com/example/core/component/EmptyView.kt index c19b843..02034fe 100644 --- a/core/src/main/java/com/example/core/component/EmptyView.kt +++ b/core/src/main/java/com/example/core/component/EmptyView.kt @@ -18,7 +18,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.example.core.R -import com.example.core.component.icon.Icons +import com.example.core.component.icon.AppIcons @Composable fun EmptyView( @@ -63,5 +63,5 @@ fun EmptyView( @Preview(showSystemUi = true) @Composable fun Preview() { - EmptyView(isVisible = true, icon = Icons.ThumbUp, message = "Not Found") + EmptyView(isVisible = true, icon = AppIcons.Search, message = "Not Found") } \ No newline at end of file diff --git a/core/src/main/java/com/example/core/component/ErrorView.kt b/core/src/main/java/com/example/core/component/ErrorView.kt index 782f36f..046d880 100644 --- a/core/src/main/java/com/example/core/component/ErrorView.kt +++ b/core/src/main/java/com/example/core/component/ErrorView.kt @@ -18,7 +18,7 @@ import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.example.core.R -import com.example.core.component.icon.Icons +import com.example.core.component.icon.AppIcons /** * @author yaya (@yahyalmh) @@ -128,13 +128,13 @@ fun AutoRetryView( @Preview(showBackground = true, showSystemUi = true) @Composable fun RetryPreview() { - RetryView(icon = Icons.Warning, errorMessage = "This is a error message") {} + RetryView(icon = AppIcons.Warning, errorMessage = "This is a error message") {} } @Preview(showBackground = true, showSystemUi = true) @Composable fun AutoRetryPreview() { AutoRetryView( - icon = Icons.Warning, errorMessage = "This is a error message", hint = "Go online to try again" + icon = AppIcons.Warning, errorMessage = "This is a error message", hint = "Go online to try again" ) } diff --git a/core/src/main/java/com/example/core/component/bar/SearchBar.kt b/core/src/main/java/com/example/core/component/bar/SearchBar.kt index 22a73fb..f317dd7 100644 --- a/core/src/main/java/com/example/core/component/bar/SearchBar.kt +++ b/core/src/main/java/com/example/core/component/bar/SearchBar.kt @@ -31,7 +31,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.zIndex import com.example.core.R -import com.example.core.component.icon.Icons +import com.example.core.component.icon.AppIcons @Composable fun SearchBar( @@ -71,7 +71,7 @@ fun SearchBar( ) { Icon( modifier = Modifier.size(20.dp), - imageVector = Icons.Search, + imageVector = AppIcons.Search, contentDescription = stringResource(id = R.string.search), tint = MaterialTheme.colorScheme.onSecondary ) @@ -126,7 +126,7 @@ fun SearchBar( onQueryChange(value) } .size(20.dp), - imageVector = Icons.Close, + imageVector = AppIcons.Close, contentDescription = stringResource(id = R.string.search), tint = MaterialTheme.colorScheme.onSecondary ) diff --git a/core/src/main/java/com/example/core/component/icon/Icons.kt b/core/src/main/java/com/example/core/component/icon/AppIcons.kt similarity index 98% rename from core/src/main/java/com/example/core/component/icon/Icons.kt rename to core/src/main/java/com/example/core/component/icon/AppIcons.kt index fe3d11c..baf0976 100644 --- a/core/src/main/java/com/example/core/component/icon/Icons.kt +++ b/core/src/main/java/com/example/core/component/icon/AppIcons.kt @@ -12,7 +12,7 @@ import androidx.compose.ui.graphics.vector.ImageVector /** * Material icons are [ImageVector]s, custom icons are drawable resource IDs. */ -object Icons { +object AppIcons { val AccountCircle = Icons.Outlined.AccountCircle val Add = Icons.Rounded.Add val ArrowBack = Icons.Rounded.ArrowBack diff --git a/ui/detail/src/main/java/com/example/detail/DetailScreen.kt b/ui/detail/src/main/java/com/example/detail/DetailScreen.kt index 27f8833..5df6a4f 100644 --- a/ui/detail/src/main/java/com/example/detail/DetailScreen.kt +++ b/ui/detail/src/main/java/com/example/detail/DetailScreen.kt @@ -23,7 +23,7 @@ import com.example.core.base.ReferenceDevices import com.example.core.component.LoadingView import com.example.core.component.RetryView import com.example.core.component.bar.AppBar -import com.example.core.component.icon.Icons +import com.example.core.component.icon.AppIcons import com.example.ui.detail.R /** @@ -48,13 +48,13 @@ fun DetailScreen( containerColor = MaterialTheme.colorScheme.background ), actionIcon = if (state.isFavorite) { - Icons.Favorite + AppIcons.Favorite } else { - Icons.FavoriteBorder + AppIcons.FavoriteBorder }, onActionClick = {viewModel.onEvent(DetailUiEvent.OnFavorite(state.rate)) }, actionIconContentDescription = stringResource(id = R.string.favoriteIcon), - navigationIcon = Icons.ArrowBack, + navigationIcon = AppIcons.ArrowBack, navigationIconContentDescription = "Back", onNavigationClick = { viewModel.onEvent(DetailUiEvent.NavigationBack) @@ -69,7 +69,7 @@ fun DetailScreen( RetryView( isVisible = state.isError, errorMessage = state.errorMsg, - icon = Icons.Warning + icon = AppIcons.Warning ) { viewModel.onEvent(DetailUiEvent.Retry) } ContentView(modifier.padding(padding), state) diff --git a/ui/favorite/src/main/java/com/example/favorite/FavoriteScreen.kt b/ui/favorite/src/main/java/com/example/favorite/FavoriteScreen.kt index c02d9eb..3f5d00d 100644 --- a/ui/favorite/src/main/java/com/example/favorite/FavoriteScreen.kt +++ b/ui/favorite/src/main/java/com/example/favorite/FavoriteScreen.kt @@ -15,7 +15,7 @@ import com.example.common.RateCell import com.example.common.model.ExchangeRate import com.example.core.component.* import com.example.core.component.bar.AppBar -import com.example.core.component.icon.Icons +import com.example.core.component.icon.AppIcons import com.example.detail.nav.navigateToDetail import com.example.ui.favorite.R @@ -42,14 +42,14 @@ fun FavoriteScreen( EmptyView( modifier = Modifier, isVisible = uiState.isEmpty, - icon = Icons.Face, + icon = AppIcons.FavoriteBorder, message = stringResource(id = R.string.noFavoriteItemFound) ) RetryView( isVisible = uiState.isRetry, errorMessage = uiState.retryMsg, - icon = Icons.Warning + icon = AppIcons.Warning ) { viewModel.onEvent(FavoriteUiEvent.Retry) } @@ -57,7 +57,7 @@ fun FavoriteScreen( AutoRetryView( isVisible = uiState.isAutoRetry, errorMessage = uiState.retryMsg, - icon = Icons.Warning, + icon = AppIcons.Warning, hint = stringResource(id = R.string.autoRetryHint) ) @@ -98,7 +98,7 @@ fun ContentView( modifier = Modifier .size(AssistChipDefaults.IconSize) .clickable { onFavoriteClick(rate) }, - imageVector = Icons.Favorite, + imageVector = AppIcons.Favorite, contentDescription = "Like Icon", ) } diff --git a/ui/home/src/main/java/com/example/home/HomeScreen.kt b/ui/home/src/main/java/com/example/home/HomeScreen.kt index b79e0f6..a06c018 100644 --- a/ui/home/src/main/java/com/example/home/HomeScreen.kt +++ b/ui/home/src/main/java/com/example/home/HomeScreen.kt @@ -23,7 +23,7 @@ import com.example.core.component.BaseLazyColumn import com.example.core.component.LoadingView import com.example.core.component.RetryView import com.example.core.component.bar.AppBar -import com.example.core.component.icon.Icons +import com.example.core.component.icon.AppIcons import com.example.detail.nav.navigateToDetail import com.example.search.nav.navigateToSearch import com.example.ui.home.R @@ -51,9 +51,9 @@ fun HomeScreen( colors = TopAppBarDefaults.centerAlignedTopAppBarColors( containerColor = MaterialTheme.colorScheme.background ), - navigationIcon = Icons.Menu, + navigationIcon = AppIcons.Menu, navigationIconContentDescription = stringResource(id = coreR.menu), - actionIcon = Icons.Search, + actionIcon = AppIcons.Search, actionIconContentDescription = stringResource(id = R.string.searchIcon), onActionClick = { navController.navigateToSearch() } ) @@ -66,7 +66,7 @@ fun HomeScreen( RetryView( isVisible = uiState.isRetry, errorMessage = uiState.retryMsg, - icon = Icons.Warning + icon = AppIcons.Warning ) { viewModel.onEvent(HomeUiEvent.Retry) } @@ -74,7 +74,7 @@ fun HomeScreen( AutoRetryView( isVisible = uiState.isAutoRetry, errorMessage = uiState.retryMsg, - icon = Icons.Warning, + icon = AppIcons.Warning, hint = stringResource(id = coreR.autoRetryHint) ) @@ -104,9 +104,9 @@ private fun ContentView( modifier = modifier.background(MaterialTheme.colorScheme.surface) ) { rate -> val leadingIcon = if (favoritesRates.any { it.id == rate.id && it.symbol == rate.symbol }) { - Icons.Favorite + AppIcons.Favorite } else { - Icons.FavoriteBorder + AppIcons.FavoriteBorder } RateCell( rate = rate.rateUsd.toString(), diff --git a/ui/search/src/main/java/com/example/search/SearchScreen.kt b/ui/search/src/main/java/com/example/search/SearchScreen.kt index 74ea2eb..fe3cd71 100644 --- a/ui/search/src/main/java/com/example/search/SearchScreen.kt +++ b/ui/search/src/main/java/com/example/search/SearchScreen.kt @@ -21,7 +21,7 @@ import com.example.common.RateCell import com.example.common.model.ExchangeRate import com.example.core.component.* import com.example.core.component.bar.SearchBar -import com.example.core.component.icon.Icons +import com.example.core.component.icon.AppIcons import com.example.detail.nav.navigateToDetail import com.example.ui.search.R import com.example.core.R.string as coreR @@ -39,20 +39,20 @@ fun SearchScreen( AutoRetryView( isVisible = state.isAutoRetry, errorMessage = state.retryMsg, - icon = Icons.Warning, + icon = AppIcons.Warning, hint = stringResource(id = coreR.autoRetryHint) ) RetryView( isVisible = state.isRetry, errorMessage = state.errorMsg, - icon = Icons.Warning + icon = AppIcons.Warning ) { viewModel.onEvent(SearchUiEvent.Retry) } EmptyView( modifier = modifier, isVisible = state.isEmpty, - icon = Icons.Face, + icon = AppIcons.Search, message = stringResource(id = R.string.noItemFound) ) @@ -98,9 +98,9 @@ private fun ContentView( ) { rate -> val leadingIcon = if (state.favoriteRates.any { it.id == rate.id && it.symbol == rate.symbol }) { - Icons.Favorite + AppIcons.Favorite } else { - Icons.FavoriteBorder + AppIcons.FavoriteBorder } RateCell( rate = rate.rateUsd.toString(), From 11b2236c580132cae7751cb8a6e8c969cd47f587 Mon Sep 17 00:00:00 2001 From: Yahya Hassani Date: Fri, 23 Dec 2022 18:12:23 +0100 Subject: [PATCH 06/64] Update Rate cell design --- core/src/main/res/values/strings.xml | 2 +- ui/common/build.gradle.kts | 2 + .../main/java/com/example/common/RateCell.kt | 110 +++++++++--------- .../com/example/favorite/FavoriteScreen.kt | 19 +-- .../main/java/com/example/home/HomeScreen.kt | 35 +----- .../java/com/example/search/SearchScreen.kt | 22 +--- 6 files changed, 68 insertions(+), 122 deletions(-) diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index df6393a..e189d83 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -5,5 +5,5 @@ Menu Empty Icon Auto Retry Icon - Go online and try again + Go online to try again \ No newline at end of file diff --git a/ui/common/build.gradle.kts b/ui/common/build.gradle.kts index ae1294e..7e82a6f 100644 --- a/ui/common/build.gradle.kts +++ b/ui/common/build.gradle.kts @@ -42,4 +42,6 @@ dependencies { compose() junit() composeMaterial() + moduleDependency(":core") + moduleDependency(":data:common") } \ No newline at end of file diff --git a/ui/common/src/main/java/com/example/common/RateCell.kt b/ui/common/src/main/java/com/example/common/RateCell.kt index 8bc938f..5448465 100644 --- a/ui/common/src/main/java/com/example/common/RateCell.kt +++ b/ui/common/src/main/java/com/example/common/RateCell.kt @@ -7,126 +7,124 @@ import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Card import androidx.compose.material.Text -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.FavoriteBorder -import androidx.compose.material3.* +import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable -import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp +import com.example.common.model.ExchangeRate +import com.example.core.component.icon.AppIcons @Composable fun RateCell( - rate: String, - symbol: String, - currencySymbol: String, - type: String, - onClick: () -> Unit, modifier: Modifier = Modifier, - leadingIcon: @Composable (() -> Unit)? = null, + rate: ExchangeRate, + onClick: () -> Unit, + leadingIcon: ImageVector? = null, + onLeadingIconClick: (rate: ExchangeRate) -> Unit ) { Card(modifier = modifier .clickable { onClick() } .padding(8.dp), shape = RoundedCornerShape(12.dp)) - { Content(modifier, currencySymbol, rate, symbol, type, leadingIcon) } + { + Content( + modifier = modifier, + rate = rate, + leadingIcon = leadingIcon, + onLeadingIconClick = onLeadingIconClick + ) + } } @Composable private fun Content( modifier: Modifier, - currencySymbol: String, - rate: String, - symbol: String, - type: String, - leadingIcon: @Composable (() -> Unit)? + rate: ExchangeRate, + leadingIcon: ImageVector?, + onLeadingIconClick: (rate: ExchangeRate) -> Unit ) { Row( modifier = modifier .background(MaterialTheme.colorScheme.secondaryContainer) - .padding(12.dp) - .wrapContentSize() + .padding(8.dp) .fillMaxWidth(), verticalAlignment = Alignment.CenterVertically ) { Box( modifier = modifier - .size(68.dp) + .size(74.dp) .clip(CircleShape) .background(MaterialTheme.colorScheme.onSecondaryContainer), contentAlignment = Alignment.Center ) { Text( textAlign = TextAlign.Center, - text = currencySymbol, + text = rate.currencySymbol ?: rate.symbol, style = MaterialTheme.typography.headlineMedium, fontWeight = FontWeight.Bold, color = MaterialTheme.colorScheme.secondary ) } - Column(modifier = modifier.padding(12.dp)) { + + Column( + modifier = modifier.padding(start = 12.dp, 4.dp), + verticalArrangement = Arrangement.spacedBy(10.dp) + ) { Text( - text = rate, - style = MaterialTheme.typography.titleMedium, - fontWeight = FontWeight.Bold, + text = rate.rateUsd.toString(), + style = MaterialTheme.typography.bodyLarge, color = MaterialTheme.colorScheme.onSurfaceVariant ) - Spacer(modifier = modifier.height(10.dp)) - Text( - text = symbol, - style = MaterialTheme.typography.titleSmall, - fontWeight = FontWeight.Bold, + text = rate.symbol, + style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onSurfaceVariant ) - - Spacer(modifier = modifier.height(10.dp)) - Text( - text = type, - style = MaterialTheme.typography.titleSmall, - fontWeight = FontWeight.ExtraBold, + text = rate.type, + style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onSurfaceVariant ) } + Spacer(modifier = Modifier.weight(1f)) if (leadingIcon != null) { - Column( - modifier = Modifier.fillMaxHeight(), - verticalArrangement = Arrangement.Top, - horizontalAlignment = Alignment.CenterHorizontally - ) { - CompositionLocalProvider( - LocalContentColor provides Color.Red, content = leadingIcon + Column { + Icon( + modifier = Modifier + .size(24.dp) + .clickable { onLeadingIconClick(rate) }, + imageVector = leadingIcon, + contentDescription = "Leading Icon", + tint = Color.Red ) + Spacer(modifier = Modifier.weight(1f)) } } } } -@OptIn(ExperimentalMaterial3Api::class) -@Preview(heightDp = 150) +@Preview(heightDp = 200, widthDp = 400) @Composable fun RateCellPreview() { RateCell( - rate = "3.343234342", - symbol = "$$", - currencySymbol = "USD", - type = "Fiat", + rate = ExchangeRate( + id = "1", + rateUsd = 3.343234342.toBigDecimal(), + symbol = "$$", + currencySymbol = "USD", + type = "Fiat" + ), onClick = {}, - leadingIcon = { - Icon( - Icons.Filled.FavoriteBorder, - contentDescription = "Check Icon", - Modifier.size(AssistChipDefaults.IconSize) - ) - } - ) + leadingIcon = AppIcons.Favorite + ) {} } diff --git a/ui/favorite/src/main/java/com/example/favorite/FavoriteScreen.kt b/ui/favorite/src/main/java/com/example/favorite/FavoriteScreen.kt index 3f5d00d..986ed3a 100644 --- a/ui/favorite/src/main/java/com/example/favorite/FavoriteScreen.kt +++ b/ui/favorite/src/main/java/com/example/favorite/FavoriteScreen.kt @@ -1,10 +1,8 @@ package com.example.favorite import androidx.compose.foundation.background -import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.size import androidx.compose.material3.* import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier @@ -73,7 +71,6 @@ fun FavoriteScreen( } } -@OptIn(ExperimentalMaterial3Api::class) @Composable fun ContentView( modifier: Modifier = Modifier, @@ -88,20 +85,10 @@ fun ContentView( modifier = modifier.background(MaterialTheme.colorScheme.surface) ) { rate -> RateCell( - rate = rate.rateUsd.toString(), - symbol = rate.symbol, - currencySymbol = rate.currencySymbol ?: rate.symbol, - type = rate.type, + rate = rate, onClick = { navigateToDetail(rate.id) }, - leadingIcon = { - Icon( - modifier = Modifier - .size(AssistChipDefaults.IconSize) - .clickable { onFavoriteClick(rate) }, - imageVector = AppIcons.Favorite, - contentDescription = "Like Icon", - ) - } + leadingIcon = AppIcons.Favorite, + onLeadingIconClick = onFavoriteClick ) } } \ No newline at end of file diff --git a/ui/home/src/main/java/com/example/home/HomeScreen.kt b/ui/home/src/main/java/com/example/home/HomeScreen.kt index a06c018..a5a2c1f 100644 --- a/ui/home/src/main/java/com/example/home/HomeScreen.kt +++ b/ui/home/src/main/java/com/example/home/HomeScreen.kt @@ -1,9 +1,7 @@ package com.example.home import androidx.compose.foundation.background -import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.size import androidx.compose.material.icons.filled.* import androidx.compose.material3.* import androidx.compose.runtime.Composable @@ -15,7 +13,6 @@ import androidx.compose.ui.zIndex import androidx.hilt.navigation.compose.hiltViewModel import androidx.navigation.NavHostController import com.example.common.RateCell -import com.example.common.database.ExchangeRateEntity import com.example.common.model.ExchangeRate import com.example.core.base.ReferenceDevices import com.example.core.component.AutoRetryView @@ -89,7 +86,6 @@ fun HomeScreen( } } -@OptIn(ExperimentalMaterial3Api::class) @Composable private fun ContentView( modifier: Modifier, @@ -109,20 +105,10 @@ private fun ContentView( AppIcons.FavoriteBorder } RateCell( - rate = rate.rateUsd.toString(), - symbol = rate.symbol, - currencySymbol = rate.currencySymbol ?: rate.symbol, - type = rate.type, - leadingIcon = { - Icon( - modifier = Modifier - .size(AssistChipDefaults.IconSize) - .clickable { onFavoriteClick(rate) }, - imageVector = leadingIcon, - contentDescription = "Like Icon", - ) - }, - onClick = { navigateToDetail(rate.id) } + rate = rate, + leadingIcon = leadingIcon, + onClick = { navigateToDetail(rate.id) }, + onLeadingIconClick = onFavoriteClick ) } } @@ -144,13 +130,6 @@ private fun ratesStub(count: Int = 20): MutableList { return rates } -@Composable -private fun favoriteRatesStub(count: Int = 10): MutableList { - val rates = mutableListOf() - repeat(count) { rates.add(favoriteRateStub()) } - return rates -} - @Composable internal fun rateStub(): ExchangeRate = ExchangeRate( id = "1", @@ -158,10 +137,4 @@ internal fun rateStub(): ExchangeRate = ExchangeRate( currencySymbol = "USD", type = "fiat", rateUsd = 0.165451654889.toBigDecimal() -) - -@Composable -internal fun favoriteRateStub() = ExchangeRateEntity( - id = "1", - symbol = "$", ) \ No newline at end of file diff --git a/ui/search/src/main/java/com/example/search/SearchScreen.kt b/ui/search/src/main/java/com/example/search/SearchScreen.kt index fe3cd71..c7dce31 100644 --- a/ui/search/src/main/java/com/example/search/SearchScreen.kt +++ b/ui/search/src/main/java/com/example/search/SearchScreen.kt @@ -1,14 +1,10 @@ package com.example.search import androidx.compose.foundation.background -import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.size import androidx.compose.foundation.lazy.rememberLazyListState -import androidx.compose.material3.AssistChipDefaults import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.ExperimentalComposeUiApi @@ -103,20 +99,10 @@ private fun ContentView( AppIcons.FavoriteBorder } RateCell( - rate = rate.rateUsd.toString(), - symbol = rate.symbol, - currencySymbol = rate.currencySymbol ?: rate.symbol, - type = rate.type, - leadingIcon = { - Icon( - modifier = Modifier - .size(AssistChipDefaults.IconSize) - .clickable { onFavoriteClick(rate) }, - imageVector = leadingIcon, - contentDescription = "Like Icon", - ) - }, - onClick = { navigateToDetail(rate.id) } + rate = rate, + leadingIcon = leadingIcon, + onClick = { navigateToDetail(rate.id) }, + onLeadingIconClick = onFavoriteClick ) } } From be9b9b0654bf19b429dc9f658c1c7b2e330fc0dc Mon Sep 17 00:00:00 2001 From: Yahya Hassani Date: Fri, 23 Dec 2022 18:28:15 +0100 Subject: [PATCH 07/64] Fix action bar icon color --- .../com/example/core/component/bar/TopAppBar.kt | 9 +++++---- .../src/main/java/com/example/common/RateCell.kt | 16 +++++++++++----- .../main/java/com/example/detail/DetailScreen.kt | 2 ++ 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/com/example/core/component/bar/TopAppBar.kt b/core/src/main/java/com/example/core/component/bar/TopAppBar.kt index 5bc0c67..a2d8c19 100644 --- a/core/src/main/java/com/example/core/component/bar/TopAppBar.kt +++ b/core/src/main/java/com/example/core/component/bar/TopAppBar.kt @@ -1,6 +1,5 @@ package com.example.core.component.bar -import android.R import androidx.annotation.StringRes import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Menu @@ -9,6 +8,7 @@ import androidx.compose.material3.* import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.draw.shadow +import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview @@ -18,12 +18,13 @@ import androidx.compose.ui.zIndex @OptIn(ExperimentalMaterial3Api::class) @Composable fun AppBar( + modifier: Modifier = Modifier, @StringRes titleRes: Int, navigationIcon: ImageVector, navigationIconContentDescription: String?, actionIcon: ImageVector, + actionIconColor: Color = MaterialTheme.colorScheme.onSurface, actionIconContentDescription: String?, - modifier: Modifier = Modifier, colors: TopAppBarColors = TopAppBarDefaults.centerAlignedTopAppBarColors(), onNavigationClick: () -> Unit = {}, onActionClick: () -> Unit = {} @@ -44,7 +45,7 @@ fun AppBar( Icon( imageVector = actionIcon, contentDescription = actionIconContentDescription, - tint = MaterialTheme.colorScheme.onSurface + tint = actionIconColor ) } }, @@ -131,7 +132,7 @@ fun AppBar( @Composable fun TopAppBarPreview() { AppBar( - titleRes = R.string.untitled, + titleRes = R.string.expanded, navigationIcon = Icons.Default.Menu, navigationIconContentDescription = "Navigation icon", actionIcon = Icons.Default.Search, diff --git a/ui/common/src/main/java/com/example/common/RateCell.kt b/ui/common/src/main/java/com/example/common/RateCell.kt index 5448465..a4fe9da 100644 --- a/ui/common/src/main/java/com/example/common/RateCell.kt +++ b/ui/common/src/main/java/com/example/common/RateCell.kt @@ -21,6 +21,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.example.common.model.ExchangeRate import com.example.core.component.icon.AppIcons +import java.util.* @Composable fun RateCell( @@ -79,19 +80,24 @@ private fun Content( verticalArrangement = Arrangement.spacedBy(10.dp) ) { Text( - text = rate.rateUsd.toString(), + text = "Rate: ${rate.rateUsd.toString()}", style = MaterialTheme.typography.bodyLarge, color = MaterialTheme.colorScheme.onSurfaceVariant ) Text( - text = rate.symbol, + text = "Symbol: ${rate.symbol}", style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onSurfaceVariant ) Text( - text = rate.type, - style = MaterialTheme.typography.bodyMedium, + text = "Type: ${ + rate.type.replaceFirstChar { + if (it.isLowerCase()) it.titlecase(Locale.ROOT) + else it.toString() + } + }", + style = MaterialTheme . typography . bodyMedium, color = MaterialTheme.colorScheme.onSurfaceVariant ) } @@ -120,7 +126,7 @@ fun RateCellPreview() { rate = ExchangeRate( id = "1", rateUsd = 3.343234342.toBigDecimal(), - symbol = "$$", + symbol = "$", currencySymbol = "USD", type = "Fiat" ), diff --git a/ui/detail/src/main/java/com/example/detail/DetailScreen.kt b/ui/detail/src/main/java/com/example/detail/DetailScreen.kt index 5df6a4f..9da097d 100644 --- a/ui/detail/src/main/java/com/example/detail/DetailScreen.kt +++ b/ui/detail/src/main/java/com/example/detail/DetailScreen.kt @@ -12,6 +12,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign @@ -52,6 +53,7 @@ fun DetailScreen( } else { AppIcons.FavoriteBorder }, + actionIconColor = Color.Red, onActionClick = {viewModel.onEvent(DetailUiEvent.OnFavorite(state.rate)) }, actionIconContentDescription = stringResource(id = R.string.favoriteIcon), navigationIcon = AppIcons.ArrowBack, From a11d12bcbfe09cb84cdd219f5e5fb64bcf0673cb Mon Sep 17 00:00:00 2001 From: Yahya Hassani Date: Fri, 23 Dec 2022 19:16:39 +0100 Subject: [PATCH 08/64] Remove Unused import --- ui/search/src/main/java/com/example/search/SearchScreen.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ui/search/src/main/java/com/example/search/SearchScreen.kt b/ui/search/src/main/java/com/example/search/SearchScreen.kt index c7dce31..6beb7a4 100644 --- a/ui/search/src/main/java/com/example/search/SearchScreen.kt +++ b/ui/search/src/main/java/com/example/search/SearchScreen.kt @@ -4,7 +4,6 @@ import androidx.compose.foundation.background import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.lazy.rememberLazyListState -import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.ExperimentalComposeUiApi @@ -72,7 +71,7 @@ fun SearchScreen( } -@OptIn(ExperimentalMaterial3Api::class, ExperimentalComposeUiApi::class) +@OptIn(ExperimentalComposeUiApi::class) @Composable private fun ContentView( modifier: Modifier = Modifier, From 759c08897a4e8dfcc6b1b8f43edcc316dfbac16a Mon Sep 17 00:00:00 2001 From: Yahya Hassani Date: Fri, 23 Dec 2022 22:17:48 +0100 Subject: [PATCH 09/64] Add main module and remove core module --- .idea/gradle.xml | 2 +- app/build.gradle.kts | 2 +- app/src/main/AndroidManifest.xml | 3 +- .../java/com/example/compose/MainActivity.kt | 20 +++++ .../com/example/compose/ui/MainActivity.kt | 47 ---------- .../java/com/example/compose/ui/MainScreen.kt | 57 ------------ .../java/com/example/core/component/Column.kt | 40 --------- .../example/core/network/NetworkMonitor.kt | 10 --- .../core/network/di/NetworkMonitorModule.kt | 20 ----- data/exchangerate/build.gradle.kts | 2 +- .../interactor/ExchangeRateInteractorImpl.kt | 8 +- settings.gradle.kts | 2 +- ui/common/build.gradle.kts | 3 +- .../java/com/example/common}/Annotation.kt | 2 +- .../java/com/example/common}/BaseViewModel.kt | 2 +- .../main/java/com/example/common/RateCell.kt | 2 +- .../example/common/component/BaseColumn.kt | 24 ++++- .../example/common}/component/EmptyView.kt | 6 +- .../example/common}/component/LoadingView.kt | 5 +- .../com/example/common/component/RetryView.kt | 11 +-- .../common}/component/bar/SearchBar.kt | 6 +- .../common}/component/bar/TopAppBar.kt | 5 +- .../common}/component/icon/AppIcons.kt | 8 +- .../java/com/example/common}/ext/FlowExt.kt | 2 +- .../common}/src/main/res/values/strings.xml | 6 +- ui/detail/build.gradle.kts | 1 - .../java/com/example/detail/DetailScreen.kt | 10 +-- .../com/example/detail/DetailViewModel.kt | 6 +- ui/favorite/build.gradle.kts | 2 - .../com/example/favorite/FavoriteScreen.kt | 6 +- .../com/example/favorite/FavoriteViewModel.kt | 8 +- ui/home/build.gradle.kts | 1 - .../main/java/com/example/home/HomeScreen.kt | 19 ++-- .../java/com/example/home/HomeViewModel.kt | 8 +- .../nav/{HomeNavigation.kt => HomeNav.kt} | 0 ui/home/src/main/res/values/strings.xml | 1 + {core => ui/main}/.gitignore | 0 {core => ui/main}/build.gradle.kts | 28 +++--- {core => ui/main}/consumer-rules.pro | 0 {core => ui/main}/proguard-rules.pro | 0 .../example/main}/ExampleInstrumentedTest.kt | 4 +- .../main}/src/main/AndroidManifest.xml | 1 - .../main/java/com/example/main}/BottomBar.kt | 32 +++---- .../main/java/com/example/main/MainScreen.kt | 87 +++++++++++++++++++ .../java/com/example/main}/MainViewModel.kt | 14 +-- .../java/com/example/main}/NetStatusView.kt | 6 +- .../main/connectivity/ConnectivityMonitor.kt | 30 ++++--- .../di/ConnectivityMonitorModule.kt | 20 +++++ .../main/java/com/example/main/nav/AppNav.kt | 6 +- .../java/com/example/main}/theme/Color.kt | 2 +- .../java/com/example/main}/theme/Shape.kt | 2 +- .../java/com/example/main}/theme/Theme.kt | 2 +- .../main/java/com/example/main}/theme/Type.kt | 2 +- ui/main/src/main/res/values/strings.xml | 13 +++ .../java/com/example/main}/ExampleUnitTest.kt | 2 +- ui/search/build.gradle.kts | 1 - .../java/com/example/search/SearchScreen.kt | 8 +- .../com/example/search/SearchViewModel.kt | 8 +- ui/search/src/main/res/values/strings.xml | 1 + ui/setting/build.gradle.kts | 1 - .../java/com/example/setting/SettingScreen.kt | 4 +- .../com/example/setting/SettingViewModel.kt | 6 +- 62 files changed, 316 insertions(+), 321 deletions(-) create mode 100644 app/src/main/java/com/example/compose/MainActivity.kt delete mode 100644 app/src/main/java/com/example/compose/ui/MainActivity.kt delete mode 100644 app/src/main/java/com/example/compose/ui/MainScreen.kt delete mode 100644 core/src/main/java/com/example/core/component/Column.kt delete mode 100644 core/src/main/java/com/example/core/network/NetworkMonitor.kt delete mode 100644 core/src/main/java/com/example/core/network/di/NetworkMonitorModule.kt rename {core/src/main/java/com/example/core/base => ui/common/src/main/java/com/example/common}/Annotation.kt (95%) rename {core/src/main/java/com/example/core/base => ui/common/src/main/java/com/example/common}/BaseViewModel.kt (95%) rename core/src/main/java/com/example/core/component/BaseLazyColumn.kt => ui/common/src/main/java/com/example/common/component/BaseColumn.kt (57%) rename {core/src/main/java/com/example/core => ui/common/src/main/java/com/example/common}/component/EmptyView.kt (94%) rename {core/src/main/java/com/example/core => ui/common/src/main/java/com/example/common}/component/LoadingView.kt (84%) rename core/src/main/java/com/example/core/component/ErrorView.kt => ui/common/src/main/java/com/example/common/component/RetryView.kt (94%) rename {core/src/main/java/com/example/core => ui/common/src/main/java/com/example/common}/component/bar/SearchBar.kt (97%) rename {core/src/main/java/com/example/core => ui/common/src/main/java/com/example/common}/component/bar/TopAppBar.kt (97%) rename {core/src/main/java/com/example/core => ui/common/src/main/java/com/example/common}/component/icon/AppIcons.kt (94%) rename {core/src/main/java/com/example/core => ui/common/src/main/java/com/example/common}/ext/FlowExt.kt (97%) rename {core => ui/common}/src/main/res/values/strings.xml (61%) rename ui/home/src/main/java/com/example/home/nav/{HomeNavigation.kt => HomeNav.kt} (100%) rename {core => ui/main}/.gitignore (100%) rename {core => ui/main}/build.gradle.kts (73%) rename {core => ui/main}/consumer-rules.pro (100%) rename {core => ui/main}/proguard-rules.pro (100%) rename {core/src/androidTest/java/com/example/core => ui/main/src/androidTest/java/com/example/main}/ExampleInstrumentedTest.kt (86%) rename {core => ui/main}/src/main/AndroidManifest.xml (99%) rename {app/src/main/java/com/example/compose/ui => ui/main/src/main/java/com/example/main}/BottomBar.kt (77%) create mode 100644 ui/main/src/main/java/com/example/main/MainScreen.kt rename {app/src/main/java/com/example/compose/ui => ui/main/src/main/java/com/example/main}/MainViewModel.kt (95%) rename {app/src/main/java/com/example/compose/ui => ui/main/src/main/java/com/example/main}/NetStatusView.kt (96%) rename core/src/main/java/com/example/core/network/NetworkMonitorImpl.kt => ui/main/src/main/java/com/example/main/connectivity/ConnectivityMonitor.kt (75%) create mode 100644 ui/main/src/main/java/com/example/main/connectivity/di/ConnectivityMonitorModule.kt rename app/src/main/java/com/example/compose/nav/AppNavigation.kt => ui/main/src/main/java/com/example/main/nav/AppNav.kt (98%) rename {app/src/main/java/com/example/compose/ui => ui/main/src/main/java/com/example/main}/theme/Color.kt (98%) rename {app/src/main/java/com/example/compose/ui => ui/main/src/main/java/com/example/main}/theme/Shape.kt (88%) rename {app/src/main/java/com/example/compose/ui => ui/main/src/main/java/com/example/main}/theme/Theme.kt (98%) rename {app/src/main/java/com/example/compose/ui => ui/main/src/main/java/com/example/main}/theme/Type.kt (98%) create mode 100644 ui/main/src/main/res/values/strings.xml rename {core/src/test/java/com/example/core => ui/main/src/test/java/com/example/main}/ExampleUnitTest.kt (92%) diff --git a/.idea/gradle.xml b/.idea/gradle.xml index f3a4007..2d1349b 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -12,7 +12,6 @@