From 33725cb1ad7c5ecf8e36cf630bce1e64dd4a022d Mon Sep 17 00:00:00 2001 From: oxy Date: Wed, 4 Oct 2023 17:09:28 +0800 Subject: [PATCH] build: 1. remove silent mode. 2. remove post. 3. rename some classes and file names. feat: 1. benchmark. 2. dropbox for backup subscriptions. 3. lifecycle-aware helper. style: 1. deeply disabled content colors. behaviour: 1. disable "about project" and "dropbox" until it is completed. fix: 1. recomposition mistake. 2. Side-Effect mistake. --- .idea/androidTestResultsUserPreferences.xml | 22 + .idea/gradle.xml | 1 + README.md | 1 + androidApp/build.gradle.kts | 9 +- androidApp/src/main/AndroidManifest.xml | 5 +- ...nerator_profileGenerator-baseline-prof.txt | 10069 ++++++++++++++++ .../java/com/m3u/androidApp/MainActivity.kt | 62 +- ...omNavigationSheet.kt => AppBottomSheet.kt} | 6 +- .../m3u/androidApp/components/AppSnackHost.kt | 53 + .../androidApp/components/OptimizeBanner.kt | 69 - .../m3u/androidApp/components/PostDialog.kt | 114 - .../main/java/com/m3u/androidApp/ui/App.kt | 214 +- .../java/com/m3u/androidApp/ui/AppDefaults.kt | 40 +- .../java/com/m3u/androidApp/ui/AppScaffold.kt | 124 + .../com/m3u/androidApp/ui/RootViewModel.kt | 119 +- benchmark/.gitignore | 1 + benchmark/build.gradle.kts | 53 + benchmark/src/main/AndroidManifest.xml | 1 + .../m3u/benchmark/ExampleStartupBenchmark.kt | 38 + build.gradle.kts | 1 + .../core/architecture/{logger => }/Logger.kt | 12 +- .../core/architecture/{reader => }/Reader.kt | 2 +- .../configuration/Configuration.kt | 6 - .../ExperimentalConfiguration.kt | 6 +- .../configuration/SharedConfiguration.kt | 4 - .../core/architecture/logger/BannerLogger.kt | 26 - .../architecture/logger/di/LoggerModule.kt | 33 - .../architecture/service/BannerService.kt | 8 - .../architecture/service/PlayerManager.kt | 18 - .../main/java/com/m3u/data/api/DropboxApi.kt | 4 + .../api/RemoteApi.kt => api/GithubApi.kt} | 20 +- .../main/java/com/m3u/data/api/dto/Asset.kt | 32 + .../api/dto/Content.kt => api/dto/File.kt} | 14 +- .../main/java/com/m3u/data/api/dto/Links.kt | 14 + .../main/java/com/m3u/data/api/dto/Release.kt | 44 + .../main/java/com/m3u/data/api/dto/User.kt | 46 + .../main/java/com/m3u/data/contract/Apis.kt | 6 + .../main/java/com/m3u/data/contract/Certs.kt | 30 + .../main/java/com/m3u/data/contract/SSL.kt | 12 + .../java/com/m3u/data/database/M3UDatabase.kt | 12 +- .../java/com/m3u/data/database/dao/PostDao.kt | 30 - .../java/com/m3u/data/database/entity/Post.kt | 84 - .../m3u/data/{remote/api => }/di/ApiModule.kt | 20 +- .../data/{database => }/di/DatabaseModule.kt | 10 +- .../main/java/com/m3u/data/di/LoggerModule.kt | 31 + .../main/java/com/m3u/data/di/ParserModule.kt | 17 + .../java/com/m3u/data}/di/ReaderModule.kt | 6 +- .../{repository => }/di/RepositoryModule.kt | 10 +- .../data/{service => }/di/ServiceModule.kt | 20 +- .../java/com/m3u/data/logger/CommonLogger.kt | 11 +- .../java/com/m3u/data}/logger/FileLogger.kt | 8 +- .../main/java/com/m3u/data/logger/UiLogger.kt | 22 + .../m3u/data/{remote => }/parser/Parser.kt | 2 +- .../com/m3u/data/parser/PlaylistParser.kt | 9 + .../parser/m3u => parser/impl}/M3UData.kt | 2 +- .../impl/PlaylistParserImpl.kt} | 21 +- .../com/m3u/data}/reader/LogFileReader.kt | 3 +- .../com/m3u/data/remote/api/dto/Release.kt | 112 - .../m3u/data/remote/parser/di/ParserModule.kt | 22 - .../parser/m3u/ConcurrentStreamParser.kt | 159 - .../parser/m3u/InvalidatePlaylistError.kt | 5 - .../com/m3u/data/remote/parser/post/Output.kt | 3 - .../m3u/data/remote/parser/post/PostParser.kt | 27 - .../remote/parser/post/impl/s1/Output1.kt | 7 - .../remote/parser/post/impl/s1/PostParser1.kt | 13 - .../impl/unsupported/UnsupportedPostParser.kt | 10 - .../remote/parser/udp/AndroidUdpDiscover.kt | 102 - .../m3u/data/remote/parser/udp/UdpDiscover.kt | 9 - .../com/m3u/data/repository/PostRepository.kt | 17 - .../m3u/data/repository/RemoteRepository.kt | 2 +- .../repository/impl/FeedRepositoryImpl.kt | 23 +- .../repository/impl/LiveRepositoryImpl.kt | 9 +- .../repository/impl/MediaRepositoryImpl.kt | 7 +- .../repository/impl/PostRepositoryImpl.kt | 101 - .../repository/impl/RemoteRepositoryImpl.kt | 11 +- .../data/service/ConflatedBannerService.kt | 20 - .../m3u/data}/service/NotificationService.kt | 4 +- .../com/m3u/data/service/PlayerManager.kt | 23 + .../java/com/m3u/data/service/UiService.kt | 10 + .../NotificationServiceImpl.kt} | 12 +- .../PlayerManagerImpl.kt} | 68 +- .../m3u/data/service/impl/UiServiceImpl.kt | 41 + ...r.kt => SubscriptionInBackgroundWorker.kt} | 2 +- .../com/m3u/features/about/AboutScreen.kt | 6 +- .../about/src/main/res/values/strings.xml | 2 +- .../com/m3u/features/console/ConsoleScreen.kt | 6 +- .../m3u/features/console/ConsoleViewModel.kt | 2 +- .../command/impl/LoggerCommandHandler.kt | 2 +- .../com/m3u/features/crash/CrashHandler.kt | 5 +- .../crash/screen/list/ListViewModel.kt | 2 +- .../m3u/features/favorite/FavoriteScreen.kt | 1 + .../java/com/m3u/features/feed/FeedScreen.kt | 38 +- .../com/m3u/features/feed/FeedViewModel.kt | 5 +- .../java/com/m3u/features/live/LiveScreen.kt | 23 +- .../com/m3u/features/live/LiveViewModel.kt | 25 +- .../live/components/DlnaDeviceDialog.kt | 84 - .../live/components/DlnaDeviceItem.kt | 26 +- .../live/components/DlnaDevicesBottomSheet.kt | 99 + .../m3u/features/live/components/LiveMask.kt | 9 +- .../features/live/fragments/LiveFragment.kt | 26 +- .../java/com/m3u/features/main/MainScreen.kt | 4 +- .../java/com/m3u/features/main/MainState.kt | 3 - .../com/m3u/features/main/MainViewModel.kt | 7 +- .../features/scheme/SchemeReceiverService.kt | 1 - .../com/m3u/features/setting/SettingEvent.kt | 1 - .../com/m3u/features/setting/SettingScreen.kt | 24 +- .../com/m3u/features/setting/SettingState.kt | 1 - .../m3u/features/setting/SettingViewModel.kt | 30 +- .../setting/components/Preferences.kt | 95 +- .../setting/fragments/PreferencesFragment.kt | 22 +- .../src/main/res/values-zh-rCN/strings.xml | 3 +- .../setting/src/main/res/values/strings.xml | 3 +- gradle/libs.versions.toml | 7 + settings.gradle.kts | 1 + ui/build.gradle.kts | 1 - .../main/java/com/m3u/ui/components/Button.kt | 3 +- .../java/com/m3u/ui/components/Foreground.kt | 43 + .../main/java/com/m3u/ui/components/Mask.kt | 10 +- ui/src/main/java/com/m3u/ui/model/Helper.kt | 97 +- 119 files changed, 11401 insertions(+), 1792 deletions(-) create mode 100644 .idea/androidTestResultsUserPreferences.xml create mode 100644 androidApp/src/main/baselineProfiles/ComposeActivityBaselineProfileGenerator_profileGenerator-baseline-prof.txt rename androidApp/src/main/java/com/m3u/androidApp/components/{BottomNavigationSheet.kt => AppBottomSheet.kt} (98%) create mode 100644 androidApp/src/main/java/com/m3u/androidApp/components/AppSnackHost.kt delete mode 100644 androidApp/src/main/java/com/m3u/androidApp/components/OptimizeBanner.kt delete mode 100644 androidApp/src/main/java/com/m3u/androidApp/components/PostDialog.kt create mode 100644 androidApp/src/main/java/com/m3u/androidApp/ui/AppScaffold.kt create mode 100644 benchmark/.gitignore create mode 100644 benchmark/build.gradle.kts create mode 100644 benchmark/src/main/AndroidManifest.xml create mode 100644 benchmark/src/main/java/com/m3u/benchmark/ExampleStartupBenchmark.kt rename core/src/main/java/com/m3u/core/architecture/{logger => }/Logger.kt (74%) rename core/src/main/java/com/m3u/core/architecture/{reader => }/Reader.kt (72%) delete mode 100644 core/src/main/java/com/m3u/core/architecture/logger/BannerLogger.kt delete mode 100644 core/src/main/java/com/m3u/core/architecture/logger/di/LoggerModule.kt delete mode 100644 core/src/main/java/com/m3u/core/architecture/service/BannerService.kt delete mode 100644 core/src/main/java/com/m3u/core/architecture/service/PlayerManager.kt create mode 100644 data/src/main/java/com/m3u/data/api/DropboxApi.kt rename data/src/main/java/com/m3u/data/{remote/api/RemoteApi.kt => api/GithubApi.kt} (55%) create mode 100644 data/src/main/java/com/m3u/data/api/dto/Asset.kt rename data/src/main/java/com/m3u/data/{remote/api/dto/Content.kt => api/dto/File.kt} (73%) create mode 100644 data/src/main/java/com/m3u/data/api/dto/Links.kt create mode 100644 data/src/main/java/com/m3u/data/api/dto/Release.kt create mode 100644 data/src/main/java/com/m3u/data/api/dto/User.kt create mode 100644 data/src/main/java/com/m3u/data/contract/Apis.kt create mode 100644 data/src/main/java/com/m3u/data/contract/Certs.kt create mode 100644 data/src/main/java/com/m3u/data/contract/SSL.kt delete mode 100644 data/src/main/java/com/m3u/data/database/dao/PostDao.kt delete mode 100644 data/src/main/java/com/m3u/data/database/entity/Post.kt rename data/src/main/java/com/m3u/data/{remote/api => }/di/ApiModule.kt (69%) rename data/src/main/java/com/m3u/data/{database => }/di/DatabaseModule.kt (83%) create mode 100644 data/src/main/java/com/m3u/data/di/LoggerModule.kt create mode 100644 data/src/main/java/com/m3u/data/di/ParserModule.kt rename {core/src/main/java/com/m3u/core/architecture/reader => data/src/main/java/com/m3u/data}/di/ReaderModule.kt (69%) rename data/src/main/java/com/m3u/data/{repository => }/di/RepositoryModule.kt (81%) rename data/src/main/java/com/m3u/data/{service => }/di/ServiceModule.kt (63%) rename core/src/main/java/com/m3u/core/architecture/logger/AndroidLogger.kt => data/src/main/java/com/m3u/data/logger/CommonLogger.kt (71%) rename {core/src/main/java/com/m3u/core/architecture => data/src/main/java/com/m3u/data}/logger/FileLogger.kt (95%) create mode 100644 data/src/main/java/com/m3u/data/logger/UiLogger.kt rename data/src/main/java/com/m3u/data/{remote => }/parser/Parser.kt (96%) create mode 100644 data/src/main/java/com/m3u/data/parser/PlaylistParser.kt rename data/src/main/java/com/m3u/data/{remote/parser/m3u => parser/impl}/M3UData.kt (91%) rename data/src/main/java/com/m3u/data/{remote/parser/m3u/PlaylistParser.kt => parser/impl/PlaylistParserImpl.kt} (91%) rename {core/src/main/java/com/m3u/core/architecture => data/src/main/java/com/m3u/data}/reader/LogFileReader.kt (88%) delete mode 100644 data/src/main/java/com/m3u/data/remote/api/dto/Release.kt delete mode 100644 data/src/main/java/com/m3u/data/remote/parser/di/ParserModule.kt delete mode 100644 data/src/main/java/com/m3u/data/remote/parser/m3u/ConcurrentStreamParser.kt delete mode 100644 data/src/main/java/com/m3u/data/remote/parser/m3u/InvalidatePlaylistError.kt delete mode 100644 data/src/main/java/com/m3u/data/remote/parser/post/Output.kt delete mode 100644 data/src/main/java/com/m3u/data/remote/parser/post/PostParser.kt delete mode 100644 data/src/main/java/com/m3u/data/remote/parser/post/impl/s1/Output1.kt delete mode 100644 data/src/main/java/com/m3u/data/remote/parser/post/impl/s1/PostParser1.kt delete mode 100644 data/src/main/java/com/m3u/data/remote/parser/post/impl/unsupported/UnsupportedPostParser.kt delete mode 100644 data/src/main/java/com/m3u/data/remote/parser/udp/AndroidUdpDiscover.kt delete mode 100644 data/src/main/java/com/m3u/data/remote/parser/udp/UdpDiscover.kt delete mode 100644 data/src/main/java/com/m3u/data/repository/PostRepository.kt delete mode 100644 data/src/main/java/com/m3u/data/repository/impl/PostRepositoryImpl.kt delete mode 100644 data/src/main/java/com/m3u/data/service/ConflatedBannerService.kt rename {core/src/main/java/com/m3u/core/architecture => data/src/main/java/com/m3u/data}/service/NotificationService.kt (91%) create mode 100644 data/src/main/java/com/m3u/data/service/PlayerManager.kt create mode 100644 data/src/main/java/com/m3u/data/service/UiService.kt rename data/src/main/java/com/m3u/data/service/{AndroidNotificationService.kt => impl/NotificationServiceImpl.kt} (89%) rename data/src/main/java/com/m3u/data/service/{AndroidPlayerManager.kt => impl/PlayerManagerImpl.kt} (66%) create mode 100644 data/src/main/java/com/m3u/data/service/impl/UiServiceImpl.kt rename data/src/main/java/com/m3u/data/worker/{SubscribeFeedWorker.kt => SubscriptionInBackgroundWorker.kt} (98%) delete mode 100644 features/live/src/main/java/com/m3u/features/live/components/DlnaDeviceDialog.kt create mode 100644 features/live/src/main/java/com/m3u/features/live/components/DlnaDevicesBottomSheet.kt create mode 100644 ui/src/main/java/com/m3u/ui/components/Foreground.kt diff --git a/.idea/androidTestResultsUserPreferences.xml b/.idea/androidTestResultsUserPreferences.xml new file mode 100644 index 000000000..e9142af2f --- /dev/null +++ b/.idea/androidTestResultsUserPreferences.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index a73fa4685..1655d6462 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -11,6 +11,7 @@