From 7e243f18533c2465d677f22bbe7224749f0bdac0 Mon Sep 17 00:00:00 2001 From: William Brawner Date: Wed, 2 Jun 2021 05:21:14 -0600 Subject: [PATCH] Reorganize code into modules and move from square networking to ktor --- .idea/gradle.xml | 3 + .idea/misc.xml | 17 + app/build.gradle.kts | 38 +- .../com/wbrawner/nanoflux/MainActivity.kt | 19 - .../wbrawner/nanoflux/NanofluxApplication.kt | 3 +- .../java/com/wbrawner/nanoflux/SyncWorker.kt | 36 +- .../nanoflux/data/MinifluxApiService.kt | 147 ------ .../nanoflux/data/NanofluxDatabase.kt | 34 -- .../wbrawner/nanoflux/data/dao/CategoryDao.kt | 24 - .../wbrawner/nanoflux/data/dao/EntryDao.kt | 34 -- .../com/wbrawner/nanoflux/data/dao/IconDao.kt | 22 - .../wbrawner/nanoflux/data/model/Category.kt | 18 - .../com/wbrawner/nanoflux/data/model/Entry.kt | 62 --- .../com/wbrawner/nanoflux/data/model/Feed.kt | 63 --- .../com/wbrawner/nanoflux/data/model/User.kt | 43 -- .../data/repository/EntryRepository.kt | 27 -- .../data/repository/FeedRepository.kt | 25 - .../nanoflux/data/viewmodel/AuthViewModel.kt | 5 +- .../nanoflux/data/viewmodel/MainViewModel.kt | 46 ++ .../com/wbrawner/nanoflux/di/NetworkModule.kt | 66 --- .../java/com/wbrawner/nanoflux/ui/Entries.kt | 223 +++++++++ .../com/wbrawner/nanoflux/ui/MainScreen.kt | 47 +- build.gradle.kts | 6 +- common/.gitignore | 1 + common/build.gradle.kts | 46 ++ common/consumer-rules.pro | 0 common/proguard-rules.pro | 21 + .../common/ExampleInstrumentedTest.kt | 22 + common/src/main/AndroidManifest.xml | 4 + .../nanoflux/common}/UtilityModule.kt | 3 +- .../nanoflux/common/ExampleUnitTest.kt | 16 + gradle/libs.versions.toml | 36 +- gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 0 network/.gitignore | 1 + network/build.gradle.kts | 49 ++ network/consumer-rules.pro | 0 network/proguard-rules.pro | 21 + .../network/ExampleInstrumentedTest.kt | 22 + network/src/main/AndroidManifest.xml | 4 + .../nanoflux/network/MinifluxApiService.kt | 440 ++++++++++++++++++ .../nanoflux/network/NetworkModule.kt | 21 + .../network/repository/CategoryRepository.kt | 25 + .../network/repository/EntryRepository.kt | 50 ++ .../network/repository/FeedRepository.kt | 22 + .../network/repository/IconRepository.kt | 30 ++ .../network}/repository/UserRepository.kt | 15 +- .../nanoflux/network/ExampleUnitTest.kt | 16 + settings.gradle.kts | 3 + storage/.gitignore | 1 + storage/build.gradle.kts | 62 +++ storage/consumer-rules.pro | 0 storage/proguard-rules.pro | 40 ++ .../1.json | 40 +- .../storage/ExampleInstrumentedTest.kt | 22 + storage/src/main/AndroidManifest.xml | 4 + .../nanoflux/storage/NanofluxDatabase.kt | 29 ++ .../nanoflux/storage}/StorageModule.kt | 5 +- .../nanoflux/storage/dao/CategoryDao.kt | 19 + .../wbrawner/nanoflux/storage/dao/EntryDao.kt | 34 ++ .../wbrawner/nanoflux/storage}/dao/FeedDao.kt | 11 +- .../wbrawner/nanoflux/storage/dao/IconDao.kt | 20 + .../wbrawner/nanoflux/storage}/dao/UserDao.kt | 5 +- .../nanoflux/storage/model/Category.kt | 16 + .../wbrawner/nanoflux/storage/model/Entry.kt | 116 +++++ .../wbrawner/nanoflux/storage/model/Feed.kt | 142 ++++++ .../wbrawner/nanoflux/storage/model/User.kt | 40 ++ .../nanoflux/storage/ExampleUnitTest.kt | 16 + 68 files changed, 1819 insertions(+), 681 deletions(-) delete mode 100644 app/src/main/java/com/wbrawner/nanoflux/data/MinifluxApiService.kt delete mode 100644 app/src/main/java/com/wbrawner/nanoflux/data/NanofluxDatabase.kt delete mode 100644 app/src/main/java/com/wbrawner/nanoflux/data/dao/CategoryDao.kt delete mode 100644 app/src/main/java/com/wbrawner/nanoflux/data/dao/EntryDao.kt delete mode 100644 app/src/main/java/com/wbrawner/nanoflux/data/dao/IconDao.kt delete mode 100644 app/src/main/java/com/wbrawner/nanoflux/data/model/Category.kt delete mode 100644 app/src/main/java/com/wbrawner/nanoflux/data/model/Entry.kt delete mode 100644 app/src/main/java/com/wbrawner/nanoflux/data/model/Feed.kt delete mode 100644 app/src/main/java/com/wbrawner/nanoflux/data/model/User.kt delete mode 100644 app/src/main/java/com/wbrawner/nanoflux/data/repository/EntryRepository.kt delete mode 100644 app/src/main/java/com/wbrawner/nanoflux/data/repository/FeedRepository.kt create mode 100644 app/src/main/java/com/wbrawner/nanoflux/data/viewmodel/MainViewModel.kt delete mode 100644 app/src/main/java/com/wbrawner/nanoflux/di/NetworkModule.kt create mode 100644 app/src/main/java/com/wbrawner/nanoflux/ui/Entries.kt create mode 100644 common/.gitignore create mode 100644 common/build.gradle.kts create mode 100644 common/consumer-rules.pro create mode 100644 common/proguard-rules.pro create mode 100644 common/src/androidTest/java/com/wbrawner/nanoflux/common/ExampleInstrumentedTest.kt create mode 100644 common/src/main/AndroidManifest.xml rename {app/src/main/java/com/wbrawner/nanoflux/di => common/src/main/java/com/wbrawner/nanoflux/common}/UtilityModule.kt (84%) create mode 100644 common/src/test/java/com/wbrawner/nanoflux/common/ExampleUnitTest.kt mode change 100644 => 100755 gradlew create mode 100644 network/.gitignore create mode 100644 network/build.gradle.kts create mode 100644 network/consumer-rules.pro create mode 100644 network/proguard-rules.pro create mode 100644 network/src/androidTest/java/com/wbrawner/nanoflux/network/ExampleInstrumentedTest.kt create mode 100644 network/src/main/AndroidManifest.xml create mode 100644 network/src/main/java/com/wbrawner/nanoflux/network/MinifluxApiService.kt create mode 100644 network/src/main/java/com/wbrawner/nanoflux/network/NetworkModule.kt create mode 100644 network/src/main/java/com/wbrawner/nanoflux/network/repository/CategoryRepository.kt create mode 100644 network/src/main/java/com/wbrawner/nanoflux/network/repository/EntryRepository.kt create mode 100644 network/src/main/java/com/wbrawner/nanoflux/network/repository/FeedRepository.kt create mode 100644 network/src/main/java/com/wbrawner/nanoflux/network/repository/IconRepository.kt rename {app/src/main/java/com/wbrawner/nanoflux/data => network/src/main/java/com/wbrawner/nanoflux/network}/repository/UserRepository.kt (86%) create mode 100644 network/src/test/java/com/wbrawner/nanoflux/network/ExampleUnitTest.kt create mode 100644 storage/.gitignore create mode 100644 storage/build.gradle.kts create mode 100644 storage/consumer-rules.pro create mode 100644 storage/proguard-rules.pro rename {app/schemas/com.wbrawner.nanoflux.data.NanofluxDatabase => storage/schemas/com.wbrawner.nanoflux.storage.NanofluxDatabase}/1.json (92%) create mode 100644 storage/src/androidTest/java/com/wbrawner/nanoflux/storage/ExampleInstrumentedTest.kt create mode 100644 storage/src/main/AndroidManifest.xml create mode 100644 storage/src/main/java/com/wbrawner/nanoflux/storage/NanofluxDatabase.kt rename {app/src/main/java/com/wbrawner/nanoflux/di => storage/src/main/java/com/wbrawner/nanoflux/storage}/StorageModule.kt (92%) create mode 100644 storage/src/main/java/com/wbrawner/nanoflux/storage/dao/CategoryDao.kt create mode 100644 storage/src/main/java/com/wbrawner/nanoflux/storage/dao/EntryDao.kt rename {app/src/main/java/com/wbrawner/nanoflux/data => storage/src/main/java/com/wbrawner/nanoflux/storage}/dao/FeedDao.kt (56%) create mode 100644 storage/src/main/java/com/wbrawner/nanoflux/storage/dao/IconDao.kt rename {app/src/main/java/com/wbrawner/nanoflux/data => storage/src/main/java/com/wbrawner/nanoflux/storage}/dao/UserDao.kt (78%) create mode 100644 storage/src/main/java/com/wbrawner/nanoflux/storage/model/Category.kt create mode 100644 storage/src/main/java/com/wbrawner/nanoflux/storage/model/Entry.kt create mode 100644 storage/src/main/java/com/wbrawner/nanoflux/storage/model/Feed.kt create mode 100644 storage/src/main/java/com/wbrawner/nanoflux/storage/model/User.kt create mode 100644 storage/src/test/java/com/wbrawner/nanoflux/storage/ExampleUnitTest.kt diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 526b4c2..736480f 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -11,6 +11,9 @@