From 26c203f287b6331717a055552b91b4a2aeb817b1 Mon Sep 17 00:00:00 2001 From: Sean Mac Gillicuddy Date: Tue, 1 Oct 2019 13:32:25 +0100 Subject: [PATCH] correct core packaging, alter pre-commit hook and travis for multimodule build --- .travis.yml | 19 +- app/build.gradle | 118 +- app/lint-baseline.xml | 15 +- .../org/kiwix/kiwixmobile/DownloadTest.java | 2 +- .../org/kiwix/kiwixmobile/KiwixMockServer.kt | 1 + .../org/kiwix/kiwixmobile/NetworkTest.java | 5 +- .../bookmark/BookmarksActivityTest.java | 1 + .../data/local/KiwixDatabaseTest.java | 1 + .../data/local/dao/BookDaoTest.java | 5 +- .../data/local/dao/RecentSearchDaoTest.java | 3 +- .../di/components/TestComponent.kt | 7 +- .../di/modules/TestNetworkModule.kt | 5 +- .../kiwixmobile/help/HelpActivityTest.kt | 1 + .../kiwixmobile/intro/IntroActivityTest.kt | 1 + .../kiwixmobile/main/MainActivityTest.java | 1 + .../search/SearchActivityTest.java | 1 + .../settings/KiwixSettingsActivityTest.java | 2 +- .../splash/SplashActivityTest.java | 7 +- .../kiwixmobile/testutils/TestUtils.java | 2 +- .../utils/KiwixIdlingResource.java | 3 +- .../files/FileUtilsInstrumentationTest.java | 3 +- .../zim_manager/ZimManageActivityTest.kt | 14 +- .../kiwixmobile/zim_manager/ZimManageRobot.kt | 2 +- app/src/main/AndroidManifest.xml | 34 +- build.gradle.kts | 7 +- core/build.gradle | 13 + core/lint-baseline.xml | 1332 ++++++++--------- .../videowebview/VideoEnabledWebView.java | 1 - .../storage/StorageSelectArrayAdapter.kt | 8 +- .../utils/storage/StorageSelectDialog.kt | 6 +- .../{ => core}/KiwixApplication.java | 11 +- .../{ => core}/KiwixViewModelFactory.java | 2 +- .../{ => core}/base/BaseActivity.java | 6 +- .../{ => core}/base/BaseContract.java | 4 +- .../{ => core}/base/BaseFragment.kt | 6 +- .../{ => core}/base/BasePresenter.java | 2 +- .../{ => core}/bookmark/BookmarkItem.kt | 6 +- .../bookmark/BookmarksActivity.java | 14 +- .../{ => core}/bookmark/BookmarksAdapter.java | 4 +- .../bookmark/BookmarksContract.java | 4 +- .../{ => core}/bookmark/BookmarksModule.java | 4 +- .../bookmark/BookmarksPresenter.java | 12 +- .../data/AbstractContentProvider.kt | 2 +- .../{ => core}/data/DataModule.java | 2 +- .../{ => core}/data/DataSource.java | 10 +- .../kiwixmobile/{ => core}/data/Repository.kt | 34 +- .../{ => core}/data/ZimContentProvider.java | 8 +- .../{ => core}/data/local/KiwixDatabase.java | 32 +- .../{ => core}/data/local/dao/BookDao.java | 10 +- .../data/local/dao/BookmarksDao.java | 6 +- .../data/local/dao/NetworkLanguageDao.java | 8 +- .../data/local/dao/RecentSearchDao.java | 6 +- .../data/local/entity/BookDataSource.java | 2 +- .../data/local/entity/BookmarksSpec.java | 2 +- .../data/local/entity/LibraryDataSource.java | 2 +- .../local/entity/NetworkLanguageSpec.java | 2 +- .../data/local/entity/RecentSearchSpec.java | 2 +- .../{ => core}/data/remote/KiwixService.java | 6 +- .../data/remote/UserAgentInterceptor.java | 2 +- .../{ => core}/di/ActivityScope.kt | 2 +- .../kiwixmobile/{ => core}/di/ServiceScope.kt | 2 +- .../{ => core}/di/ViewModelKey.java | 2 +- .../di/components/ActivityComponent.kt | 16 +- .../di/components/ApplicationComponent.java | 26 +- .../di/components/ServiceComponent.kt | 8 +- .../di/modules/ActivityBindingModule.java | 38 +- .../{ => core}/di/modules/ActivityModule.kt | 8 +- .../di/modules/ApplicationModule.java | 18 +- .../{ => core}/di/modules/DatabaseModule.kt | 16 +- .../{ => core}/di/modules/DownloaderModule.kt | 28 +- .../{ => core}/di/modules/JNIModule.java | 2 +- .../{ => core}/di/modules/NetworkModule.java | 6 +- .../{ => core}/di/modules/ServiceModule.kt | 24 +- .../{ => core}/di/modules/ViewModelModule.kt | 10 +- .../{ => core}/di/qualifiers/Computation.java | 2 +- .../{ => core}/di/qualifiers/IO.java | 2 +- .../{ => core}/di/qualifiers/MainThread.java | 2 +- .../{ => core}/downloader/Chunk.java | 2 +- .../{ => core}/downloader/ChunkUtils.java | 4 +- .../{ => core}/downloader/DownloadAdapter.kt | 15 +- .../{ => core}/downloader/DownloadFragment.kt | 18 +- .../{ => core}/downloader/DownloadIntent.java | 2 +- .../{ => core}/downloader/DownloadMonitor.kt | 2 +- .../downloader/DownloadRequester.kt | 6 +- .../downloader/DownloadViewHolder.kt | 18 +- .../{ => core}/downloader/Downloader.kt | 6 +- .../{ => core}/downloader/DownloaderImpl.kt | 10 +- .../downloader/fetch/FetchDownloadMonitor.kt | 6 +- .../fetch/FetchDownloadNotificationManager.kt | 2 +- .../fetch/FetchDownloadRequester.kt | 10 +- .../downloader/model/Base64String.kt | 2 +- .../downloader/model/DownloadItem.kt | 7 +- .../downloader/model/DownloadModel.kt | 8 +- .../downloader/model/DownloadRequest.kt | 10 +- .../{ => core}/downloader/model/Seconds.kt | 4 +- .../entity/LibraryNetworkEntity.java | 2 +- .../entity/MetaLinkNetworkEntity.java | 2 +- .../{ => core}/error/ErrorActivity.java | 16 +- .../extensions/ActivityExtensions.kt | 2 +- .../{ => core}/extensions/BookExtensions.kt | 10 +- .../ConnectivityManagerExtensions.kt | 12 + .../extensions/ContextExtensions.kt | 4 +- .../{ => core}/extensions/CursorExtensions.kt | 2 +- .../extensions/ImageViewExtensions.kt | 4 +- .../extensions/TextViewExtensions.kt | 2 +- .../{ => core}/extensions/ViewExtensions.kt | 2 +- .../extensions/ViewGroupExtensions.kt | 15 +- .../{ => core}/help/HelpActivity.java | 8 +- .../{ => core}/help/HelpAdapter.java | 6 +- .../{ => core}/history/HistoryActivity.java | 12 +- .../{ => core}/history/HistoryAdapter.java | 4 +- .../{ => core}/history/HistoryContract.java | 4 +- .../{ => core}/history/HistoryListItem.kt | 6 +- .../{ => core}/history/HistoryModule.java | 4 +- .../{ => core}/history/HistoryPresenter.java | 12 +- .../{ => core}/intro/CustomViewPager.java | 2 +- .../{ => core}/intro/IntroActivity.java | 6 +- .../{ => core}/intro/IntroContract.java | 4 +- .../{ => core}/intro/IntroModule.java | 4 +- .../{ => core}/intro/IntroPagerAdapter.java | 2 +- .../{ => core}/intro/IntroPresenter.java | 8 +- .../{ => core}/language/LanguageActivity.kt | 30 +- .../language/adapter/LanguageAdapter.kt | 6 +- .../language/adapter/LanguageDelegate.kt | 14 +- .../language/adapter/LanguageListItem.kt | 4 +- .../adapter/LanguageListViewHolder.kt | 8 +- .../{ => core}/language/viewmodel/Action.kt | 6 +- .../language/viewmodel/LanguageViewModel.kt | 22 +- .../viewmodel/SaveLanguagesAndFinish.kt | 8 +- .../{ => core}/language/viewmodel/State.kt | 27 +- .../{ => core}/main/AddNoteDialog.java | 8 +- .../{ => core}/main/AnimatedProgressBar.java | 2 +- .../main/CompatFindActionModeCallback.java | 2 +- .../main/ConfirmationAlertDialogFragment.java | 4 +- .../{ => core}/main/DocumentParser.java | 4 +- .../{ => core}/main/FileReader.java | 2 +- .../{ => core}/main/KiwixSearchWidget.java | 10 +- .../{ => core}/main/KiwixTextToSpeech.java | 10 +- .../{ => core}/main/KiwixWebChromeClient.java | 2 +- .../{ => core}/main/KiwixWebView.java | 10 +- .../{ => core}/main/KiwixWebViewClient.java | 14 +- .../{ => core}/main/MainActivity.java | 113 +- .../{ => core}/main/MainContract.java | 10 +- .../{ => core}/main/MainModule.java | 4 +- .../{ => core}/main/MainPresenter.java | 14 +- .../{ => core}/main/OnSwipeTouchListener.java | 2 +- .../{ => core}/main/RateAppCounter.java | 2 +- .../{ => core}/main/TableDrawerAdapter.java | 2 +- .../{ => core}/main/TabsAdapter.java | 14 +- .../main/ToolbarScrollingKiwixWebView.java | 4 +- .../main/ToolbarStaticKiwixWebView.java | 4 +- .../{ => core}/main/WebViewCallback.java | 2 +- .../newdb/dao/FetchDownloadDao.kt | 25 +- .../newdb/dao/HistoryDao.kt | 8 +- .../newdb/dao/NewBookDao.kt | 12 +- .../newdb/dao/NewBookmarksDao.kt | 12 +- .../newdb/dao/NewLanguagesDao.kt | 6 +- .../newdb/dao/NewRecentSearchDao.kt | 15 +- .../newdb/entities/BookOnDiskEntity.kt | 6 +- .../newdb/entities/BookmarkEntity.kt | 6 +- .../newdb/entities/FetchDownloadEntity.kt | 4 +- .../newdb/entities/HistoryEntity.kt | 4 +- .../newdb/entities/LanguageEntity.kt | 4 +- .../newdb/entities/RecentSearchEntity.kt | 4 +- .../search/AutoCompleteAdapter.java | 8 +- .../{ => core}/search/SearchActivity.java | 16 +- .../{ => core}/search/SearchPresenter.java | 8 +- .../{ => core}/search/SearchViewCallback.java | 4 +- .../settings/CustomSwitchPreference.java | 2 +- .../settings/KiwixSettingsActivity.java | 8 +- .../{ => core}/settings/PrefsFragment.java | 32 +- .../{ => core}/settings/SettingsContract.java | 4 +- .../settings/SettingsPresenter.java | 6 +- .../{ => core}/settings/SliderPreference.java | 4 +- .../{ => core}/settings/StorageCalculator.kt | 2 +- .../{ => core}/splash/SplashActivity.java | 10 +- .../{ => core}/utils/AlertDialogShower.kt | 4 +- .../{ => core}/utils/AnimationUtils.java | 2 +- .../{ => core}/utils/BookUtils.java | 2 +- .../{ => core}/utils/Constants.java | 4 +- .../{ => core}/utils/DialogShower.kt | 2 +- .../{ => core}/utils/DimenUtils.java | 2 +- .../{ => core}/utils/ImageUtils.kt | 15 +- .../{ => core}/utils/KiwixDialog.kt | 4 +- .../{ => core}/utils/LanguageContainer.kt | 6 +- .../{ => core}/utils/LanguageUtils.kt | 13 +- .../{ => core}/utils/NetworkUtils.java | 6 +- .../{ => core}/utils/ServerUtils.java | 2 +- .../utils/SharedPreferenceUtil.java | 4 +- .../{ => core}/utils/StorageUtils.java | 2 +- .../{ => core}/utils/StyleUtils.java | 4 +- .../{ => core}/utils/TestingUtils.java | 2 +- .../{ => core}/utils/UpdateUtils.java | 6 +- .../{ => core}/utils/files/FileSearch.kt | 6 +- .../{ => core}/utils/files/FileUtils.kt | 12 +- .../{ => core}/webserver/WebServerHelper.java | 8 +- .../{ => core}/webserver/ZimHostActivity.java | 27 +- .../webserver/ZimHostCallbacks.java | 3 +- .../core/webserver/ZimHostContract.java | 18 + .../{ => core}/webserver/ZimHostModule.java | 4 +- .../webserver/ZimHostPresenter.java | 10 +- .../HotspotNotificationManager.java | 11 +- .../wifi_hotspot/HotspotService.java | 16 +- .../wifi_hotspot/HotspotStateReceiver.kt | 13 +- .../wifi_hotspot/IpAddressCallbacks.java | 4 +- .../zim_manager/BaseBroadcastReceiver.kt | 2 +- .../ConnectivityBroadcastReceiver.kt | 6 +- .../zim_manager/DefaultLanguageProvider.kt | 2 +- .../{ => core}/zim_manager/Fat32Checker.kt | 12 +- .../{ => core}/zim_manager/KiloByte.kt | 2 +- .../{ => core}/zim_manager/Language.kt | 2 +- .../{ => core}/zim_manager/NetworkState.kt | 2 +- .../zim_manager/SectionsPagerAdapter.kt | 8 +- .../zim_manager/SimplePageChangeListener.kt | 2 +- .../zim_manager/SimpleTextListener.kt | 2 +- .../{ => core}/zim_manager/ZimFileReader.kt | 12 +- .../zim_manager/ZimManageActivity.kt | 22 +- .../zim_manager/ZimManageViewModel.kt | 80 +- .../zim_manager/ZimReaderContainer.kt | 2 +- .../fileselect_view/ArticleCount.kt | 2 +- .../fileselect_view/FileSelectListState.kt | 8 +- .../fileselect_view/StorageObserver.kt | 12 +- .../fileselect_view/ZimFileSelectFragment.kt | 35 +- .../adapter/BookOnDiskDelegate.kt | 18 +- .../adapter/BooksOnDiskAdapter.kt | 12 + .../adapter/BooksOnDiskListItem.kt | 10 +- .../adapter/BooksOnDiskViewHolder.kt | 26 +- .../fileselect_view/effects/DeleteFiles.kt | 16 +- .../fileselect_view/effects/None.kt | 2 +- .../fileselect_view/effects/OpenFile.kt | 8 +- .../fileselect_view/effects/ShareFiles.kt | 4 +- .../fileselect_view/effects/SideEffect.kt | 4 +- .../effects/StartMultiSelection.kt | 12 +- .../library_view/LibraryFragment.kt | 50 +- .../library_view/LibraryViewCallback.java | 8 +- .../library_view/adapter/LibraryAdapter.kt | 6 +- .../library_view/adapter/LibraryDelegate.kt | 16 +- .../library_view/adapter/LibraryListItem.kt | 4 +- .../library_view/adapter/LibraryViewHolder.kt | 22 +- .../adapter/base/AbsDelegateAdapter.kt | 2 +- .../adapter/base/AdapterDelegate.kt | 2 +- .../adapter/base/AdapterDelegateManager.kt | 2 +- .../adapter/base/BaseDelegateAdapter.kt | 2 +- .../adapter/base/BaseViewHolder.kt | 2 +- .../local_file_transfer/FileItem.java | 10 +- .../local_file_transfer/FileListAdapter.java | 10 +- .../KiwixWifiP2pBroadcastReceiver.java | 2 +- .../LocalFileTransferActivity.java | 14 +- .../PeerGroupHandshakeAsyncTask.java | 2 +- .../ReceiverDeviceAsyncTask.java | 16 +- .../SenderDeviceAsyncTask.java | 14 +- .../WifiDirectManager.java | 12 +- .../WifiPeerListAdapter.java | 6 +- .../ConnectivityManagerExtensions.kt | 12 - .../webserver/ZimHostContract.java | 18 - .../adapter/BooksOnDiskAdapter.kt | 12 - core/src/main/res/layout/activity_intro.xml | 2 +- .../main/res/layout/activity_kiwix_error.xml | 2 +- .../main/res/layout/main_activity_content.xml | 2 +- core/src/main/res/xml-v25/shortcuts.xml | 2 +- core/src/main/res/xml/preferences.xml | 20 +- core/src/main/res/xml/webview.xml | 2 +- .../{ => core}/InstantExecutorExtension.kt | 2 +- .../{ => core}/TestUtilitiyFunctions.kt | 2 +- .../{ => core}/downloader/ChunkUtilsTest.kt | 6 +- .../entity/MetaLinkNetworkEntityTest.java | 2 +- .../language/adapter/LanguageDelegateTest.kt | 25 +- .../viewmodel/LanguageViewModelTest.kt | 40 +- .../viewmodel/SaveLanguagesAndFinishTest.kt | 10 +- .../language/viewmodel/StateTest.kt | 10 +- .../settings/StorageCalculatorTest.kt | 2 +- .../{ => core}/utils/BookUtilsTest.kt | 2 +- .../{ => core}/utils/NetworkUtilsTest.kt | 9 +- .../{ => core}/utils/files/FileSearchTest.kt | 6 +- .../{ => core}/utils/files/FileUtilsTest.kt | 8 +- .../{ => core}/zim_manager/LanguageTest.kt | 4 +- .../zim_manager/ZimManageViewModelTest.kt | 56 +- .../fileselect_view/StorageObserverTest.kt | 28 +- .../kiwixmobile/{ => core}/TestConstants.kt | 2 +- .../{ => core}/TestModelFunctions.kt | 40 +- custom/build.gradle | 11 + custom/lint-baseline.xml | 33 + custom/src/main/AndroidManifest.xml | 34 +- settings.gradle | 1 + 284 files changed, 2080 insertions(+), 1968 deletions(-) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/KiwixApplication.java (94%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/KiwixViewModelFactory.java (98%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/base/BaseActivity.java (93%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/base/BaseContract.java (92%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/base/BaseFragment.kt (74%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/base/BasePresenter.java (96%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/bookmark/BookmarkItem.kt (80%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/bookmark/BookmarksActivity.java (94%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/bookmark/BookmarksAdapter.java (95%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/bookmark/BookmarksContract.java (83%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/bookmark/BookmarksModule.java (70%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/bookmark/BookmarksPresenter.java (89%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/data/AbstractContentProvider.kt (97%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/data/DataModule.java (84%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/data/DataSource.java (78%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/data/Repository.kt (78%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/data/ZimContentProvider.java (93%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/data/local/KiwixDatabase.java (86%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/data/local/dao/BookDao.java (90%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/data/local/dao/BookmarksDao.java (93%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/data/local/dao/NetworkLanguageDao.java (86%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/data/local/dao/RecentSearchDao.java (89%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/data/local/entity/BookDataSource.java (95%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/data/local/entity/BookmarksSpec.java (95%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/data/local/entity/LibraryDataSource.java (94%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/data/local/entity/NetworkLanguageSpec.java (95%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/data/local/entity/RecentSearchSpec.java (95%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/data/remote/KiwixService.java (91%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/data/remote/UserAgentInterceptor.java (96%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/di/ActivityScope.kt (66%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/di/ServiceScope.kt (95%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/di/ViewModelKey.java (96%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/di/components/ActivityComponent.kt (70%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/di/components/ApplicationComponent.java (70%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/di/components/ServiceComponent.kt (62%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/di/modules/ActivityBindingModule.java (62%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/di/modules/ActivityModule.kt (81%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/di/modules/ApplicationModule.java (84%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/di/modules/DatabaseModule.kt (81%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/di/modules/DownloaderModule.kt (76%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/di/modules/JNIModule.java (96%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/di/modules/NetworkModule.java (92%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/di/modules/ServiceModule.kt (67%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/di/modules/ViewModelModule.kt (82%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/di/qualifiers/Computation.java (79%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/di/qualifiers/IO.java (79%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/di/qualifiers/MainThread.java (79%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/downloader/Chunk.java (97%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/downloader/ChunkUtils.java (96%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/downloader/DownloadAdapter.kt (81%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/downloader/DownloadFragment.kt (84%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/downloader/DownloadIntent.java (95%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/downloader/DownloadMonitor.kt (94%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/downloader/DownloadRequester.kt (82%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/downloader/DownloadViewHolder.kt (79%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/downloader/Downloader.kt (83%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/downloader/DownloaderImpl.kt (81%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/downloader/fetch/FetchDownloadMonitor.kt (94%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/downloader/fetch/FetchDownloadNotificationManager.kt (98%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/downloader/fetch/FetchDownloadRequester.kt (84%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/downloader/model/Base64String.kt (89%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/downloader/model/DownloadItem.kt (95%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/downloader/model/DownloadModel.kt (86%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/downloader/model/DownloadRequest.kt (81%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/downloader/model/Seconds.kt (92%) rename core/src/main/java/org/kiwix/kiwixmobile/{library => core}/entity/LibraryNetworkEntity.java (98%) rename core/src/main/java/org/kiwix/kiwixmobile/{library => core}/entity/MetaLinkNetworkEntity.java (98%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/error/ErrorActivity.java (90%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/extensions/ActivityExtensions.kt (96%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/extensions/BookExtensions.kt (72%) create mode 100644 core/src/main/java/org/kiwix/kiwixmobile/core/extensions/ConnectivityManagerExtensions.kt rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/extensions/ContextExtensions.kt (88%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/extensions/CursorExtensions.kt (96%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/extensions/ImageViewExtensions.kt (79%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/extensions/TextViewExtensions.kt (85%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/extensions/ViewExtensions.kt (90%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/extensions/ViewGroupExtensions.kt (77%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/help/HelpActivity.java (93%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/help/HelpAdapter.java (92%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/history/HistoryActivity.java (96%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/history/HistoryAdapter.java (97%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/history/HistoryContract.java (83%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/history/HistoryListItem.kt (92%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/history/HistoryModule.java (70%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/history/HistoryPresenter.java (90%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/intro/CustomViewPager.java (97%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/intro/IntroActivity.java (95%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/intro/IntroContract.java (65%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/intro/IntroModule.java (69%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/intro/IntroPagerAdapter.java (95%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/intro/IntroPresenter.java (64%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/language/LanguageActivity.kt (75%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/language/adapter/LanguageAdapter.kt (79%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/language/adapter/LanguageDelegate.kt (58%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/language/adapter/LanguageListItem.kt (78%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/language/adapter/LanguageListViewHolder.kt (84%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/language/viewmodel/Action.kt (55%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/language/viewmodel/LanguageViewModel.kt (73%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/language/viewmodel/SaveLanguagesAndFinish.kt (82%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/language/viewmodel/State.kt (66%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/main/AddNoteDialog.java (98%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/main/AnimatedProgressBar.java (99%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/main/CompatFindActionModeCallback.java (99%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/main/ConfirmationAlertDialogFragment.java (96%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/main/DocumentParser.java (95%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/main/FileReader.java (97%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/main/KiwixSearchWidget.java (91%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/main/KiwixTextToSpeech.java (97%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/main/KiwixWebChromeClient.java (97%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/main/KiwixWebView.java (96%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/main/KiwixWebViewClient.java (91%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/main/MainActivity.java (94%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/main/MainContract.java (67%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/main/MainModule.java (70%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/main/MainPresenter.java (88%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/main/OnSwipeTouchListener.java (97%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/main/RateAppCounter.java (97%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/main/TableDrawerAdapter.java (99%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/main/TabsAdapter.java (93%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/main/ToolbarScrollingKiwixWebView.java (97%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/main/ToolbarStaticKiwixWebView.java (94%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/main/WebViewCallback.java (96%) rename core/src/main/java/org/kiwix/kiwixmobile/{database => core}/newdb/dao/FetchDownloadDao.kt (77%) rename core/src/main/java/org/kiwix/kiwixmobile/{database => core}/newdb/dao/HistoryDao.kt (87%) rename core/src/main/java/org/kiwix/kiwixmobile/{database => core}/newdb/dao/NewBookDao.kt (86%) rename core/src/main/java/org/kiwix/kiwixmobile/{database => core}/newdb/dao/NewBookmarksDao.kt (85%) rename core/src/main/java/org/kiwix/kiwixmobile/{database => core}/newdb/dao/NewLanguagesDao.kt (89%) rename core/src/main/java/org/kiwix/kiwixmobile/{database => core}/newdb/dao/NewRecentSearchDao.kt (82%) rename core/src/main/java/org/kiwix/kiwixmobile/{database => core}/newdb/entities/BookOnDiskEntity.kt (89%) rename core/src/main/java/org/kiwix/kiwixmobile/{database => core}/newdb/entities/BookmarkEntity.kt (90%) rename core/src/main/java/org/kiwix/kiwixmobile/{database => core}/newdb/entities/FetchDownloadEntity.kt (96%) rename core/src/main/java/org/kiwix/kiwixmobile/{database => core}/newdb/entities/HistoryEntity.kt (91%) rename core/src/main/java/org/kiwix/kiwixmobile/{database => core}/newdb/entities/LanguageEntity.kt (90%) rename core/src/main/java/org/kiwix/kiwixmobile/{database => core}/newdb/entities/RecentSearchEntity.kt (89%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/search/AutoCompleteAdapter.java (95%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/search/SearchActivity.java (95%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/search/SearchPresenter.java (87%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/search/SearchViewCallback.java (90%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/settings/CustomSwitchPreference.java (98%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/settings/KiwixSettingsActivity.java (88%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/settings/PrefsFragment.java (91%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/settings/SettingsContract.java (65%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/settings/SettingsPresenter.java (83%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/settings/SliderPreference.java (98%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/settings/StorageCalculator.kt (96%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/splash/SplashActivity.java (87%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/utils/AlertDialogShower.kt (92%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/utils/AnimationUtils.java (98%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/utils/BookUtils.java (97%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/utils/Constants.java (97%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/utils/DialogShower.kt (95%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/utils/DimenUtils.java (97%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/utils/ImageUtils.kt (88%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/utils/KiwixDialog.kt (94%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/utils/LanguageContainer.kt (76%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/utils/LanguageUtils.kt (96%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/utils/NetworkUtils.java (96%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/utils/ServerUtils.java (97%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/utils/SharedPreferenceUtil.java (98%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/utils/StorageUtils.java (95%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/utils/StyleUtils.java (95%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/utils/TestingUtils.java (97%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/utils/UpdateUtils.java (54%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/utils/files/FileSearch.kt (95%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/utils/files/FileUtils.kt (96%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/webserver/WebServerHelper.java (92%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/webserver/ZimHostActivity.java (89%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/webserver/ZimHostCallbacks.java (73%) create mode 100644 core/src/main/java/org/kiwix/kiwixmobile/core/webserver/ZimHostContract.java rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/webserver/ZimHostModule.java (80%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/webserver/ZimHostPresenter.java (77%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/wifi_hotspot/HotspotNotificationManager.java (90%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/wifi_hotspot/HotspotService.java (86%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/wifi_hotspot/HotspotStateReceiver.kt (86%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/wifi_hotspot/IpAddressCallbacks.java (65%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/BaseBroadcastReceiver.kt (90%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/ConnectivityBroadcastReceiver.kt (80%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/DefaultLanguageProvider.kt (84%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/Fat32Checker.kt (87%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/KiloByte.kt (91%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/Language.kt (96%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/NetworkState.kt (55%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/SectionsPagerAdapter.kt (85%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/SimplePageChangeListener.kt (90%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/SimpleTextListener.kt (88%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/ZimFileReader.kt (95%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/ZimManageActivity.kt (88%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/ZimManageViewModel.kt (82%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/ZimReaderContainer.kt (98%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/fileselect_view/ArticleCount.kt (92%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/fileselect_view/FileSelectListState.kt (75%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/fileselect_view/StorageObserver.kt (71%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/fileselect_view/ZimFileSelectFragment.kt (77%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/fileselect_view/adapter/BookOnDiskDelegate.kt (73%) create mode 100644 core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/adapter/BooksOnDiskAdapter.kt rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/fileselect_view/adapter/BooksOnDiskListItem.kt (76%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/fileselect_view/adapter/BooksOnDiskViewHolder.kt (76%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/fileselect_view/effects/DeleteFiles.kt (68%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/fileselect_view/effects/None.kt (62%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/fileselect_view/effects/OpenFile.kt (79%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/fileselect_view/effects/ShareFiles.kt (88%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/fileselect_view/effects/SideEffect.kt (88%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/fileselect_view/effects/StartMultiSelection.kt (57%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/library_view/LibraryFragment.kt (79%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/library_view/LibraryViewCallback.java (82%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/library_view/adapter/LibraryAdapter.kt (79%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/library_view/adapter/LibraryDelegate.kt (70%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/library_view/adapter/LibraryListItem.kt (68%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/library_view/adapter/LibraryViewHolder.kt (71%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/library_view/adapter/base/AbsDelegateAdapter.kt (94%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/library_view/adapter/base/AdapterDelegate.kt (79%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/library_view/adapter/base/AdapterDelegateManager.kt (93%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/library_view/adapter/base/BaseDelegateAdapter.kt (96%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/library_view/adapter/base/BaseViewHolder.kt (80%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/local_file_transfer/FileItem.java (75%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/local_file_transfer/FileListAdapter.java (85%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/local_file_transfer/KiwixWifiP2pBroadcastReceiver.java (96%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/local_file_transfer/LocalFileTransferActivity.java (97%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/local_file_transfer/PeerGroupHandshakeAsyncTask.java (98%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/local_file_transfer/ReceiverDeviceAsyncTask.java (81%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/local_file_transfer/SenderDeviceAsyncTask.java (82%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/local_file_transfer/WifiDirectManager.java (97%) rename core/src/main/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/local_file_transfer/WifiPeerListAdapter.java (89%) delete mode 100644 core/src/main/java/org/kiwix/kiwixmobile/extensions/ConnectivityManagerExtensions.kt delete mode 100644 core/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostContract.java delete mode 100644 core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/adapter/BooksOnDiskAdapter.kt rename core/src/test/java/org/kiwix/kiwixmobile/{ => core}/InstantExecutorExtension.kt (97%) rename core/src/test/java/org/kiwix/kiwixmobile/{ => core}/TestUtilitiyFunctions.kt (97%) rename core/src/test/java/org/kiwix/kiwixmobile/{ => core}/downloader/ChunkUtilsTest.kt (97%) rename core/src/test/java/org/kiwix/kiwixmobile/{library => core}/entity/MetaLinkNetworkEntityTest.java (98%) rename core/src/test/java/org/kiwix/kiwixmobile/{ => core}/language/adapter/LanguageDelegateTest.kt (70%) rename core/src/test/java/org/kiwix/kiwixmobile/{ => core}/language/viewmodel/LanguageViewModelTest.kt (79%) rename core/src/test/java/org/kiwix/kiwixmobile/{ => core}/language/viewmodel/SaveLanguagesAndFinishTest.kt (83%) rename core/src/test/java/org/kiwix/kiwixmobile/{ => core}/language/viewmodel/StateTest.kt (84%) rename core/src/test/java/org/kiwix/kiwixmobile/{ => core}/settings/StorageCalculatorTest.kt (97%) rename core/src/test/java/org/kiwix/kiwixmobile/{ => core}/utils/BookUtilsTest.kt (97%) rename core/src/test/java/org/kiwix/kiwixmobile/{ => core}/utils/NetworkUtilsTest.kt (97%) rename core/src/test/java/org/kiwix/kiwixmobile/{ => core}/utils/files/FileSearchTest.kt (97%) rename core/src/test/java/org/kiwix/kiwixmobile/{ => core}/utils/files/FileUtilsTest.kt (89%) rename core/src/test/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/LanguageTest.kt (96%) rename core/src/test/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/ZimManageViewModelTest.kt (87%) rename core/src/test/java/org/kiwix/kiwixmobile/{ => core}/zim_manager/fileselect_view/StorageObserverTest.kt (80%) rename core/src/testShared/org/kiwix/kiwixmobile/{ => core}/TestConstants.kt (95%) rename core/src/testShared/org/kiwix/kiwixmobile/{ => core}/TestModelFunctions.kt (76%) diff --git a/.travis.yml b/.travis.yml index c81939b67..535267979 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,11 +23,6 @@ install: - pip install --user 'requests[security]' - wget -r -nH -nd -np -R index.html* robots.txt* http://download.kiwix.org/dev/android/api/licenses/ -e robots=off -P $ANDROID_HOME/licenses || true -addons: - apt: - packages: - - lynx - before_cache: - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ @@ -57,23 +52,15 @@ before_script: - adb shell input keyevent 82 & script: - - ./gradlew createKiwixDebugCoverageReport lintKiwixDebug jacocoTestKiwixDebugUnitTestReport assemble + - ./gradlew createDebugCoverageReport ktlintCheck lint jacocoTestReport assembleRelease after_success: - bash <(curl -s https://codecov.io/bash) - - ./gradlew kiwixtestUploadKiwix - -after_failure: - - export REPORT_DIR=${TRAVIS_HOME}/build/kiwix/kiwix-android/app/build/outputs/reports/ - - export LOG_DIR=${REPORT_DIR}androidTests/connected/flavors/KIWIX/ - - lynx -dump ${LOG_DIR}index.html - - lynx -dump ${REPORT_DIR}lint-results-kiwixDebug.html - before_deploy: # - export APP_CHANGELOG=$(cat app/src/kiwix/play/release-notes/en-US/default.txt) - export DATE=$(date +%Y-%m-%d) - - export OUTPUT_DIR=app/build/outputs/apk/kiwix + - export OUTPUT_DIR=app/build/outputs/apk - export UNIVERSAL_RELEASE_APK=$OUTPUT_DIR/release/*universal*.apk - export UNIVERSAL_DEBUG_APK=$OUTPUT_DIR/debug/*universal*.apk - export SSH_KEY=travisci_builder_id_key @@ -96,7 +83,7 @@ deploy: #publish on play store - provider: script skip_cleanup: true - script: ./gradlew publishKiwixRelease + script: ./gradlew publishRelease on: tags: true diff --git a/app/build.gradle b/app/build.gradle index 8b16da71b..d49cfbc32 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,9 +9,7 @@ buildscript { dependencies { dependencies { - classpath Libs.com_android_tools_build_gradle - classpath Libs.kotlin_gradle_plugin - classpath Libs.ktlint_gradle + } } } @@ -27,13 +25,7 @@ apply plugin: 'kotlin-kapt' apply plugin: 'jacoco-android' apply plugin: "org.jlleitschuh.gradle.ktlint" -jacoco { - toolVersion = "0.8.3" -} -tasks.withType(Test) { - jacoco.includeNoLocationClasses = true -} def buildNumber = System.getenv('TRAVIS_BUILD_NUMBER') ?: "dev" @@ -76,14 +68,23 @@ android { multiDexEnabled true vectorDrawables.useSupportLibrary = true archivesBaseName = "$buildNumber" + // Set vanilla config + buildConfigField "boolean", "IS_CUSTOM_APP", "false" + buildConfigField "boolean", "HAS_EMBEDDED_ZIM", "false" + buildConfigField "String", "ZIM_FILE_NAME", "\"\"" + buildConfigField "long", "ZIM_FILE_SIZE", "0" + buildConfigField "int", "CONTENT_VERSION_CODE", "0" + buildConfigField "String", "ENFORCED_LANG", "\"\"" + resValue "string", "app_name", "Kiwix" + resValue "string", "app_search_string", "Search Kiwix" + versionCode generateVersionCode() + versionName generateVersionName() } aaptOptions { cruncherEnabled true } - testBuildType "debug" - lintOptions { abortOnError true checkAllWarnings true @@ -117,8 +118,6 @@ android { } } - flavorDimensions "default" - signingConfigs { release { storeFile file("../kiwix-android.keystore") @@ -149,33 +148,6 @@ android { } } - productFlavors { - // Vanilla Kiwix app - kiwix { - println "Configuring Kiwix" - // Set vanilla config - buildConfigField "boolean", "IS_CUSTOM_APP", "false" - buildConfigField "boolean", "HAS_EMBEDDED_ZIM", "false" - buildConfigField "String", "ZIM_FILE_NAME", "\"\"" - buildConfigField "long", "ZIM_FILE_SIZE", "0" - buildConfigField "int", "CONTENT_VERSION_CODE", "0" - buildConfigField "String", "ENFORCED_LANG", "\"\"" - resValue "string", "app_name", "Kiwix" - resValue "string", "app_search_string", "Search Kiwix" - if (project.hasProperty("version_code")) { - def version_code = project.property("version_code") - versionCode version_code.toInteger() - } else { - versionCode generateVersionCode() - } - if (project.hasProperty("version_name")) { - versionName project.property("version_name") - } else { - versionName generateVersionName() - } - } - } - compileOptions { encoding = "UTF-8" sourceCompatibility JavaVersion.VERSION_1_8 @@ -229,35 +201,43 @@ ktlint { android = true } +jacoco { + toolVersion = "0.8.3" +} + +tasks.withType(Test) { + jacoco.includeNoLocationClasses = true +} + apply from: "${rootDir}/team-props/git-hooks.gradle" - dependencies { - implementation project(":core") - implementation(Libs.appcompat) - androidTestImplementation(Libs.espresso_core) - androidTestImplementation(Libs.espresso_web) - androidTestImplementation(Libs.espresso_intents) - androidTestImplementation(Libs.barista) { - exclude group: "com.android.support.test.uiautomator" - } - androidTestImplementation(Libs.espresso_contrib) - androidTestImplementation(Libs.androidx_annotation) - androidTestImplementation(Libs.junit) - androidTestImplementation(Libs.androidx_test_runner) - androidTestImplementation(Libs.androidx_test_rules) - androidTestImplementation(Libs.androidx_test_core) - androidTestImplementation(Libs.mockwebserver) - androidTestUtil(Libs.orchestrator) - androidTestImplementation(Libs.mockito_android) - androidTestCompileOnly(Libs.javax_annotation_api) - implementation(Libs.dagger) - kaptAndroidTest(Libs.dagger_compiler) - androidTestImplementation(Libs.mockk_android) - androidTestImplementation(Libs.uiautomator) - androidTestImplementation(Libs.assertj_core) - androidTestImplementation(Libs.simple_xml) { - exclude module: 'stax' - exclude module: 'stax-api' - exclude module: 'xpp3' - } +dependencies { + implementation project(":core") + implementation(Libs.appcompat) + androidTestImplementation(Libs.espresso_core) + androidTestImplementation(Libs.espresso_web) + androidTestImplementation(Libs.espresso_intents) + androidTestImplementation(Libs.barista) { + exclude group: "com.android.support.test.uiautomator" } + androidTestImplementation(Libs.espresso_contrib) + androidTestImplementation(Libs.androidx_annotation) + androidTestImplementation(Libs.junit) + androidTestImplementation(Libs.androidx_test_runner) + androidTestImplementation(Libs.androidx_test_rules) + androidTestImplementation(Libs.androidx_test_core) + androidTestImplementation(Libs.mockwebserver) + androidTestUtil(Libs.orchestrator) + androidTestImplementation(Libs.mockito_android) + androidTestCompileOnly(Libs.javax_annotation_api) + implementation(Libs.dagger) + kaptAndroidTest(Libs.dagger_compiler) + androidTestImplementation(Libs.mockk_android) + androidTestImplementation(Libs.uiautomator) + androidTestImplementation(Libs.assertj_core) + androidTestImplementation(Libs.simple_xml) { + exclude module: 'stax' + exclude module: 'stax-api' + exclude module: 'xpp3' + } +} diff --git a/app/lint-baseline.xml b/app/lint-baseline.xml index 1d0a57a3f..215bfe4b0 100644 --- a/app/lint-baseline.xml +++ b/app/lint-baseline.xml @@ -1,5 +1,5 @@ - + + + + + diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/DownloadTest.java b/app/src/androidTest/java/org/kiwix/kiwixmobile/DownloadTest.java index d59c50080..2fdccaea4 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/DownloadTest.java +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/DownloadTest.java @@ -37,7 +37,7 @@ import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; -import org.kiwix.kiwixmobile.main.MainActivity; +import org.kiwix.kiwixmobile.core.main.MainActivity; import org.kiwix.kiwixmobile.utils.KiwixIdlingResource; import static androidx.test.espresso.Espresso.onData; diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/KiwixMockServer.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/KiwixMockServer.kt index 93d85d55a..d9dc8ceaf 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/KiwixMockServer.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/KiwixMockServer.kt @@ -4,6 +4,7 @@ import okhttp3.mockwebserver.Dispatcher import okhttp3.mockwebserver.MockResponse import okhttp3.mockwebserver.MockWebServer import okhttp3.mockwebserver.RecordedRequest +import org.kiwix.kiwixmobile.core.TEST_PORT import org.simpleframework.xml.core.Persister import java.io.StringWriter import java.util.Stack diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/NetworkTest.java b/app/src/androidTest/java/org/kiwix/kiwixmobile/NetworkTest.java index 7f8406088..1536d69e6 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/NetworkTest.java +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/NetworkTest.java @@ -36,10 +36,11 @@ import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; -import org.kiwix.kiwixmobile.data.ZimContentProvider; +import org.kiwix.kiwixmobile.core.KiwixApplication; +import org.kiwix.kiwixmobile.core.data.ZimContentProvider; import org.kiwix.kiwixmobile.di.components.DaggerTestComponent; import org.kiwix.kiwixmobile.di.components.TestComponent; -import org.kiwix.kiwixmobile.main.MainActivity; +import org.kiwix.kiwixmobile.core.main.MainActivity; import org.kiwix.kiwixmobile.testutils.TestUtils; import org.kiwix.kiwixmobile.utils.KiwixIdlingResource; diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/bookmark/BookmarksActivityTest.java b/app/src/androidTest/java/org/kiwix/kiwixmobile/bookmark/BookmarksActivityTest.java index b6ff9a8bf..0d933e92f 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/bookmark/BookmarksActivityTest.java +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/bookmark/BookmarksActivityTest.java @@ -7,6 +7,7 @@ import androidx.test.rule.GrantPermissionRule; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; +import org.kiwix.kiwixmobile.core.bookmark.BookmarksActivity; @RunWith(AndroidJUnit4.class) public class BookmarksActivityTest { diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/data/local/KiwixDatabaseTest.java b/app/src/androidTest/java/org/kiwix/kiwixmobile/data/local/KiwixDatabaseTest.java index 81f4abc1a..99676a0ff 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/data/local/KiwixDatabaseTest.java +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/data/local/KiwixDatabaseTest.java @@ -34,6 +34,7 @@ import java.io.Writer; import java.util.ArrayList; import org.junit.Test; import org.junit.runner.RunWith; +import org.kiwix.kiwixmobile.core.data.local.KiwixDatabase; import org.kiwix.kiwixmobile.data.local.entity.Bookmark; import static org.junit.Assert.assertArrayEquals; diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/data/local/dao/BookDaoTest.java b/app/src/androidTest/java/org/kiwix/kiwixmobile/data/local/dao/BookDaoTest.java index 206405dc8..468aff36c 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/data/local/dao/BookDaoTest.java +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/data/local/dao/BookDaoTest.java @@ -26,13 +26,14 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.kiwix.kiwixmobile.data.local.KiwixDatabase; +import org.kiwix.kiwixmobile.core.data.local.KiwixDatabase; +import org.kiwix.kiwixmobile.core.data.local.dao.BookDao; import org.kiwix.kiwixmobile.data.local.entity.BookDatabaseEntity; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import static org.junit.Assert.assertEquals; -import static org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity.Book; +import static org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/data/local/dao/RecentSearchDaoTest.java b/app/src/androidTest/java/org/kiwix/kiwixmobile/data/local/dao/RecentSearchDaoTest.java index 50e123c50..66ba16acb 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/data/local/dao/RecentSearchDaoTest.java +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/data/local/dao/RecentSearchDaoTest.java @@ -23,7 +23,8 @@ import com.yahoo.squidb.sql.Query; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.kiwix.kiwixmobile.data.local.KiwixDatabase; +import org.kiwix.kiwixmobile.core.data.local.KiwixDatabase; +import org.kiwix.kiwixmobile.core.data.local.dao.RecentSearchDao; import org.mockito.Mock; import org.mockito.MockitoAnnotations; diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/di/components/TestComponent.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/di/components/TestComponent.kt index 50937f347..f665f282c 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/di/components/TestComponent.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/di/components/TestComponent.kt @@ -22,9 +22,10 @@ import dagger.BindsInstance import dagger.Component import org.kiwix.kiwixmobile.NetworkTest import org.kiwix.kiwixmobile.ZimTest -import org.kiwix.kiwixmobile.data.DataModule -import org.kiwix.kiwixmobile.di.modules.ApplicationModule -import org.kiwix.kiwixmobile.di.modules.JNIModule +import org.kiwix.kiwixmobile.core.data.DataModule +import org.kiwix.kiwixmobile.core.di.components.ApplicationComponent +import org.kiwix.kiwixmobile.core.di.modules.ApplicationModule +import org.kiwix.kiwixmobile.core.di.modules.JNIModule import org.kiwix.kiwixmobile.di.modules.TestNetworkModule import javax.inject.Singleton diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/di/modules/TestNetworkModule.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/di/modules/TestNetworkModule.kt index c0e31d305..74fb1bc54 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/di/modules/TestNetworkModule.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/di/modules/TestNetworkModule.kt @@ -19,8 +19,9 @@ package org.kiwix.kiwixmobile.di.modules import dagger.Module import okhttp3.OkHttpClient -import org.kiwix.kiwixmobile.MOCK_BASE_URL -import org.kiwix.kiwixmobile.data.remote.KiwixService +import org.kiwix.kiwixmobile.core.MOCK_BASE_URL +import org.kiwix.kiwixmobile.core.data.remote.KiwixService +import org.kiwix.kiwixmobile.core.di.modules.NetworkModule /** * Created by mhutti1 on 14/04/17. diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/help/HelpActivityTest.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/help/HelpActivityTest.kt index 94fa2f798..03b98a3cf 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/help/HelpActivityTest.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/help/HelpActivityTest.kt @@ -22,6 +22,7 @@ import androidx.test.filters.SdkSuppress import androidx.test.rule.ActivityTestRule import org.junit.Test import org.kiwix.kiwixmobile.BaseActivityTest +import org.kiwix.kiwixmobile.core.help.HelpActivity @SdkSuppress(minSdkVersion = Build.VERSION_CODES.JELLY_BEAN_MR2) class HelpActivityTest : BaseActivityTest() { diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/intro/IntroActivityTest.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/intro/IntroActivityTest.kt index ee67bdfc7..be46c89b8 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/intro/IntroActivityTest.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/intro/IntroActivityTest.kt @@ -21,6 +21,7 @@ import android.os.Build import androidx.test.filters.SdkSuppress import org.junit.Test import org.kiwix.kiwixmobile.BaseActivityTest +import org.kiwix.kiwixmobile.core.intro.IntroActivity @SdkSuppress(minSdkVersion = Build.VERSION_CODES.JELLY_BEAN_MR2) class IntroActivityTest : BaseActivityTest() { diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/main/MainActivityTest.java b/app/src/androidTest/java/org/kiwix/kiwixmobile/main/MainActivityTest.java index 3c8affed0..9cedfba80 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/main/MainActivityTest.java +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/main/MainActivityTest.java @@ -30,6 +30,7 @@ import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.kiwix.kiwixmobile.core.R; +import org.kiwix.kiwixmobile.core.main.MainActivity; import static com.schibsted.spain.barista.interaction.BaristaClickInteractions.clickOn; import static org.kiwix.kiwixmobile.testutils.TestUtils.TEST_PAUSE_MS; diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/search/SearchActivityTest.java b/app/src/androidTest/java/org/kiwix/kiwixmobile/search/SearchActivityTest.java index 6eb0539ac..0358c832d 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/search/SearchActivityTest.java +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/search/SearchActivityTest.java @@ -8,6 +8,7 @@ import androidx.test.rule.GrantPermissionRule; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; +import org.kiwix.kiwixmobile.core.search.SearchActivity; @LargeTest @RunWith(AndroidJUnit4.class) diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/settings/KiwixSettingsActivityTest.java b/app/src/androidTest/java/org/kiwix/kiwixmobile/settings/KiwixSettingsActivityTest.java index d336c4770..623d96a45 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/settings/KiwixSettingsActivityTest.java +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/settings/KiwixSettingsActivityTest.java @@ -23,7 +23,7 @@ import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.kiwix.kiwixmobile.core.R; -import org.kiwix.kiwixmobile.main.MainActivity; +import org.kiwix.kiwixmobile.core.main.MainActivity; import static androidx.test.espresso.Espresso.onData; import static androidx.test.espresso.action.ViewActions.click; diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/splash/SplashActivityTest.java b/app/src/androidTest/java/org/kiwix/kiwixmobile/splash/SplashActivityTest.java index 833d6f14d..eb809d7e0 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/splash/SplashActivityTest.java +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/splash/SplashActivityTest.java @@ -34,15 +34,16 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; -import org.kiwix.kiwixmobile.intro.IntroActivity; -import org.kiwix.kiwixmobile.main.MainActivity; +import org.kiwix.kiwixmobile.core.intro.IntroActivity; +import org.kiwix.kiwixmobile.core.main.MainActivity; +import org.kiwix.kiwixmobile.core.splash.SplashActivity; import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.intent.Intents.intended; import static androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent; import static org.junit.Assert.assertEquals; import static org.kiwix.kiwixmobile.testutils.TestUtils.TEST_PAUSE_MS; -import static org.kiwix.kiwixmobile.utils.SharedPreferenceUtil.PREF_SHOW_INTRO; +import static org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil.PREF_SHOW_INTRO; @LargeTest @RunWith(AndroidJUnit4.class) diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/testutils/TestUtils.java b/app/src/androidTest/java/org/kiwix/kiwixmobile/testutils/TestUtils.java index 78b9f7fd6..277656fdc 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/testutils/TestUtils.java +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/testutils/TestUtils.java @@ -40,7 +40,7 @@ import java.text.SimpleDateFormat; import java.util.Date; import org.hamcrest.Description; import org.hamcrest.Matcher; -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity.Book; +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book; /** * Created by mhutti1 on 07/04/17. diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/utils/KiwixIdlingResource.java b/app/src/androidTest/java/org/kiwix/kiwixmobile/utils/KiwixIdlingResource.java index fceb1d50e..955064877 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/utils/KiwixIdlingResource.java +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/utils/KiwixIdlingResource.java @@ -18,7 +18,8 @@ package org.kiwix.kiwixmobile.utils; import androidx.test.espresso.IdlingResource; -import org.kiwix.kiwixmobile.utils.TestingUtils.IdleListener; +import org.kiwix.kiwixmobile.core.utils.TestingUtils; +import org.kiwix.kiwixmobile.core.utils.TestingUtils.IdleListener; /** * Created by mhutti1 on 19/04/17. diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/utils/files/FileUtilsInstrumentationTest.java b/app/src/androidTest/java/org/kiwix/kiwixmobile/utils/files/FileUtilsInstrumentationTest.java index d1c685ae5..e73ec1c5b 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/utils/files/FileUtilsInstrumentationTest.java +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/utils/files/FileUtilsInstrumentationTest.java @@ -9,7 +9,8 @@ import java.util.Random; import org.junit.After; import org.junit.Before; import org.junit.Test; -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity.Book; +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book; +import org.kiwix.kiwixmobile.core.utils.files.FileUtils; import static org.junit.Assert.assertEquals; diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/zim_manager/ZimManageActivityTest.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/zim_manager/ZimManageActivityTest.kt index 26d9ed77d..645beef31 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/zim_manager/ZimManageActivityTest.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/zim_manager/ZimManageActivityTest.kt @@ -5,14 +5,14 @@ import androidx.test.filters.SdkSuppress import okhttp3.mockwebserver.MockResponse import org.junit.Test import org.kiwix.kiwixmobile.BaseActivityTest -import org.kiwix.kiwixmobile.KiwixApplication +import org.kiwix.kiwixmobile.core.KiwixApplication import org.kiwix.kiwixmobile.KiwixMockServer -import org.kiwix.kiwixmobile.book -import org.kiwix.kiwixmobile.data.remote.KiwixService.LIBRARY_NETWORK_PATH -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity -import org.kiwix.kiwixmobile.libraryNetworkEntity -import org.kiwix.kiwixmobile.metaLinkNetworkEntity -import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil +import org.kiwix.kiwixmobile.core.book +import org.kiwix.kiwixmobile.core.data.remote.KiwixService.LIBRARY_NETWORK_PATH +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity +import org.kiwix.kiwixmobile.core.libraryNetworkEntity +import org.kiwix.kiwixmobile.core.metaLinkNetworkEntity +import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil import java.util.concurrent.TimeUnit.SECONDS @SdkSuppress(minSdkVersion = Build.VERSION_CODES.JELLY_BEAN_MR2) diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/zim_manager/ZimManageRobot.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/zim_manager/ZimManageRobot.kt index 687f6e954..d7ab52f94 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/zim_manager/ZimManageRobot.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/zim_manager/ZimManageRobot.kt @@ -25,7 +25,7 @@ import org.kiwix.kiwixmobile.Findable.ViewId import org.kiwix.kiwixmobile.core.R import org.kiwix.kiwixmobile.language.LanguageRobot import org.kiwix.kiwixmobile.language.language -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity.Book +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book fun zimManage(func: ZimManageRobot.() -> Unit) = ZimManageRobot().applyWithViewHierarchyPrinting(func) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index b141a0d18..cce96824a 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -17,7 +17,7 @@ @@ -43,7 +43,7 @@ android:resource="@xml/shortcuts" /> @@ -160,17 +160,17 @@ - - - - + + + + - + @@ -184,10 +184,10 @@ android:resource="@xml/kiwix_widget_provider_info" /> - + - - - - + + + + + android:value=".core.main.MainActivity" /> diff --git a/build.gradle.kts b/build.gradle.kts index e04f1d58e..bd7b5580c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,9 +4,10 @@ buildscript { jcenter() } dependencies { - classpath("com.android.tools.build:gradle:3.5.0") - classpath("com.dicedmelon.gradle:jacoco-android:0.1.4") - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50") + classpath(Libs.com_android_tools_build_gradle) + classpath(Libs.kotlin_gradle_plugin) + classpath(Libs.ktlint_gradle) + classpath(Libs.jacoco_android) // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/core/build.gradle b/core/build.gradle index 1d6e7809f..3e18764f4 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -64,6 +64,19 @@ android { androidExtensions { experimental = true } + + testOptions { + execution 'ANDROIDX_TEST_ORCHESTRATOR' + unitTests.returnDefaultValues = true + unitTests.all { + useJUnitPlatform() + testLogging { + events "passed", "skipped", "failed", "standardOut", "standardError" + outputs.upToDateWhen { false } + showStandardStreams = true + } + } + } lintOptions { abortOnError true checkAllWarnings true diff --git a/core/lint-baseline.xml b/core/lint-baseline.xml index 232835a03..4c5eef4f1 100644 --- a/core/lint-baseline.xml +++ b/core/lint-baseline.xml @@ -14,7 +14,7 @@ errorLine1=" get() = if (activeNetworkInfo?.isConnected == true)" errorLine2=" ~~~~~~~~~~~~~~~~~"> @@ -25,7 +25,7 @@ errorLine1=" private val isNotConnected get() = conMan.activeNetworkInfo?.isConnected == false" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -36,8 +36,8 @@ errorLine1=" NetworkInfo[] networkInfos = connectivity.getAllNetworkInfo();" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -47,8 +47,8 @@ errorLine1=" NetworkInfo networkInfo = connectivity.getActiveNetworkInfo();" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -58,8 +58,8 @@ errorLine1=" NetworkInfo wifi = connectivity.getNetworkInfo(ConnectivityManager.TYPE_WIFI);" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -80,7 +80,7 @@ errorLine1=" bookmark -> bookmark.getBookmarkTitle().toLowerCase().contains(newText.toLowerCase()))" errorLine2=" ~~~~~~~~~~~"> @@ -91,7 +91,7 @@ errorLine1=" bookmark -> bookmark.getBookmarkTitle().toLowerCase().contains(newText.toLowerCase()))" errorLine2=" ~~~~~~~~~~~"> @@ -102,7 +102,7 @@ errorLine1=" if (historyItem.getHistoryTitle().toLowerCase()" errorLine2=" ~~~~~~~~~~~"> @@ -113,7 +113,7 @@ errorLine1=" .contains(newText.toLowerCase())) {" errorLine2=" ~~~~~~~~~~~"> @@ -124,7 +124,7 @@ errorLine1=" autoAdapter.getFilter().filter(searchText.toLowerCase());" errorLine2=" ~~~~~~~~~~~"> @@ -135,7 +135,7 @@ errorLine1=" autoAdapter.getFilter().filter(s.toLowerCase());" errorLine2=" ~~~~~~~~~~~"> @@ -146,7 +146,7 @@ errorLine1=" searchView.setQuery(getIntent().getStringExtra(Intent.EXTRA_PROCESS_TEXT), true);" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -157,11 +157,11 @@ errorLine1=" intent.setData(uri);" errorLine2=" ~~~~~~~~~~~~~~~~~~~"> @@ -197,8 +197,8 @@ errorLine1=" filePath = String.format("/data/data/%s/lib/%s", getPackageName()," errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~"> @@ -553,7 +553,7 @@ errorLine1=" webView.addJavascriptInterface(new ParserCallback(), "DocumentParser");" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~"> @@ -564,7 +564,7 @@ errorLine1=" webView.addJavascriptInterface(new TTSJavaScriptInterface(), "tts");" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~"> @@ -575,8 +575,8 @@ errorLine1=" getCurrentWebView().getSettings().setJavaScriptEnabled(true);" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -663,7 +663,7 @@ errorLine1=" noteEdited = true;" errorLine2=" ~~~~~~~~~~"> @@ -674,7 +674,7 @@ errorLine1=" enableSaveNoteMenuItem();" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~"> @@ -685,7 +685,7 @@ errorLine1=" enableShareNoteMenuItem();" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~"> @@ -696,7 +696,7 @@ errorLine1=" exitAddNoteDialog();" errorLine2=" ~~~~~~~~~~~~~~~~~"> @@ -707,7 +707,7 @@ errorLine1=" mDrawWidth = width;" errorLine2=" ~~~~~~~~~~"> @@ -718,7 +718,7 @@ errorLine1=" if (mProgress >= 100) {" errorLine2=" ~~~~~~~~~"> @@ -729,7 +729,7 @@ errorLine1=" fadeOut();" errorLine2=" ~~~~~~~"> @@ -740,7 +740,7 @@ errorLine1=" mData = (ArrayList<String>) results.values;" errorLine2=" ~~~~~"> @@ -751,7 +751,7 @@ errorLine1=" refreshAdapter = false;" errorLine2=" ~~~~~~~~~~~~~~"> @@ -762,7 +762,7 @@ errorLine1=" allBookmarks.removeAll(deleteList);" errorLine2=" ~~~~~~~~~~~~"> @@ -773,7 +773,7 @@ errorLine1=" allBookmarks.removeAll(deleteList);" errorLine2=" ~~~~~~~~~~"> @@ -784,7 +784,7 @@ errorLine1=" for (BookmarkItem bookmark : deleteList) {" errorLine2=" ~~~~~~~~~~"> @@ -795,7 +795,7 @@ errorLine1=" int position = bookmarksList.indexOf(bookmark);" errorLine2=" ~~~~~~~~~~~~~"> @@ -806,7 +806,7 @@ errorLine1=" bookmarksList.remove(bookmark);" errorLine2=" ~~~~~~~~~~~~~"> @@ -817,7 +817,7 @@ errorLine1=" bookmarksAdapter.notifyItemRemoved(position);" errorLine2=" ~~~~~~~~~~~~~~~~"> @@ -828,7 +828,7 @@ errorLine1=" bookmarksAdapter.notifyItemRangeChanged(position, bookmarksAdapter.getItemCount());" errorLine2=" ~~~~~~~~~~~~~~~~"> @@ -839,7 +839,7 @@ errorLine1=" bookmarksAdapter.notifyItemRangeChanged(position, bookmarksAdapter.getItemCount());" errorLine2=" ~~~~~~~~~~~~~~~~"> @@ -850,7 +850,7 @@ errorLine1=" presenter.deleteBookmarks(new ArrayList<>(deleteList));" errorLine2=" ~~~~~~~~~~"> @@ -861,7 +861,7 @@ errorLine1=" if (deleteList.size() != 0) {" errorLine2=" ~~~~~~~~~~"> @@ -872,7 +872,7 @@ errorLine1=" deleteList.clear();" errorLine2=" ~~~~~~~~~~"> @@ -883,7 +883,7 @@ errorLine1=" actionMode = null;" errorLine2=" ~~~~~~~~~~"> @@ -894,7 +894,7 @@ errorLine1=" if (refreshAdapter) {" errorLine2=" ~~~~~~~~~~~~~~"> @@ -905,7 +905,7 @@ errorLine1=" bookmarksAdapter.notifyDataSetChanged();" errorLine2=" ~~~~~~~~~~~~~~~~"> @@ -916,7 +916,7 @@ errorLine1=" bookmarksList.clear();" errorLine2=" ~~~~~~~~~~~~~"> @@ -927,7 +927,7 @@ errorLine1=" bookmarksList.addAll(allBookmarks);" errorLine2=" ~~~~~~~~~~~~"> @@ -938,7 +938,7 @@ errorLine1=" bookmarksList.addAll(allBookmarks);" errorLine2=" ~~~~~~~~~~~~~"> @@ -949,7 +949,7 @@ errorLine1=" bookmarksAdapter.notifyDataSetChanged();" errorLine2=" ~~~~~~~~~~~~~~~~"> @@ -960,7 +960,7 @@ errorLine1=" presenter.filterBookmarks(bookmarksList, newText);" errorLine2=" ~~~~~~~~~~~~~"> @@ -971,7 +971,7 @@ errorLine1=" if (disposable != null && !disposable.isDisposed()) {" errorLine2=" ~~~~~~~~~~"> @@ -982,7 +982,7 @@ errorLine1=" if (disposable != null && !disposable.isDisposed()) {" errorLine2=" ~~~~~~~~~~"> @@ -993,7 +993,7 @@ errorLine1=" disposable.dispose();" errorLine2=" ~~~~~~~~~~"> @@ -1004,7 +1004,7 @@ errorLine1=" disposable = d;" errorLine2=" ~~~~~~~~~~"> @@ -1015,7 +1015,7 @@ errorLine1=" title = sectionTitle.trim();" errorLine2=" ~~~~~"> @@ -1026,7 +1026,7 @@ errorLine1=" sections.add(section);" errorLine2=" ~~~~~~~~"> @@ -1037,7 +1037,7 @@ errorLine1=" title = "";" errorLine2=" ~~~~~"> @@ -1048,7 +1048,7 @@ errorLine1=" sections = new ArrayList<>();" errorLine2=" ~~~~~~~~"> @@ -1059,7 +1059,7 @@ errorLine1=" new Handler(Looper.getMainLooper()).post(() -> listener.clearSections());" errorLine2=" ~~~~~~~~"> @@ -1070,7 +1070,7 @@ errorLine1=" new Handler(Looper.getMainLooper()).post(() -> listener.sectionsLoaded(title, sections));" errorLine2=" ~~~~~~~~"> @@ -1081,7 +1081,7 @@ errorLine1=" new Handler(Looper.getMainLooper()).post(() -> listener.sectionsLoaded(title, sections));" errorLine2=" ~~~~~~~~"> @@ -1092,7 +1092,7 @@ errorLine1=" new Handler(Looper.getMainLooper()).post(() -> listener.sectionsLoaded(title, sections));" errorLine2=" ~~~~~"> @@ -1103,7 +1103,7 @@ errorLine1=" requestCheckSystemFileType.onNext(Unit)" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1114,7 +1114,7 @@ errorLine1=" File(path).deleteIfExists()" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1125,7 +1125,7 @@ errorLine1=" File(path).deleteIfExists()" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1136,7 +1136,7 @@ errorLine1=" updater.onNext { fetchDownloadDao.update(download) }" errorLine2=" ~~~~~~~"> @@ -1147,7 +1147,7 @@ errorLine1=" updater.onNext { fetchDownloadDao.delete(download) }" errorLine2=" ~~~~~~~"> @@ -1158,7 +1158,7 @@ errorLine1=" val request = downloadRequest.toFetchRequest(sharedPreferenceUtil)" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1169,7 +1169,7 @@ errorLine1=" refreshAdapter = false;" errorLine2=" ~~~~~~~~~~~~~~"> @@ -1180,7 +1180,7 @@ errorLine1=" fullHistory.removeAll(deleteList);" errorLine2=" ~~~~~~~~~~"> @@ -1191,7 +1191,7 @@ errorLine1=" fullHistory.removeAll(deleteList);" errorLine2=" ~~~~~~~~~~~"> @@ -1202,7 +1202,7 @@ errorLine1=" for (HistoryListItem history : deleteList) {" errorLine2=" ~~~~~~~~~~"> @@ -1213,7 +1213,7 @@ errorLine1=" int position = historyList.indexOf(history);" errorLine2=" ~~~~~~~~~~~"> @@ -1224,7 +1224,7 @@ errorLine1=" if (position - 1 >= 0 && historyList.get(position - 1) == null &&" errorLine2=" ~~~~~~~~~~~"> @@ -1235,7 +1235,7 @@ errorLine1=" (position + 1 >= historyList.size() ||" errorLine2=" ~~~~~~~~~~~"> @@ -1246,7 +1246,7 @@ errorLine1=" (position + 1 < historyList.size() && historyList.get(position + 1) == null))) {" errorLine2=" ~~~~~~~~~~~"> @@ -1257,7 +1257,7 @@ errorLine1=" (position + 1 < historyList.size() && historyList.get(position + 1) == null))) {" errorLine2=" ~~~~~~~~~~~"> @@ -1268,7 +1268,7 @@ errorLine1=" historyList.remove(position - 1);" errorLine2=" ~~~~~~~~~~~"> @@ -1279,7 +1279,7 @@ errorLine1=" historyAdapter.notifyItemRemoved(position - 1);" errorLine2=" ~~~~~~~~~~~~~~"> @@ -1290,7 +1290,7 @@ errorLine1=" position = historyList.indexOf(history);" errorLine2=" ~~~~~~~~~~~"> @@ -1301,7 +1301,7 @@ errorLine1=" historyList.remove(history);" errorLine2=" ~~~~~~~~~~~"> @@ -1312,7 +1312,7 @@ errorLine1=" historyAdapter.notifyItemRemoved(position);" errorLine2=" ~~~~~~~~~~~~~~"> @@ -1323,7 +1323,7 @@ errorLine1=" historyAdapter.notifyItemRangeChanged(position, historyAdapter.getItemCount());" errorLine2=" ~~~~~~~~~~~~~~"> @@ -1334,7 +1334,7 @@ errorLine1=" historyAdapter.notifyItemRangeChanged(position, historyAdapter.getItemCount());" errorLine2=" ~~~~~~~~~~~~~~"> @@ -1345,7 +1345,7 @@ errorLine1=" presenter.deleteHistory(new ArrayList<>(deleteList));" errorLine2=" ~~~~~~~~~~"> @@ -1356,7 +1356,7 @@ errorLine1=" if (deleteList.size() != 0) {" errorLine2=" ~~~~~~~~~~"> @@ -1367,7 +1367,7 @@ errorLine1=" deleteList.clear();" errorLine2=" ~~~~~~~~~~"> @@ -1378,7 +1378,7 @@ errorLine1=" actionMode = null;" errorLine2=" ~~~~~~~~~~"> @@ -1389,7 +1389,7 @@ errorLine1=" if (refreshAdapter) {" errorLine2=" ~~~~~~~~~~~~~~"> @@ -1400,7 +1400,7 @@ errorLine1=" historyAdapter.notifyDataSetChanged();" errorLine2=" ~~~~~~~~~~~~~~"> @@ -1411,7 +1411,7 @@ errorLine1=" historyList.clear();" errorLine2=" ~~~~~~~~~~~"> @@ -1422,7 +1422,7 @@ errorLine1=" historyList.addAll(fullHistory);" errorLine2=" ~~~~~~~~~~~"> @@ -1433,7 +1433,7 @@ errorLine1=" historyList.addAll(fullHistory);" errorLine2=" ~~~~~~~~~~~"> @@ -1444,7 +1444,7 @@ errorLine1=" historyAdapter.notifyDataSetChanged();" errorLine2=" ~~~~~~~~~~~~~~"> @@ -1455,7 +1455,7 @@ errorLine1=" presenter.filterHistory(historyList, newText);" errorLine2=" ~~~~~~~~~~~"> @@ -1466,7 +1466,7 @@ errorLine1=" if (disposable != null && !disposable.isDisposed()) {" errorLine2=" ~~~~~~~~~~"> @@ -1477,7 +1477,7 @@ errorLine1=" if (disposable != null && !disposable.isDisposed()) {" errorLine2=" ~~~~~~~~~~"> @@ -1488,7 +1488,7 @@ errorLine1=" disposable.dispose();" errorLine2=" ~~~~~~~~~~"> @@ -1499,7 +1499,7 @@ errorLine1=" disposable = d;" errorLine2=" ~~~~~~~~~~"> @@ -1510,7 +1510,7 @@ errorLine1=" airPlane.setVisibility(View.VISIBLE);" errorLine2=" ~~~~~~~~"> @@ -1521,7 +1521,7 @@ errorLine1=" airPlane.animate()" errorLine2=" ~~~~~~~~"> @@ -1532,7 +1532,7 @@ errorLine1=" .translationX(airPlane.getWidth())" errorLine2=" ~~~~~~~~"> @@ -1543,7 +1543,7 @@ errorLine1=" airPlane.setVisibility(View.INVISIBLE);" errorLine2=" ~~~~~~~~"> @@ -1554,7 +1554,7 @@ errorLine1=" airPlane.animate()" errorLine2=" ~~~~~~~~"> @@ -1565,7 +1565,7 @@ errorLine1=" .translationX(-airPlane.getWidth());" errorLine2=" ~~~~~~~~"> @@ -1576,7 +1576,7 @@ errorLine1=" currentPage = position;" errorLine2=" ~~~~~~~~~~~"> @@ -1587,7 +1587,7 @@ errorLine1=" dismissAutoRotate();" errorLine2=" ~~~~~~~~~~~~~~~~~"> @@ -1598,7 +1598,7 @@ errorLine1=" handler.post(() -> {" errorLine2=" ~~~~~~~"> @@ -1609,7 +1609,7 @@ errorLine1=" if (currentPage == views.length) {" errorLine2=" ~~~~~~~~~~~"> @@ -1620,7 +1620,7 @@ errorLine1=" if (currentPage == views.length) {" errorLine2=" ~~~~~"> @@ -1631,7 +1631,7 @@ errorLine1=" currentPage = 0;" errorLine2=" ~~~~~~~~~~~"> @@ -1642,7 +1642,7 @@ errorLine1=" viewPager.setCurrentItem(currentPage++, true);" errorLine2=" ~~~~~~~~~~~"> @@ -1653,7 +1653,7 @@ errorLine1=" webView.addJavascriptInterface(new TTSJavaScriptInterface(), "tts");" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1664,7 +1664,7 @@ errorLine1=" tts.setOnUtteranceProgressListener(null);" errorLine2=" ~~~"> @@ -1675,7 +1675,7 @@ errorLine1=" tts.stop();" errorLine2=" ~~~"> @@ -1686,7 +1686,7 @@ errorLine1=" tts.speak(pieces.get(currentPiece.getAndIncrement()), TextToSpeech.QUEUE_ADD, params);" errorLine2=" ~~~"> @@ -1697,7 +1697,7 @@ errorLine1=" tts.setOnUtteranceProgressListener(new UtteranceProgressListener() {" errorLine2=" ~~~"> @@ -1708,7 +1708,7 @@ errorLine1=" int line = currentPiece.intValue();" errorLine2=" ~~~~~~~~~~~~"> @@ -1719,7 +1719,7 @@ errorLine1=" if (line >= pieces.size() && !paused) {" errorLine2=" ~~~~~~"> @@ -1730,7 +1730,7 @@ errorLine1=" tts.speak(pieces.get(line), TextToSpeech.QUEUE_ADD, params);" errorLine2=" ~~~~~~"> @@ -1741,7 +1741,7 @@ errorLine1=" tts.speak(pieces.get(line), TextToSpeech.QUEUE_ADD, params);" errorLine2=" ~~~"> @@ -1752,7 +1752,7 @@ errorLine1=" currentPiece.getAndIncrement();" errorLine2=" ~~~~~~~~~~~~"> @@ -1763,7 +1763,7 @@ errorLine1=" onSpeakingListener.onSpeakingEnded();" errorLine2=" ~~~~~~~~~~~~~~~~~~"> @@ -1774,7 +1774,7 @@ errorLine1=" onSpeakingListener.onSpeakingStarted();" errorLine2=" ~~~~~~~~~~~~~~~~~~"> @@ -1785,7 +1785,7 @@ errorLine1=" currentTTSTask = new TTSTask(pieces);" errorLine2=" ~~~~~~~~~~~~~~~~~~~"> @@ -1793,12 +1793,12 @@ + errorLine1=" chooseLanguageName(languageCode)" + errorLine2=" ~~~~~~~~~~~~~~~~~~"> + file="src\main\java\org\kiwix\kiwixmobile\core\utils\LanguageContainer.kt" + line="7" + column="5"/> @@ -1818,8 +1818,8 @@ errorLine1=" fontExceptions[languageCode] ?: "fonts/DejaVuSansCondensed.ttf"" errorLine2=" ~~~~~~~~~~~~~~"> @@ -1829,8 +1829,8 @@ errorLine1=" closeTab(viewHolder.getAdapterPosition());" errorLine2=" ~~~~~~~~"> @@ -1840,8 +1840,8 @@ errorLine1=" documentSections.addAll(sections);" errorLine2=" ~~~~~~~~~~~~~~~~"> @@ -1851,8 +1851,8 @@ errorLine1=" tableDrawerAdapter.setTitle(getResourceString(getApplicationContext(), title));" errorLine2=" ~~~~~~~~~~~~~~~~~~"> @@ -1862,8 +1862,8 @@ errorLine1=" tableDrawerAdapter.setTitle(title);" errorLine2=" ~~~~~~~~~~~~~~~~~~"> @@ -1873,8 +1873,8 @@ errorLine1=" tableDrawerAdapter.setSections(documentSections);" errorLine2=" ~~~~~~~~~~~~~~~~"> @@ -1884,8 +1884,8 @@ errorLine1=" tableDrawerAdapter.setSections(documentSections);" errorLine2=" ~~~~~~~~~~~~~~~~~~"> @@ -1895,8 +1895,8 @@ errorLine1=" tableDrawerAdapter.notifyDataSetChanged();" errorLine2=" ~~~~~~~~~~~~~~~~~~"> @@ -1906,8 +1906,8 @@ errorLine1=" documentSections.clear();" errorLine2=" ~~~~~~~~~~~~~~~~"> @@ -1917,8 +1917,8 @@ errorLine1=" tableDrawerAdapter.notifyDataSetChanged();" errorLine2=" ~~~~~~~~~~~~~~~~~~"> @@ -1928,8 +1928,8 @@ errorLine1=" hideTabSwitcher();" errorLine2=" ~~~~~~~~~~~~~~~"> @@ -1939,8 +1939,8 @@ errorLine1=" selectTab(position);" errorLine2=" ~~~~~~~~~"> @@ -1950,8 +1950,8 @@ errorLine1=" updateBottomToolbarArrowsAlpha();" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1961,8 +1961,8 @@ errorLine1=" closeTab(position);" errorLine2=" ~~~~~~~~"> @@ -1972,8 +1972,8 @@ errorLine1=" updateTabSwitcherIcon();" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~"> @@ -1983,8 +1983,8 @@ errorLine1=" + documentSections.get(position).id" errorLine2=" ~~~~~~~~~~~~~~~~"> @@ -1994,8 +1994,8 @@ errorLine1=" isSpeaking = true;" errorLine2=" ~~~~~~~~~~"> @@ -2005,8 +2005,8 @@ errorLine1=" menu.findItem(R.id.menu_read_aloud)" errorLine2=" ~~~~"> @@ -2016,8 +2016,8 @@ errorLine1=" .setTitle(createMenuItem(getResources().getString(R.string.menu_read_aloud_stop)));" errorLine2=" ~~~~~~~~~~~~~~"> @@ -2027,8 +2027,8 @@ errorLine1=" isSpeaking = false;" errorLine2=" ~~~~~~~~~~"> @@ -2038,8 +2038,8 @@ errorLine1=" menu.findItem(R.id.menu_read_aloud)" errorLine2=" ~~~~"> @@ -2049,8 +2049,8 @@ errorLine1=" .setTitle(createMenuItem(getResources().getString(R.string.menu_read_aloud)));" errorLine2=" ~~~~~~~~~~~~~~"> @@ -2060,7 +2060,7 @@ errorLine1=" return pieces.length;" errorLine2=" ~~~~~~"> @@ -2071,7 +2071,7 @@ errorLine1=" autoAdapter.getFilter().filter(s.toLowerCase());" errorLine2=" ~~~~~~~~~~~"> @@ -2082,7 +2082,7 @@ errorLine1=" mMessage.setText(String.valueOf(mSeekBarValue));" errorLine2=" ~~~~~~~~"> @@ -2094,7 +2094,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -2105,7 +2105,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -2115,7 +2115,7 @@ errorLine1=" Log.d(TAG, activity.getString(R.string.discovery_failed) + ": " + errorMessage);" errorLine2=" ~~~~~~~~"> @@ -2126,7 +2126,7 @@ errorLine1=" hasSenderStartedConnection = true;" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -2137,7 +2137,7 @@ errorLine1=" Log.d(TAG, activity.getString(R.string.connection_failed) + ": " + errorMessage);" errorLine2=" ~~~~~~~~"> @@ -2148,7 +2148,7 @@ errorLine1=" closeChannel();" errorLine2=" ~~~~~~~~~~~~"> @@ -2159,7 +2159,7 @@ errorLine1=" closeChannel();" errorLine2=" ~~~~~~~~~~~~"> @@ -2170,7 +2170,7 @@ errorLine1=" fun readMimeType(uri: Uri) = "$uri".removeArguments().let {" errorLine2=" ~~~~~~~~~~~~~~~~~~~~"> @@ -2181,7 +2181,7 @@ errorLine1=" it.mimeType?.takeIf(String::isNotEmpty) ?: mimeTypeFromReader(it)" errorLine2=" ~~~~~~~~"> @@ -2192,7 +2192,7 @@ errorLine1=" private fun mimeTypeFromReader(it: String) = jniKiwixReader.getMimeType(it.filePath)" errorLine2=" ~~~~~~~~"> @@ -2203,7 +2203,7 @@ errorLine1=" "$CONTENT_URI${jniKiwixReader.checkUrl(url.toUri().filePath)}".toUri()" errorLine2=" ~~~~~~~~"> @@ -2214,7 +2214,7 @@ errorLine1=" val infoPair = jniKiwixReader.getDirectAccessInformation(uri.filePath)" errorLine2=" ~~~~~~~~"> @@ -2225,7 +2225,7 @@ errorLine1=" return dup(infoPair.fileDescriptor)" errorLine2=" ~~~~~~~~~~~~~~"> @@ -2236,7 +2236,7 @@ errorLine1=" val url = JNIKiwixString(uri.filePath.removeArguments())" errorLine2=" ~~~~~~~~"> @@ -2247,7 +2247,7 @@ errorLine1=" val url = JNIKiwixString(uri.filePath.removeArguments())" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -2258,7 +2258,7 @@ errorLine1=" private fun getContent(uri: Uri) = getContent(JNIKiwixString(uri.filePath.removeArguments()))" errorLine2=" ~~~~~~~~"> @@ -2269,7 +2269,7 @@ errorLine1=" private fun getContent(uri: Uri) = getContent(JNIKiwixString(uri.filePath.removeArguments()))" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -2280,8 +2280,8 @@ errorLine1=" hotspotService = ((HotspotService.HotspotBinder) service).getService();" errorLine2=" ~~~~~~~~~~~~~~"> @@ -2291,8 +2291,8 @@ errorLine1=" hotspotService.registerCallBack(ZimHostActivity.this);" errorLine2=" ~~~~~~~~~~~~~~"> @@ -2668,8 +2668,8 @@ errorLine1=" menu.getItem(4).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~"> @@ -2679,8 +2679,8 @@ errorLine1=" random.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~"> @@ -2727,7 +2727,7 @@ errorLine1=" public boolean onTouchEvent(MotionEvent event) {" errorLine2=" ~~~~~~~~~~~~"> @@ -2921,7 +2921,7 @@ errorLine1=" public abstract MainActivity provideMainActivity();" errorLine2=" ~~~~~~~~~~~~"> @@ -2932,7 +2932,7 @@ errorLine1=" public abstract KiwixSettingsActivity provideKiwixSettingsActivity();" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~"> @@ -2943,7 +2943,7 @@ errorLine1=" public abstract ZimManageActivity provideZimManageActivity();" errorLine2=" ~~~~~~~~~~~~~~~~~"> @@ -2954,7 +2954,7 @@ errorLine1=" public abstract SearchActivity provideSearchActivity();" errorLine2=" ~~~~~~~~~~~~~~"> @@ -2965,7 +2965,7 @@ errorLine1=" public abstract BookmarksActivity provideBookmarksActivity();" errorLine2=" ~~~~~~~~~~~~~~~~~"> @@ -2976,7 +2976,7 @@ errorLine1=" public abstract ErrorActivity provideErrorActivity();" errorLine2=" ~~~~~~~~~~~~~"> @@ -2987,7 +2987,7 @@ errorLine1=" public abstract IntroActivity provideIntroActivity();" errorLine2=" ~~~~~~~~~~~~~"> @@ -2998,7 +2998,7 @@ errorLine1=" public abstract SplashActivity provideSplashActivity();" errorLine2=" ~~~~~~~~~~~~~~"> @@ -3009,7 +3009,7 @@ errorLine1=" public abstract LanguageActivity provideLanguageActivity();" errorLine2=" ~~~~~~~~~~~~~~~~"> @@ -3020,7 +3020,7 @@ errorLine1=" public abstract HistoryActivity provideHistoryActivity();" errorLine2=" ~~~~~~~~~~~~~~~"> @@ -3031,7 +3031,7 @@ errorLine1=" public abstract HelpActivity provideHelpActivity();" errorLine2=" ~~~~~~~~~~~~"> @@ -3042,7 +3042,7 @@ errorLine1=" public abstract ZimHostActivity provideZimHostActivity();" errorLine2=" ~~~~~~~~~~~~~~~"> @@ -3053,7 +3053,7 @@ errorLine1=" public AnimatedProgressBar(Context context, AttributeSet attrs) {" errorLine2=" ~~~~~~~"> @@ -3064,7 +3064,7 @@ errorLine1=" public AnimatedProgressBar(Context context, AttributeSet attrs) {" errorLine2=" ~~~~~~~~~~~~"> @@ -3075,7 +3075,7 @@ errorLine1=" public AnimatedProgressBar(Context context, AttributeSet attrs, int defStyleAttr) {" errorLine2=" ~~~~~~~"> @@ -3086,7 +3086,7 @@ errorLine1=" public AnimatedProgressBar(Context context, AttributeSet attrs, int defStyleAttr) {" errorLine2=" ~~~~~~~~~~~~"> @@ -3097,7 +3097,7 @@ errorLine1=" protected void onDraw(Canvas canvas) {" errorLine2=" ~~~~~~"> @@ -3108,7 +3108,7 @@ errorLine1=" protected void onRestoreInstanceState(Parcelable state) {" errorLine2=" ~~~~~~~~~~"> @@ -3119,7 +3119,7 @@ errorLine1=" protected Parcelable onSaveInstanceState() {" errorLine2=" ~~~~~~~~~~"> @@ -3130,7 +3130,7 @@ errorLine1=" public static void expand(final View view) {" errorLine2=" ~~~~"> @@ -3141,7 +3141,7 @@ errorLine1=" public static void collapse(final View view) {" errorLine2=" ~~~~"> @@ -3152,7 +3152,7 @@ errorLine1=" public static void rotate(FloatingActionButton v) {" errorLine2=" ~~~~~~~~~~~~~~~~~~~~"> @@ -3163,7 +3163,7 @@ errorLine1=" @BindsInstance Builder context(Context context);" errorLine2=" ~~~~~~~"> @@ -3174,7 +3174,7 @@ errorLine1=" @BindsInstance Builder context(Context context);" errorLine2=" ~~~~~~~"> @@ -3185,7 +3185,7 @@ errorLine1=" ApplicationComponent build();" errorLine2=" ~~~~~~~~~~~~~~~~~~~~"> @@ -3196,7 +3196,7 @@ errorLine1=" ActivityComponent.Builder activityComponent();" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -3207,7 +3207,7 @@ errorLine1=" ServiceComponent.Builder serviceComponent();" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -3218,7 +3218,7 @@ errorLine1=" void inject(KiwixApplication application);" errorLine2=" ~~~~~~~~~~~~~~~~"> @@ -3229,7 +3229,7 @@ errorLine1=" void inject(ZimContentProvider zimContentProvider);" errorLine2=" ~~~~~~~~~~~~~~~~~~"> @@ -3240,7 +3240,7 @@ errorLine1=" void inject(KiwixWebView kiwixWebView);" errorLine2=" ~~~~~~~~~~~~"> @@ -3251,7 +3251,7 @@ errorLine1=" void inject(PrefsFragment prefsFragment);" errorLine2=" ~~~~~~~~~~~~~"> @@ -3262,7 +3262,7 @@ errorLine1=" void inject(AutoCompleteAdapter autoCompleteAdapter);" errorLine2=" ~~~~~~~~~~~~~~~~~~~"> @@ -3273,7 +3273,7 @@ errorLine1=" void inject(AddNoteDialog addNoteDialog);" errorLine2=" ~~~~~~~~~~~~~"> @@ -3284,7 +3284,7 @@ errorLine1=" public Scheduler provideIoThread() {" errorLine2=" ~~~~~~~~~"> @@ -3295,7 +3295,7 @@ errorLine1=" public Scheduler provideMainThread() {" errorLine2=" ~~~~~~~~~"> @@ -3306,7 +3306,7 @@ errorLine1=" public Scheduler provideComputationThread() {" errorLine2=" ~~~~~~~~~"> @@ -3317,7 +3317,7 @@ errorLine1=" public AutoCompleteAdapter(Context context) {" errorLine2=" ~~~~~~~"> @@ -3328,7 +3328,7 @@ errorLine1=" public View getView(int position, View convertView, ViewGroup parent) {" errorLine2=" ~~~~"> @@ -3339,7 +3339,7 @@ errorLine1=" public View getView(int position, View convertView, ViewGroup parent) {" errorLine2=" ~~~~"> @@ -3350,7 +3350,7 @@ errorLine1=" public View getView(int position, View convertView, ViewGroup parent) {" errorLine2=" ~~~~~~~~~"> @@ -3361,7 +3361,7 @@ errorLine1=" public String getItem(int index) {" errorLine2=" ~~~~~~"> @@ -3372,7 +3372,7 @@ errorLine1=" public Filter getFilter() {" errorLine2=" ~~~~~~"> @@ -3383,7 +3383,7 @@ errorLine1=" protected SharedPreferenceUtil sharedPreferenceUtil;" errorLine2=" ~~~~~~~~~~~~~~~~~~~~"> @@ -3394,7 +3394,7 @@ errorLine1=" public Resources.Theme getTheme() {" errorLine2=" ~~~~~~~~~~~~~~~"> @@ -3405,7 +3405,7 @@ errorLine1=" void attachView(T view);" errorLine2=" ~"> @@ -3416,7 +3416,7 @@ errorLine1=" protected T view;" errorLine2=" ~"> @@ -3427,7 +3427,7 @@ errorLine1=" public void attachView(T view) {" errorLine2=" ~"> @@ -3438,7 +3438,7 @@ errorLine1=" public BookDao(KiwixDatabase kiwixDatabase) {" errorLine2=" ~~~~~~~~~~~~~"> @@ -3449,7 +3449,7 @@ errorLine1=" public ArrayList<Book> getBooks() {" errorLine2=" ~~~~~~~~~~~~~~~"> @@ -3460,7 +3460,7 @@ errorLine1=" public ArrayList<Book> filterBookResults(ArrayList<Book> books) {" errorLine2=" ~~~~~~~~~~~~~~~"> @@ -3471,7 +3471,7 @@ errorLine1=" public ArrayList<Book> filterBookResults(ArrayList<Book> books) {" errorLine2=" ~~~~~~~~~~~~~~~"> @@ -3482,7 +3482,7 @@ errorLine1=" public String bookId;" errorLine2=" ~~~~~~"> @@ -3493,7 +3493,7 @@ errorLine1=" public String title;" errorLine2=" ~~~~~~"> @@ -3504,7 +3504,7 @@ errorLine1=" public String description;" errorLine2=" ~~~~~~"> @@ -3515,7 +3515,7 @@ errorLine1=" public String language;" errorLine2=" ~~~~~~"> @@ -3526,7 +3526,7 @@ errorLine1=" public String bookCreator;" errorLine2=" ~~~~~~"> @@ -3537,7 +3537,7 @@ errorLine1=" public String publisher;" errorLine2=" ~~~~~~"> @@ -3548,7 +3548,7 @@ errorLine1=" public String date;" errorLine2=" ~~~~~~"> @@ -3559,7 +3559,7 @@ errorLine1=" public String url;" errorLine2=" ~~~~~~"> @@ -3570,7 +3570,7 @@ errorLine1=" public String remoteUrl;" errorLine2=" ~~~~~~"> @@ -3581,7 +3581,7 @@ errorLine1=" public String articleCount;" errorLine2=" ~~~~~~"> @@ -3592,7 +3592,7 @@ errorLine1=" public String mediaCount;" errorLine2=" ~~~~~~"> @@ -3603,7 +3603,7 @@ errorLine1=" public String size;" errorLine2=" ~~~~~~"> @@ -3614,7 +3614,7 @@ errorLine1=" public String favicon;" errorLine2=" ~~~~~~"> @@ -3625,7 +3625,7 @@ errorLine1=" public String name;" errorLine2=" ~~~~~~"> @@ -3636,7 +3636,7 @@ errorLine1=" public String getLanguage(String languageCode) {" errorLine2=" ~~~~~~"> @@ -3647,7 +3647,7 @@ errorLine1=" public String getLanguage(String languageCode) {" errorLine2=" ~~~~~~"> @@ -3658,7 +3658,7 @@ errorLine1=" protected void onCreate(Bundle savedInstanceState) {" errorLine2=" ~~~~~~"> @@ -3669,7 +3669,7 @@ errorLine1=" public boolean onCreateOptionsMenu(Menu menu) {" errorLine2=" ~~~~"> @@ -3680,7 +3680,7 @@ errorLine1=" public boolean onOptionsItemSelected(MenuItem item) {" errorLine2=" ~~~~~~~~"> @@ -3691,7 +3691,7 @@ errorLine1=" public void updateBookmarksList(List<BookmarkItem> bookmarksList) {" errorLine2=" ~~~~~~~~~~~~~~~~~~"> @@ -3702,7 +3702,7 @@ errorLine1=" public void notifyBookmarksListFiltered(List<BookmarkItem> bookmarksList) {" errorLine2=" ~~~~~~~~~~~~~~~~~~"> @@ -3713,7 +3713,7 @@ errorLine1=" public void onItemClick(ImageView favicon, BookmarkItem bookmark) {" errorLine2=" ~~~~~~~~~"> @@ -3724,7 +3724,7 @@ errorLine1=" public void onItemClick(ImageView favicon, BookmarkItem bookmark) {" errorLine2=" ~~~~~~~~~~~~"> @@ -3735,7 +3735,7 @@ errorLine1=" public boolean onItemLongClick(ImageView favicon, BookmarkItem bookmark) {" errorLine2=" ~~~~~~~~~"> @@ -3746,7 +3746,7 @@ errorLine1=" public boolean onItemLongClick(ImageView favicon, BookmarkItem bookmark) {" errorLine2=" ~~~~~~~~~~~~"> @@ -3757,7 +3757,7 @@ errorLine1=" void updateBookmarksList(List<BookmarkItem> bookmarks);" errorLine2=" ~~~~~~~~~~~~~~~~~~"> @@ -3768,7 +3768,7 @@ errorLine1=" void notifyBookmarksListFiltered(List<BookmarkItem> bookmarks);" errorLine2=" ~~~~~~~~~~~~~~~~~~"> @@ -3779,7 +3779,7 @@ errorLine1=" void filterBookmarks(List<BookmarkItem> bookmarksList, String newText);" errorLine2=" ~~~~~~~~~~~~~~~~~~"> @@ -3790,7 +3790,7 @@ errorLine1=" void filterBookmarks(List<BookmarkItem> bookmarksList, String newText);" errorLine2=" ~~~~~~"> @@ -3801,7 +3801,7 @@ errorLine1=" void deleteBookmarks(List<BookmarkItem> deleteList);" errorLine2=" ~~~~~~~~~~~~~~~~~~"> @@ -3812,7 +3812,7 @@ errorLine1=" public BookmarksDao(KiwixDatabase kiwixDatabase) {" errorLine2=" ~~~~~~~~~~~~~"> @@ -3823,7 +3823,7 @@ errorLine1=" public List<Bookmark> getBookmarks() {" errorLine2=" ~~~~~~~~~~~~~~"> @@ -3834,7 +3834,7 @@ errorLine1=" public void processBookmark(StringOperation operation) {" errorLine2=" ~~~~~~~~~~~~~~~"> @@ -3845,7 +3845,7 @@ errorLine1=" String apply(String string);" errorLine2=" ~~~~~~"> @@ -3856,7 +3856,7 @@ errorLine1=" String apply(String string);" errorLine2=" ~~~~~~"> @@ -3867,7 +3867,7 @@ errorLine1=" public String ZimId;" errorLine2=" ~~~~~~"> @@ -3878,7 +3878,7 @@ errorLine1=" public String ZimName;" errorLine2=" ~~~~~~"> @@ -3889,7 +3889,7 @@ errorLine1=" public String bookmarkUrl;" errorLine2=" ~~~~~~"> @@ -3900,7 +3900,7 @@ errorLine1=" public String bookmarkTitle;" errorLine2=" ~~~~~~"> @@ -3911,7 +3911,7 @@ errorLine1=" public Chunk(String rangeHeader, String fileName, String url, long contentLength," errorLine2=" ~~~~~~"> @@ -3922,7 +3922,7 @@ errorLine1=" public Chunk(String rangeHeader, String fileName, String url, long contentLength," errorLine2=" ~~~~~~"> @@ -3933,7 +3933,7 @@ errorLine1=" public Chunk(String rangeHeader, String fileName, String url, long contentLength," errorLine2=" ~~~~~~"> @@ -3944,7 +3944,7 @@ errorLine1=" public String getRangeHeader() {" errorLine2=" ~~~~~~"> @@ -3955,7 +3955,7 @@ errorLine1=" public String getFileName() {" errorLine2=" ~~~~~~"> @@ -3966,7 +3966,7 @@ errorLine1=" public String getUrl() {" errorLine2=" ~~~~~~"> @@ -3977,7 +3977,7 @@ errorLine1=" public static List<Chunk> getChunks(String url, long contentLength, int notificationID) {" errorLine2=" ~~~~~~~~~~~"> @@ -3988,7 +3988,7 @@ errorLine1=" public static List<Chunk> getChunks(String url, long contentLength, int notificationID) {" errorLine2=" ~~~~~~"> @@ -3999,7 +3999,7 @@ errorLine1=" public void setText(String text) {" errorLine2=" ~~~~~~"> @@ -4010,7 +4010,7 @@ errorLine1=" public void setWebView(WebView webView) {" errorLine2=" ~~~~~~~"> @@ -4021,7 +4021,7 @@ errorLine1=" public void onClick(View v) {" errorLine2=" ~~~~"> @@ -4032,7 +4032,7 @@ errorLine1=" public boolean onCreateActionMode(ActionMode mode, Menu menu) {" errorLine2=" ~~~~~~~~~~"> @@ -4043,7 +4043,7 @@ errorLine1=" public boolean onCreateActionMode(ActionMode mode, Menu menu) {" errorLine2=" ~~~~"> @@ -4054,7 +4054,7 @@ errorLine1=" public void onDestroyActionMode(ActionMode mode) {" errorLine2=" ~~~~~~~~~~"> @@ -4065,7 +4065,7 @@ errorLine1=" public boolean onPrepareActionMode(ActionMode mode, Menu menu) {" errorLine2=" ~~~~~~~~~~"> @@ -4076,7 +4076,7 @@ errorLine1=" public boolean onPrepareActionMode(ActionMode mode, Menu menu) {" errorLine2=" ~~~~"> @@ -4087,7 +4087,7 @@ errorLine1=" public boolean onActionItemClicked(ActionMode mode, MenuItem item) {" errorLine2=" ~~~~~~~~~~"> @@ -4098,7 +4098,7 @@ errorLine1=" public boolean onActionItemClicked(ActionMode mode, MenuItem item) {" errorLine2=" ~~~~~~~~"> @@ -4109,7 +4109,7 @@ errorLine1=" public void beforeTextChanged(CharSequence s, int start, int count, int after) {" errorLine2=" ~~~~~~~~~~~~"> @@ -4120,7 +4120,7 @@ errorLine1=" public void onTextChanged(CharSequence s, int start, int before, int count) {" errorLine2=" ~~~~~~~~~~~~"> @@ -4131,7 +4131,7 @@ errorLine1=" public void afterTextChanged(Editable s) {" errorLine2=" ~~~~~~~~"> @@ -4142,7 +4142,7 @@ errorLine1=" public static String TAG = "ConfirmationAlertDialog";" errorLine2=" ~~~~~~"> @@ -4153,7 +4153,7 @@ errorLine1=" public ConfirmationAlertDialogFragment(SharedPreferenceUtil sharedPreferenceUtil," errorLine2=" ~~~~~~~~~~~~~~~~~~~~"> @@ -4164,7 +4164,7 @@ errorLine1=" String parentDialogFragmentTAG, int stringResourceId) {" errorLine2=" ~~~~~~"> @@ -4175,7 +4175,7 @@ errorLine1=" public Dialog onCreateDialog(Bundle savedInstanceState) {" errorLine2=" ~~~~~~"> @@ -4186,7 +4186,7 @@ errorLine1=" public Dialog onCreateDialog(Bundle savedInstanceState) {" errorLine2=" ~~~~~~"> @@ -4197,7 +4197,7 @@ errorLine1=" public CustomSwitchPreference(Context context, AttributeSet attrs, int defStyle) {" errorLine2=" ~~~~~~~"> @@ -4208,7 +4208,7 @@ errorLine1=" public CustomSwitchPreference(Context context, AttributeSet attrs, int defStyle) {" errorLine2=" ~~~~~~~~~~~~"> @@ -4219,7 +4219,7 @@ errorLine1=" public CustomSwitchPreference(Context context, AttributeSet attrs) {" errorLine2=" ~~~~~~~"> @@ -4230,7 +4230,7 @@ errorLine1=" public CustomSwitchPreference(Context context, AttributeSet attrs) {" errorLine2=" ~~~~~~~~~~~~"> @@ -4241,7 +4241,7 @@ errorLine1=" public CustomSwitchPreference(Context context) {" errorLine2=" ~~~~~~~"> @@ -4252,7 +4252,7 @@ errorLine1=" protected void onBindView(View view) {" errorLine2=" ~~~~"> @@ -4263,7 +4263,7 @@ errorLine1=" public CustomViewPager(Context context) {" errorLine2=" ~~~~~~~"> @@ -4274,7 +4274,7 @@ errorLine1=" public CustomViewPager(Context context, AttributeSet attrs) {" errorLine2=" ~~~~~~~"> @@ -4285,7 +4285,7 @@ errorLine1=" public CustomViewPager(Context context, AttributeSet attrs) {" errorLine2=" ~~~~~~~~~~~~"> @@ -4296,7 +4296,7 @@ errorLine1=" public DataSource provideDataSource(Repository repository) {" errorLine2=" ~~~~~~~~~~"> @@ -4307,7 +4307,7 @@ errorLine1=" public DataSource provideDataSource(Repository repository) {" errorLine2=" ~~~~~~~~~~"> @@ -4318,7 +4318,7 @@ errorLine1=" Single<List<BooksOnDiskListItem>> getLanguageCategorizedBooks();" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -4329,7 +4329,7 @@ errorLine1=" Completable saveBook(BooksOnDiskListItem.BookOnDisk book);" errorLine2=" ~~~~~~~~~~~"> @@ -4340,7 +4340,7 @@ errorLine1=" Completable saveBook(BooksOnDiskListItem.BookOnDisk book);" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -4351,7 +4351,7 @@ errorLine1=" Completable saveBooks(List<BooksOnDiskListItem.BookOnDisk> book);" errorLine2=" ~~~~~~~~~~~"> @@ -4362,7 +4362,7 @@ errorLine1=" Completable saveBooks(List<BooksOnDiskListItem.BookOnDisk> book);" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -4373,7 +4373,7 @@ errorLine1=" Completable saveLanguages(List<Language> languages);" errorLine2=" ~~~~~~~~~~~"> @@ -4384,7 +4384,7 @@ errorLine1=" Completable saveLanguages(List<Language> languages);" errorLine2=" ~~~~~~~~~~~~~~"> @@ -4395,7 +4395,7 @@ errorLine1=" Single<List<HistoryListItem>> getDateCategorizedHistory(boolean showHistoryCurrentBook);" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -4406,7 +4406,7 @@ errorLine1=" Completable saveHistory(HistoryListItem.HistoryItem history);" errorLine2=" ~~~~~~~~~~~"> @@ -4417,7 +4417,7 @@ errorLine1=" Completable saveHistory(HistoryListItem.HistoryItem history);" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -4428,7 +4428,7 @@ errorLine1=" Completable deleteHistory(List<HistoryListItem> historyList);" errorLine2=" ~~~~~~~~~~~"> @@ -4439,7 +4439,7 @@ errorLine1=" Completable deleteHistory(List<HistoryListItem> historyList);" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~"> @@ -4450,7 +4450,7 @@ errorLine1=" Completable clearHistory();" errorLine2=" ~~~~~~~~~~~"> @@ -4461,7 +4461,7 @@ errorLine1=" Single<List<BookmarkItem>> getBookmarks(boolean showFromCurrentBook);" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -4472,7 +4472,7 @@ errorLine1=" Single<List<String>> getCurrentZimBookmarksUrl();" errorLine2=" ~~~~~~~~~~~~~~~~~~~~"> @@ -4483,7 +4483,7 @@ errorLine1=" Completable saveBookmark(BookmarkItem bookmark);" errorLine2=" ~~~~~~~~~~~"> @@ -4494,7 +4494,7 @@ errorLine1=" Completable saveBookmark(BookmarkItem bookmark);" errorLine2=" ~~~~~~~~~~~~"> @@ -4505,7 +4505,7 @@ errorLine1=" Completable deleteBookmarks(List<BookmarkItem> bookmarks);" errorLine2=" ~~~~~~~~~~~"> @@ -4516,7 +4516,7 @@ errorLine1=" Completable deleteBookmarks(List<BookmarkItem> bookmarks);" errorLine2=" ~~~~~~~~~~~~~~~~~~"> @@ -4527,7 +4527,7 @@ errorLine1=" Completable deleteBookmark(String bookmarkUrl);" errorLine2=" ~~~~~~~~~~~"> @@ -4538,7 +4538,7 @@ errorLine1=" Completable deleteBookmark(String bookmarkUrl);" errorLine2=" ~~~~~~"> @@ -4549,7 +4549,7 @@ errorLine1=" Flowable<List<BooksOnDiskListItem>> booksOnDiskAsListItems();" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -4560,7 +4560,7 @@ errorLine1=" public static int getToolbarHeight(Context context) {" errorLine2=" ~~~~~~~"> @@ -4571,7 +4571,7 @@ errorLine1=" public static int getWindowHeight(Activity activity) {" errorLine2=" ~~~~~~~~"> @@ -4582,7 +4582,7 @@ errorLine1=" public static int getWindowWidth(Activity activity) {" errorLine2=" ~~~~~~~~"> @@ -4593,7 +4593,7 @@ errorLine1=" public void initInterface(WebView webView) {" errorLine2=" ~~~~~~~"> @@ -4604,7 +4604,7 @@ errorLine1=" void sectionsLoaded(String title, List<DocumentSection> sections);" errorLine2=" ~~~~~~"> @@ -4615,7 +4615,7 @@ errorLine1=" void sectionsLoaded(String title, List<DocumentSection> sections);" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~"> @@ -4626,7 +4626,7 @@ errorLine1=" protected void onCreate(Bundle savedInstanceState) {" errorLine2=" ~~~~~~"> @@ -4637,7 +4637,7 @@ errorLine1=" public void onActivityResult(int requestCode, int resultCode, Intent data) {" errorLine2=" ~~~~~~"> @@ -4648,7 +4648,7 @@ errorLine1=" public String readFile(String filePath, Context context) {" errorLine2=" ~~~~~~"> @@ -4659,7 +4659,7 @@ errorLine1=" public String readFile(String filePath, Context context) {" errorLine2=" ~~~~~~"> @@ -4670,7 +4670,7 @@ errorLine1=" public String readFile(String filePath, Context context) {" errorLine2=" ~~~~~~~"> @@ -4681,7 +4681,7 @@ errorLine1=" protected void onCreate(Bundle savedInstanceState) {" errorLine2=" ~~~~~~"> @@ -4692,7 +4692,7 @@ errorLine1=" protected void onCreate(Bundle savedInstanceState) {" errorLine2=" ~~~~~~"> @@ -4703,7 +4703,7 @@ errorLine1=" protected void onSaveInstanceState(Bundle state) {" errorLine2=" ~~~~~~"> @@ -4714,7 +4714,7 @@ errorLine1=" protected void onRestoreInstanceState(Bundle state) {" errorLine2=" ~~~~~~"> @@ -4725,7 +4725,7 @@ errorLine1=" public boolean onCreateOptionsMenu(Menu menu) {" errorLine2=" ~~~~"> @@ -4736,7 +4736,7 @@ errorLine1=" public boolean onOptionsItemSelected(MenuItem item) {" errorLine2=" ~~~~~~~~"> @@ -4747,7 +4747,7 @@ errorLine1=" public void updateHistoryList(List<HistoryListItem> historyList) {" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~"> @@ -4758,7 +4758,7 @@ errorLine1=" public void notifyHistoryListFiltered(List<HistoryListItem> historyList) {" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~"> @@ -4769,7 +4769,7 @@ errorLine1=" public void onItemClick(ImageView favicon, HistoryListItem.HistoryItem history) {" errorLine2=" ~~~~~~~~~"> @@ -4780,7 +4780,7 @@ errorLine1=" public void onItemClick(ImageView favicon, HistoryListItem.HistoryItem history) {" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -4791,7 +4791,7 @@ errorLine1=" public boolean onItemLongClick(ImageView favicon, HistoryListItem.HistoryItem history) {" errorLine2=" ~~~~~~~~~"> @@ -4802,7 +4802,7 @@ errorLine1=" public boolean onItemLongClick(ImageView favicon, HistoryListItem.HistoryItem history) {" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -4813,7 +4813,7 @@ errorLine1=" void updateHistoryList(List<HistoryListItem> historyList);" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~"> @@ -4824,7 +4824,7 @@ errorLine1=" void notifyHistoryListFiltered(List<HistoryListItem> historyList);" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~"> @@ -4835,7 +4835,7 @@ errorLine1=" void filterHistory(List<HistoryListItem> historyList, String newText);" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~"> @@ -4846,7 +4846,7 @@ errorLine1=" void filterHistory(List<HistoryListItem> historyList, String newText);" errorLine2=" ~~~~~~"> @@ -4857,7 +4857,7 @@ errorLine1=" void deleteHistory(List<HistoryListItem> deleteList);" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~"> @@ -4868,7 +4868,7 @@ errorLine1=" protected void onCreate(Bundle savedInstanceState) {" errorLine2=" ~~~~~~"> @@ -4879,7 +4879,7 @@ errorLine1=" public JNIKiwix providesJNIKiwix(@NonNull Context context) {" errorLine2=" ~~~~~~~~"> @@ -4890,8 +4890,8 @@ errorLine1=" public static KiwixApplication getInstance() {" errorLine2=" ~~~~~~~~~~~~~~~~"> @@ -4901,8 +4901,8 @@ errorLine1=" public static ApplicationComponent getApplicationComponent() {" errorLine2=" ~~~~~~~~~~~~~~~~~~~~"> @@ -4912,8 +4912,8 @@ errorLine1=" public static void setApplicationComponent(ApplicationComponent applicationComponent) {" errorLine2=" ~~~~~~~~~~~~~~~~~~~~"> @@ -4923,8 +4923,8 @@ errorLine1=" protected void attachBaseContext(Context base) {" errorLine2=" ~~~~~~~"> @@ -4934,8 +4934,8 @@ errorLine1=" public AndroidInjector<Activity> activityInjector() {" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -4945,7 +4945,7 @@ errorLine1=" public KiwixDatabase(Context context, NewBookDao bookDao, NewLanguagesDao languagesDao," errorLine2=" ~~~~~~~"> @@ -4956,7 +4956,7 @@ errorLine1=" public KiwixDatabase(Context context, NewBookDao bookDao, NewLanguagesDao languagesDao," errorLine2=" ~~~~~~~~~~"> @@ -4967,7 +4967,7 @@ errorLine1=" public KiwixDatabase(Context context, NewBookDao bookDao, NewLanguagesDao languagesDao," errorLine2=" ~~~~~~~~~~~~~~~"> @@ -4978,7 +4978,7 @@ errorLine1=" NewBookmarksDao bookmarksDao," errorLine2=" ~~~~~~~~~~~~~~~"> @@ -4989,7 +4989,7 @@ errorLine1=" NewRecentSearchDao recentSearchDao) {" errorLine2=" ~~~~~~~~~~~~~~~~~~"> @@ -5000,7 +5000,7 @@ errorLine1=" public String getName() {" errorLine2=" ~~~~~~"> @@ -5011,7 +5011,7 @@ errorLine1=" protected Table[] getTables() {" errorLine2=" ~~~~~~~"> @@ -5022,7 +5022,7 @@ errorLine1=" protected boolean onUpgrade(SQLiteDatabaseWrapper db, int oldVersion, int newVersion) {" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~"> @@ -5033,7 +5033,7 @@ errorLine1=" public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {" errorLine2=" ~~~~~~~"> @@ -5044,7 +5044,7 @@ errorLine1=" public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {" errorLine2=" ~~~~~~~~~~~~~~~~"> @@ -5055,7 +5055,7 @@ errorLine1=" public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {" errorLine2=" ~~~~~"> @@ -5066,7 +5066,7 @@ errorLine1=" @GET(LIBRARY_NETWORK_PATH) Single<LibraryNetworkEntity> getLibrary();" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -5077,7 +5077,7 @@ errorLine1=" @GET Observable<MetaLinkNetworkEntity> getMetaLinks(@Url String url);" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -5088,7 +5088,7 @@ errorLine1=" @GET Observable<MetaLinkNetworkEntity> getMetaLinks(@Url String url);" errorLine2=" ~~~~~~"> @@ -5099,7 +5099,7 @@ errorLine1=" public static KiwixService newHacklistService(OkHttpClient okHttpClient, String baseUrl) {" errorLine2=" ~~~~~~~~~~~~"> @@ -5110,7 +5110,7 @@ errorLine1=" public static KiwixService newHacklistService(OkHttpClient okHttpClient, String baseUrl) {" errorLine2=" ~~~~~~~~~~~~"> @@ -5121,7 +5121,7 @@ errorLine1=" public static KiwixService newHacklistService(OkHttpClient okHttpClient, String baseUrl) {" errorLine2=" ~~~~~~"> @@ -5132,7 +5132,7 @@ errorLine1=" public void onCreate(Bundle savedInstanceState) {" errorLine2=" ~~~~~~"> @@ -5143,7 +5143,7 @@ errorLine1=" public TTSTask currentTTSTask = null;" errorLine2=" ~~~~~~~"> @@ -5154,7 +5154,7 @@ errorLine1=" public void readSelection(WebView webView) {" errorLine2=" ~~~~~~~"> @@ -5165,7 +5165,7 @@ errorLine1=" public void readAloud(WebView webView) {" errorLine2=" ~~~~~~~"> @@ -5176,7 +5176,7 @@ errorLine1=" public void initWebView(WebView webView) {" errorLine2=" ~~~~~~~"> @@ -5187,7 +5187,7 @@ errorLine1=" public KiwixViewModelFactory(Map<Class<? extends ViewModel>, Provider<ViewModel>> creators) {" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -5198,7 +5198,7 @@ errorLine1=" public <T extends ViewModel> T create(Class<T> modelClass) {" errorLine2=" ~"> @@ -5209,7 +5209,7 @@ errorLine1=" public <T extends ViewModel> T create(Class<T> modelClass) {" errorLine2=" ~~~~~~~~"> @@ -5220,7 +5220,7 @@ errorLine1=" public KiwixWebChromeClient(WebViewCallback callback, ViewGroup nonVideoView," errorLine2=" ~~~~~~~~~~~~~~~"> @@ -5231,7 +5231,7 @@ errorLine1=" public KiwixWebChromeClient(WebViewCallback callback, ViewGroup nonVideoView," errorLine2=" ~~~~~~~~~"> @@ -5242,7 +5242,7 @@ errorLine1=" ViewGroup videoView, KiwixWebView webView) {" errorLine2=" ~~~~~~~~~"> @@ -5253,7 +5253,7 @@ errorLine1=" ViewGroup videoView, KiwixWebView webView) {" errorLine2=" ~~~~~~~~~~~~"> @@ -5264,7 +5264,7 @@ errorLine1=" public void onProgressChanged(WebView view, int progress) {" errorLine2=" ~~~~~~~"> @@ -5275,7 +5275,7 @@ errorLine1=" @Override public void onReceivedTitle(WebView view, String title) {" errorLine2=" ~~~~~~~"> @@ -5286,7 +5286,7 @@ errorLine1=" @Override public void onReceivedTitle(WebView view, String title) {" errorLine2=" ~~~~~~"> @@ -5297,7 +5297,7 @@ errorLine1=" public KiwixWebView(Context context) {" errorLine2=" ~~~~~~~"> @@ -5308,7 +5308,7 @@ errorLine1=" public KiwixWebView(Context context, WebViewCallback callback, AttributeSet attrs," errorLine2=" ~~~~~~~"> @@ -5319,7 +5319,7 @@ errorLine1=" public KiwixWebView(Context context, WebViewCallback callback, AttributeSet attrs," errorLine2=" ~~~~~~~~~~~~~~~"> @@ -5330,7 +5330,7 @@ errorLine1=" public KiwixWebView(Context context, WebViewCallback callback, AttributeSet attrs," errorLine2=" ~~~~~~~~~~~~"> @@ -5341,7 +5341,7 @@ errorLine1=" ViewGroup nonVideoView, ViewGroup videoView) {" errorLine2=" ~~~~~~~~~"> @@ -5352,7 +5352,7 @@ errorLine1=" ViewGroup nonVideoView, ViewGroup videoView) {" errorLine2=" ~~~~~~~~~"> @@ -5363,7 +5363,7 @@ errorLine1=" protected void onCreateContextMenu(ContextMenu menu) {" errorLine2=" ~~~~~~~~~~~"> @@ -5374,7 +5374,7 @@ errorLine1=" public boolean shouldOverrideUrlLoading(WebView view, String url) {" errorLine2=" ~~~~~~~"> @@ -5385,7 +5385,7 @@ errorLine1=" public boolean shouldOverrideUrlLoading(WebView view, String url) {" errorLine2=" ~~~~~~"> @@ -5396,7 +5396,7 @@ errorLine1=" public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {" errorLine2=" ~~~~~~~"> @@ -5407,7 +5407,7 @@ errorLine1=" public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {" errorLine2=" ~~~~~~"> @@ -5418,7 +5418,7 @@ errorLine1=" public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {" errorLine2=" ~~~~~~"> @@ -5429,7 +5429,7 @@ errorLine1=" public void onPageFinished(WebView view, String url) {" errorLine2=" ~~~~~~~"> @@ -5440,7 +5440,7 @@ errorLine1=" public void onPageFinished(WebView view, String url) {" errorLine2=" ~~~~~~"> @@ -5451,7 +5451,7 @@ errorLine1=" public String libraryVersion;" errorLine2=" ~~~~~~"> @@ -5462,7 +5462,7 @@ errorLine1=" public LinkedList<Book> book;" errorLine2=" ~~~~~~~~~~~~~~~~"> @@ -5473,7 +5473,7 @@ errorLine1=" public LinkedList<Book> getBooks() {" errorLine2=" ~~~~~~~~~~~~~~~~"> @@ -5484,7 +5484,7 @@ errorLine1=" public String getVersion() {" errorLine2=" ~~~~~~"> @@ -5495,7 +5495,7 @@ errorLine1=" public String id;" errorLine2=" ~~~~~~"> @@ -5506,7 +5506,7 @@ errorLine1=" public String title;" errorLine2=" ~~~~~~"> @@ -5517,7 +5517,7 @@ errorLine1=" public String description;" errorLine2=" ~~~~~~"> @@ -5528,7 +5528,7 @@ errorLine1=" public String language;" errorLine2=" ~~~~~~"> @@ -5539,7 +5539,7 @@ errorLine1=" public String creator;" errorLine2=" ~~~~~~"> @@ -5550,7 +5550,7 @@ errorLine1=" public String publisher;" errorLine2=" ~~~~~~"> @@ -5561,7 +5561,7 @@ errorLine1=" public String favicon;" errorLine2=" ~~~~~~"> @@ -5572,7 +5572,7 @@ errorLine1=" public String faviconMimeType;" errorLine2=" ~~~~~~"> @@ -5583,7 +5583,7 @@ errorLine1=" public String date;" errorLine2=" ~~~~~~"> @@ -5594,7 +5594,7 @@ errorLine1=" public String url;" errorLine2=" ~~~~~~"> @@ -5605,7 +5605,7 @@ errorLine1=" public String articleCount;" errorLine2=" ~~~~~~"> @@ -5616,7 +5616,7 @@ errorLine1=" public String mediaCount;" errorLine2=" ~~~~~~"> @@ -5627,7 +5627,7 @@ errorLine1=" public String size;" errorLine2=" ~~~~~~"> @@ -5638,7 +5638,7 @@ errorLine1=" public String bookName;" errorLine2=" ~~~~~~"> @@ -5649,7 +5649,7 @@ errorLine1=" public String tags;" errorLine2=" ~~~~~~"> @@ -5660,7 +5660,7 @@ errorLine1=" public File file;" errorLine2=" ~~~~"> @@ -5671,7 +5671,7 @@ errorLine1=" public String remoteUrl;" errorLine2=" ~~~~~~"> @@ -5682,7 +5682,7 @@ errorLine1=" public String getId() {" errorLine2=" ~~~~~~"> @@ -5693,7 +5693,7 @@ errorLine1=" public String getTitle() {" errorLine2=" ~~~~~~"> @@ -5704,7 +5704,7 @@ errorLine1=" public String getDescription() {" errorLine2=" ~~~~~~"> @@ -5715,7 +5715,7 @@ errorLine1=" public String getLanguage() {" errorLine2=" ~~~~~~"> @@ -5726,7 +5726,7 @@ errorLine1=" public String getCreator() {" errorLine2=" ~~~~~~"> @@ -5737,7 +5737,7 @@ errorLine1=" public String getPublisher() {" errorLine2=" ~~~~~~"> @@ -5748,7 +5748,7 @@ errorLine1=" public String getFavicon() {" errorLine2=" ~~~~~~"> @@ -5759,7 +5759,7 @@ errorLine1=" public String getFaviconMimeType() {" errorLine2=" ~~~~~~"> @@ -5770,7 +5770,7 @@ errorLine1=" public String getDate() {" errorLine2=" ~~~~~~"> @@ -5781,7 +5781,7 @@ errorLine1=" public String getUrl() {" errorLine2=" ~~~~~~"> @@ -5792,7 +5792,7 @@ errorLine1=" public String getArticleCount() {" errorLine2=" ~~~~~~"> @@ -5803,7 +5803,7 @@ errorLine1=" public String getMediaCount() {" errorLine2=" ~~~~~~"> @@ -5814,7 +5814,7 @@ errorLine1=" public String getName() {" errorLine2=" ~~~~~~"> @@ -5825,7 +5825,7 @@ errorLine1=" public String getSize() {" errorLine2=" ~~~~~~"> @@ -5836,7 +5836,7 @@ errorLine1=" void showBooks(LinkedList<Book> books);" errorLine2=" ~~~~~~~~~~~~~~~~"> @@ -5847,7 +5847,7 @@ errorLine1=" void downloadFile(LibraryNetworkEntity.Book book);" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -5858,8 +5858,8 @@ errorLine1=" public void onActionModeStarted(ActionMode mode) {" errorLine2=" ~~~~~~~~~~"> @@ -5869,8 +5869,8 @@ errorLine1=" public void onActionModeFinished(ActionMode mode) {" errorLine2=" ~~~~~~~~~~"> @@ -5880,8 +5880,8 @@ errorLine1=" public void onCreate(Bundle savedInstanceState) {" errorLine2=" ~~~~~~"> @@ -5891,8 +5891,8 @@ errorLine1=" public boolean onOptionsItemSelected(MenuItem item) {" errorLine2=" ~~~~~~~~"> @@ -5902,8 +5902,8 @@ errorLine1=" public void openExternalUrl(Intent intent) {" errorLine2=" ~~~~~~"> @@ -5913,8 +5913,8 @@ errorLine1=" protected void onNewIntent(Intent intent) {" errorLine2=" ~~~~~~"> @@ -5924,8 +5924,8 @@ errorLine1=" public void refreshBookmarksUrl(List<String> urls) {" errorLine2=" ~~~~~~~~~~~~"> @@ -5935,8 +5935,8 @@ errorLine1=" public void onConfigurationChanged(Configuration newConfig) {" errorLine2=" ~~~~~~~~~~~~~"> @@ -5946,8 +5946,8 @@ errorLine1=" public void onActivityResult(int requestCode, int resultCode, Intent data) {" errorLine2=" ~~~~~~"> @@ -5957,8 +5957,8 @@ errorLine1=" public boolean onCreateOptionsMenu(Menu menu) {" errorLine2=" ~~~~"> @@ -5968,8 +5968,8 @@ errorLine1=" public boolean onPrepareOptionsMenu(Menu menu) {" errorLine2=" ~~~~"> @@ -5979,8 +5979,8 @@ errorLine1=" public void webViewFailedLoading(String url) {" errorLine2=" ~~~~~~"> @@ -5990,8 +5990,8 @@ errorLine1=" public void webViewTitleUpdated(String title) {" errorLine2=" ~~~~~~"> @@ -6001,8 +6001,8 @@ errorLine1=" public void webViewLongClick(final String url) {" errorLine2=" ~~~~~~"> @@ -6012,8 +6012,8 @@ errorLine1=" public void setHomePage(View view) {" errorLine2=" ~~~~"> @@ -6023,8 +6023,8 @@ errorLine1=" public void open(BooksOnDiskListItem.BookOnDisk bookOnDisk) {" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -6034,8 +6034,8 @@ errorLine1=" public void addBooks(List<BooksOnDiskListItem> books) {" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -6045,8 +6045,8 @@ errorLine1=" public boolean checkNull(View view) {" errorLine2=" ~~~~"> @@ -6056,7 +6056,7 @@ errorLine1=" public FileElement file;" errorLine2=" ~~~~~~~~~~~"> @@ -6067,7 +6067,7 @@ errorLine1=" public List<Url> getUrls() {" errorLine2=" ~~~~~~~~~"> @@ -6078,7 +6078,7 @@ errorLine1=" public Url getRelevantUrl() {" errorLine2=" ~~~"> @@ -6089,7 +6089,7 @@ errorLine1=" public FileElement getFile() {" errorLine2=" ~~~~~~~~~~~"> @@ -6100,7 +6100,7 @@ errorLine1=" public String name;" errorLine2=" ~~~~~~"> @@ -6111,7 +6111,7 @@ errorLine1=" public List<Url> urls;" errorLine2=" ~~~~~~~~~"> @@ -6122,7 +6122,7 @@ errorLine1=" public Map<String, String> hashes;" errorLine2=" ~~~~~~~~~~~~~~~~~~~"> @@ -6133,7 +6133,7 @@ errorLine1=" public Pieces pieces;" errorLine2=" ~~~~~~"> @@ -6144,7 +6144,7 @@ errorLine1=" public String getName() {" errorLine2=" ~~~~~~"> @@ -6155,7 +6155,7 @@ errorLine1=" public String getPieceHashType() {" errorLine2=" ~~~~~~"> @@ -6166,7 +6166,7 @@ errorLine1=" public List<String> getPieceHashes() {" errorLine2=" ~~~~~~~~~~~~"> @@ -6177,7 +6177,7 @@ errorLine1=" public String getHash(String type) {" errorLine2=" ~~~~~~"> @@ -6188,7 +6188,7 @@ errorLine1=" public String getHash(String type) {" errorLine2=" ~~~~~~"> @@ -6199,7 +6199,7 @@ errorLine1=" public String hashType;" errorLine2=" ~~~~~~"> @@ -6210,7 +6210,7 @@ errorLine1=" public List<String> pieceHashes;" errorLine2=" ~~~~~~~~~~~~"> @@ -6221,7 +6221,7 @@ errorLine1=" public String location;" errorLine2=" ~~~~~~"> @@ -6232,7 +6232,7 @@ errorLine1=" public String value;" errorLine2=" ~~~~~~"> @@ -6243,7 +6243,7 @@ errorLine1=" public String getValue() {" errorLine2=" ~~~~~~"> @@ -6254,7 +6254,7 @@ errorLine1=" public String getLocation() {" errorLine2=" ~~~~~~"> @@ -6265,7 +6265,7 @@ errorLine1=" public NetworkLanguageDao(KiwixDatabase kiwixDatabase) {" errorLine2=" ~~~~~~~~~~~~~"> @@ -6276,7 +6276,7 @@ errorLine1=" public ArrayList<Language> getFilteredLanguages() {" errorLine2=" ~~~~~~~~~~~~~~~~~~~"> @@ -6287,7 +6287,7 @@ errorLine1=" public String languageISO3;" errorLine2=" ~~~~~~"> @@ -6298,8 +6298,8 @@ errorLine1=" public static boolean isNetworkAvailable(Context context) {" errorLine2=" ~~~~~~~"> @@ -6309,8 +6309,8 @@ errorLine1=" public static boolean isWiFi(Context context) {" errorLine2=" ~~~~~~~"> @@ -6320,8 +6320,8 @@ errorLine1=" public static String getFileNameFromUrl(String url) {" errorLine2=" ~~~~~~"> @@ -6331,8 +6331,8 @@ errorLine1=" public static String getFileNameFromUrl(String url) {" errorLine2=" ~~~~~~"> @@ -6342,8 +6342,8 @@ errorLine1=" public static String parseURL(Context context, String url) {" errorLine2=" ~~~~~~"> @@ -6353,8 +6353,8 @@ errorLine1=" public static String parseURL(Context context, String url) {" errorLine2=" ~~~~~~~"> @@ -6364,8 +6364,8 @@ errorLine1=" public static String parseURL(Context context, String url) {" errorLine2=" ~~~~~~"> @@ -6375,7 +6375,7 @@ errorLine1=" public OnSwipeTouchListener(Context ctx) {" errorLine2=" ~~~~~~~"> @@ -6386,7 +6386,7 @@ errorLine1=" public boolean onTouch(View v, MotionEvent event) {" errorLine2=" ~~~~"> @@ -6397,7 +6397,7 @@ errorLine1=" public boolean onTouch(View v, MotionEvent event) {" errorLine2=" ~~~~~~~~~~~"> @@ -6408,7 +6408,7 @@ errorLine1=" public void onCreate(Bundle savedInstanceState) {" errorLine2=" ~~~~~~"> @@ -6419,7 +6419,7 @@ errorLine1=" public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {" errorLine2=" ~~~~~~~~~~~~~~~~~"> @@ -6430,7 +6430,7 @@ errorLine1=" public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {" errorLine2=" ~~~~~~"> @@ -6441,7 +6441,7 @@ errorLine1=" public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen," errorLine2=" ~~~~~~~~~~~~~~~~"> @@ -6452,7 +6452,7 @@ errorLine1=" Preference preference) {" errorLine2=" ~~~~~~~~~~"> @@ -6463,7 +6463,7 @@ errorLine1=" public RecentSearchDao(KiwixDatabase kiwixDatabase) {" errorLine2=" ~~~~~~~~~~~~~"> @@ -6474,7 +6474,7 @@ errorLine1=" public List<RecentSearch> getRecentSearches() {" errorLine2=" ~~~~~~~~~~~~~~~~~~"> @@ -6485,7 +6485,7 @@ errorLine1=" public String searchString;" errorLine2=" ~~~~~~"> @@ -6496,7 +6496,7 @@ errorLine1=" public String zimID;" errorLine2=" ~~~~~~"> @@ -6507,7 +6507,7 @@ errorLine1=" protected void onCreate(Bundle savedInstanceState) {" errorLine2=" ~~~~~~"> @@ -6518,7 +6518,7 @@ errorLine1=" public void addRecentSearches(List<String> recentSearches) {" errorLine2=" ~~~~~~~~~~~~"> @@ -6529,7 +6529,7 @@ errorLine1=" public boolean onCreateOptionsMenu(Menu menu) {" errorLine2=" ~~~~"> @@ -6540,7 +6540,7 @@ errorLine1=" public boolean onOptionsItemSelected(MenuItem item) {" errorLine2=" ~~~~~~~~"> @@ -6551,7 +6551,7 @@ errorLine1=" public void onItemClick(AdapterView<?> parent, View view, int position, long id) {" errorLine2=" ~~~~~~~~~~~~~~"> @@ -6562,7 +6562,7 @@ errorLine1=" public void onItemClick(AdapterView<?> parent, View view, int position, long id) {" errorLine2=" ~~~~"> @@ -6573,7 +6573,7 @@ errorLine1=" public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {" errorLine2=" ~~~~~~~~~~~~~~"> @@ -6584,7 +6584,7 @@ errorLine1=" public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {" errorLine2=" ~~~~"> @@ -6595,7 +6595,7 @@ errorLine1=" protected void onActivityResult(int requestCode, int resultCode, Intent data) {" errorLine2=" ~~~~~~"> @@ -6606,7 +6606,7 @@ errorLine1=" protected void onSaveInstanceState(Bundle outState) {" errorLine2=" ~~~~~~"> @@ -6617,7 +6617,7 @@ errorLine1=" public void attachView(SearchViewCallback searchViewCallback) {" errorLine2=" ~~~~~~~~~~~~~~~~~~"> @@ -6628,7 +6628,7 @@ errorLine1=" void addRecentSearches(List<String> recentSearches);" errorLine2=" ~~~~~~~~~~~~"> @@ -6639,7 +6639,7 @@ errorLine1=" public SharedPreferenceUtil(Context context) {" errorLine2=" ~~~~~~~"> @@ -6650,7 +6650,7 @@ errorLine1=" public String getPrefLanguage(String defaultLanguage) {" errorLine2=" ~~~~~~"> @@ -6661,7 +6661,7 @@ errorLine1=" public String getPrefLanguage(String defaultLanguage) {" errorLine2=" ~~~~~~"> @@ -6672,7 +6672,7 @@ errorLine1=" public String getPrefStorage() {" errorLine2=" ~~~~~~"> @@ -6683,7 +6683,7 @@ errorLine1=" public String getPrefStorageTitle(String defaultTitle) {" errorLine2=" ~~~~~~"> @@ -6694,7 +6694,7 @@ errorLine1=" public String getPrefStorageTitle(String defaultTitle) {" errorLine2=" ~~~~~~"> @@ -6705,7 +6705,7 @@ errorLine1=" public void putPrefLanguage(String language) {" errorLine2=" ~~~~~~"> @@ -6716,7 +6716,7 @@ errorLine1=" public void putPrefStorageTitle(String storageTitle) {" errorLine2=" ~~~~~~"> @@ -6727,7 +6727,7 @@ errorLine1=" public void putPrefStorage(String storage) {" errorLine2=" ~~~~~~"> @@ -6738,7 +6738,7 @@ errorLine1=" public Flowable<String> getPrefStorages() {" errorLine2=" ~~~~~~~~~~~~~~~~"> @@ -6749,7 +6749,7 @@ errorLine1=" protected CharSequence[] mSummaries;" errorLine2=" ~~~~~~~~~~~~~~"> @@ -6760,7 +6760,7 @@ errorLine1=" public SliderPreference(Context context, AttributeSet attrs) {" errorLine2=" ~~~~~~~"> @@ -6771,7 +6771,7 @@ errorLine1=" public SliderPreference(Context context, AttributeSet attrs) {" errorLine2=" ~~~~~~~~~~~~"> @@ -6782,7 +6782,7 @@ errorLine1=" public SliderPreference(Context context, AttributeSet attrs, int defStyle) {" errorLine2=" ~~~~~~~"> @@ -6793,7 +6793,7 @@ errorLine1=" public SliderPreference(Context context, AttributeSet attrs, int defStyle) {" errorLine2=" ~~~~~~~~~~~~"> @@ -6804,7 +6804,7 @@ errorLine1=" public void updateSummaryText(Context context, AttributeSet attrs) {" errorLine2=" ~~~~~~~"> @@ -6815,7 +6815,7 @@ errorLine1=" public void updateSummaryText(Context context, AttributeSet attrs) {" errorLine2=" ~~~~~~~~~~~~"> @@ -6826,7 +6826,7 @@ errorLine1=" protected Object onGetDefaultValue(TypedArray a, int index) {" errorLine2=" ~~~~~~"> @@ -6837,7 +6837,7 @@ errorLine1=" protected Object onGetDefaultValue(TypedArray a, int index) {" errorLine2=" ~~~~~~~~~~"> @@ -6848,7 +6848,7 @@ errorLine1=" protected void onSetInitialValue(boolean restoreValue, Object defaultValue) {" errorLine2=" ~~~~~~"> @@ -6859,7 +6859,7 @@ errorLine1=" public CharSequence getSummary() {" errorLine2=" ~~~~~~~~~~~~"> @@ -6870,7 +6870,7 @@ errorLine1=" public void setSummary(CharSequence[] summaries) {" errorLine2=" ~~~~~~~~~~~~~~"> @@ -6881,7 +6881,7 @@ errorLine1=" protected View onCreateDialogView() {" errorLine2=" ~~~~"> @@ -6892,7 +6892,7 @@ errorLine1=" protected void onBindView(View view) {" errorLine2=" ~~~~"> @@ -6903,7 +6903,7 @@ errorLine1=" protected void onCreate(Bundle savedInstanceState) {" errorLine2=" ~~~~~~"> @@ -6914,7 +6914,7 @@ errorLine1=" public static String getFileNameFromUrl(String url) {" errorLine2=" ~~~~~~"> @@ -6925,7 +6925,7 @@ errorLine1=" public static String getFileNameFromUrl(String url) {" errorLine2=" ~~~~~~"> @@ -6936,7 +6936,7 @@ errorLine1=" public static AttributeSet getAttributes(Context context, @XmlRes int xml) {" errorLine2=" ~~~~~~~~~~~~"> @@ -6947,7 +6947,7 @@ errorLine1=" public static AttributeSet getAttributes(Context context, @XmlRes int xml) {" errorLine2=" ~~~~~~~"> @@ -6958,7 +6958,7 @@ errorLine1=" public static Spanned highlightUrl(String text, String url) {" errorLine2=" ~~~~~~~"> @@ -6969,7 +6969,7 @@ errorLine1=" public static Spanned highlightUrl(String text, String url) {" errorLine2=" ~~~~~~"> @@ -6980,7 +6980,7 @@ errorLine1=" public static Spanned highlightUrl(String text, String url) {" errorLine2=" ~~~~~~"> @@ -6991,7 +6991,7 @@ errorLine1=" public static Spanned fromHtml(String source) {" errorLine2=" ~~~~~~~"> @@ -7002,7 +7002,7 @@ errorLine1=" public static Spanned fromHtml(String source) {" errorLine2=" ~~~~~~"> @@ -7013,7 +7013,7 @@ errorLine1=" public void setTitle(String title) {" errorLine2=" ~~~~~~"> @@ -7024,7 +7024,7 @@ errorLine1=" void onHeaderClick(View view);" errorLine2=" ~~~~"> @@ -7035,7 +7035,7 @@ errorLine1=" void onSectionClick(View view, int position);" errorLine2=" ~~~~"> @@ -7046,7 +7046,7 @@ errorLine1=" TextView title;" errorLine2=" ~~~~~~~~"> @@ -7057,7 +7057,7 @@ errorLine1=" public ViewHolder(View v) {" errorLine2=" ~~~~"> @@ -7068,7 +7068,7 @@ errorLine1=" public String title;" errorLine2=" ~~~~~~"> @@ -7079,7 +7079,7 @@ errorLine1=" public String id;" errorLine2=" ~~~~~~"> @@ -7090,7 +7090,7 @@ errorLine1=" public static void bindResource(Class bindClass) {" errorLine2=" ~~~~~"> @@ -7101,7 +7101,7 @@ errorLine1=" public static void unbindResource(Class bindClass) {" errorLine2=" ~~~~~"> @@ -7112,7 +7112,7 @@ errorLine1=" public static void registerIdleCallback(TestingUtils.IdleListener listListener) {" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -7123,7 +7123,7 @@ errorLine1=" public ToolbarScrollingKiwixWebView(Context context) {" errorLine2=" ~~~~~~~"> @@ -7134,7 +7134,7 @@ errorLine1=" public ToolbarScrollingKiwixWebView(Context context, WebViewCallback callback, View toolbarView," errorLine2=" ~~~~~~~"> @@ -7145,7 +7145,7 @@ errorLine1=" public ToolbarScrollingKiwixWebView(Context context, WebViewCallback callback, View toolbarView," errorLine2=" ~~~~~~~~~~~~~~~"> @@ -7156,7 +7156,7 @@ errorLine1=" public ToolbarScrollingKiwixWebView(Context context, WebViewCallback callback, View toolbarView," errorLine2=" ~~~~"> @@ -7167,7 +7167,7 @@ errorLine1=" View bottomBarView, ViewGroup nonVideoView, ViewGroup videoView," errorLine2=" ~~~~"> @@ -7178,7 +7178,7 @@ errorLine1=" View bottomBarView, ViewGroup nonVideoView, ViewGroup videoView," errorLine2=" ~~~~~~~~~"> @@ -7189,7 +7189,7 @@ errorLine1=" View bottomBarView, ViewGroup nonVideoView, ViewGroup videoView," errorLine2=" ~~~~~~~~~"> @@ -7200,7 +7200,7 @@ errorLine1=" AttributeSet attrs) {" errorLine2=" ~~~~~~~~~~~~"> @@ -7211,7 +7211,7 @@ errorLine1=" public boolean onTouchEvent(MotionEvent event) {" errorLine2=" ~~~~~~~~~~~"> @@ -7222,7 +7222,7 @@ errorLine1=" public ToolbarStaticKiwixWebView(Context context) {" errorLine2=" ~~~~~~~"> @@ -7233,7 +7233,7 @@ errorLine1=" public ToolbarStaticKiwixWebView(Context context, WebViewCallback callback," errorLine2=" ~~~~~~~"> @@ -7244,7 +7244,7 @@ errorLine1=" public ToolbarStaticKiwixWebView(Context context, WebViewCallback callback," errorLine2=" ~~~~~~~~~~~~~~~"> @@ -7255,7 +7255,7 @@ errorLine1=" ViewGroup nonVideoView, ViewGroup videoView, AttributeSet attrs) {" errorLine2=" ~~~~~~~~~"> @@ -7266,7 +7266,7 @@ errorLine1=" ViewGroup nonVideoView, ViewGroup videoView, AttributeSet attrs) {" errorLine2=" ~~~~~~~~~"> @@ -7277,7 +7277,7 @@ errorLine1=" ViewGroup nonVideoView, ViewGroup videoView, AttributeSet attrs) {" errorLine2=" ~~~~~~~~~~~~"> @@ -7288,7 +7288,7 @@ errorLine1=" public static String reformatProviderUrl(String url) {" errorLine2=" ~~~~~~"> @@ -7299,7 +7299,7 @@ errorLine1=" public static String reformatProviderUrl(String url) {" errorLine2=" ~~~~~~"> @@ -7310,7 +7310,7 @@ errorLine1=" public UserAgentInterceptor(String useragent) {" errorLine2=" ~~~~~~"> @@ -7321,7 +7321,7 @@ errorLine1=" public Response intercept(Chain chain) throws IOException {" errorLine2=" ~~~~~~~~"> @@ -7332,7 +7332,7 @@ errorLine1=" public Response intercept(Chain chain) throws IOException {" errorLine2=" ~~~~~"> @@ -7542,7 +7542,7 @@ errorLine2=" ~~~~~~~"> @@ -7553,7 +7553,7 @@ errorLine2=" ~~~~~~~"> @@ -7564,7 +7564,7 @@ errorLine2=" ~~~~~~~~~~~~"> @@ -7575,7 +7575,7 @@ errorLine2=" ~~~~~~~"> @@ -7586,7 +7586,7 @@ errorLine2=" ~~~~~~~~~~~~"> @@ -7597,7 +7597,7 @@ errorLine2=" ~~~~~~~~~~~~~~~"> @@ -7608,7 +7608,7 @@ errorLine2=" ~~~~~~"> @@ -7619,7 +7619,7 @@ errorLine2=" ~~~~~~"> @@ -7630,7 +7630,7 @@ errorLine2=" ~~~~~~"> @@ -7641,7 +7641,7 @@ errorLine2=" ~~~~~~"> @@ -7652,7 +7652,7 @@ errorLine2=" ~~~~~~"> @@ -7663,7 +7663,7 @@ errorLine2=" ~~~~~~"> @@ -7674,7 +7674,7 @@ errorLine2=" ~~~~~~"> @@ -7685,7 +7685,7 @@ errorLine2=" ~~~~~~"> @@ -7696,7 +7696,7 @@ errorLine2=" ~~~~~~"> @@ -7707,7 +7707,7 @@ errorLine2=" ~~~~~~"> @@ -7718,7 +7718,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~"> @@ -7728,7 +7728,7 @@ errorLine1=" void webViewFailedLoading(String failingUrl);" errorLine2=" ~~~~~~"> @@ -7739,7 +7739,7 @@ errorLine1=" void openExternalUrl(Intent intent);" errorLine2=" ~~~~~~"> @@ -7750,7 +7750,7 @@ errorLine1=" void webViewTitleUpdated(String title);" errorLine2=" ~~~~~~"> @@ -7761,7 +7761,7 @@ errorLine1=" void webViewLongClick(String url);" errorLine2=" ~~~~~~"> @@ -7772,7 +7772,7 @@ errorLine1=" void setHomePage(View view);" errorLine2=" ~~~~"> @@ -7783,7 +7783,7 @@ errorLine1=" public JNIKiwix jniKiwix;" errorLine2=" ~~~~~~~~"> @@ -7794,7 +7794,7 @@ errorLine1=" public String getType(Uri uri) {" errorLine2=" ~~~~~~"> @@ -7805,7 +7805,7 @@ errorLine1=" public String getType(Uri uri) {" errorLine2=" ~~~"> @@ -7816,7 +7816,7 @@ errorLine1=" public ParcelFileDescriptor openFile(Uri uri, String mode) {" errorLine2=" ~~~~~~~~~~~~~~~~~~~~"> @@ -7827,7 +7827,7 @@ errorLine1=" public ParcelFileDescriptor openFile(Uri uri, String mode) {" errorLine2=" ~~~"> @@ -7838,7 +7838,7 @@ errorLine1=" public ParcelFileDescriptor openFile(Uri uri, String mode) {" errorLine2=" ~~~~~~"> diff --git a/core/src/main/java/com/cprcrack/videowebview/VideoEnabledWebView.java b/core/src/main/java/com/cprcrack/videowebview/VideoEnabledWebView.java index 6387dfc47..262e0daf5 100644 --- a/core/src/main/java/com/cprcrack/videowebview/VideoEnabledWebView.java +++ b/core/src/main/java/com/cprcrack/videowebview/VideoEnabledWebView.java @@ -8,7 +8,6 @@ import android.util.AttributeSet; import android.util.Log; import android.webkit.WebChromeClient; import android.webkit.WebView; - import java.util.Map; /** diff --git a/core/src/main/java/eu/mhutti1/utils/storage/StorageSelectArrayAdapter.kt b/core/src/main/java/eu/mhutti1/utils/storage/StorageSelectArrayAdapter.kt index 3d8993417..2ae263051 100644 --- a/core/src/main/java/eu/mhutti1/utils/storage/StorageSelectArrayAdapter.kt +++ b/core/src/main/java/eu/mhutti1/utils/storage/StorageSelectArrayAdapter.kt @@ -27,12 +27,10 @@ import android.widget.ArrayAdapter import kotlinx.android.extensions.LayoutContainer import kotlinx.android.synthetic.main.device_item.file_name import kotlinx.android.synthetic.main.device_item.file_size -import org.kiwix.kiwixmobile.core.R.string import org.kiwix.kiwixmobile.core.R -import org.kiwix.kiwixmobile.core.R2.id.file_name -import org.kiwix.kiwixmobile.core.R2.id.file_size -import org.kiwix.kiwixmobile.extensions.inflate -import org.kiwix.kiwixmobile.settings.StorageCalculator +import org.kiwix.kiwixmobile.core.R.string +import org.kiwix.kiwixmobile.core.extensions.ViewGroupExtensions.inflate +import org.kiwix.kiwixmobile.core.settings.StorageCalculator internal class StorageSelectArrayAdapter( context: Context, diff --git a/core/src/main/java/eu/mhutti1/utils/storage/StorageSelectDialog.kt b/core/src/main/java/eu/mhutti1/utils/storage/StorageSelectDialog.kt index 991842bf1..761cb6b8a 100644 --- a/core/src/main/java/eu/mhutti1/utils/storage/StorageSelectDialog.kt +++ b/core/src/main/java/eu/mhutti1/utils/storage/StorageSelectDialog.kt @@ -31,10 +31,10 @@ import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.schedulers.Schedulers import kotlinx.android.synthetic.main.storage_select_dialog.device_list import kotlinx.android.synthetic.main.storage_select_dialog.title -import org.kiwix.kiwixmobile.KiwixApplication +import org.kiwix.kiwixmobile.core.KiwixApplication import org.kiwix.kiwixmobile.core.R -import org.kiwix.kiwixmobile.settings.StorageCalculator -import org.kiwix.kiwixmobile.utils.StyleUtils +import org.kiwix.kiwixmobile.core.settings.StorageCalculator +import org.kiwix.kiwixmobile.core.utils.StyleUtils import javax.inject.Inject class StorageSelectDialog : DialogFragment() { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/KiwixApplication.java b/core/src/main/java/org/kiwix/kiwixmobile/core/KiwixApplication.java similarity index 94% rename from core/src/main/java/org/kiwix/kiwixmobile/KiwixApplication.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/KiwixApplication.java index 072d42d34..d067191e6 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/KiwixApplication.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/KiwixApplication.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile; +package org.kiwix.kiwixmobile.core; import android.app.Activity; import android.content.Context; @@ -32,11 +32,10 @@ import dagger.android.HasActivityInjector; import java.io.File; import java.io.IOException; import javax.inject.Inject; -import org.kiwix.kiwixmobile.core.BuildConfig; -import org.kiwix.kiwixmobile.data.local.KiwixDatabase; -import org.kiwix.kiwixmobile.di.components.ApplicationComponent; -import org.kiwix.kiwixmobile.di.components.DaggerApplicationComponent; -import org.kiwix.kiwixmobile.downloader.DownloadMonitor; +import org.kiwix.kiwixmobile.core.data.local.KiwixDatabase; +import org.kiwix.kiwixmobile.core.di.components.ApplicationComponent; +import org.kiwix.kiwixmobile.core.di.components.DaggerApplicationComponent; +import org.kiwix.kiwixmobile.core.downloader.DownloadMonitor; public class KiwixApplication extends MultiDexApplication implements HasActivityInjector { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/KiwixViewModelFactory.java b/core/src/main/java/org/kiwix/kiwixmobile/core/KiwixViewModelFactory.java similarity index 98% rename from core/src/main/java/org/kiwix/kiwixmobile/KiwixViewModelFactory.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/KiwixViewModelFactory.java index 8640a237f..7605e30e4 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/KiwixViewModelFactory.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/KiwixViewModelFactory.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile; +package org.kiwix.kiwixmobile.core; import androidx.lifecycle.ViewModel; import androidx.lifecycle.ViewModelProvider; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/base/BaseActivity.java b/core/src/main/java/org/kiwix/kiwixmobile/core/base/BaseActivity.java similarity index 93% rename from core/src/main/java/org/kiwix/kiwixmobile/base/BaseActivity.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/base/BaseActivity.java index 0b3019ea7..1a627ca08 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/base/BaseActivity.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/base/BaseActivity.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.base; +package org.kiwix.kiwixmobile.core.base; import android.content.res.Resources; import android.os.Bundle; @@ -27,8 +27,8 @@ import butterknife.Unbinder; import dagger.android.AndroidInjection; import javax.inject.Inject; import org.kiwix.kiwixmobile.core.R; -import org.kiwix.kiwixmobile.utils.LanguageUtils; -import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil; +import org.kiwix.kiwixmobile.core.utils.LanguageUtils; +import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil; public abstract class BaseActivity extends AppCompatActivity { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/base/BaseContract.java b/core/src/main/java/org/kiwix/kiwixmobile/core/base/BaseContract.java similarity index 92% rename from core/src/main/java/org/kiwix/kiwixmobile/base/BaseContract.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/base/BaseContract.java index a58e6005b..c5b283818 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/base/BaseContract.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/base/BaseContract.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.base; +package org.kiwix.kiwixmobile.core.base; public class BaseContract { @@ -25,4 +25,4 @@ public class BaseContract { */ void detachView(); } -} \ No newline at end of file +} diff --git a/core/src/main/java/org/kiwix/kiwixmobile/base/BaseFragment.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/base/BaseFragment.kt similarity index 74% rename from core/src/main/java/org/kiwix/kiwixmobile/base/BaseFragment.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/base/BaseFragment.kt index 99a454a49..f2b0a10a2 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/base/BaseFragment.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/base/BaseFragment.kt @@ -1,9 +1,9 @@ -package org.kiwix.kiwixmobile.base +package org.kiwix.kiwixmobile.core.base import android.content.Context import androidx.fragment.app.Fragment -import org.kiwix.kiwixmobile.KiwixApplication -import org.kiwix.kiwixmobile.di.components.ActivityComponent +import org.kiwix.kiwixmobile.core.KiwixApplication +import org.kiwix.kiwixmobile.core.di.components.ActivityComponent /** * All fragments should inherit from this fragment. diff --git a/core/src/main/java/org/kiwix/kiwixmobile/base/BasePresenter.java b/core/src/main/java/org/kiwix/kiwixmobile/core/base/BasePresenter.java similarity index 96% rename from core/src/main/java/org/kiwix/kiwixmobile/base/BasePresenter.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/base/BasePresenter.java index 1952ee28a..34708df8e 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/base/BasePresenter.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/base/BasePresenter.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.base; +package org.kiwix.kiwixmobile.core.base; import io.reactivex.disposables.CompositeDisposable; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/bookmark/BookmarkItem.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/bookmark/BookmarkItem.kt similarity index 80% rename from core/src/main/java/org/kiwix/kiwixmobile/bookmark/BookmarkItem.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/bookmark/BookmarkItem.kt index c823e44a6..ed72c9eb5 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/bookmark/BookmarkItem.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/bookmark/BookmarkItem.kt @@ -1,7 +1,7 @@ -package org.kiwix.kiwixmobile.bookmark +package org.kiwix.kiwixmobile.core.bookmark -import org.kiwix.kiwixmobile.database.newdb.entities.BookmarkEntity -import org.kiwix.kiwixmobile.zim_manager.ZimFileReader +import org.kiwix.kiwixmobile.core.newdb.entities.BookmarkEntity +import org.kiwix.kiwixmobile.core.zim_manager.ZimFileReader data class BookmarkItem( val databaseId: Long = 0L, diff --git a/core/src/main/java/org/kiwix/kiwixmobile/bookmark/BookmarksActivity.java b/core/src/main/java/org/kiwix/kiwixmobile/core/bookmark/BookmarksActivity.java similarity index 94% rename from core/src/main/java/org/kiwix/kiwixmobile/bookmark/BookmarksActivity.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/bookmark/BookmarksActivity.java index f29cef9c8..cbd7bc98a 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/bookmark/BookmarksActivity.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/bookmark/BookmarksActivity.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.bookmark; +package org.kiwix.kiwixmobile.core.bookmark; import android.content.Intent; import android.net.Uri; @@ -19,14 +19,14 @@ import java.util.ArrayList; import java.util.List; import javax.inject.Inject; import org.kiwix.kiwixmobile.core.R; -import org.kiwix.kiwixmobile.base.BaseActivity; import org.kiwix.kiwixmobile.core.R2; -import org.kiwix.kiwixmobile.extensions.ImageViewExtensionsKt; -import org.kiwix.kiwixmobile.main.MainActivity; -import org.kiwix.kiwixmobile.zim_manager.ZimReaderContainer; +import org.kiwix.kiwixmobile.core.base.BaseActivity; +import org.kiwix.kiwixmobile.core.extensions.ImageViewExtensionsKt; +import org.kiwix.kiwixmobile.core.main.MainActivity; +import org.kiwix.kiwixmobile.core.zim_manager.ZimReaderContainer; -import static org.kiwix.kiwixmobile.utils.Constants.EXTRA_CHOSE_X_TITLE; -import static org.kiwix.kiwixmobile.utils.Constants.EXTRA_CHOSE_X_URL; +import static org.kiwix.kiwixmobile.core.utils.Constants.EXTRA_CHOSE_X_TITLE; +import static org.kiwix.kiwixmobile.core.utils.Constants.EXTRA_CHOSE_X_URL; public class BookmarksActivity extends BaseActivity implements BookmarksContract.View, BookmarksAdapter.OnItemClickListener { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/bookmark/BookmarksAdapter.java b/core/src/main/java/org/kiwix/kiwixmobile/core/bookmark/BookmarksAdapter.java similarity index 95% rename from core/src/main/java/org/kiwix/kiwixmobile/bookmark/BookmarksAdapter.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/bookmark/BookmarksAdapter.java index 4b81fce05..5236a3a26 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/bookmark/BookmarksAdapter.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/bookmark/BookmarksAdapter.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.bookmark; +package org.kiwix.kiwixmobile.core.bookmark; import android.view.LayoutInflater; import android.view.View; @@ -13,7 +13,7 @@ import butterknife.ButterKnife; import java.util.List; import org.kiwix.kiwixmobile.core.R; import org.kiwix.kiwixmobile.core.R2; -import org.kiwix.kiwixmobile.extensions.ImageViewExtensionsKt; +import org.kiwix.kiwixmobile.core.extensions.ImageViewExtensionsKt; class BookmarksAdapter extends RecyclerView.Adapter { private final List bookmarkList; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/bookmark/BookmarksContract.java b/core/src/main/java/org/kiwix/kiwixmobile/core/bookmark/BookmarksContract.java similarity index 83% rename from core/src/main/java/org/kiwix/kiwixmobile/bookmark/BookmarksContract.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/bookmark/BookmarksContract.java index 7a7ab012c..94bbe51ac 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/bookmark/BookmarksContract.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/bookmark/BookmarksContract.java @@ -1,7 +1,7 @@ -package org.kiwix.kiwixmobile.bookmark; +package org.kiwix.kiwixmobile.core.bookmark; import java.util.List; -import org.kiwix.kiwixmobile.base.BaseContract; +import org.kiwix.kiwixmobile.core.base.BaseContract; interface BookmarksContract { interface View extends BaseContract.View { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/bookmark/BookmarksModule.java b/core/src/main/java/org/kiwix/kiwixmobile/core/bookmark/BookmarksModule.java similarity index 70% rename from core/src/main/java/org/kiwix/kiwixmobile/bookmark/BookmarksModule.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/bookmark/BookmarksModule.java index d0a6ce815..aa9402bdc 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/bookmark/BookmarksModule.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/bookmark/BookmarksModule.java @@ -1,8 +1,8 @@ -package org.kiwix.kiwixmobile.bookmark; +package org.kiwix.kiwixmobile.core.bookmark; import dagger.Module; import dagger.Provides; -import org.kiwix.kiwixmobile.di.ActivityScope; +import org.kiwix.kiwixmobile.core.di.ActivityScope; @Module public class BookmarksModule { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/bookmark/BookmarksPresenter.java b/core/src/main/java/org/kiwix/kiwixmobile/core/bookmark/BookmarksPresenter.java similarity index 89% rename from core/src/main/java/org/kiwix/kiwixmobile/bookmark/BookmarksPresenter.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/bookmark/BookmarksPresenter.java index 76983b847..8f744fd1a 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/bookmark/BookmarksPresenter.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/bookmark/BookmarksPresenter.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.bookmark; +package org.kiwix.kiwixmobile.core.bookmark; import android.util.Log; import io.reactivex.CompletableObserver; @@ -8,11 +8,11 @@ import io.reactivex.SingleObserver; import io.reactivex.disposables.Disposable; import java.util.List; import javax.inject.Inject; -import org.kiwix.kiwixmobile.base.BasePresenter; -import org.kiwix.kiwixmobile.data.DataSource; -import org.kiwix.kiwixmobile.di.ActivityScope; -import org.kiwix.kiwixmobile.di.qualifiers.Computation; -import org.kiwix.kiwixmobile.di.qualifiers.MainThread; +import org.kiwix.kiwixmobile.core.base.BasePresenter; +import org.kiwix.kiwixmobile.core.data.DataSource; +import org.kiwix.kiwixmobile.core.di.ActivityScope; +import org.kiwix.kiwixmobile.core.di.qualifiers.Computation; +import org.kiwix.kiwixmobile.core.di.qualifiers.MainThread; @ActivityScope class BookmarksPresenter extends BasePresenter diff --git a/core/src/main/java/org/kiwix/kiwixmobile/data/AbstractContentProvider.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/data/AbstractContentProvider.kt similarity index 97% rename from core/src/main/java/org/kiwix/kiwixmobile/data/AbstractContentProvider.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/data/AbstractContentProvider.kt index 052206a09..7c8f58564 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/data/AbstractContentProvider.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/data/AbstractContentProvider.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.data +package org.kiwix.kiwixmobile.core.data import android.content.ContentProvider import android.content.ContentValues diff --git a/core/src/main/java/org/kiwix/kiwixmobile/data/DataModule.java b/core/src/main/java/org/kiwix/kiwixmobile/core/data/DataModule.java similarity index 84% rename from core/src/main/java/org/kiwix/kiwixmobile/data/DataModule.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/data/DataModule.java index 888357a12..1a7282f9f 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/data/DataModule.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/data/DataModule.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.data; +package org.kiwix.kiwixmobile.core.data; import dagger.Module; import dagger.Provides; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/data/DataSource.java b/core/src/main/java/org/kiwix/kiwixmobile/core/data/DataSource.java similarity index 78% rename from core/src/main/java/org/kiwix/kiwixmobile/data/DataSource.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/data/DataSource.java index ce7b183af..8c1ff7fc9 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/data/DataSource.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/data/DataSource.java @@ -1,13 +1,13 @@ -package org.kiwix.kiwixmobile.data; +package org.kiwix.kiwixmobile.core.data; import io.reactivex.Completable; import io.reactivex.Flowable; import io.reactivex.Single; import java.util.List; -import org.kiwix.kiwixmobile.bookmark.BookmarkItem; -import org.kiwix.kiwixmobile.history.HistoryListItem; -import org.kiwix.kiwixmobile.zim_manager.Language; -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem; +import org.kiwix.kiwixmobile.core.bookmark.BookmarkItem; +import org.kiwix.kiwixmobile.core.history.HistoryListItem; +import org.kiwix.kiwixmobile.core.zim_manager.Language; +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem; /** * Defines the set of methods which are required to provide the presenter with the requisite data. diff --git a/core/src/main/java/org/kiwix/kiwixmobile/data/Repository.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/data/Repository.kt similarity index 78% rename from core/src/main/java/org/kiwix/kiwixmobile/data/Repository.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/data/Repository.kt index d8dfabea6..a94bbddbb 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/data/Repository.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/data/Repository.kt @@ -1,25 +1,25 @@ -package org.kiwix.kiwixmobile.data +package org.kiwix.kiwixmobile.core.data import io.reactivex.Completable import io.reactivex.Flowable import io.reactivex.Scheduler import io.reactivex.Single -import org.kiwix.kiwixmobile.bookmark.BookmarkItem -import org.kiwix.kiwixmobile.database.newdb.dao.HistoryDao -import org.kiwix.kiwixmobile.database.newdb.dao.NewBookDao -import org.kiwix.kiwixmobile.database.newdb.dao.NewBookmarksDao -import org.kiwix.kiwixmobile.database.newdb.dao.NewLanguagesDao -import org.kiwix.kiwixmobile.database.newdb.dao.NewRecentSearchDao -import org.kiwix.kiwixmobile.di.qualifiers.IO -import org.kiwix.kiwixmobile.di.qualifiers.MainThread -import org.kiwix.kiwixmobile.history.HistoryListItem -import org.kiwix.kiwixmobile.history.HistoryListItem.DateItem -import org.kiwix.kiwixmobile.history.HistoryListItem.HistoryItem -import org.kiwix.kiwixmobile.zim_manager.Language -import org.kiwix.kiwixmobile.zim_manager.ZimReaderContainer -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.LanguageItem +import org.kiwix.kiwixmobile.core.bookmark.BookmarkItem +import org.kiwix.kiwixmobile.core.di.qualifiers.IO +import org.kiwix.kiwixmobile.core.di.qualifiers.MainThread +import org.kiwix.kiwixmobile.core.history.HistoryListItem +import org.kiwix.kiwixmobile.core.history.HistoryListItem.DateItem +import org.kiwix.kiwixmobile.core.history.HistoryListItem.HistoryItem +import org.kiwix.kiwixmobile.core.newdb.dao.HistoryDao +import org.kiwix.kiwixmobile.core.newdb.dao.NewBookDao +import org.kiwix.kiwixmobile.core.newdb.dao.NewBookmarksDao +import org.kiwix.kiwixmobile.core.newdb.dao.NewLanguagesDao +import org.kiwix.kiwixmobile.core.newdb.dao.NewRecentSearchDao +import org.kiwix.kiwixmobile.core.zim_manager.Language +import org.kiwix.kiwixmobile.core.zim_manager.ZimReaderContainer +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.LanguageItem import javax.inject.Inject import javax.inject.Singleton diff --git a/core/src/main/java/org/kiwix/kiwixmobile/data/ZimContentProvider.java b/core/src/main/java/org/kiwix/kiwixmobile/core/data/ZimContentProvider.java similarity index 93% rename from core/src/main/java/org/kiwix/kiwixmobile/data/ZimContentProvider.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/data/ZimContentProvider.java index 4f664ba48..9178305c2 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/data/ZimContentProvider.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/data/ZimContentProvider.java @@ -17,7 +17,7 @@ * MA 02110-1301, USA. */ -package org.kiwix.kiwixmobile.data; +package org.kiwix.kiwixmobile.core.data; import android.content.Context; import android.net.Uri; @@ -29,10 +29,10 @@ import java.io.InputStream; import java.io.OutputStream; import javax.inject.Inject; import org.kiwix.kiwixlib.JNIKiwix; -import org.kiwix.kiwixmobile.KiwixApplication; -import org.kiwix.kiwixmobile.zim_manager.ZimReaderContainer; +import org.kiwix.kiwixmobile.core.KiwixApplication; +import org.kiwix.kiwixmobile.core.zim_manager.ZimReaderContainer; -import static org.kiwix.kiwixmobile.utils.Constants.TAG_KIWIX; +import static org.kiwix.kiwixmobile.core.utils.Constants.TAG_KIWIX; public class ZimContentProvider extends AbstractContentProvider { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/data/local/KiwixDatabase.java b/core/src/main/java/org/kiwix/kiwixmobile/core/data/local/KiwixDatabase.java similarity index 86% rename from core/src/main/java/org/kiwix/kiwixmobile/data/local/KiwixDatabase.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/data/local/KiwixDatabase.java index de880edc1..625b72163 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/data/local/KiwixDatabase.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/data/local/KiwixDatabase.java @@ -17,7 +17,7 @@ * MA 02110-1301, USA. */ -package org.kiwix.kiwixmobile.data.local; +package org.kiwix.kiwixmobile.core.data.local; import android.content.Context; import android.util.Log; @@ -31,22 +31,22 @@ import java.io.InputStream; import java.io.InputStreamReader; import javax.inject.Inject; import javax.inject.Singleton; -import org.kiwix.kiwixmobile.data.local.dao.BookDao; -import org.kiwix.kiwixmobile.data.local.dao.BookmarksDao; -import org.kiwix.kiwixmobile.data.local.dao.NetworkLanguageDao; -import org.kiwix.kiwixmobile.data.local.dao.RecentSearchDao; -import org.kiwix.kiwixmobile.data.local.entity.BookDatabaseEntity; -import org.kiwix.kiwixmobile.data.local.entity.Bookmark; -import org.kiwix.kiwixmobile.data.local.entity.LibraryDatabaseEntity; -import org.kiwix.kiwixmobile.data.local.entity.NetworkLanguageDatabaseEntity; -import org.kiwix.kiwixmobile.data.local.entity.RecentSearch; -import org.kiwix.kiwixmobile.database.newdb.dao.NewBookDao; -import org.kiwix.kiwixmobile.database.newdb.dao.NewBookmarksDao; -import org.kiwix.kiwixmobile.database.newdb.dao.NewLanguagesDao; -import org.kiwix.kiwixmobile.database.newdb.dao.NewRecentSearchDao; -import org.kiwix.kiwixmobile.utils.UpdateUtils; +import org.kiwix.kiwixmobile.core.data.local.dao.BookDao; +import org.kiwix.kiwixmobile.core.data.local.dao.BookmarksDao; +import org.kiwix.kiwixmobile.core.data.local.dao.NetworkLanguageDao; +import org.kiwix.kiwixmobile.core.data.local.dao.RecentSearchDao; +import org.kiwix.kiwixmobile.core.data.local.entity.BookDatabaseEntity; +import org.kiwix.kiwixmobile.core.data.local.entity.Bookmark; +import org.kiwix.kiwixmobile.core.data.local.entity.LibraryDatabaseEntity; +import org.kiwix.kiwixmobile.core.data.local.entity.NetworkLanguageDatabaseEntity; +import org.kiwix.kiwixmobile.core.data.local.entity.RecentSearch; +import org.kiwix.kiwixmobile.core.newdb.dao.NewBookDao; +import org.kiwix.kiwixmobile.core.newdb.dao.NewBookmarksDao; +import org.kiwix.kiwixmobile.core.newdb.dao.NewLanguagesDao; +import org.kiwix.kiwixmobile.core.newdb.dao.NewRecentSearchDao; +import org.kiwix.kiwixmobile.core.utils.UpdateUtils; -import static org.kiwix.kiwixmobile.utils.Constants.TAG_KIWIX; +import static org.kiwix.kiwixmobile.core.utils.Constants.TAG_KIWIX; @Singleton @Deprecated //delete once migrations are no longer needed diff --git a/core/src/main/java/org/kiwix/kiwixmobile/data/local/dao/BookDao.java b/core/src/main/java/org/kiwix/kiwixmobile/core/data/local/dao/BookDao.java similarity index 90% rename from core/src/main/java/org/kiwix/kiwixmobile/data/local/dao/BookDao.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/data/local/dao/BookDao.java index e8ba5e82d..50297c480 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/data/local/dao/BookDao.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/data/local/dao/BookDao.java @@ -15,17 +15,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.data.local.dao; +package org.kiwix.kiwixmobile.core.data.local.dao; import com.yahoo.squidb.data.SquidCursor; import com.yahoo.squidb.sql.Query; import java.io.File; import java.util.ArrayList; import javax.inject.Inject; -import org.kiwix.kiwixmobile.data.local.KiwixDatabase; -import org.kiwix.kiwixmobile.data.local.entity.BookDatabaseEntity; -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity.Book; -import org.kiwix.kiwixmobile.utils.files.FileUtils; +import org.kiwix.kiwixmobile.core.data.local.KiwixDatabase; +import org.kiwix.kiwixmobile.core.data.local.entity.BookDatabaseEntity; +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book; +import org.kiwix.kiwixmobile.core.utils.files.FileUtils; /** * Dao class for books diff --git a/core/src/main/java/org/kiwix/kiwixmobile/data/local/dao/BookmarksDao.java b/core/src/main/java/org/kiwix/kiwixmobile/core/data/local/dao/BookmarksDao.java similarity index 93% rename from core/src/main/java/org/kiwix/kiwixmobile/data/local/dao/BookmarksDao.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/data/local/dao/BookmarksDao.java index 4fe1e2f75..aca799c21 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/data/local/dao/BookmarksDao.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/data/local/dao/BookmarksDao.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.data.local.dao; +package org.kiwix.kiwixmobile.core.data.local.dao; import com.yahoo.squidb.data.SquidCursor; import com.yahoo.squidb.sql.Query; @@ -23,8 +23,8 @@ import com.yahoo.squidb.sql.Update; import java.util.ArrayList; import java.util.List; import javax.inject.Inject; -import org.kiwix.kiwixmobile.data.local.KiwixDatabase; -import org.kiwix.kiwixmobile.data.local.entity.Bookmark; +import org.kiwix.kiwixmobile.core.data.local.KiwixDatabase; +import org.kiwix.kiwixmobile.core.data.local.entity.Bookmark; /** * Dao class for bookmarks. diff --git a/core/src/main/java/org/kiwix/kiwixmobile/data/local/dao/NetworkLanguageDao.java b/core/src/main/java/org/kiwix/kiwixmobile/core/data/local/dao/NetworkLanguageDao.java similarity index 86% rename from core/src/main/java/org/kiwix/kiwixmobile/data/local/dao/NetworkLanguageDao.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/data/local/dao/NetworkLanguageDao.java index e3d0c965a..113498109 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/data/local/dao/NetworkLanguageDao.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/data/local/dao/NetworkLanguageDao.java @@ -17,15 +17,15 @@ * MA 02110-1301, USA. */ -package org.kiwix.kiwixmobile.data.local.dao; +package org.kiwix.kiwixmobile.core.data.local.dao; import com.yahoo.squidb.data.SquidCursor; import com.yahoo.squidb.sql.Query; import java.util.ArrayList; import javax.inject.Inject; -import org.kiwix.kiwixmobile.data.local.KiwixDatabase; -import org.kiwix.kiwixmobile.data.local.entity.NetworkLanguageDatabaseEntity; -import org.kiwix.kiwixmobile.zim_manager.Language; +import org.kiwix.kiwixmobile.core.data.local.KiwixDatabase; +import org.kiwix.kiwixmobile.core.data.local.entity.NetworkLanguageDatabaseEntity; +import org.kiwix.kiwixmobile.core.zim_manager.Language; @Deprecated public class NetworkLanguageDao { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/data/local/dao/RecentSearchDao.java b/core/src/main/java/org/kiwix/kiwixmobile/core/data/local/dao/RecentSearchDao.java similarity index 89% rename from core/src/main/java/org/kiwix/kiwixmobile/data/local/dao/RecentSearchDao.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/data/local/dao/RecentSearchDao.java index 90170d2c2..d03bc7b8d 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/data/local/dao/RecentSearchDao.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/data/local/dao/RecentSearchDao.java @@ -15,15 +15,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.data.local.dao; +package org.kiwix.kiwixmobile.core.data.local.dao; import com.yahoo.squidb.data.SquidCursor; import com.yahoo.squidb.sql.Query; import java.util.ArrayList; import java.util.List; import javax.inject.Inject; -import org.kiwix.kiwixmobile.data.local.KiwixDatabase; -import org.kiwix.kiwixmobile.data.local.entity.RecentSearch; +import org.kiwix.kiwixmobile.core.data.local.KiwixDatabase; +import org.kiwix.kiwixmobile.core.data.local.entity.RecentSearch; /** * Dao class for recent searches. diff --git a/core/src/main/java/org/kiwix/kiwixmobile/data/local/entity/BookDataSource.java b/core/src/main/java/org/kiwix/kiwixmobile/core/data/local/entity/BookDataSource.java similarity index 95% rename from core/src/main/java/org/kiwix/kiwixmobile/data/local/entity/BookDataSource.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/data/local/entity/BookDataSource.java index fd58504bb..cc486a00f 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/data/local/entity/BookDataSource.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/data/local/entity/BookDataSource.java @@ -17,7 +17,7 @@ * MA 02110-1301, USA. */ -package org.kiwix.kiwixmobile.data.local.entity; +package org.kiwix.kiwixmobile.core.data.local.entity; import com.yahoo.squidb.annotations.TableModelSpec; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/data/local/entity/BookmarksSpec.java b/core/src/main/java/org/kiwix/kiwixmobile/core/data/local/entity/BookmarksSpec.java similarity index 95% rename from core/src/main/java/org/kiwix/kiwixmobile/data/local/entity/BookmarksSpec.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/data/local/entity/BookmarksSpec.java index 535515f43..3b371aaa9 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/data/local/entity/BookmarksSpec.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/data/local/entity/BookmarksSpec.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.data.local.entity; +package org.kiwix.kiwixmobile.core.data.local.entity; import com.yahoo.squidb.annotations.ColumnSpec; import com.yahoo.squidb.annotations.TableModelSpec; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/data/local/entity/LibraryDataSource.java b/core/src/main/java/org/kiwix/kiwixmobile/core/data/local/entity/LibraryDataSource.java similarity index 94% rename from core/src/main/java/org/kiwix/kiwixmobile/data/local/entity/LibraryDataSource.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/data/local/entity/LibraryDataSource.java index a22e08b46..b103119a1 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/data/local/entity/LibraryDataSource.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/data/local/entity/LibraryDataSource.java @@ -17,7 +17,7 @@ * MA 02110-1301, USA. */ -package org.kiwix.kiwixmobile.data.local.entity; +package org.kiwix.kiwixmobile.core.data.local.entity; import com.yahoo.squidb.annotations.TableModelSpec; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/data/local/entity/NetworkLanguageSpec.java b/core/src/main/java/org/kiwix/kiwixmobile/core/data/local/entity/NetworkLanguageSpec.java similarity index 95% rename from core/src/main/java/org/kiwix/kiwixmobile/data/local/entity/NetworkLanguageSpec.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/data/local/entity/NetworkLanguageSpec.java index 56b330ae3..debedb830 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/data/local/entity/NetworkLanguageSpec.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/data/local/entity/NetworkLanguageSpec.java @@ -17,7 +17,7 @@ * MA 02110-1301, USA. */ -package org.kiwix.kiwixmobile.data.local.entity; +package org.kiwix.kiwixmobile.core.data.local.entity; import com.yahoo.squidb.annotations.TableModelSpec; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/data/local/entity/RecentSearchSpec.java b/core/src/main/java/org/kiwix/kiwixmobile/core/data/local/entity/RecentSearchSpec.java similarity index 95% rename from core/src/main/java/org/kiwix/kiwixmobile/data/local/entity/RecentSearchSpec.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/data/local/entity/RecentSearchSpec.java index 5892eae68..360d69bff 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/data/local/entity/RecentSearchSpec.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/data/local/entity/RecentSearchSpec.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.data.local.entity; +package org.kiwix.kiwixmobile.core.data.local.entity; import com.yahoo.squidb.annotations.ColumnSpec; import com.yahoo.squidb.annotations.TableModelSpec; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/data/remote/KiwixService.java b/core/src/main/java/org/kiwix/kiwixmobile/core/data/remote/KiwixService.java similarity index 91% rename from core/src/main/java/org/kiwix/kiwixmobile/data/remote/KiwixService.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/data/remote/KiwixService.java index d148fac99..8198d2114 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/data/remote/KiwixService.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/data/remote/KiwixService.java @@ -15,14 +15,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.data.remote; +package org.kiwix.kiwixmobile.core.data.remote; import io.reactivex.Observable; import io.reactivex.Single; import io.reactivex.schedulers.Schedulers; import okhttp3.OkHttpClient; -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity; -import org.kiwix.kiwixmobile.library.entity.MetaLinkNetworkEntity; +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity; +import org.kiwix.kiwixmobile.core.entity.MetaLinkNetworkEntity; import retrofit2.Retrofit; import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; import retrofit2.converter.simplexml.SimpleXmlConverterFactory; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/data/remote/UserAgentInterceptor.java b/core/src/main/java/org/kiwix/kiwixmobile/core/data/remote/UserAgentInterceptor.java similarity index 96% rename from core/src/main/java/org/kiwix/kiwixmobile/data/remote/UserAgentInterceptor.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/data/remote/UserAgentInterceptor.java index 59a4c4b67..d170ad769 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/data/remote/UserAgentInterceptor.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/data/remote/UserAgentInterceptor.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.data.remote; +package org.kiwix.kiwixmobile.core.data.remote; import java.io.IOException; import okhttp3.Interceptor; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/di/ActivityScope.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/di/ActivityScope.kt similarity index 66% rename from core/src/main/java/org/kiwix/kiwixmobile/di/ActivityScope.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/di/ActivityScope.kt index c9554c1a6..ed2f4cfcc 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/di/ActivityScope.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/di/ActivityScope.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.di +package org.kiwix.kiwixmobile.core.di import javax.inject.Scope diff --git a/core/src/main/java/org/kiwix/kiwixmobile/di/ServiceScope.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/di/ServiceScope.kt similarity index 95% rename from core/src/main/java/org/kiwix/kiwixmobile/di/ServiceScope.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/di/ServiceScope.kt index 38af39c69..099d5977c 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/di/ServiceScope.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/di/ServiceScope.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.di +package org.kiwix.kiwixmobile.core.di import javax.inject.Scope import kotlin.annotation.AnnotationRetention.RUNTIME diff --git a/core/src/main/java/org/kiwix/kiwixmobile/di/ViewModelKey.java b/core/src/main/java/org/kiwix/kiwixmobile/core/di/ViewModelKey.java similarity index 96% rename from core/src/main/java/org/kiwix/kiwixmobile/di/ViewModelKey.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/di/ViewModelKey.java index d94382be5..ba29fc7f2 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/di/ViewModelKey.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/di/ViewModelKey.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.di; +package org.kiwix.kiwixmobile.core.di; import androidx.lifecycle.ViewModel; import dagger.MapKey; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/di/components/ActivityComponent.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/di/components/ActivityComponent.kt similarity index 70% rename from core/src/main/java/org/kiwix/kiwixmobile/di/components/ActivityComponent.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/di/components/ActivityComponent.kt index aae8b94d7..e833191c9 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/di/components/ActivityComponent.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/di/components/ActivityComponent.kt @@ -15,18 +15,18 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.di.components +package org.kiwix.kiwixmobile.core.di.components import android.app.Activity import dagger.BindsInstance import dagger.Subcomponent -import org.kiwix.kiwixmobile.di.ActivityScope -import org.kiwix.kiwixmobile.di.modules.ActivityModule -import org.kiwix.kiwixmobile.downloader.DownloadFragment -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.ZimFileSelectFragment -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.effects.DeleteFiles -import org.kiwix.kiwixmobile.zim_manager.library_view.LibraryFragment -import org.kiwix.kiwixmobile.zim_manager.local_file_transfer.LocalFileTransferActivity +import org.kiwix.kiwixmobile.core.di.ActivityScope +import org.kiwix.kiwixmobile.core.di.modules.ActivityModule +import org.kiwix.kiwixmobile.core.downloader.DownloadFragment +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.ZimFileSelectFragment +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.effects.DeleteFiles +import org.kiwix.kiwixmobile.core.zim_manager.library_view.LibraryFragment +import org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer.LocalFileTransferActivity @ActivityScope @Subcomponent(modules = [ActivityModule::class]) diff --git a/core/src/main/java/org/kiwix/kiwixmobile/di/components/ApplicationComponent.java b/core/src/main/java/org/kiwix/kiwixmobile/core/di/components/ApplicationComponent.java similarity index 70% rename from core/src/main/java/org/kiwix/kiwixmobile/di/components/ApplicationComponent.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/di/components/ApplicationComponent.java index 0e8963a6b..f21ecc866 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/di/components/ApplicationComponent.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/di/components/ApplicationComponent.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.di.components; +package org.kiwix.kiwixmobile.core.di.components; import android.content.Context; import dagger.BindsInstance; @@ -23,18 +23,18 @@ import dagger.Component; import eu.mhutti1.utils.storage.StorageSelectDialog; import javax.inject.Singleton; import org.jetbrains.annotations.NotNull; -import org.kiwix.kiwixmobile.KiwixApplication; -import org.kiwix.kiwixmobile.data.DataModule; -import org.kiwix.kiwixmobile.data.ZimContentProvider; -import org.kiwix.kiwixmobile.di.modules.ApplicationModule; -import org.kiwix.kiwixmobile.di.modules.JNIModule; -import org.kiwix.kiwixmobile.di.modules.NetworkModule; -import org.kiwix.kiwixmobile.language.LanguageActivity; -import org.kiwix.kiwixmobile.main.AddNoteDialog; -import org.kiwix.kiwixmobile.main.KiwixWebView; -import org.kiwix.kiwixmobile.search.AutoCompleteAdapter; -import org.kiwix.kiwixmobile.settings.PrefsFragment; -import org.kiwix.kiwixmobile.zim_manager.ZimManageActivity; +import org.kiwix.kiwixmobile.core.KiwixApplication; +import org.kiwix.kiwixmobile.core.data.DataModule; +import org.kiwix.kiwixmobile.core.data.ZimContentProvider; +import org.kiwix.kiwixmobile.core.di.modules.ApplicationModule; +import org.kiwix.kiwixmobile.core.di.modules.JNIModule; +import org.kiwix.kiwixmobile.core.di.modules.NetworkModule; +import org.kiwix.kiwixmobile.core.language.LanguageActivity; +import org.kiwix.kiwixmobile.core.main.AddNoteDialog; +import org.kiwix.kiwixmobile.core.main.KiwixWebView; +import org.kiwix.kiwixmobile.core.search.AutoCompleteAdapter; +import org.kiwix.kiwixmobile.core.settings.PrefsFragment; +import org.kiwix.kiwixmobile.core.zim_manager.ZimManageActivity; @Singleton @Component(modules = { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/di/components/ServiceComponent.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/di/components/ServiceComponent.kt similarity index 62% rename from core/src/main/java/org/kiwix/kiwixmobile/di/components/ServiceComponent.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/di/components/ServiceComponent.kt index d20878324..07cdce93c 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/di/components/ServiceComponent.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/di/components/ServiceComponent.kt @@ -1,11 +1,11 @@ -package org.kiwix.kiwixmobile.di.components +package org.kiwix.kiwixmobile.core.di.components import android.app.Service import dagger.BindsInstance import dagger.Subcomponent -import org.kiwix.kiwixmobile.di.ServiceScope -import org.kiwix.kiwixmobile.di.modules.ServiceModule -import org.kiwix.kiwixmobile.wifi_hotspot.HotspotService +import org.kiwix.kiwixmobile.core.di.ServiceScope +import org.kiwix.kiwixmobile.core.di.modules.ServiceModule +import org.kiwix.kiwixmobile.core.wifi_hotspot.HotspotService @Subcomponent(modules = [ServiceModule::class]) @ServiceScope diff --git a/core/src/main/java/org/kiwix/kiwixmobile/di/modules/ActivityBindingModule.java b/core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/ActivityBindingModule.java similarity index 62% rename from core/src/main/java/org/kiwix/kiwixmobile/di/modules/ActivityBindingModule.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/ActivityBindingModule.java index db48a0e28..2289b0d43 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/di/modules/ActivityBindingModule.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/ActivityBindingModule.java @@ -1,25 +1,25 @@ -package org.kiwix.kiwixmobile.di.modules; +package org.kiwix.kiwixmobile.core.di.modules; import dagger.Module; import dagger.android.ContributesAndroidInjector; -import org.kiwix.kiwixmobile.bookmark.BookmarksActivity; -import org.kiwix.kiwixmobile.bookmark.BookmarksModule; -import org.kiwix.kiwixmobile.di.ActivityScope; -import org.kiwix.kiwixmobile.error.ErrorActivity; -import org.kiwix.kiwixmobile.help.HelpActivity; -import org.kiwix.kiwixmobile.history.HistoryActivity; -import org.kiwix.kiwixmobile.history.HistoryModule; -import org.kiwix.kiwixmobile.intro.IntroActivity; -import org.kiwix.kiwixmobile.intro.IntroModule; -import org.kiwix.kiwixmobile.language.LanguageActivity; -import org.kiwix.kiwixmobile.main.MainActivity; -import org.kiwix.kiwixmobile.main.MainModule; -import org.kiwix.kiwixmobile.search.SearchActivity; -import org.kiwix.kiwixmobile.settings.KiwixSettingsActivity; -import org.kiwix.kiwixmobile.splash.SplashActivity; -import org.kiwix.kiwixmobile.webserver.ZimHostActivity; -import org.kiwix.kiwixmobile.webserver.ZimHostModule; -import org.kiwix.kiwixmobile.zim_manager.ZimManageActivity; +import org.kiwix.kiwixmobile.core.bookmark.BookmarksActivity; +import org.kiwix.kiwixmobile.core.bookmark.BookmarksModule; +import org.kiwix.kiwixmobile.core.di.ActivityScope; +import org.kiwix.kiwixmobile.core.error.ErrorActivity; +import org.kiwix.kiwixmobile.core.help.HelpActivity; +import org.kiwix.kiwixmobile.core.history.HistoryActivity; +import org.kiwix.kiwixmobile.core.history.HistoryModule; +import org.kiwix.kiwixmobile.core.intro.IntroActivity; +import org.kiwix.kiwixmobile.core.intro.IntroModule; +import org.kiwix.kiwixmobile.core.language.LanguageActivity; +import org.kiwix.kiwixmobile.core.main.MainActivity; +import org.kiwix.kiwixmobile.core.main.MainModule; +import org.kiwix.kiwixmobile.core.search.SearchActivity; +import org.kiwix.kiwixmobile.core.settings.KiwixSettingsActivity; +import org.kiwix.kiwixmobile.core.splash.SplashActivity; +import org.kiwix.kiwixmobile.core.webserver.ZimHostActivity; +import org.kiwix.kiwixmobile.core.webserver.ZimHostModule; +import org.kiwix.kiwixmobile.core.zim_manager.ZimManageActivity; /** * Dagger.Android annotation processor will create the sub-components. We also specify the modules diff --git a/core/src/main/java/org/kiwix/kiwixmobile/di/modules/ActivityModule.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/ActivityModule.kt similarity index 81% rename from core/src/main/java/org/kiwix/kiwixmobile/di/modules/ActivityModule.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/ActivityModule.kt index 05244413a..d64628c03 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/di/modules/ActivityModule.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/ActivityModule.kt @@ -15,13 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.di.modules +package org.kiwix.kiwixmobile.core.di.modules import dagger.Binds import dagger.Module -import org.kiwix.kiwixmobile.di.ActivityScope -import org.kiwix.kiwixmobile.utils.AlertDialogShower -import org.kiwix.kiwixmobile.utils.DialogShower +import org.kiwix.kiwixmobile.core.di.ActivityScope +import org.kiwix.kiwixmobile.core.utils.AlertDialogShower +import org.kiwix.kiwixmobile.core.utils.DialogShower @Module abstract class ActivityModule { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/di/modules/ApplicationModule.java b/core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/ApplicationModule.java similarity index 84% rename from core/src/main/java/org/kiwix/kiwixmobile/di/modules/ApplicationModule.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/ApplicationModule.java index 0dcf6f20f..e582711c7 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/di/modules/ApplicationModule.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/ApplicationModule.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.di.modules; +package org.kiwix.kiwixmobile.core.di.modules; import android.app.Application; import android.app.DownloadManager; @@ -30,14 +30,14 @@ import io.reactivex.Scheduler; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.schedulers.Schedulers; import javax.inject.Singleton; -import org.kiwix.kiwixmobile.di.qualifiers.Computation; -import org.kiwix.kiwixmobile.di.qualifiers.IO; -import org.kiwix.kiwixmobile.di.qualifiers.MainThread; -import org.kiwix.kiwixmobile.downloader.DownloadMonitor; -import org.kiwix.kiwixmobile.downloader.fetch.FetchDownloadMonitor; -import org.kiwix.kiwixmobile.utils.BookUtils; -import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil; -import org.kiwix.kiwixmobile.zim_manager.ZimFileReader; +import org.kiwix.kiwixmobile.core.di.qualifiers.Computation; +import org.kiwix.kiwixmobile.core.di.qualifiers.IO; +import org.kiwix.kiwixmobile.core.di.qualifiers.MainThread; +import org.kiwix.kiwixmobile.core.downloader.DownloadMonitor; +import org.kiwix.kiwixmobile.core.downloader.fetch.FetchDownloadMonitor; +import org.kiwix.kiwixmobile.core.utils.BookUtils; +import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil; +import org.kiwix.kiwixmobile.core.zim_manager.ZimFileReader; @Module(includes = { ActivityBindingModule.class, diff --git a/core/src/main/java/org/kiwix/kiwixmobile/di/modules/DatabaseModule.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/DatabaseModule.kt similarity index 81% rename from core/src/main/java/org/kiwix/kiwixmobile/di/modules/DatabaseModule.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/DatabaseModule.kt index ee797fe04..f17607067 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/di/modules/DatabaseModule.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/DatabaseModule.kt @@ -15,20 +15,20 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.di.modules +package org.kiwix.kiwixmobile.core.di.modules import android.content.Context import dagger.Module import dagger.Provides import io.objectbox.BoxStore import io.objectbox.kotlin.boxFor -import org.kiwix.kiwixmobile.database.newdb.dao.FetchDownloadDao -import org.kiwix.kiwixmobile.database.newdb.dao.HistoryDao -import org.kiwix.kiwixmobile.database.newdb.dao.NewBookDao -import org.kiwix.kiwixmobile.database.newdb.dao.NewBookmarksDao -import org.kiwix.kiwixmobile.database.newdb.dao.NewLanguagesDao -import org.kiwix.kiwixmobile.database.newdb.dao.NewRecentSearchDao -import org.kiwix.kiwixmobile.database.newdb.entities.MyObjectBox +import org.kiwix.kiwixmobile.core.newdb.dao.FetchDownloadDao +import org.kiwix.kiwixmobile.core.newdb.dao.HistoryDao +import org.kiwix.kiwixmobile.core.newdb.dao.NewBookDao +import org.kiwix.kiwixmobile.core.newdb.dao.NewBookmarksDao +import org.kiwix.kiwixmobile.core.newdb.dao.NewLanguagesDao +import org.kiwix.kiwixmobile.core.newdb.dao.NewRecentSearchDao +import org.kiwix.kiwixmobile.core.newdb.entities.MyObjectBox import javax.inject.Singleton @Module diff --git a/core/src/main/java/org/kiwix/kiwixmobile/di/modules/DownloaderModule.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/DownloaderModule.kt similarity index 76% rename from core/src/main/java/org/kiwix/kiwixmobile/di/modules/DownloaderModule.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/DownloaderModule.kt index 118c5241c..54868dd76 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/di/modules/DownloaderModule.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/DownloaderModule.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.di.modules +package org.kiwix.kiwixmobile.core.di.modules import android.content.Context import com.tonyodev.fetch2.Fetch @@ -27,14 +27,14 @@ import dagger.Module import dagger.Provides import okhttp3.OkHttpClient import org.kiwix.kiwixmobile.core.BuildConfig -import org.kiwix.kiwixmobile.data.remote.KiwixService -import org.kiwix.kiwixmobile.database.newdb.dao.FetchDownloadDao -import org.kiwix.kiwixmobile.downloader.DownloadRequester -import org.kiwix.kiwixmobile.downloader.Downloader -import org.kiwix.kiwixmobile.downloader.DownloaderImpl -import org.kiwix.kiwixmobile.downloader.fetch.FetchDownloadNotificationManager -import org.kiwix.kiwixmobile.downloader.fetch.FetchDownloadRequester -import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil +import org.kiwix.kiwixmobile.core.data.remote.KiwixService +import org.kiwix.kiwixmobile.core.downloader.DownloadRequester +import org.kiwix.kiwixmobile.core.downloader.Downloader +import org.kiwix.kiwixmobile.core.downloader.DownloaderImpl +import org.kiwix.kiwixmobile.core.downloader.fetch.FetchDownloadNotificationManager +import org.kiwix.kiwixmobile.core.downloader.fetch.FetchDownloadRequester +import org.kiwix.kiwixmobile.core.newdb.dao.FetchDownloadDao +import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil import javax.inject.Singleton @Module @@ -46,7 +46,12 @@ object DownloaderModule { downloadRequester: DownloadRequester, downloadDao: FetchDownloadDao, kiwixService: KiwixService - ): Downloader = DownloaderImpl(downloadRequester, downloadDao, kiwixService) + ): Downloader = + DownloaderImpl( + downloadRequester, + downloadDao, + kiwixService + ) @JvmStatic @Provides @@ -54,7 +59,8 @@ object DownloaderModule { fun providesDownloadRequester( fetch: Fetch, sharedPreferenceUtil: SharedPreferenceUtil - ): DownloadRequester = FetchDownloadRequester(fetch, sharedPreferenceUtil) + ): DownloadRequester = + FetchDownloadRequester(fetch, sharedPreferenceUtil) @JvmStatic @Provides diff --git a/core/src/main/java/org/kiwix/kiwixmobile/di/modules/JNIModule.java b/core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/JNIModule.java similarity index 96% rename from core/src/main/java/org/kiwix/kiwixmobile/di/modules/JNIModule.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/JNIModule.java index 1f9bfad5f..f58189ccb 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/di/modules/JNIModule.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/JNIModule.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.di.modules; +package org.kiwix.kiwixmobile.core.di.modules; import android.content.Context; import androidx.annotation.NonNull; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/di/modules/NetworkModule.java b/core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/NetworkModule.java similarity index 92% rename from core/src/main/java/org/kiwix/kiwixmobile/di/modules/NetworkModule.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/NetworkModule.java index 2b6b22d56..c1869a640 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/di/modules/NetworkModule.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/NetworkModule.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.di.modules; +package org.kiwix.kiwixmobile.core.di.modules; import android.content.Context; import android.net.ConnectivityManager; @@ -27,8 +27,8 @@ import okhttp3.OkHttpClient; import okhttp3.logging.HttpLoggingInterceptor; import okhttp3.logging.HttpLoggingInterceptor.Level; import org.kiwix.kiwixmobile.core.BuildConfig; -import org.kiwix.kiwixmobile.data.remote.KiwixService; -import org.kiwix.kiwixmobile.data.remote.UserAgentInterceptor; +import org.kiwix.kiwixmobile.core.data.remote.KiwixService; +import org.kiwix.kiwixmobile.core.data.remote.UserAgentInterceptor; @Module public class NetworkModule { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/di/modules/ServiceModule.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/ServiceModule.kt similarity index 67% rename from core/src/main/java/org/kiwix/kiwixmobile/di/modules/ServiceModule.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/ServiceModule.kt index 35178124f..ade7e6870 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/di/modules/ServiceModule.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/ServiceModule.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.di.modules +package org.kiwix.kiwixmobile.core.di.modules import android.app.NotificationManager import android.app.Service @@ -7,12 +7,12 @@ import dagger.Module import dagger.Provides import org.kiwix.kiwixlib.JNIKiwixLibrary import org.kiwix.kiwixlib.JNIKiwixServer -import org.kiwix.kiwixmobile.di.ServiceScope -import org.kiwix.kiwixmobile.webserver.WebServerHelper -import org.kiwix.kiwixmobile.wifi_hotspot.HotspotNotificationManager -import org.kiwix.kiwixmobile.wifi_hotspot.HotspotStateReceiver -import org.kiwix.kiwixmobile.wifi_hotspot.HotspotStateReceiver.Callback -import org.kiwix.kiwixmobile.wifi_hotspot.IpAddressCallbacks +import org.kiwix.kiwixmobile.core.di.ServiceScope +import org.kiwix.kiwixmobile.core.webserver.WebServerHelper +import org.kiwix.kiwixmobile.core.wifi_hotspot.HotspotNotificationManager +import org.kiwix.kiwixmobile.core.wifi_hotspot.HotspotStateReceiver +import org.kiwix.kiwixmobile.core.wifi_hotspot.HotspotStateReceiver.Callback +import org.kiwix.kiwixmobile.core.wifi_hotspot.IpAddressCallbacks @Module class ServiceModule { @@ -23,7 +23,12 @@ class ServiceModule { jniKiwixLibrary: JNIKiwixLibrary, kiwixServer: JNIKiwixServer, ipAddressCallbacks: IpAddressCallbacks - ): WebServerHelper = WebServerHelper(jniKiwixLibrary, kiwixServer, ipAddressCallbacks) + ): WebServerHelper = + WebServerHelper( + jniKiwixLibrary, + kiwixServer, + ipAddressCallbacks + ) @Provides @ServiceScope @@ -51,7 +56,8 @@ class ServiceModule { @ServiceScope fun providesHotspotStateReceiver( callback: Callback - ): HotspotStateReceiver = HotspotStateReceiver(callback) + ): HotspotStateReceiver = + HotspotStateReceiver(callback) @Provides @ServiceScope diff --git a/core/src/main/java/org/kiwix/kiwixmobile/di/modules/ViewModelModule.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/ViewModelModule.kt similarity index 82% rename from core/src/main/java/org/kiwix/kiwixmobile/di/modules/ViewModelModule.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/ViewModelModule.kt index c5a42ec69..3c4b7400d 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/di/modules/ViewModelModule.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/di/modules/ViewModelModule.kt @@ -1,14 +1,14 @@ -package org.kiwix.kiwixmobile.di.modules +package org.kiwix.kiwixmobile.core.di.modules import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider import dagger.Binds import dagger.Module import dagger.multibindings.IntoMap -import org.kiwix.kiwixmobile.KiwixViewModelFactory -import org.kiwix.kiwixmobile.di.ViewModelKey -import org.kiwix.kiwixmobile.language.viewmodel.LanguageViewModel -import org.kiwix.kiwixmobile.zim_manager.ZimManageViewModel +import org.kiwix.kiwixmobile.core.KiwixViewModelFactory +import org.kiwix.kiwixmobile.core.di.ViewModelKey +import org.kiwix.kiwixmobile.core.language.viewmodel.LanguageViewModel +import org.kiwix.kiwixmobile.core.zim_manager.ZimManageViewModel /* * Kiwix Android diff --git a/core/src/main/java/org/kiwix/kiwixmobile/di/qualifiers/Computation.java b/core/src/main/java/org/kiwix/kiwixmobile/core/di/qualifiers/Computation.java similarity index 79% rename from core/src/main/java/org/kiwix/kiwixmobile/di/qualifiers/Computation.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/di/qualifiers/Computation.java index 5bca78c56..042c8a100 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/di/qualifiers/Computation.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/di/qualifiers/Computation.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.di.qualifiers; +package org.kiwix.kiwixmobile.core.di.qualifiers; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/di/qualifiers/IO.java b/core/src/main/java/org/kiwix/kiwixmobile/core/di/qualifiers/IO.java similarity index 79% rename from core/src/main/java/org/kiwix/kiwixmobile/di/qualifiers/IO.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/di/qualifiers/IO.java index fad4a7669..157251336 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/di/qualifiers/IO.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/di/qualifiers/IO.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.di.qualifiers; +package org.kiwix.kiwixmobile.core.di.qualifiers; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/di/qualifiers/MainThread.java b/core/src/main/java/org/kiwix/kiwixmobile/core/di/qualifiers/MainThread.java similarity index 79% rename from core/src/main/java/org/kiwix/kiwixmobile/di/qualifiers/MainThread.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/di/qualifiers/MainThread.java index de9f42a5f..5fb6f23fc 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/di/qualifiers/MainThread.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/di/qualifiers/MainThread.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.di.qualifiers; +package org.kiwix.kiwixmobile.core.di.qualifiers; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/downloader/Chunk.java b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/Chunk.java similarity index 97% rename from core/src/main/java/org/kiwix/kiwixmobile/downloader/Chunk.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/downloader/Chunk.java index d1f60502c..e8578031d 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/downloader/Chunk.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/Chunk.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.downloader; +package org.kiwix.kiwixmobile.core.downloader; public class Chunk { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/downloader/ChunkUtils.java b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/ChunkUtils.java similarity index 96% rename from core/src/main/java/org/kiwix/kiwixmobile/downloader/ChunkUtils.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/downloader/ChunkUtils.java index 3896724d6..cbad72ebb 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/downloader/ChunkUtils.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/ChunkUtils.java @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.downloader; +package org.kiwix.kiwixmobile.core.downloader; import java.util.ArrayList; import java.util.List; import java.util.Locale; -import org.kiwix.kiwixmobile.utils.StorageUtils; +import org.kiwix.kiwixmobile.core.utils.StorageUtils; public class ChunkUtils { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/downloader/DownloadAdapter.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/DownloadAdapter.kt similarity index 81% rename from core/src/main/java/org/kiwix/kiwixmobile/downloader/DownloadAdapter.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/downloader/DownloadAdapter.kt index 87378d7ad..a167aed5a 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/downloader/DownloadAdapter.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/DownloadAdapter.kt @@ -15,13 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.downloader +package org.kiwix.kiwixmobile.core.downloader import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView -import org.kiwix.kiwixmobile.core.R -import org.kiwix.kiwixmobile.downloader.model.DownloadItem -import org.kiwix.kiwixmobile.extensions.inflate +import org.kiwix.kiwixmobile.core.R.layout +import org.kiwix.kiwixmobile.core.downloader.model.DownloadItem +import org.kiwix.kiwixmobile.core.extensions.ViewGroupExtensions.inflate class DownloadAdapter(private val itemClickListener: (DownloadItem) -> Unit) : RecyclerView.Adapter() { @@ -41,7 +41,12 @@ class DownloadAdapter(private val itemClickListener: (DownloadItem) -> Unit) : override fun onCreateViewHolder( parent: ViewGroup, viewType: Int - ) = DownloadViewHolder(parent.inflate(R.layout.download_item, false)) + ) = DownloadViewHolder( + parent.inflate( + layout.download_item, + false + ) + ) override fun getItemCount() = itemList.size diff --git a/core/src/main/java/org/kiwix/kiwixmobile/downloader/DownloadFragment.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/DownloadFragment.kt similarity index 84% rename from core/src/main/java/org/kiwix/kiwixmobile/downloader/DownloadFragment.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/downloader/DownloadFragment.kt index f7c0d37a5..ab9f8cfa0 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/downloader/DownloadFragment.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/DownloadFragment.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.downloader +package org.kiwix.kiwixmobile.core.downloader import android.os.Bundle import android.view.LayoutInflater @@ -27,15 +27,15 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import kotlinx.android.synthetic.main.layout_download_management.download_management_no_downloads import kotlinx.android.synthetic.main.layout_download_management.zim_downloader_list -import org.kiwix.kiwixmobile.base.BaseFragment import org.kiwix.kiwixmobile.core.R -import org.kiwix.kiwixmobile.di.components.ActivityComponent -import org.kiwix.kiwixmobile.downloader.model.DownloadItem -import org.kiwix.kiwixmobile.extensions.viewModel -import org.kiwix.kiwixmobile.utils.DialogShower -import org.kiwix.kiwixmobile.utils.KiwixDialog.YesNoDialog.StopDownload -import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil -import org.kiwix.kiwixmobile.zim_manager.ZimManageViewModel +import org.kiwix.kiwixmobile.core.base.BaseFragment +import org.kiwix.kiwixmobile.core.di.components.ActivityComponent +import org.kiwix.kiwixmobile.core.downloader.model.DownloadItem +import org.kiwix.kiwixmobile.core.extensions.viewModel +import org.kiwix.kiwixmobile.core.utils.DialogShower +import org.kiwix.kiwixmobile.core.utils.KiwixDialog.YesNoDialog.StopDownload +import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil +import org.kiwix.kiwixmobile.core.zim_manager.ZimManageViewModel import javax.inject.Inject class DownloadFragment : BaseFragment() { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/downloader/DownloadIntent.java b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/DownloadIntent.java similarity index 95% rename from core/src/main/java/org/kiwix/kiwixmobile/downloader/DownloadIntent.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/downloader/DownloadIntent.java index ccba6c3d4..ddef27ff0 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/downloader/DownloadIntent.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/DownloadIntent.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.downloader; +package org.kiwix.kiwixmobile.core.downloader; public class DownloadIntent { public static final String DOWNLOAD_URL_PARAMETER = "DOWNLOAD_URL_PARAMETER"; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/downloader/DownloadMonitor.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/DownloadMonitor.kt similarity index 94% rename from core/src/main/java/org/kiwix/kiwixmobile/downloader/DownloadMonitor.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/downloader/DownloadMonitor.kt index 4a15086ae..9c647ead0 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/downloader/DownloadMonitor.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/DownloadMonitor.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.downloader +package org.kiwix.kiwixmobile.core.downloader interface DownloadMonitor { fun init() diff --git a/core/src/main/java/org/kiwix/kiwixmobile/downloader/DownloadRequester.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/DownloadRequester.kt similarity index 82% rename from core/src/main/java/org/kiwix/kiwixmobile/downloader/DownloadRequester.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/downloader/DownloadRequester.kt index 7ac02afd2..94c0bfb97 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/downloader/DownloadRequester.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/DownloadRequester.kt @@ -15,10 +15,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.downloader +package org.kiwix.kiwixmobile.core.downloader -import org.kiwix.kiwixmobile.downloader.model.DownloadItem -import org.kiwix.kiwixmobile.downloader.model.DownloadRequest +import org.kiwix.kiwixmobile.core.downloader.model.DownloadItem +import org.kiwix.kiwixmobile.core.downloader.model.DownloadRequest interface DownloadRequester { fun enqueue(downloadRequest: DownloadRequest): Long diff --git a/core/src/main/java/org/kiwix/kiwixmobile/downloader/DownloadViewHolder.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/DownloadViewHolder.kt similarity index 79% rename from core/src/main/java/org/kiwix/kiwixmobile/downloader/DownloadViewHolder.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/downloader/DownloadViewHolder.kt index 28f1330f4..5a49b2d72 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/downloader/DownloadViewHolder.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/DownloadViewHolder.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.downloader +package org.kiwix.kiwixmobile.core.downloader import android.content.Context @@ -29,14 +29,14 @@ import kotlinx.android.synthetic.main.download_item.eta import kotlinx.android.synthetic.main.download_item.favicon import kotlinx.android.synthetic.main.download_item.stop import kotlinx.android.synthetic.main.download_item.title -import org.kiwix.kiwixmobile.downloader.model.DownloadItem -import org.kiwix.kiwixmobile.downloader.model.DownloadState -import org.kiwix.kiwixmobile.downloader.model.DownloadState.Failed -import org.kiwix.kiwixmobile.downloader.model.DownloadState.Paused -import org.kiwix.kiwixmobile.downloader.model.DownloadState.Pending -import org.kiwix.kiwixmobile.downloader.model.DownloadState.Running -import org.kiwix.kiwixmobile.downloader.model.DownloadState.Successful -import org.kiwix.kiwixmobile.extensions.setBitmap +import org.kiwix.kiwixmobile.core.downloader.model.DownloadItem +import org.kiwix.kiwixmobile.core.downloader.model.DownloadState +import org.kiwix.kiwixmobile.core.downloader.model.DownloadState.Failed +import org.kiwix.kiwixmobile.core.downloader.model.DownloadState.Paused +import org.kiwix.kiwixmobile.core.downloader.model.DownloadState.Pending +import org.kiwix.kiwixmobile.core.downloader.model.DownloadState.Running +import org.kiwix.kiwixmobile.core.downloader.model.DownloadState.Successful +import org.kiwix.kiwixmobile.core.extensions.setBitmap class DownloadViewHolder(override val containerView: View) : RecyclerView.ViewHolder(containerView), LayoutContainer { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/downloader/Downloader.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/Downloader.kt similarity index 83% rename from core/src/main/java/org/kiwix/kiwixmobile/downloader/Downloader.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/downloader/Downloader.kt index f261f2298..44cfeb44a 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/downloader/Downloader.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/Downloader.kt @@ -15,10 +15,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.downloader +package org.kiwix.kiwixmobile.core.downloader -import org.kiwix.kiwixmobile.downloader.model.DownloadItem -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity +import org.kiwix.kiwixmobile.core.downloader.model.DownloadItem +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity interface Downloader { fun download(book: LibraryNetworkEntity.Book) diff --git a/core/src/main/java/org/kiwix/kiwixmobile/downloader/DownloaderImpl.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/DownloaderImpl.kt similarity index 81% rename from core/src/main/java/org/kiwix/kiwixmobile/downloader/DownloaderImpl.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/downloader/DownloaderImpl.kt index 5d4fb8fff..d8d1e8c06 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/downloader/DownloaderImpl.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/DownloaderImpl.kt @@ -16,12 +16,12 @@ * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.downloader +package org.kiwix.kiwixmobile.core.downloader -import org.kiwix.kiwixmobile.data.remote.KiwixService -import org.kiwix.kiwixmobile.database.newdb.dao.FetchDownloadDao -import org.kiwix.kiwixmobile.downloader.model.DownloadItem -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity +import org.kiwix.kiwixmobile.core.data.remote.KiwixService +import org.kiwix.kiwixmobile.core.downloader.model.DownloadItem +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity +import org.kiwix.kiwixmobile.core.newdb.dao.FetchDownloadDao import javax.inject.Inject class DownloaderImpl @Inject constructor( diff --git a/core/src/main/java/org/kiwix/kiwixmobile/downloader/fetch/FetchDownloadMonitor.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/fetch/FetchDownloadMonitor.kt similarity index 94% rename from core/src/main/java/org/kiwix/kiwixmobile/downloader/fetch/FetchDownloadMonitor.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/downloader/fetch/FetchDownloadMonitor.kt index bdd4e4bdb..c73fb199c 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/downloader/fetch/FetchDownloadMonitor.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/fetch/FetchDownloadMonitor.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.downloader.fetch +package org.kiwix.kiwixmobile.core.downloader.fetch import com.tonyodev.fetch2.Download import com.tonyodev.fetch2.Error @@ -24,8 +24,8 @@ import com.tonyodev.fetch2.FetchListener import com.tonyodev.fetch2core.DownloadBlock import io.reactivex.schedulers.Schedulers import io.reactivex.subjects.PublishSubject -import org.kiwix.kiwixmobile.database.newdb.dao.FetchDownloadDao -import org.kiwix.kiwixmobile.downloader.DownloadMonitor +import org.kiwix.kiwixmobile.core.downloader.DownloadMonitor +import org.kiwix.kiwixmobile.core.newdb.dao.FetchDownloadDao import javax.inject.Inject class FetchDownloadMonitor @Inject constructor(fetch: Fetch, fetchDownloadDao: FetchDownloadDao) : diff --git a/core/src/main/java/org/kiwix/kiwixmobile/downloader/fetch/FetchDownloadNotificationManager.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/fetch/FetchDownloadNotificationManager.kt similarity index 98% rename from core/src/main/java/org/kiwix/kiwixmobile/downloader/fetch/FetchDownloadNotificationManager.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/downloader/fetch/FetchDownloadNotificationManager.kt index 32e174707..0f9cb8d32 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/downloader/fetch/FetchDownloadNotificationManager.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/fetch/FetchDownloadNotificationManager.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.downloader.fetch +package org.kiwix.kiwixmobile.core.downloader.fetch import android.app.NotificationChannel import android.app.NotificationManager diff --git a/core/src/main/java/org/kiwix/kiwixmobile/downloader/fetch/FetchDownloadRequester.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/fetch/FetchDownloadRequester.kt similarity index 84% rename from core/src/main/java/org/kiwix/kiwixmobile/downloader/fetch/FetchDownloadRequester.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/downloader/fetch/FetchDownloadRequester.kt index 95fc556bc..f22aba3c0 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/downloader/fetch/FetchDownloadRequester.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/fetch/FetchDownloadRequester.kt @@ -15,16 +15,16 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.downloader.fetch +package org.kiwix.kiwixmobile.core.downloader.fetch import com.tonyodev.fetch2.Fetch import com.tonyodev.fetch2.NetworkType.ALL import com.tonyodev.fetch2.NetworkType.WIFI_ONLY import com.tonyodev.fetch2.Request -import org.kiwix.kiwixmobile.downloader.DownloadRequester -import org.kiwix.kiwixmobile.downloader.model.DownloadItem -import org.kiwix.kiwixmobile.downloader.model.DownloadRequest -import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil +import org.kiwix.kiwixmobile.core.downloader.DownloadRequester +import org.kiwix.kiwixmobile.core.downloader.model.DownloadItem +import org.kiwix.kiwixmobile.core.downloader.model.DownloadRequest +import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil import javax.inject.Inject class FetchDownloadRequester @Inject constructor( diff --git a/core/src/main/java/org/kiwix/kiwixmobile/downloader/model/Base64String.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/model/Base64String.kt similarity index 89% rename from core/src/main/java/org/kiwix/kiwixmobile/downloader/model/Base64String.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/downloader/model/Base64String.kt index 6e683d4de..d05432c96 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/downloader/model/Base64String.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/model/Base64String.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.downloader.model +package org.kiwix.kiwixmobile.core.downloader.model import android.graphics.Bitmap import android.graphics.BitmapFactory diff --git a/core/src/main/java/org/kiwix/kiwixmobile/downloader/model/DownloadItem.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/model/DownloadItem.kt similarity index 95% rename from core/src/main/java/org/kiwix/kiwixmobile/downloader/model/DownloadItem.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/downloader/model/DownloadItem.kt index 6a8fd66ea..ae47d6f85 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/downloader/model/DownloadItem.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/model/DownloadItem.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.downloader.model +package org.kiwix.kiwixmobile.core.downloader.model import com.tonyodev.fetch2.Error import com.tonyodev.fetch2.Status @@ -52,7 +52,10 @@ data class DownloadItem( downloadModel.totalSizeOfDownload, downloadModel.progress, Seconds(downloadModel.etaInMilliSeconds / 1000L), - DownloadState.from(downloadModel.state, downloadModel.error) + DownloadState.from( + downloadModel.state, + downloadModel.error + ) ) } diff --git a/core/src/main/java/org/kiwix/kiwixmobile/downloader/model/DownloadModel.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/model/DownloadModel.kt similarity index 86% rename from core/src/main/java/org/kiwix/kiwixmobile/downloader/model/DownloadModel.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/downloader/model/DownloadModel.kt index 5739be5ea..ef746c711 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/downloader/model/DownloadModel.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/model/DownloadModel.kt @@ -15,13 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.downloader.model +package org.kiwix.kiwixmobile.core.downloader.model import com.tonyodev.fetch2.Error import com.tonyodev.fetch2.Status -import org.kiwix.kiwixmobile.database.newdb.entities.FetchDownloadEntity -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity.Book -import org.kiwix.kiwixmobile.utils.StorageUtils +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book +import org.kiwix.kiwixmobile.core.newdb.entities.FetchDownloadEntity +import org.kiwix.kiwixmobile.core.utils.StorageUtils data class DownloadModel( val databaseId: Long, diff --git a/core/src/main/java/org/kiwix/kiwixmobile/downloader/model/DownloadRequest.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/model/DownloadRequest.kt similarity index 81% rename from core/src/main/java/org/kiwix/kiwixmobile/downloader/model/DownloadRequest.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/downloader/model/DownloadRequest.kt index 483a73a63..53f6f1d6d 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/downloader/model/DownloadRequest.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/model/DownloadRequest.kt @@ -15,13 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.downloader.model +package org.kiwix.kiwixmobile.core.downloader.model import android.net.Uri -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity -import org.kiwix.kiwixmobile.library.entity.MetaLinkNetworkEntity -import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil -import org.kiwix.kiwixmobile.utils.StorageUtils +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity +import org.kiwix.kiwixmobile.core.entity.MetaLinkNetworkEntity +import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil +import org.kiwix.kiwixmobile.core.utils.StorageUtils data class DownloadRequest( val urlString: String, diff --git a/core/src/main/java/org/kiwix/kiwixmobile/downloader/model/Seconds.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/model/Seconds.kt similarity index 92% rename from core/src/main/java/org/kiwix/kiwixmobile/downloader/model/Seconds.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/downloader/model/Seconds.kt index 2747d65a2..108ddb785 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/downloader/model/Seconds.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/downloader/model/Seconds.kt @@ -1,6 +1,6 @@ -package org.kiwix.kiwixmobile.downloader.model +package org.kiwix.kiwixmobile.core.downloader.model -import org.kiwix.kiwixmobile.KiwixApplication +import org.kiwix.kiwixmobile.core.KiwixApplication import org.kiwix.kiwixmobile.core.R import java.util.Locale import kotlin.math.roundToLong diff --git a/core/src/main/java/org/kiwix/kiwixmobile/library/entity/LibraryNetworkEntity.java b/core/src/main/java/org/kiwix/kiwixmobile/core/entity/LibraryNetworkEntity.java similarity index 98% rename from core/src/main/java/org/kiwix/kiwixmobile/library/entity/LibraryNetworkEntity.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/entity/LibraryNetworkEntity.java index b3a326e41..9622c7049 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/library/entity/LibraryNetworkEntity.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/entity/LibraryNetworkEntity.java @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. */ -package org.kiwix.kiwixmobile.library.entity; +package org.kiwix.kiwixmobile.core.entity; import java.io.File; import java.io.Serializable; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/library/entity/MetaLinkNetworkEntity.java b/core/src/main/java/org/kiwix/kiwixmobile/core/entity/MetaLinkNetworkEntity.java similarity index 98% rename from core/src/main/java/org/kiwix/kiwixmobile/library/entity/MetaLinkNetworkEntity.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/entity/MetaLinkNetworkEntity.java index 450061531..7320b0b37 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/library/entity/MetaLinkNetworkEntity.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/entity/MetaLinkNetworkEntity.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.library.entity; +package org.kiwix.kiwixmobile.core.entity; import java.util.List; import java.util.Map; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/error/ErrorActivity.java b/core/src/main/java/org/kiwix/kiwixmobile/core/error/ErrorActivity.java similarity index 90% rename from core/src/main/java/org/kiwix/kiwixmobile/error/ErrorActivity.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/error/ErrorActivity.java index 478b370c6..b680880bf 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/error/ErrorActivity.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/error/ErrorActivity.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.error; +package org.kiwix.kiwixmobile.core.error; import android.content.Context; import android.content.Intent; @@ -16,15 +16,15 @@ import java.io.StringWriter; import java.util.List; import javax.inject.Inject; import org.kiwix.kiwixmobile.core.R; -import org.kiwix.kiwixmobile.base.BaseActivity; import org.kiwix.kiwixmobile.core.R2; -import org.kiwix.kiwixmobile.database.newdb.dao.NewBookDao; -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity; -import org.kiwix.kiwixmobile.splash.SplashActivity; -import org.kiwix.kiwixmobile.zim_manager.ZimReaderContainer; -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk; +import org.kiwix.kiwixmobile.core.base.BaseActivity; +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity; +import org.kiwix.kiwixmobile.core.newdb.dao.NewBookDao; +import org.kiwix.kiwixmobile.core.splash.SplashActivity; +import org.kiwix.kiwixmobile.core.zim_manager.ZimReaderContainer; +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk; -import static org.kiwix.kiwixmobile.utils.LanguageUtils.getCurrentLocale; +import static org.kiwix.kiwixmobile.core.utils.LanguageUtils.getCurrentLocale; public class ErrorActivity extends BaseActivity { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/extensions/ActivityExtensions.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/extensions/ActivityExtensions.kt similarity index 96% rename from core/src/main/java/org/kiwix/kiwixmobile/extensions/ActivityExtensions.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/extensions/ActivityExtensions.kt index 9f163ca94..37885eb30 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/extensions/ActivityExtensions.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/extensions/ActivityExtensions.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.extensions +package org.kiwix.kiwixmobile.core.extensions import android.app.Activity import android.content.Intent diff --git a/core/src/main/java/org/kiwix/kiwixmobile/extensions/BookExtensions.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/extensions/BookExtensions.kt similarity index 72% rename from core/src/main/java/org/kiwix/kiwixmobile/extensions/BookExtensions.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/extensions/BookExtensions.kt index 8b82f6294..3af96da51 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/extensions/BookExtensions.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/extensions/BookExtensions.kt @@ -1,9 +1,9 @@ -package org.kiwix.kiwixmobile.extensions +package org.kiwix.kiwixmobile.core.extensions -import org.kiwix.kiwixmobile.KiwixApplication -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity.Book -import org.kiwix.kiwixmobile.utils.BookUtils -import org.kiwix.kiwixmobile.utils.NetworkUtils +import org.kiwix.kiwixmobile.core.KiwixApplication +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book +import org.kiwix.kiwixmobile.core.utils.BookUtils +import org.kiwix.kiwixmobile.core.utils.NetworkUtils fun Book.calculateSearchMatches( filter: String, diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/extensions/ConnectivityManagerExtensions.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/extensions/ConnectivityManagerExtensions.kt new file mode 100644 index 000000000..207d4d277 --- /dev/null +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/extensions/ConnectivityManagerExtensions.kt @@ -0,0 +1,12 @@ +package org.kiwix.kiwixmobile.core.extensions + +import android.net.ConnectivityManager +import org.kiwix.kiwixmobile.core.zim_manager.NetworkState +import org.kiwix.kiwixmobile.core.zim_manager.NetworkState.CONNECTED +import org.kiwix.kiwixmobile.core.zim_manager.NetworkState.NOT_CONNECTED + +val ConnectivityManager.networkState: NetworkState + get() = if (activeNetworkInfo?.isConnected == true) + CONNECTED + else + NOT_CONNECTED diff --git a/core/src/main/java/org/kiwix/kiwixmobile/extensions/ContextExtensions.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/extensions/ContextExtensions.kt similarity index 88% rename from core/src/main/java/org/kiwix/kiwixmobile/extensions/ContextExtensions.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/extensions/ContextExtensions.kt index a24f03a6f..76394345d 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/extensions/ContextExtensions.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/extensions/ContextExtensions.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.extensions +package org.kiwix.kiwixmobile.core.extensions import android.content.Context import android.content.Intent @@ -6,7 +6,7 @@ import android.content.IntentFilter import android.os.Build.VERSION import android.os.Build.VERSION_CODES import android.widget.Toast -import org.kiwix.kiwixmobile.zim_manager.BaseBroadcastReceiver +import org.kiwix.kiwixmobile.core.zim_manager.BaseBroadcastReceiver import java.util.Locale fun Context?.toast( diff --git a/core/src/main/java/org/kiwix/kiwixmobile/extensions/CursorExtensions.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/extensions/CursorExtensions.kt similarity index 96% rename from core/src/main/java/org/kiwix/kiwixmobile/extensions/CursorExtensions.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/extensions/CursorExtensions.kt index 13f9f0cf0..6a2ef9669 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/extensions/CursorExtensions.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/extensions/CursorExtensions.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.extensions +package org.kiwix.kiwixmobile.core.extensions import android.database.Cursor diff --git a/core/src/main/java/org/kiwix/kiwixmobile/extensions/ImageViewExtensions.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/extensions/ImageViewExtensions.kt similarity index 79% rename from core/src/main/java/org/kiwix/kiwixmobile/extensions/ImageViewExtensions.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/extensions/ImageViewExtensions.kt index 904797b70..24e2e7990 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/extensions/ImageViewExtensions.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/extensions/ImageViewExtensions.kt @@ -1,7 +1,7 @@ -package org.kiwix.kiwixmobile.extensions +package org.kiwix.kiwixmobile.core.extensions import android.widget.ImageView -import org.kiwix.kiwixmobile.downloader.model.Base64String +import org.kiwix.kiwixmobile.core.downloader.model.Base64String fun ImageView.setBitmap(base64String: Base64String) { if (tag != base64String) { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/extensions/TextViewExtensions.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/extensions/TextViewExtensions.kt similarity index 85% rename from core/src/main/java/org/kiwix/kiwixmobile/extensions/TextViewExtensions.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/extensions/TextViewExtensions.kt index 0532a9dc0..32b1efa50 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/extensions/TextViewExtensions.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/extensions/TextViewExtensions.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.extensions +package org.kiwix.kiwixmobile.core.extensions import android.view.View import android.widget.TextView diff --git a/core/src/main/java/org/kiwix/kiwixmobile/extensions/ViewExtensions.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/extensions/ViewExtensions.kt similarity index 90% rename from core/src/main/java/org/kiwix/kiwixmobile/extensions/ViewExtensions.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/extensions/ViewExtensions.kt index 8f35bc69f..dbdc2308e 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/extensions/ViewExtensions.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/extensions/ViewExtensions.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.extensions +package org.kiwix.kiwixmobile.core.extensions import android.graphics.Color import android.view.View diff --git a/core/src/main/java/org/kiwix/kiwixmobile/extensions/ViewGroupExtensions.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/extensions/ViewGroupExtensions.kt similarity index 77% rename from core/src/main/java/org/kiwix/kiwixmobile/extensions/ViewGroupExtensions.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/extensions/ViewGroupExtensions.kt index 26b456d35..c2c7abdfc 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/extensions/ViewGroupExtensions.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/extensions/ViewGroupExtensions.kt @@ -15,14 +15,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.extensions +package org.kiwix.kiwixmobile.core.extensions import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -fun ViewGroup.inflate( - layoutId: Int, - attachToRoot: Boolean = true -): View = - LayoutInflater.from(context).inflate(layoutId, this, attachToRoot) +object ViewGroupExtensions { + + fun ViewGroup.inflate( + layoutId: Int, + attachToRoot: Boolean = true + ): View = + LayoutInflater.from(context).inflate(layoutId, this, attachToRoot) +} diff --git a/core/src/main/java/org/kiwix/kiwixmobile/help/HelpActivity.java b/core/src/main/java/org/kiwix/kiwixmobile/core/help/HelpActivity.java similarity index 93% rename from core/src/main/java/org/kiwix/kiwixmobile/help/HelpActivity.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/help/HelpActivity.java index d9b048e26..85e8753b6 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/help/HelpActivity.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/help/HelpActivity.java @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.help; +package org.kiwix.kiwixmobile.core.help; import android.content.Intent; import android.net.Uri; @@ -28,11 +28,11 @@ import butterknife.BindView; import butterknife.OnClick; import java.util.HashMap; import org.kiwix.kiwixmobile.core.R; -import org.kiwix.kiwixmobile.base.BaseActivity; import org.kiwix.kiwixmobile.core.R2; -import org.kiwix.kiwixmobile.utils.LanguageUtils; +import org.kiwix.kiwixmobile.core.base.BaseActivity; +import org.kiwix.kiwixmobile.core.utils.LanguageUtils; -import static org.kiwix.kiwixmobile.utils.Constants.CONTACT_EMAIL_ADDRESS; +import static org.kiwix.kiwixmobile.core.utils.Constants.CONTACT_EMAIL_ADDRESS; public class HelpActivity extends BaseActivity { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/help/HelpAdapter.java b/core/src/main/java/org/kiwix/kiwixmobile/core/help/HelpAdapter.java similarity index 92% rename from core/src/main/java/org/kiwix/kiwixmobile/help/HelpAdapter.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/help/HelpAdapter.java index bc25b7eaa..aa1dbcb9e 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/help/HelpAdapter.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/help/HelpAdapter.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.help; +package org.kiwix.kiwixmobile.core.help; import android.animation.ObjectAnimator; import android.graphics.Color; @@ -16,8 +16,8 @@ import java.util.HashMap; import org.kiwix.kiwixmobile.core.R; import org.kiwix.kiwixmobile.core.R2; -import static org.kiwix.kiwixmobile.utils.AnimationUtils.collapse; -import static org.kiwix.kiwixmobile.utils.AnimationUtils.expand; +import static org.kiwix.kiwixmobile.core.utils.AnimationUtils.collapse; +import static org.kiwix.kiwixmobile.core.utils.AnimationUtils.expand; class HelpAdapter extends RecyclerView.Adapter { private final String[] titles; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/history/HistoryActivity.java b/core/src/main/java/org/kiwix/kiwixmobile/core/history/HistoryActivity.java similarity index 96% rename from core/src/main/java/org/kiwix/kiwixmobile/history/HistoryActivity.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/history/HistoryActivity.java index 8a36e6e87..5ab03c5a4 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/history/HistoryActivity.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/history/HistoryActivity.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.history; +package org.kiwix.kiwixmobile.core.history; import android.content.Intent; import android.net.Uri; @@ -21,14 +21,14 @@ import java.io.File; import java.util.ArrayList; import java.util.List; import javax.inject.Inject; -import org.kiwix.kiwixmobile.base.BaseActivity; import org.kiwix.kiwixmobile.core.R; import org.kiwix.kiwixmobile.core.R2; -import org.kiwix.kiwixmobile.extensions.ImageViewExtensionsKt; -import org.kiwix.kiwixmobile.main.MainActivity; -import org.kiwix.kiwixmobile.zim_manager.ZimReaderContainer; +import org.kiwix.kiwixmobile.core.base.BaseActivity; +import org.kiwix.kiwixmobile.core.extensions.ImageViewExtensionsKt; +import org.kiwix.kiwixmobile.core.main.MainActivity; +import org.kiwix.kiwixmobile.core.zim_manager.ZimReaderContainer; -import static org.kiwix.kiwixmobile.utils.Constants.EXTRA_CHOSE_X_URL; +import static org.kiwix.kiwixmobile.core.utils.Constants.EXTRA_CHOSE_X_URL; public class HistoryActivity extends BaseActivity implements HistoryContract.View, HistoryAdapter.OnItemClickListener { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/history/HistoryAdapter.java b/core/src/main/java/org/kiwix/kiwixmobile/core/history/HistoryAdapter.java similarity index 97% rename from core/src/main/java/org/kiwix/kiwixmobile/history/HistoryAdapter.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/history/HistoryAdapter.java index f1a35349a..7f0bcc1de 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/history/HistoryAdapter.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/history/HistoryAdapter.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.history; +package org.kiwix.kiwixmobile.core.history; import android.view.LayoutInflater; import android.view.View; @@ -13,7 +13,7 @@ import butterknife.ButterKnife; import java.util.List; import org.kiwix.kiwixmobile.core.R; import org.kiwix.kiwixmobile.core.R2; -import org.kiwix.kiwixmobile.extensions.ImageViewExtensionsKt; +import org.kiwix.kiwixmobile.core.extensions.ImageViewExtensionsKt; import org.threeten.bp.LocalDate; import org.threeten.bp.format.DateTimeFormatter; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/history/HistoryContract.java b/core/src/main/java/org/kiwix/kiwixmobile/core/history/HistoryContract.java similarity index 83% rename from core/src/main/java/org/kiwix/kiwixmobile/history/HistoryContract.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/history/HistoryContract.java index de44a6fea..819ff374a 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/history/HistoryContract.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/history/HistoryContract.java @@ -1,7 +1,7 @@ -package org.kiwix.kiwixmobile.history; +package org.kiwix.kiwixmobile.core.history; import java.util.List; -import org.kiwix.kiwixmobile.base.BaseContract; +import org.kiwix.kiwixmobile.core.base.BaseContract; interface HistoryContract { interface View extends BaseContract.View { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/history/HistoryListItem.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/history/HistoryListItem.kt similarity index 92% rename from core/src/main/java/org/kiwix/kiwixmobile/history/HistoryListItem.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/history/HistoryListItem.kt index ce80328e3..d56ea0531 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/history/HistoryListItem.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/history/HistoryListItem.kt @@ -15,10 +15,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.history +package org.kiwix.kiwixmobile.core.history -import org.kiwix.kiwixmobile.database.newdb.entities.HistoryEntity -import org.kiwix.kiwixmobile.zim_manager.ZimFileReader +import org.kiwix.kiwixmobile.core.newdb.entities.HistoryEntity +import org.kiwix.kiwixmobile.core.zim_manager.ZimFileReader sealed class HistoryListItem { abstract val id: Long diff --git a/core/src/main/java/org/kiwix/kiwixmobile/history/HistoryModule.java b/core/src/main/java/org/kiwix/kiwixmobile/core/history/HistoryModule.java similarity index 70% rename from core/src/main/java/org/kiwix/kiwixmobile/history/HistoryModule.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/history/HistoryModule.java index 5055b136d..4dfbc0d71 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/history/HistoryModule.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/history/HistoryModule.java @@ -1,8 +1,8 @@ -package org.kiwix.kiwixmobile.history; +package org.kiwix.kiwixmobile.core.history; import dagger.Module; import dagger.Provides; -import org.kiwix.kiwixmobile.di.ActivityScope; +import org.kiwix.kiwixmobile.core.di.ActivityScope; @Module public class HistoryModule { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/history/HistoryPresenter.java b/core/src/main/java/org/kiwix/kiwixmobile/core/history/HistoryPresenter.java similarity index 90% rename from core/src/main/java/org/kiwix/kiwixmobile/history/HistoryPresenter.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/history/HistoryPresenter.java index 2e61ea8ac..f1852ad55 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/history/HistoryPresenter.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/history/HistoryPresenter.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.history; +package org.kiwix.kiwixmobile.core.history; import android.util.Log; import io.reactivex.CompletableObserver; @@ -9,11 +9,11 @@ import io.reactivex.disposables.Disposable; import java.util.ArrayList; import java.util.List; import javax.inject.Inject; -import org.kiwix.kiwixmobile.base.BasePresenter; -import org.kiwix.kiwixmobile.data.DataSource; -import org.kiwix.kiwixmobile.di.ActivityScope; -import org.kiwix.kiwixmobile.di.qualifiers.Computation; -import org.kiwix.kiwixmobile.di.qualifiers.MainThread; +import org.kiwix.kiwixmobile.core.base.BasePresenter; +import org.kiwix.kiwixmobile.core.data.DataSource; +import org.kiwix.kiwixmobile.core.di.ActivityScope; +import org.kiwix.kiwixmobile.core.di.qualifiers.Computation; +import org.kiwix.kiwixmobile.core.di.qualifiers.MainThread; @ActivityScope class HistoryPresenter extends BasePresenter diff --git a/core/src/main/java/org/kiwix/kiwixmobile/intro/CustomViewPager.java b/core/src/main/java/org/kiwix/kiwixmobile/core/intro/CustomViewPager.java similarity index 97% rename from core/src/main/java/org/kiwix/kiwixmobile/intro/CustomViewPager.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/intro/CustomViewPager.java index 79ee04524..4f86f33b1 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/intro/CustomViewPager.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/intro/CustomViewPager.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.intro; +package org.kiwix.kiwixmobile.core.intro; import android.content.Context; import android.util.AttributeSet; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/intro/IntroActivity.java b/core/src/main/java/org/kiwix/kiwixmobile/core/intro/IntroActivity.java similarity index 95% rename from core/src/main/java/org/kiwix/kiwixmobile/intro/IntroActivity.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/intro/IntroActivity.java index 02710a400..e3a9bf34b 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/intro/IntroActivity.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/intro/IntroActivity.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.intro; +package org.kiwix.kiwixmobile.core.intro; import android.content.Intent; import android.os.Bundle; @@ -14,9 +14,9 @@ import java.util.Timer; import java.util.TimerTask; import javax.inject.Inject; import org.kiwix.kiwixmobile.core.R; -import org.kiwix.kiwixmobile.base.BaseActivity; import org.kiwix.kiwixmobile.core.R2; -import org.kiwix.kiwixmobile.main.MainActivity; +import org.kiwix.kiwixmobile.core.base.BaseActivity; +import org.kiwix.kiwixmobile.core.main.MainActivity; public class IntroActivity extends BaseActivity implements IntroContract.View { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/intro/IntroContract.java b/core/src/main/java/org/kiwix/kiwixmobile/core/intro/IntroContract.java similarity index 65% rename from core/src/main/java/org/kiwix/kiwixmobile/intro/IntroContract.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/intro/IntroContract.java index c4074883a..b5e684218 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/intro/IntroContract.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/intro/IntroContract.java @@ -1,6 +1,6 @@ -package org.kiwix.kiwixmobile.intro; +package org.kiwix.kiwixmobile.core.intro; -import org.kiwix.kiwixmobile.base.BaseContract; +import org.kiwix.kiwixmobile.core.base.BaseContract; interface IntroContract { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/intro/IntroModule.java b/core/src/main/java/org/kiwix/kiwixmobile/core/intro/IntroModule.java similarity index 69% rename from core/src/main/java/org/kiwix/kiwixmobile/intro/IntroModule.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/intro/IntroModule.java index df8670386..37c59bfaa 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/intro/IntroModule.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/intro/IntroModule.java @@ -1,8 +1,8 @@ -package org.kiwix.kiwixmobile.intro; +package org.kiwix.kiwixmobile.core.intro; import dagger.Module; import dagger.Provides; -import org.kiwix.kiwixmobile.di.ActivityScope; +import org.kiwix.kiwixmobile.core.di.ActivityScope; @Module public class IntroModule { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/intro/IntroPagerAdapter.java b/core/src/main/java/org/kiwix/kiwixmobile/core/intro/IntroPagerAdapter.java similarity index 95% rename from core/src/main/java/org/kiwix/kiwixmobile/intro/IntroPagerAdapter.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/intro/IntroPagerAdapter.java index 7d49eee08..580b5dece 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/intro/IntroPagerAdapter.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/intro/IntroPagerAdapter.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.intro; +package org.kiwix.kiwixmobile.core.intro; import android.view.View; import android.view.ViewGroup; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/intro/IntroPresenter.java b/core/src/main/java/org/kiwix/kiwixmobile/core/intro/IntroPresenter.java similarity index 64% rename from core/src/main/java/org/kiwix/kiwixmobile/intro/IntroPresenter.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/intro/IntroPresenter.java index 85fe49062..f9e7c67e9 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/intro/IntroPresenter.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/intro/IntroPresenter.java @@ -1,9 +1,9 @@ -package org.kiwix.kiwixmobile.intro; +package org.kiwix.kiwixmobile.core.intro; import javax.inject.Inject; -import org.kiwix.kiwixmobile.base.BasePresenter; -import org.kiwix.kiwixmobile.di.ActivityScope; -import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil; +import org.kiwix.kiwixmobile.core.base.BasePresenter; +import org.kiwix.kiwixmobile.core.di.ActivityScope; +import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil; @ActivityScope class IntroPresenter extends BasePresenter implements IntroContract.Presenter { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/language/LanguageActivity.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/language/LanguageActivity.kt similarity index 75% rename from core/src/main/java/org/kiwix/kiwixmobile/language/LanguageActivity.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/language/LanguageActivity.kt index 5b7e2f03f..1ecb9d99e 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/language/LanguageActivity.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/language/LanguageActivity.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.language +package org.kiwix.kiwixmobile.core.language import android.os.Bundle import android.view.Menu @@ -12,21 +12,21 @@ import io.reactivex.disposables.CompositeDisposable import kotlinx.android.synthetic.main.activity_language.language_progressbar import kotlinx.android.synthetic.main.activity_language.language_recycler_view import kotlinx.android.synthetic.main.activity_language.toolbar -import org.kiwix.kiwixmobile.KiwixApplication +import org.kiwix.kiwixmobile.core.KiwixApplication import org.kiwix.kiwixmobile.core.R -import org.kiwix.kiwixmobile.base.BaseActivity -import org.kiwix.kiwixmobile.extensions.viewModel -import org.kiwix.kiwixmobile.language.adapter.LanguageAdapter -import org.kiwix.kiwixmobile.language.adapter.LanguageDelegate.HeaderDelegate -import org.kiwix.kiwixmobile.language.adapter.LanguageDelegate.LanguageItemDelegate -import org.kiwix.kiwixmobile.language.viewmodel.Action -import org.kiwix.kiwixmobile.language.viewmodel.Action.Select -import org.kiwix.kiwixmobile.language.viewmodel.LanguageViewModel -import org.kiwix.kiwixmobile.language.viewmodel.State -import org.kiwix.kiwixmobile.language.viewmodel.State.Content -import org.kiwix.kiwixmobile.language.viewmodel.State.Loading -import org.kiwix.kiwixmobile.language.viewmodel.State.Saving -import org.kiwix.kiwixmobile.zim_manager.SimpleTextListener +import org.kiwix.kiwixmobile.core.base.BaseActivity +import org.kiwix.kiwixmobile.core.extensions.viewModel +import org.kiwix.kiwixmobile.core.language.adapter.LanguageAdapter +import org.kiwix.kiwixmobile.core.language.adapter.LanguageDelegate.HeaderDelegate +import org.kiwix.kiwixmobile.core.language.adapter.LanguageDelegate.LanguageItemDelegate +import org.kiwix.kiwixmobile.core.language.viewmodel.Action +import org.kiwix.kiwixmobile.core.language.viewmodel.Action.Select +import org.kiwix.kiwixmobile.core.language.viewmodel.LanguageViewModel +import org.kiwix.kiwixmobile.core.language.viewmodel.State +import org.kiwix.kiwixmobile.core.language.viewmodel.State.Content +import org.kiwix.kiwixmobile.core.language.viewmodel.State.Loading +import org.kiwix.kiwixmobile.core.language.viewmodel.State.Saving +import org.kiwix.kiwixmobile.core.zim_manager.SimpleTextListener import javax.inject.Inject class LanguageActivity : BaseActivity() { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/language/adapter/LanguageAdapter.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/language/adapter/LanguageAdapter.kt similarity index 79% rename from core/src/main/java/org/kiwix/kiwixmobile/language/adapter/LanguageAdapter.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/language/adapter/LanguageAdapter.kt index 5860bf524..f6ed63afa 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/language/adapter/LanguageAdapter.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/language/adapter/LanguageAdapter.kt @@ -15,10 +15,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.language.adapter +package org.kiwix.kiwixmobile.core.language.adapter -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.base.AdapterDelegate -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.base.BaseDelegateAdapter +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.base.AdapterDelegate +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.base.BaseDelegateAdapter class LanguageAdapter( vararg delegates: AdapterDelegate diff --git a/core/src/main/java/org/kiwix/kiwixmobile/language/adapter/LanguageDelegate.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/language/adapter/LanguageDelegate.kt similarity index 58% rename from core/src/main/java/org/kiwix/kiwixmobile/language/adapter/LanguageDelegate.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/language/adapter/LanguageDelegate.kt index e00312c5a..d8566835c 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/language/adapter/LanguageDelegate.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/language/adapter/LanguageDelegate.kt @@ -1,13 +1,13 @@ -package org.kiwix.kiwixmobile.language.adapter +package org.kiwix.kiwixmobile.core.language.adapter import android.view.ViewGroup import org.kiwix.kiwixmobile.core.R -import org.kiwix.kiwixmobile.extensions.inflate -import org.kiwix.kiwixmobile.language.adapter.LanguageListItem.HeaderItem -import org.kiwix.kiwixmobile.language.adapter.LanguageListItem.LanguageItem -import org.kiwix.kiwixmobile.language.adapter.LanguageListViewHolder.HeaderViewHolder -import org.kiwix.kiwixmobile.language.adapter.LanguageListViewHolder.LanguageViewHolder -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.base.AbsDelegateAdapter +import org.kiwix.kiwixmobile.core.extensions.ViewGroupExtensions.inflate +import org.kiwix.kiwixmobile.core.language.adapter.LanguageListItem.HeaderItem +import org.kiwix.kiwixmobile.core.language.adapter.LanguageListItem.LanguageItem +import org.kiwix.kiwixmobile.core.language.adapter.LanguageListViewHolder.HeaderViewHolder +import org.kiwix.kiwixmobile.core.language.adapter.LanguageListViewHolder.LanguageViewHolder +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.base.AbsDelegateAdapter sealed class LanguageDelegate> : AbsDelegateAdapter { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/language/adapter/LanguageListItem.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/language/adapter/LanguageListItem.kt similarity index 78% rename from core/src/main/java/org/kiwix/kiwixmobile/language/adapter/LanguageListItem.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/language/adapter/LanguageListItem.kt index f2407dcbd..c0a67d8a8 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/language/adapter/LanguageListItem.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/language/adapter/LanguageListItem.kt @@ -1,6 +1,6 @@ -package org.kiwix.kiwixmobile.language.adapter +package org.kiwix.kiwixmobile.core.language.adapter -import org.kiwix.kiwixmobile.zim_manager.Language +import org.kiwix.kiwixmobile.core.zim_manager.Language sealed class LanguageListItem { abstract val id: Long diff --git a/core/src/main/java/org/kiwix/kiwixmobile/language/adapter/LanguageListViewHolder.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/language/adapter/LanguageListViewHolder.kt similarity index 84% rename from core/src/main/java/org/kiwix/kiwixmobile/language/adapter/LanguageListViewHolder.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/language/adapter/LanguageListViewHolder.kt index 85c681dff..14e6d652a 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/language/adapter/LanguageListViewHolder.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/language/adapter/LanguageListViewHolder.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.language.adapter +package org.kiwix.kiwixmobile.core.language.adapter import android.view.View import kotlinx.android.synthetic.main.header_date.header_date @@ -8,9 +8,9 @@ import kotlinx.android.synthetic.main.item_language.item_language_clickable_area import kotlinx.android.synthetic.main.item_language.item_language_localized_name import kotlinx.android.synthetic.main.item_language.item_language_name import org.kiwix.kiwixmobile.core.R -import org.kiwix.kiwixmobile.language.adapter.LanguageListItem.HeaderItem -import org.kiwix.kiwixmobile.language.adapter.LanguageListItem.LanguageItem -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.base.BaseViewHolder +import org.kiwix.kiwixmobile.core.language.adapter.LanguageListItem.HeaderItem +import org.kiwix.kiwixmobile.core.language.adapter.LanguageListItem.LanguageItem +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.base.BaseViewHolder sealed class LanguageListViewHolder(override val containerView: View) : BaseViewHolder(containerView) { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/language/viewmodel/Action.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/language/viewmodel/Action.kt similarity index 55% rename from core/src/main/java/org/kiwix/kiwixmobile/language/viewmodel/Action.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/language/viewmodel/Action.kt index 5a0804d99..3b4ddfb62 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/language/viewmodel/Action.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/language/viewmodel/Action.kt @@ -1,7 +1,7 @@ -package org.kiwix.kiwixmobile.language.viewmodel +package org.kiwix.kiwixmobile.core.language.viewmodel -import org.kiwix.kiwixmobile.language.adapter.LanguageListItem.LanguageItem -import org.kiwix.kiwixmobile.zim_manager.Language +import org.kiwix.kiwixmobile.core.language.adapter.LanguageListItem.LanguageItem +import org.kiwix.kiwixmobile.core.zim_manager.Language sealed class Action { data class UpdateLanguages(val languages: List) : Action() diff --git a/core/src/main/java/org/kiwix/kiwixmobile/language/viewmodel/LanguageViewModel.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/language/viewmodel/LanguageViewModel.kt similarity index 73% rename from core/src/main/java/org/kiwix/kiwixmobile/language/viewmodel/LanguageViewModel.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/language/viewmodel/LanguageViewModel.kt index 285cfda36..5d9add944 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/language/viewmodel/LanguageViewModel.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/language/viewmodel/LanguageViewModel.kt @@ -1,19 +1,19 @@ -package org.kiwix.kiwixmobile.language.viewmodel +package org.kiwix.kiwixmobile.core.language.viewmodel import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import io.reactivex.disposables.CompositeDisposable import io.reactivex.processors.PublishProcessor -import org.kiwix.kiwixmobile.database.newdb.dao.NewLanguagesDao -import org.kiwix.kiwixmobile.language.adapter.LanguageListItem.LanguageItem -import org.kiwix.kiwixmobile.language.viewmodel.Action.Filter -import org.kiwix.kiwixmobile.language.viewmodel.Action.SaveAll -import org.kiwix.kiwixmobile.language.viewmodel.Action.Select -import org.kiwix.kiwixmobile.language.viewmodel.Action.UpdateLanguages -import org.kiwix.kiwixmobile.language.viewmodel.State.Content -import org.kiwix.kiwixmobile.language.viewmodel.State.Loading -import org.kiwix.kiwixmobile.language.viewmodel.State.Saving -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.effects.SideEffect +import org.kiwix.kiwixmobile.core.language.adapter.LanguageListItem.LanguageItem +import org.kiwix.kiwixmobile.core.language.viewmodel.Action.Filter +import org.kiwix.kiwixmobile.core.language.viewmodel.Action.SaveAll +import org.kiwix.kiwixmobile.core.language.viewmodel.Action.Select +import org.kiwix.kiwixmobile.core.language.viewmodel.Action.UpdateLanguages +import org.kiwix.kiwixmobile.core.language.viewmodel.State.Content +import org.kiwix.kiwixmobile.core.language.viewmodel.State.Loading +import org.kiwix.kiwixmobile.core.language.viewmodel.State.Saving +import org.kiwix.kiwixmobile.core.newdb.dao.NewLanguagesDao +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.effects.SideEffect import javax.inject.Inject class LanguageViewModel @Inject constructor( diff --git a/core/src/main/java/org/kiwix/kiwixmobile/language/viewmodel/SaveLanguagesAndFinish.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/language/viewmodel/SaveLanguagesAndFinish.kt similarity index 82% rename from core/src/main/java/org/kiwix/kiwixmobile/language/viewmodel/SaveLanguagesAndFinish.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/language/viewmodel/SaveLanguagesAndFinish.kt index 48175de69..00e895416 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/language/viewmodel/SaveLanguagesAndFinish.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/language/viewmodel/SaveLanguagesAndFinish.kt @@ -15,14 +15,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.language.viewmodel +package org.kiwix.kiwixmobile.core.language.viewmodel import android.app.Activity import io.reactivex.Flowable import io.reactivex.schedulers.Schedulers -import org.kiwix.kiwixmobile.database.newdb.dao.NewLanguagesDao -import org.kiwix.kiwixmobile.zim_manager.Language -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.effects.SideEffect +import org.kiwix.kiwixmobile.core.newdb.dao.NewLanguagesDao +import org.kiwix.kiwixmobile.core.zim_manager.Language +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.effects.SideEffect data class SaveLanguagesAndFinish( val languages: List, diff --git a/core/src/main/java/org/kiwix/kiwixmobile/language/viewmodel/State.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/language/viewmodel/State.kt similarity index 66% rename from core/src/main/java/org/kiwix/kiwixmobile/language/viewmodel/State.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/language/viewmodel/State.kt index ae3be96db..fdd3799ce 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/language/viewmodel/State.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/language/viewmodel/State.kt @@ -1,9 +1,9 @@ -package org.kiwix.kiwixmobile.language.viewmodel +package org.kiwix.kiwixmobile.core.language.viewmodel -import org.kiwix.kiwixmobile.language.adapter.LanguageListItem -import org.kiwix.kiwixmobile.language.adapter.LanguageListItem.HeaderItem -import org.kiwix.kiwixmobile.language.adapter.LanguageListItem.LanguageItem -import org.kiwix.kiwixmobile.zim_manager.Language +import org.kiwix.kiwixmobile.core.language.adapter.LanguageListItem +import org.kiwix.kiwixmobile.core.language.adapter.LanguageListItem.HeaderItem +import org.kiwix.kiwixmobile.core.language.adapter.LanguageListItem.LanguageItem +import org.kiwix.kiwixmobile.core.zim_manager.Language sealed class State { object Loading : State() @@ -15,12 +15,14 @@ sealed class State { items, filter ) ) : State() { - fun select(languageItem: LanguageItem) = Content( - items.map { if (it.id == languageItem.id) it.copy(active = !it.active) else it }, - filter - ) + fun select(languageItem: LanguageItem) = + Content( + items.map { if (it.id == languageItem.id) it.copy(active = !it.active) else it }, + filter + ) - fun updateFilter(filter: String) = Content(items, filter) + fun updateFilter(filter: String) = + Content(items, filter) companion object { internal fun createViewList( @@ -28,7 +30,10 @@ sealed class State { filter: String ) = activeItems( items, filter - ) + otherItems(items, filter) + ) + otherItems( + items, + filter + ) private fun activeItems( items: List, diff --git a/core/src/main/java/org/kiwix/kiwixmobile/main/AddNoteDialog.java b/core/src/main/java/org/kiwix/kiwixmobile/core/main/AddNoteDialog.java similarity index 98% rename from core/src/main/java/org/kiwix/kiwixmobile/main/AddNoteDialog.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/main/AddNoteDialog.java index 92705e909..c69394c04 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/main/AddNoteDialog.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/AddNoteDialog.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.main; +package org.kiwix.kiwixmobile.core.main; import android.Manifest; import android.app.Dialog; @@ -35,11 +35,11 @@ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import javax.inject.Inject; -import org.kiwix.kiwixmobile.KiwixApplication; +import org.kiwix.kiwixmobile.core.KiwixApplication; import org.kiwix.kiwixmobile.core.R; import org.kiwix.kiwixmobile.core.R2; -import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil; -import org.kiwix.kiwixmobile.zim_manager.ZimReaderContainer; +import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil; +import org.kiwix.kiwixmobile.core.zim_manager.ZimReaderContainer; /** * Created by @author Aditya-Sood (21/05/19) as a part of GSoC 2019 diff --git a/core/src/main/java/org/kiwix/kiwixmobile/main/AnimatedProgressBar.java b/core/src/main/java/org/kiwix/kiwixmobile/core/main/AnimatedProgressBar.java similarity index 99% rename from core/src/main/java/org/kiwix/kiwixmobile/main/AnimatedProgressBar.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/main/AnimatedProgressBar.java index 93a355feb..be859163a 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/main/AnimatedProgressBar.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/AnimatedProgressBar.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.main; +package org.kiwix.kiwixmobile.core.main; import android.animation.ObjectAnimator; import android.content.Context; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/main/CompatFindActionModeCallback.java b/core/src/main/java/org/kiwix/kiwixmobile/core/main/CompatFindActionModeCallback.java similarity index 99% rename from core/src/main/java/org/kiwix/kiwixmobile/main/CompatFindActionModeCallback.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/main/CompatFindActionModeCallback.java index 413f08539..803593bbe 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/main/CompatFindActionModeCallback.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/CompatFindActionModeCallback.java @@ -17,7 +17,7 @@ * MA 02110-1301, USA. */ -package org.kiwix.kiwixmobile.main; +package org.kiwix.kiwixmobile.core.main; import android.content.Context; import android.os.Build; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/main/ConfirmationAlertDialogFragment.java b/core/src/main/java/org/kiwix/kiwixmobile/core/main/ConfirmationAlertDialogFragment.java similarity index 96% rename from core/src/main/java/org/kiwix/kiwixmobile/main/ConfirmationAlertDialogFragment.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/main/ConfirmationAlertDialogFragment.java index e83f322b8..2c94eddeb 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/main/ConfirmationAlertDialogFragment.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/ConfirmationAlertDialogFragment.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.main; +package org.kiwix.kiwixmobile.core.main; import android.app.Dialog; import android.content.DialogInterface; @@ -7,7 +7,7 @@ import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.DialogFragment; import androidx.fragment.app.Fragment; import org.kiwix.kiwixmobile.core.R; -import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil; +import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil; /** * Created by @Aditya-Sood as a part of GSoC 2019 diff --git a/core/src/main/java/org/kiwix/kiwixmobile/main/DocumentParser.java b/core/src/main/java/org/kiwix/kiwixmobile/core/main/DocumentParser.java similarity index 95% rename from core/src/main/java/org/kiwix/kiwixmobile/main/DocumentParser.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/main/DocumentParser.java index a342162b7..874d720f2 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/main/DocumentParser.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/DocumentParser.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.main; +package org.kiwix.kiwixmobile.core.main; import android.os.Handler; import android.os.Looper; @@ -24,7 +24,7 @@ import android.webkit.WebView; import java.util.ArrayList; import java.util.List; -import static org.kiwix.kiwixmobile.main.TableDrawerAdapter.DocumentSection; +import static org.kiwix.kiwixmobile.core.main.TableDrawerAdapter.DocumentSection; public class DocumentParser { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/main/FileReader.java b/core/src/main/java/org/kiwix/kiwixmobile/core/main/FileReader.java similarity index 97% rename from core/src/main/java/org/kiwix/kiwixmobile/main/FileReader.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/main/FileReader.java index 4717c5b2b..a1c4f0ecc 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/main/FileReader.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/FileReader.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.main; +package org.kiwix.kiwixmobile.core.main; import android.content.Context; import java.io.BufferedReader; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/main/KiwixSearchWidget.java b/core/src/main/java/org/kiwix/kiwixmobile/core/main/KiwixSearchWidget.java similarity index 91% rename from core/src/main/java/org/kiwix/kiwixmobile/main/KiwixSearchWidget.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/main/KiwixSearchWidget.java index e0df434f3..545d2f97f 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/main/KiwixSearchWidget.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/KiwixSearchWidget.java @@ -17,7 +17,7 @@ * MA 02110-1301, USA. */ -package org.kiwix.kiwixmobile.main; +package org.kiwix.kiwixmobile.core.main; import android.app.PendingIntent; import android.appwidget.AppWidgetManager; @@ -30,13 +30,13 @@ import org.kiwix.kiwixmobile.core.R; public class KiwixSearchWidget extends AppWidgetProvider { public static final String TEXT_CLICKED = - "org.kiwix.kiwixmobile.main.KiwixSearchWidget.TEXT_CLICKED"; + "KiwixSearchWidget.TEXT_CLICKED"; public static final String ICON_CLICKED = - "org.kiwix.kiwixmobile.main.KiwixSearchWidget.ICON_CLICKED"; + "KiwixSearchWidget.ICON_CLICKED"; public static final String MIC_CLICKED = - "org.kiwix.kiwixmobile.main.KiwixSearchWidget.MIC_CLICKED"; + "KiwixSearchWidget.MIC_CLICKED"; public static final String STAR_CLICKED = - "org.kiwix.kiwixmobile.main.KiwixSearchWidget.STAR_CLICKED"; + "KiwixSearchWidget.STAR_CLICKED"; @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/main/KiwixTextToSpeech.java b/core/src/main/java/org/kiwix/kiwixmobile/core/main/KiwixTextToSpeech.java similarity index 97% rename from core/src/main/java/org/kiwix/kiwixmobile/main/KiwixTextToSpeech.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/main/KiwixTextToSpeech.java index 45343376c..a7f0bbcbc 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/main/KiwixTextToSpeech.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/KiwixTextToSpeech.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.main; +package org.kiwix.kiwixmobile.core.main; import android.annotation.SuppressLint; import android.content.Context; @@ -35,12 +35,12 @@ import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.concurrent.atomic.AtomicInteger; -import org.kiwix.kiwixmobile.KiwixApplication; +import org.kiwix.kiwixmobile.core.KiwixApplication; import org.kiwix.kiwixmobile.core.R; -import org.kiwix.kiwixmobile.utils.LanguageUtils; -import org.kiwix.kiwixmobile.zim_manager.ZimReaderContainer; +import org.kiwix.kiwixmobile.core.utils.LanguageUtils; +import org.kiwix.kiwixmobile.core.zim_manager.ZimReaderContainer; -import static org.kiwix.kiwixmobile.utils.Constants.TAG_KIWIX; +import static org.kiwix.kiwixmobile.core.utils.Constants.TAG_KIWIX; public class KiwixTextToSpeech { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/main/KiwixWebChromeClient.java b/core/src/main/java/org/kiwix/kiwixmobile/core/main/KiwixWebChromeClient.java similarity index 97% rename from core/src/main/java/org/kiwix/kiwixmobile/main/KiwixWebChromeClient.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/main/KiwixWebChromeClient.java index 3380e4db5..7116b8f0c 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/main/KiwixWebChromeClient.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/KiwixWebChromeClient.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.main; +package org.kiwix.kiwixmobile.core.main; import android.view.ViewGroup; import android.webkit.WebView; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/main/KiwixWebView.java b/core/src/main/java/org/kiwix/kiwixmobile/core/main/KiwixWebView.java similarity index 96% rename from core/src/main/java/org/kiwix/kiwixmobile/main/KiwixWebView.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/main/KiwixWebView.java index 1321102a6..9b72309fb 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/main/KiwixWebView.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/KiwixWebView.java @@ -17,7 +17,7 @@ * MA 02110-1301, USA. */ -package org.kiwix.kiwixmobile.main; +package org.kiwix.kiwixmobile.core.main; import android.app.Activity; import android.content.Context; @@ -42,11 +42,11 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import javax.inject.Inject; -import org.kiwix.kiwixmobile.KiwixApplication; +import org.kiwix.kiwixmobile.core.KiwixApplication; import org.kiwix.kiwixmobile.core.R; -import org.kiwix.kiwixmobile.utils.LanguageUtils; -import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil; -import org.kiwix.kiwixmobile.zim_manager.ZimReaderContainer; +import org.kiwix.kiwixmobile.core.utils.LanguageUtils; +import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil; +import org.kiwix.kiwixmobile.core.zim_manager.ZimReaderContainer; public class KiwixWebView extends VideoEnabledWebView { public static final float[] NIGHT_MODE_COLORS = { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/main/KiwixWebViewClient.java b/core/src/main/java/org/kiwix/kiwixmobile/core/main/KiwixWebViewClient.java similarity index 91% rename from core/src/main/java/org/kiwix/kiwixmobile/main/KiwixWebViewClient.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/main/KiwixWebViewClient.java index ce79d375e..743ad4ff2 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/main/KiwixWebViewClient.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/KiwixWebViewClient.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.main; +package org.kiwix.kiwixmobile.core.main; import android.content.Intent; import android.net.Uri; @@ -28,14 +28,14 @@ import android.webkit.WebViewClient; import android.widget.ImageView; import java.util.HashMap; import org.kiwix.kiwixmobile.core.BuildConfig; -import org.kiwix.kiwixmobile.KiwixApplication; +import org.kiwix.kiwixmobile.core.KiwixApplication; import org.kiwix.kiwixmobile.core.R; -import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil; -import org.kiwix.kiwixmobile.zim_manager.ZimFileReader; -import org.kiwix.kiwixmobile.zim_manager.ZimReaderContainer; +import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil; +import org.kiwix.kiwixmobile.core.zim_manager.ZimFileReader; +import org.kiwix.kiwixmobile.core.zim_manager.ZimReaderContainer; -import static org.kiwix.kiwixmobile.utils.Constants.EXTRA_EXTERNAL_LINK; -import static org.kiwix.kiwixmobile.utils.Constants.TAG_KIWIX; +import static org.kiwix.kiwixmobile.core.utils.Constants.EXTRA_EXTERNAL_LINK; +import static org.kiwix.kiwixmobile.core.utils.Constants.TAG_KIWIX; public class KiwixWebViewClient extends WebViewClient { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/main/MainActivity.java b/core/src/main/java/org/kiwix/kiwixmobile/core/main/MainActivity.java similarity index 94% rename from core/src/main/java/org/kiwix/kiwixmobile/main/MainActivity.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/main/MainActivity.java index 107625a24..7b2873d72 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/main/MainActivity.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/MainActivity.java @@ -17,7 +17,7 @@ * MA 02110-1301, USA. */ -package org.kiwix.kiwixmobile.main; +package org.kiwix.kiwixmobile.core.main; import android.Manifest; import android.annotation.SuppressLint; @@ -94,68 +94,67 @@ import javax.inject.Inject; import kotlin.Unit; import org.jetbrains.annotations.NotNull; import org.json.JSONArray; -import org.kiwix.kiwixmobile.KiwixApplication; -import org.kiwix.kiwixmobile.base.BaseActivity; -import org.kiwix.kiwixmobile.bookmark.BookmarkItem; -import org.kiwix.kiwixmobile.bookmark.BookmarksActivity; import org.kiwix.kiwixmobile.core.BuildConfig; import org.kiwix.kiwixmobile.core.R; import org.kiwix.kiwixmobile.core.R2; -import org.kiwix.kiwixmobile.help.HelpActivity; -import org.kiwix.kiwixmobile.history.HistoryActivity; -import org.kiwix.kiwixmobile.history.HistoryListItem; -import org.kiwix.kiwixmobile.search.SearchActivity; -import org.kiwix.kiwixmobile.settings.KiwixSettingsActivity; -import org.kiwix.kiwixmobile.utils.DimenUtils; -import org.kiwix.kiwixmobile.utils.LanguageUtils; -import org.kiwix.kiwixmobile.utils.NetworkUtils; -import org.kiwix.kiwixmobile.utils.StyleUtils; -import org.kiwix.kiwixmobile.utils.files.FileUtils; -import org.kiwix.kiwixmobile.webserver.ZimHostActivity; -import org.kiwix.kiwixmobile.zim_manager.ZimFileReader; -import org.kiwix.kiwixmobile.zim_manager.ZimManageActivity; -import org.kiwix.kiwixmobile.zim_manager.ZimReaderContainer; -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.StorageObserver; -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BookOnDiskDelegate; -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskAdapter; -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem; +import org.kiwix.kiwixmobile.core.base.BaseActivity; +import org.kiwix.kiwixmobile.core.bookmark.BookmarkItem; +import org.kiwix.kiwixmobile.core.bookmark.BookmarksActivity; +import org.kiwix.kiwixmobile.core.help.HelpActivity; +import org.kiwix.kiwixmobile.core.history.HistoryActivity; +import org.kiwix.kiwixmobile.core.history.HistoryListItem; +import org.kiwix.kiwixmobile.core.search.SearchActivity; +import org.kiwix.kiwixmobile.core.settings.KiwixSettingsActivity; +import org.kiwix.kiwixmobile.core.utils.DimenUtils; +import org.kiwix.kiwixmobile.core.utils.LanguageUtils; +import org.kiwix.kiwixmobile.core.utils.NetworkUtils; +import org.kiwix.kiwixmobile.core.utils.StyleUtils; +import org.kiwix.kiwixmobile.core.utils.files.FileUtils; +import org.kiwix.kiwixmobile.core.webserver.ZimHostActivity; +import org.kiwix.kiwixmobile.core.zim_manager.ZimFileReader; +import org.kiwix.kiwixmobile.core.zim_manager.ZimManageActivity; +import org.kiwix.kiwixmobile.core.zim_manager.ZimReaderContainer; +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.StorageObserver; +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BookOnDiskDelegate; +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskAdapter; +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem; import static android.content.res.Configuration.ORIENTATION_LANDSCAPE; import static android.os.Build.VERSION_CODES; -import static org.kiwix.kiwixmobile.main.TableDrawerAdapter.DocumentSection; -import static org.kiwix.kiwixmobile.main.TableDrawerAdapter.TableClickListener; -import static org.kiwix.kiwixmobile.search.SearchActivity.EXTRA_SEARCH_IN_TEXT; -import static org.kiwix.kiwixmobile.utils.AnimationUtils.rotate; -import static org.kiwix.kiwixmobile.utils.Constants.BOOKMARK_CHOSEN_REQUEST; -import static org.kiwix.kiwixmobile.utils.Constants.EXTRA_CHOSE_X_TITLE; -import static org.kiwix.kiwixmobile.utils.Constants.EXTRA_CHOSE_X_URL; -import static org.kiwix.kiwixmobile.utils.Constants.EXTRA_EXTERNAL_LINK; -import static org.kiwix.kiwixmobile.utils.Constants.EXTRA_IS_WIDGET_SEARCH; -import static org.kiwix.kiwixmobile.utils.Constants.EXTRA_IS_WIDGET_STAR; -import static org.kiwix.kiwixmobile.utils.Constants.EXTRA_IS_WIDGET_VOICE; -import static org.kiwix.kiwixmobile.utils.Constants.EXTRA_LIBRARY; -import static org.kiwix.kiwixmobile.utils.Constants.EXTRA_SEARCH; -import static org.kiwix.kiwixmobile.utils.Constants.EXTRA_ZIM_FILE; -import static org.kiwix.kiwixmobile.utils.Constants.EXTRA_ZIM_FILE_2; -import static org.kiwix.kiwixmobile.utils.Constants.REQUEST_FILE_SEARCH; -import static org.kiwix.kiwixmobile.utils.Constants.REQUEST_FILE_SELECT; -import static org.kiwix.kiwixmobile.utils.Constants.REQUEST_HISTORY_ITEM_CHOSEN; -import static org.kiwix.kiwixmobile.utils.Constants.REQUEST_PREFERENCES; -import static org.kiwix.kiwixmobile.utils.Constants.REQUEST_READ_STORAGE_PERMISSION; -import static org.kiwix.kiwixmobile.utils.Constants.REQUEST_STORAGE_PERMISSION; -import static org.kiwix.kiwixmobile.utils.Constants.REQUEST_WRITE_STORAGE_PERMISSION_ADD_NOTE; -import static org.kiwix.kiwixmobile.utils.Constants.RESULT_HISTORY_CLEARED; -import static org.kiwix.kiwixmobile.utils.Constants.RESULT_RESTART; -import static org.kiwix.kiwixmobile.utils.Constants.TAG_CURRENT_ARTICLES; -import static org.kiwix.kiwixmobile.utils.Constants.TAG_CURRENT_FILE; -import static org.kiwix.kiwixmobile.utils.Constants.TAG_CURRENT_POSITIONS; -import static org.kiwix.kiwixmobile.utils.Constants.TAG_CURRENT_TAB; -import static org.kiwix.kiwixmobile.utils.Constants.TAG_FILE_SEARCHED; -import static org.kiwix.kiwixmobile.utils.Constants.TAG_KIWIX; -import static org.kiwix.kiwixmobile.utils.LanguageUtils.getResourceString; -import static org.kiwix.kiwixmobile.utils.SharedPreferenceUtil.PREF_KIWIX_MOBILE; -import static org.kiwix.kiwixmobile.utils.StyleUtils.dialogStyle; -import static org.kiwix.kiwixmobile.utils.UpdateUtils.reformatProviderUrl; +import static org.kiwix.kiwixmobile.core.main.TableDrawerAdapter.DocumentSection; +import static org.kiwix.kiwixmobile.core.main.TableDrawerAdapter.TableClickListener; +import static org.kiwix.kiwixmobile.core.search.SearchActivity.EXTRA_SEARCH_IN_TEXT; +import static org.kiwix.kiwixmobile.core.utils.AnimationUtils.rotate; +import static org.kiwix.kiwixmobile.core.utils.Constants.BOOKMARK_CHOSEN_REQUEST; +import static org.kiwix.kiwixmobile.core.utils.Constants.EXTRA_CHOSE_X_TITLE; +import static org.kiwix.kiwixmobile.core.utils.Constants.EXTRA_CHOSE_X_URL; +import static org.kiwix.kiwixmobile.core.utils.Constants.EXTRA_EXTERNAL_LINK; +import static org.kiwix.kiwixmobile.core.utils.Constants.EXTRA_IS_WIDGET_SEARCH; +import static org.kiwix.kiwixmobile.core.utils.Constants.EXTRA_IS_WIDGET_STAR; +import static org.kiwix.kiwixmobile.core.utils.Constants.EXTRA_IS_WIDGET_VOICE; +import static org.kiwix.kiwixmobile.core.utils.Constants.EXTRA_LIBRARY; +import static org.kiwix.kiwixmobile.core.utils.Constants.EXTRA_SEARCH; +import static org.kiwix.kiwixmobile.core.utils.Constants.EXTRA_ZIM_FILE; +import static org.kiwix.kiwixmobile.core.utils.Constants.EXTRA_ZIM_FILE_2; +import static org.kiwix.kiwixmobile.core.utils.Constants.REQUEST_FILE_SEARCH; +import static org.kiwix.kiwixmobile.core.utils.Constants.REQUEST_FILE_SELECT; +import static org.kiwix.kiwixmobile.core.utils.Constants.REQUEST_HISTORY_ITEM_CHOSEN; +import static org.kiwix.kiwixmobile.core.utils.Constants.REQUEST_PREFERENCES; +import static org.kiwix.kiwixmobile.core.utils.Constants.REQUEST_READ_STORAGE_PERMISSION; +import static org.kiwix.kiwixmobile.core.utils.Constants.REQUEST_STORAGE_PERMISSION; +import static org.kiwix.kiwixmobile.core.utils.Constants.REQUEST_WRITE_STORAGE_PERMISSION_ADD_NOTE; +import static org.kiwix.kiwixmobile.core.utils.Constants.RESULT_HISTORY_CLEARED; +import static org.kiwix.kiwixmobile.core.utils.Constants.RESULT_RESTART; +import static org.kiwix.kiwixmobile.core.utils.Constants.TAG_CURRENT_ARTICLES; +import static org.kiwix.kiwixmobile.core.utils.Constants.TAG_CURRENT_FILE; +import static org.kiwix.kiwixmobile.core.utils.Constants.TAG_CURRENT_POSITIONS; +import static org.kiwix.kiwixmobile.core.utils.Constants.TAG_CURRENT_TAB; +import static org.kiwix.kiwixmobile.core.utils.Constants.TAG_FILE_SEARCHED; +import static org.kiwix.kiwixmobile.core.utils.Constants.TAG_KIWIX; +import static org.kiwix.kiwixmobile.core.utils.LanguageUtils.getResourceString; +import static org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil.PREF_KIWIX_MOBILE; +import static org.kiwix.kiwixmobile.core.utils.StyleUtils.dialogStyle; +import static org.kiwix.kiwixmobile.core.utils.UpdateUtils.reformatProviderUrl; public class MainActivity extends BaseActivity implements WebViewCallback, MainContract.View { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/main/MainContract.java b/core/src/main/java/org/kiwix/kiwixmobile/core/main/MainContract.java similarity index 67% rename from core/src/main/java/org/kiwix/kiwixmobile/main/MainContract.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/main/MainContract.java index 21bad0470..eaf638b9c 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/main/MainContract.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/MainContract.java @@ -1,10 +1,10 @@ -package org.kiwix.kiwixmobile.main; +package org.kiwix.kiwixmobile.core.main; import java.util.List; -import org.kiwix.kiwixmobile.base.BaseContract; -import org.kiwix.kiwixmobile.bookmark.BookmarkItem; -import org.kiwix.kiwixmobile.history.HistoryListItem; -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem; +import org.kiwix.kiwixmobile.core.base.BaseContract; +import org.kiwix.kiwixmobile.core.bookmark.BookmarkItem; +import org.kiwix.kiwixmobile.core.history.HistoryListItem; +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem; /** * The contract between {@link MainActivity} and {@link MainPresenter}. diff --git a/core/src/main/java/org/kiwix/kiwixmobile/main/MainModule.java b/core/src/main/java/org/kiwix/kiwixmobile/core/main/MainModule.java similarity index 70% rename from core/src/main/java/org/kiwix/kiwixmobile/main/MainModule.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/main/MainModule.java index 76364d762..f2c44db3a 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/main/MainModule.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/MainModule.java @@ -1,8 +1,8 @@ -package org.kiwix.kiwixmobile.main; +package org.kiwix.kiwixmobile.core.main; import dagger.Module; import dagger.Provides; -import org.kiwix.kiwixmobile.di.ActivityScope; +import org.kiwix.kiwixmobile.core.di.ActivityScope; @Module public class MainModule { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/main/MainPresenter.java b/core/src/main/java/org/kiwix/kiwixmobile/core/main/MainPresenter.java similarity index 88% rename from core/src/main/java/org/kiwix/kiwixmobile/main/MainPresenter.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/main/MainPresenter.java index 362e6c216..4a1075153 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/main/MainPresenter.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/MainPresenter.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.main; +package org.kiwix.kiwixmobile.core.main; import android.util.Log; import io.reactivex.CompletableObserver; @@ -6,12 +6,12 @@ import io.reactivex.SingleObserver; import io.reactivex.disposables.Disposable; import java.util.List; import javax.inject.Inject; -import org.kiwix.kiwixmobile.base.BasePresenter; -import org.kiwix.kiwixmobile.bookmark.BookmarkItem; -import org.kiwix.kiwixmobile.data.DataSource; -import org.kiwix.kiwixmobile.di.ActivityScope; -import org.kiwix.kiwixmobile.history.HistoryListItem; -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem; +import org.kiwix.kiwixmobile.core.base.BasePresenter; +import org.kiwix.kiwixmobile.core.bookmark.BookmarkItem; +import org.kiwix.kiwixmobile.core.data.DataSource; +import org.kiwix.kiwixmobile.core.di.ActivityScope; +import org.kiwix.kiwixmobile.core.history.HistoryListItem; +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem; /** * Presenter for {@link MainActivity}. diff --git a/core/src/main/java/org/kiwix/kiwixmobile/main/OnSwipeTouchListener.java b/core/src/main/java/org/kiwix/kiwixmobile/core/main/OnSwipeTouchListener.java similarity index 97% rename from core/src/main/java/org/kiwix/kiwixmobile/main/OnSwipeTouchListener.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/main/OnSwipeTouchListener.java index 397033cc5..e796a4b57 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/main/OnSwipeTouchListener.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/OnSwipeTouchListener.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.main; +package org.kiwix.kiwixmobile.core.main; import android.annotation.SuppressLint; import android.content.Context; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/main/RateAppCounter.java b/core/src/main/java/org/kiwix/kiwixmobile/core/main/RateAppCounter.java similarity index 97% rename from core/src/main/java/org/kiwix/kiwixmobile/main/RateAppCounter.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/main/RateAppCounter.java index ecc75f7f1..1618629e0 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/main/RateAppCounter.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/RateAppCounter.java @@ -17,7 +17,7 @@ * MA 02110-1301, USA. */ -package org.kiwix.kiwixmobile.main; +package org.kiwix.kiwixmobile.core.main; import android.content.Context; import android.content.SharedPreferences; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/main/TableDrawerAdapter.java b/core/src/main/java/org/kiwix/kiwixmobile/core/main/TableDrawerAdapter.java similarity index 99% rename from core/src/main/java/org/kiwix/kiwixmobile/main/TableDrawerAdapter.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/main/TableDrawerAdapter.java index 28f90cfb1..9bec3dafd 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/main/TableDrawerAdapter.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/TableDrawerAdapter.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.main; +package org.kiwix.kiwixmobile.core.main; import android.content.Context; import android.content.res.Resources; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/main/TabsAdapter.java b/core/src/main/java/org/kiwix/kiwixmobile/core/main/TabsAdapter.java similarity index 93% rename from core/src/main/java/org/kiwix/kiwixmobile/main/TabsAdapter.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/main/TabsAdapter.java index 4a22bfbf2..d83eff4d7 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/main/TabsAdapter.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/TabsAdapter.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.main; +package org.kiwix.kiwixmobile.core.main; import android.annotation.SuppressLint; import android.content.Context; @@ -33,12 +33,12 @@ import androidx.recyclerview.widget.RecyclerView; import java.util.List; import org.kiwix.kiwixmobile.core.R; -import static org.kiwix.kiwixmobile.utils.DimenUtils.getToolbarHeight; -import static org.kiwix.kiwixmobile.utils.DimenUtils.getWindowHeight; -import static org.kiwix.kiwixmobile.utils.DimenUtils.getWindowWidth; -import static org.kiwix.kiwixmobile.utils.ImageUtils.getBitmapFromView; -import static org.kiwix.kiwixmobile.utils.LanguageUtils.getResourceString; -import static org.kiwix.kiwixmobile.utils.StyleUtils.fromHtml; +import static org.kiwix.kiwixmobile.core.utils.DimenUtils.getToolbarHeight; +import static org.kiwix.kiwixmobile.core.utils.DimenUtils.getWindowHeight; +import static org.kiwix.kiwixmobile.core.utils.DimenUtils.getWindowWidth; +import static org.kiwix.kiwixmobile.core.utils.ImageUtils.getBitmapFromView; +import static org.kiwix.kiwixmobile.core.utils.LanguageUtils.getResourceString; +import static org.kiwix.kiwixmobile.core.utils.StyleUtils.fromHtml; public class TabsAdapter extends RecyclerView.Adapter { private final List webViews; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/main/ToolbarScrollingKiwixWebView.java b/core/src/main/java/org/kiwix/kiwixmobile/core/main/ToolbarScrollingKiwixWebView.java similarity index 97% rename from core/src/main/java/org/kiwix/kiwixmobile/main/ToolbarScrollingKiwixWebView.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/main/ToolbarScrollingKiwixWebView.java index 824b683d0..8f3e64b88 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/main/ToolbarScrollingKiwixWebView.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/ToolbarScrollingKiwixWebView.java @@ -17,14 +17,14 @@ * MA 02110-1301, USA. */ -package org.kiwix.kiwixmobile.main; +package org.kiwix.kiwixmobile.core.main; import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; -import org.kiwix.kiwixmobile.utils.DimenUtils; +import org.kiwix.kiwixmobile.core.utils.DimenUtils; public class ToolbarScrollingKiwixWebView extends KiwixWebView { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/main/ToolbarStaticKiwixWebView.java b/core/src/main/java/org/kiwix/kiwixmobile/core/main/ToolbarStaticKiwixWebView.java similarity index 94% rename from core/src/main/java/org/kiwix/kiwixmobile/main/ToolbarStaticKiwixWebView.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/main/ToolbarStaticKiwixWebView.java index b959a1acc..d150631dc 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/main/ToolbarStaticKiwixWebView.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/ToolbarStaticKiwixWebView.java @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.main; +package org.kiwix.kiwixmobile.core.main; import android.content.Context; import android.util.AttributeSet; import android.view.ViewGroup; -import org.kiwix.kiwixmobile.utils.DimenUtils; +import org.kiwix.kiwixmobile.core.utils.DimenUtils; /** * {@link KiwixWebView} which keeps the app bar fixed. diff --git a/core/src/main/java/org/kiwix/kiwixmobile/main/WebViewCallback.java b/core/src/main/java/org/kiwix/kiwixmobile/core/main/WebViewCallback.java similarity index 96% rename from core/src/main/java/org/kiwix/kiwixmobile/main/WebViewCallback.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/main/WebViewCallback.java index ad5d707fc..a6d92b387 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/main/WebViewCallback.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/WebViewCallback.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.main; +package org.kiwix.kiwixmobile.core.main; import android.content.Intent; import android.view.View; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/database/newdb/dao/FetchDownloadDao.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/newdb/dao/FetchDownloadDao.kt similarity index 77% rename from core/src/main/java/org/kiwix/kiwixmobile/database/newdb/dao/FetchDownloadDao.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/newdb/dao/FetchDownloadDao.kt index 80f6d5dd0..ef095b574 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/database/newdb/dao/FetchDownloadDao.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/newdb/dao/FetchDownloadDao.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.database.newdb.dao +package org.kiwix.kiwixmobile.core.newdb.dao import com.tonyodev.fetch2.Download import com.tonyodev.fetch2.Status.COMPLETED @@ -23,14 +23,14 @@ import io.objectbox.Box import io.objectbox.kotlin.equal import io.objectbox.kotlin.query import io.reactivex.Flowable -import org.kiwix.kiwixmobile.database.newdb.entities.FetchDownloadEntity -import org.kiwix.kiwixmobile.database.newdb.entities.FetchDownloadEntity_ -import org.kiwix.kiwixmobile.downloader.DownloadRequester -import org.kiwix.kiwixmobile.downloader.model.DownloadModel -import org.kiwix.kiwixmobile.downloader.model.DownloadRequest -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity.Book -import org.kiwix.kiwixmobile.library.entity.MetaLinkNetworkEntity -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk +import org.kiwix.kiwixmobile.core.downloader.DownloadRequester +import org.kiwix.kiwixmobile.core.downloader.model.DownloadModel +import org.kiwix.kiwixmobile.core.downloader.model.DownloadRequest +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book +import org.kiwix.kiwixmobile.core.entity.MetaLinkNetworkEntity +import org.kiwix.kiwixmobile.core.newdb.entities.FetchDownloadEntity +import org.kiwix.kiwixmobile.core.newdb.entities.FetchDownloadEntity_ +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk import javax.inject.Inject class FetchDownloadDao @Inject constructor( @@ -86,7 +86,12 @@ class FetchDownloadDao @Inject constructor( box.store.callInTx { if (doesNotAlreadyExist(book)) { insert( - downloadRequester.enqueue(DownloadRequest(metaLinkNetworkEntity, book)), + downloadRequester.enqueue( + DownloadRequest( + metaLinkNetworkEntity, + book + ) + ), book = book ) } diff --git a/core/src/main/java/org/kiwix/kiwixmobile/database/newdb/dao/HistoryDao.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/newdb/dao/HistoryDao.kt similarity index 87% rename from core/src/main/java/org/kiwix/kiwixmobile/database/newdb/dao/HistoryDao.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/newdb/dao/HistoryDao.kt index ce8b38566..b220289ac 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/database/newdb/dao/HistoryDao.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/newdb/dao/HistoryDao.kt @@ -15,13 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.database.newdb.dao +package org.kiwix.kiwixmobile.core.newdb.dao import io.objectbox.Box import io.objectbox.kotlin.query -import org.kiwix.kiwixmobile.database.newdb.entities.HistoryEntity -import org.kiwix.kiwixmobile.database.newdb.entities.HistoryEntity_ -import org.kiwix.kiwixmobile.history.HistoryListItem.HistoryItem +import org.kiwix.kiwixmobile.core.history.HistoryListItem.HistoryItem +import org.kiwix.kiwixmobile.core.newdb.entities.HistoryEntity +import org.kiwix.kiwixmobile.core.newdb.entities.HistoryEntity_ import javax.inject.Inject class HistoryDao @Inject constructor(val box: Box) { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/database/newdb/dao/NewBookDao.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/newdb/dao/NewBookDao.kt similarity index 86% rename from core/src/main/java/org/kiwix/kiwixmobile/database/newdb/dao/NewBookDao.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/newdb/dao/NewBookDao.kt index 8841a38e8..d66664380 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/database/newdb/dao/NewBookDao.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/newdb/dao/NewBookDao.kt @@ -15,16 +15,16 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.database.newdb.dao +package org.kiwix.kiwixmobile.core.newdb.dao import io.objectbox.Box import io.objectbox.kotlin.inValues import io.objectbox.kotlin.query -import org.kiwix.kiwixmobile.data.local.entity.Bookmark -import org.kiwix.kiwixmobile.database.newdb.entities.BookOnDiskEntity -import org.kiwix.kiwixmobile.database.newdb.entities.BookOnDiskEntity_ -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity.Book -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk +import org.kiwix.kiwixmobile.core.data.local.entity.Bookmark +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book +import org.kiwix.kiwixmobile.core.newdb.entities.BookOnDiskEntity +import org.kiwix.kiwixmobile.core.newdb.entities.BookOnDiskEntity_ +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk import java.util.ArrayList import javax.inject.Inject diff --git a/core/src/main/java/org/kiwix/kiwixmobile/database/newdb/dao/NewBookmarksDao.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/newdb/dao/NewBookmarksDao.kt similarity index 85% rename from core/src/main/java/org/kiwix/kiwixmobile/database/newdb/dao/NewBookmarksDao.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/newdb/dao/NewBookmarksDao.kt index 7f9614aa5..b3d02aadc 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/database/newdb/dao/NewBookmarksDao.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/newdb/dao/NewBookmarksDao.kt @@ -15,15 +15,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.database.newdb.dao +package org.kiwix.kiwixmobile.core.newdb.dao import io.objectbox.Box import io.objectbox.kotlin.query -import org.kiwix.kiwixmobile.bookmark.BookmarkItem -import org.kiwix.kiwixmobile.data.local.entity.Bookmark -import org.kiwix.kiwixmobile.database.newdb.entities.BookmarkEntity -import org.kiwix.kiwixmobile.database.newdb.entities.BookmarkEntity_ -import org.kiwix.kiwixmobile.zim_manager.ZimFileReader +import org.kiwix.kiwixmobile.core.bookmark.BookmarkItem +import org.kiwix.kiwixmobile.core.data.local.entity.Bookmark +import org.kiwix.kiwixmobile.core.newdb.entities.BookmarkEntity +import org.kiwix.kiwixmobile.core.newdb.entities.BookmarkEntity_ +import org.kiwix.kiwixmobile.core.zim_manager.ZimFileReader import javax.inject.Inject class NewBookmarksDao @Inject constructor(val box: Box) { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/database/newdb/dao/NewLanguagesDao.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/newdb/dao/NewLanguagesDao.kt similarity index 89% rename from core/src/main/java/org/kiwix/kiwixmobile/database/newdb/dao/NewLanguagesDao.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/newdb/dao/NewLanguagesDao.kt index aaaba855b..75500958f 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/database/newdb/dao/NewLanguagesDao.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/newdb/dao/NewLanguagesDao.kt @@ -15,15 +15,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.database.newdb.dao +package org.kiwix.kiwixmobile.core.newdb.dao import io.objectbox.Box import io.objectbox.kotlin.query import io.objectbox.rx.RxQuery import io.reactivex.BackpressureStrategy import io.reactivex.BackpressureStrategy.LATEST -import org.kiwix.kiwixmobile.database.newdb.entities.LanguageEntity -import org.kiwix.kiwixmobile.zim_manager.Language +import org.kiwix.kiwixmobile.core.newdb.entities.LanguageEntity +import org.kiwix.kiwixmobile.core.zim_manager.Language import javax.inject.Inject class NewLanguagesDao @Inject constructor(private val box: Box) { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/database/newdb/dao/NewRecentSearchDao.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/newdb/dao/NewRecentSearchDao.kt similarity index 82% rename from core/src/main/java/org/kiwix/kiwixmobile/database/newdb/dao/NewRecentSearchDao.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/newdb/dao/NewRecentSearchDao.kt index a2385cb73..f790efec8 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/database/newdb/dao/NewRecentSearchDao.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/newdb/dao/NewRecentSearchDao.kt @@ -15,13 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.database.newdb.dao +package org.kiwix.kiwixmobile.core.newdb.dao import io.objectbox.Box import io.objectbox.kotlin.query -import org.kiwix.kiwixmobile.data.local.entity.RecentSearch -import org.kiwix.kiwixmobile.database.newdb.entities.RecentSearchEntity -import org.kiwix.kiwixmobile.database.newdb.entities.RecentSearchEntity_ +import org.kiwix.kiwixmobile.core.data.local.entity.RecentSearch +import org.kiwix.kiwixmobile.core.newdb.entities.RecentSearchEntity +import org.kiwix.kiwixmobile.core.newdb.entities.RecentSearchEntity_ import javax.inject.Inject class NewRecentSearchDao @Inject constructor( @@ -38,7 +38,12 @@ class NewRecentSearchDao @Inject constructor( .map(RecentSearchEntity::searchTerm) fun saveSearch(title: String, id: String) { - box.put(RecentSearchEntity(searchTerm = title, zimId = id)) + box.put( + RecentSearchEntity( + searchTerm = title, + zimId = id + ) + ) } fun deleteSearchString(searchTerm: String) { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/database/newdb/entities/BookOnDiskEntity.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/newdb/entities/BookOnDiskEntity.kt similarity index 89% rename from core/src/main/java/org/kiwix/kiwixmobile/database/newdb/entities/BookOnDiskEntity.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/newdb/entities/BookOnDiskEntity.kt index 244d031e9..89b8645db 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/database/newdb/entities/BookOnDiskEntity.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/newdb/entities/BookOnDiskEntity.kt @@ -1,11 +1,11 @@ -package org.kiwix.kiwixmobile.database.newdb.entities +package org.kiwix.kiwixmobile.core.newdb.entities import io.objectbox.annotation.Convert import io.objectbox.annotation.Entity import io.objectbox.annotation.Id import io.objectbox.converter.PropertyConverter -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity.Book -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk import java.io.File @Entity diff --git a/core/src/main/java/org/kiwix/kiwixmobile/database/newdb/entities/BookmarkEntity.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/newdb/entities/BookmarkEntity.kt similarity index 90% rename from core/src/main/java/org/kiwix/kiwixmobile/database/newdb/entities/BookmarkEntity.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/newdb/entities/BookmarkEntity.kt index aa7cd93e3..08d9a0090 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/database/newdb/entities/BookmarkEntity.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/newdb/entities/BookmarkEntity.kt @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.database.newdb.entities +package org.kiwix.kiwixmobile.core.newdb.entities import io.objectbox.annotation.Entity import io.objectbox.annotation.Id -import org.kiwix.kiwixmobile.bookmark.BookmarkItem -import org.kiwix.kiwixmobile.data.local.entity.Bookmark +import org.kiwix.kiwixmobile.core.bookmark.BookmarkItem +import org.kiwix.kiwixmobile.core.data.local.entity.Bookmark @Entity data class BookmarkEntity( diff --git a/core/src/main/java/org/kiwix/kiwixmobile/database/newdb/entities/FetchDownloadEntity.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/newdb/entities/FetchDownloadEntity.kt similarity index 96% rename from core/src/main/java/org/kiwix/kiwixmobile/database/newdb/entities/FetchDownloadEntity.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/newdb/entities/FetchDownloadEntity.kt index ebaf50725..0207f2770 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/database/newdb/entities/FetchDownloadEntity.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/newdb/entities/FetchDownloadEntity.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.database.newdb.entities +package org.kiwix.kiwixmobile.core.newdb.entities import com.tonyodev.fetch2.Download import com.tonyodev.fetch2.Error @@ -24,7 +24,7 @@ import io.objectbox.annotation.Convert import io.objectbox.annotation.Entity import io.objectbox.annotation.Id import io.objectbox.converter.PropertyConverter -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity.Book +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book @Entity data class FetchDownloadEntity( diff --git a/core/src/main/java/org/kiwix/kiwixmobile/database/newdb/entities/HistoryEntity.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/newdb/entities/HistoryEntity.kt similarity index 91% rename from core/src/main/java/org/kiwix/kiwixmobile/database/newdb/entities/HistoryEntity.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/newdb/entities/HistoryEntity.kt index 95f3115de..d0553fd5b 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/database/newdb/entities/HistoryEntity.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/newdb/entities/HistoryEntity.kt @@ -15,11 +15,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.database.newdb.entities +package org.kiwix.kiwixmobile.core.newdb.entities import io.objectbox.annotation.Entity import io.objectbox.annotation.Id -import org.kiwix.kiwixmobile.history.HistoryListItem.HistoryItem +import org.kiwix.kiwixmobile.core.history.HistoryListItem.HistoryItem @Entity data class HistoryEntity( diff --git a/core/src/main/java/org/kiwix/kiwixmobile/database/newdb/entities/LanguageEntity.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/newdb/entities/LanguageEntity.kt similarity index 90% rename from core/src/main/java/org/kiwix/kiwixmobile/database/newdb/entities/LanguageEntity.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/newdb/entities/LanguageEntity.kt index a96cc91ec..45a46b2cc 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/database/newdb/entities/LanguageEntity.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/newdb/entities/LanguageEntity.kt @@ -1,10 +1,10 @@ -package org.kiwix.kiwixmobile.database.newdb.entities +package org.kiwix.kiwixmobile.core.newdb.entities import io.objectbox.annotation.Convert import io.objectbox.annotation.Entity import io.objectbox.annotation.Id import io.objectbox.converter.PropertyConverter -import org.kiwix.kiwixmobile.zim_manager.Language +import org.kiwix.kiwixmobile.core.zim_manager.Language import java.util.Locale @Entity diff --git a/core/src/main/java/org/kiwix/kiwixmobile/database/newdb/entities/RecentSearchEntity.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/newdb/entities/RecentSearchEntity.kt similarity index 89% rename from core/src/main/java/org/kiwix/kiwixmobile/database/newdb/entities/RecentSearchEntity.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/newdb/entities/RecentSearchEntity.kt index 52d3a2092..ca404cfc4 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/database/newdb/entities/RecentSearchEntity.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/newdb/entities/RecentSearchEntity.kt @@ -15,11 +15,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.database.newdb.entities +package org.kiwix.kiwixmobile.core.newdb.entities import io.objectbox.annotation.Entity import io.objectbox.annotation.Id -import org.kiwix.kiwixmobile.data.local.entity.RecentSearch +import org.kiwix.kiwixmobile.core.data.local.entity.RecentSearch @Entity data class RecentSearchEntity( diff --git a/core/src/main/java/org/kiwix/kiwixmobile/search/AutoCompleteAdapter.java b/core/src/main/java/org/kiwix/kiwixmobile/core/search/AutoCompleteAdapter.java similarity index 95% rename from core/src/main/java/org/kiwix/kiwixmobile/search/AutoCompleteAdapter.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/search/AutoCompleteAdapter.java index 4a939aac3..6dd40b12e 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/search/AutoCompleteAdapter.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/search/AutoCompleteAdapter.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.search; +package org.kiwix.kiwixmobile.core.search; import android.content.Context; import android.text.Html; @@ -30,9 +30,9 @@ import java.util.List; import javax.inject.Inject; import org.kiwix.kiwixlib.JNIKiwix; import org.kiwix.kiwixlib.JNIKiwixSearcher; -import org.kiwix.kiwixmobile.KiwixApplication; -import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil; -import org.kiwix.kiwixmobile.zim_manager.ZimReaderContainer; +import org.kiwix.kiwixmobile.core.KiwixApplication; +import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil; +import org.kiwix.kiwixmobile.core.zim_manager.ZimReaderContainer; public class AutoCompleteAdapter extends ArrayAdapter implements Filterable { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/search/SearchActivity.java b/core/src/main/java/org/kiwix/kiwixmobile/core/search/SearchActivity.java similarity index 95% rename from core/src/main/java/org/kiwix/kiwixmobile/search/SearchActivity.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/search/SearchActivity.java index 647dd1b8b..d90e12f31 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/search/SearchActivity.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/search/SearchActivity.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.search; +package org.kiwix.kiwixmobile.core.search; import android.content.ActivityNotFoundException; import android.content.Intent; @@ -45,14 +45,14 @@ import java.util.List; import java.util.Locale; import javax.inject.Inject; import org.kiwix.kiwixmobile.core.R; -import org.kiwix.kiwixmobile.base.BaseActivity; -import org.kiwix.kiwixmobile.main.MainActivity; +import org.kiwix.kiwixmobile.core.base.BaseActivity; +import org.kiwix.kiwixmobile.core.main.MainActivity; -import static org.kiwix.kiwixmobile.utils.Constants.EXTRA_IS_WIDGET_VOICE; -import static org.kiwix.kiwixmobile.utils.Constants.EXTRA_SEARCH; -import static org.kiwix.kiwixmobile.utils.Constants.EXTRA_SEARCH_TEXT; -import static org.kiwix.kiwixmobile.utils.Constants.TAG_FILE_SEARCHED; -import static org.kiwix.kiwixmobile.utils.StyleUtils.dialogStyle; +import static org.kiwix.kiwixmobile.core.utils.Constants.EXTRA_IS_WIDGET_VOICE; +import static org.kiwix.kiwixmobile.core.utils.Constants.EXTRA_SEARCH; +import static org.kiwix.kiwixmobile.core.utils.Constants.EXTRA_SEARCH_TEXT; +import static org.kiwix.kiwixmobile.core.utils.Constants.TAG_FILE_SEARCHED; +import static org.kiwix.kiwixmobile.core.utils.StyleUtils.dialogStyle; public class SearchActivity extends BaseActivity implements AdapterView.OnItemClickListener, AdapterView.OnItemLongClickListener, diff --git a/core/src/main/java/org/kiwix/kiwixmobile/search/SearchPresenter.java b/core/src/main/java/org/kiwix/kiwixmobile/core/search/SearchPresenter.java similarity index 87% rename from core/src/main/java/org/kiwix/kiwixmobile/search/SearchPresenter.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/search/SearchPresenter.java index 73e1ca825..d5ff67fa0 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/search/SearchPresenter.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/search/SearchPresenter.java @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.search; +package org.kiwix.kiwixmobile.core.search; import javax.inject.Inject; -import org.kiwix.kiwixmobile.base.BasePresenter; -import org.kiwix.kiwixmobile.database.newdb.dao.NewRecentSearchDao; -import org.kiwix.kiwixmobile.zim_manager.ZimReaderContainer; +import org.kiwix.kiwixmobile.core.base.BasePresenter; +import org.kiwix.kiwixmobile.core.newdb.dao.NewRecentSearchDao; +import org.kiwix.kiwixmobile.core.zim_manager.ZimReaderContainer; /** * Created by srv_twry on 14/2/18. diff --git a/core/src/main/java/org/kiwix/kiwixmobile/search/SearchViewCallback.java b/core/src/main/java/org/kiwix/kiwixmobile/core/search/SearchViewCallback.java similarity index 90% rename from core/src/main/java/org/kiwix/kiwixmobile/search/SearchViewCallback.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/search/SearchViewCallback.java index ef4d3a974..c3f8aab70 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/search/SearchViewCallback.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/search/SearchViewCallback.java @@ -15,10 +15,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.search; +package org.kiwix.kiwixmobile.core.search; import java.util.List; -import org.kiwix.kiwixmobile.base.BaseContract; +import org.kiwix.kiwixmobile.core.base.BaseContract; /** * Created by srv_twry on 14/2/18. diff --git a/core/src/main/java/org/kiwix/kiwixmobile/settings/CustomSwitchPreference.java b/core/src/main/java/org/kiwix/kiwixmobile/core/settings/CustomSwitchPreference.java similarity index 98% rename from core/src/main/java/org/kiwix/kiwixmobile/settings/CustomSwitchPreference.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/settings/CustomSwitchPreference.java index 02bbf7983..aab3cb537 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/settings/CustomSwitchPreference.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/settings/CustomSwitchPreference.java @@ -17,7 +17,7 @@ * MA 02110-1301, USA. */ -package org.kiwix.kiwixmobile.settings; +package org.kiwix.kiwixmobile.core.settings; import android.content.Context; import android.preference.SwitchPreference; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/settings/KiwixSettingsActivity.java b/core/src/main/java/org/kiwix/kiwixmobile/core/settings/KiwixSettingsActivity.java similarity index 88% rename from core/src/main/java/org/kiwix/kiwixmobile/settings/KiwixSettingsActivity.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/settings/KiwixSettingsActivity.java index 4321d8d7f..6ef95fed7 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/settings/KiwixSettingsActivity.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/settings/KiwixSettingsActivity.java @@ -17,16 +17,16 @@ * MA 02110-1301, USA. */ -package org.kiwix.kiwixmobile.settings; +package org.kiwix.kiwixmobile.core.settings; import android.content.Intent; import android.os.Bundle; import androidx.appcompat.widget.Toolbar; import org.kiwix.kiwixmobile.core.R; -import org.kiwix.kiwixmobile.base.BaseActivity; +import org.kiwix.kiwixmobile.core.base.BaseActivity; -import static org.kiwix.kiwixmobile.utils.Constants.EXTRA_WEBVIEWS_LIST; -import static org.kiwix.kiwixmobile.utils.Constants.RESULT_HISTORY_CLEARED; +import static org.kiwix.kiwixmobile.core.utils.Constants.EXTRA_WEBVIEWS_LIST; +import static org.kiwix.kiwixmobile.core.utils.Constants.RESULT_HISTORY_CLEARED; public class KiwixSettingsActivity extends BaseActivity { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/settings/PrefsFragment.java b/core/src/main/java/org/kiwix/kiwixmobile/core/settings/PrefsFragment.java similarity index 91% rename from core/src/main/java/org/kiwix/kiwixmobile/settings/PrefsFragment.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/settings/PrefsFragment.java index 4999e4f20..d982dde5d 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/settings/PrefsFragment.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/settings/PrefsFragment.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.settings; +package org.kiwix.kiwixmobile.core.settings; import android.Manifest; import android.annotation.SuppressLint; @@ -29,23 +29,23 @@ import javax.inject.Inject; import kotlin.Unit; import kotlin.io.FilesKt; import org.kiwix.kiwixmobile.core.BuildConfig; -import org.kiwix.kiwixmobile.KiwixApplication; +import org.kiwix.kiwixmobile.core.KiwixApplication; import org.kiwix.kiwixmobile.core.R; -import org.kiwix.kiwixmobile.extensions.ContextExtensionsKt; -import org.kiwix.kiwixmobile.main.AddNoteDialog; -import org.kiwix.kiwixmobile.main.MainActivity; -import org.kiwix.kiwixmobile.utils.LanguageUtils; -import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil; +import org.kiwix.kiwixmobile.core.extensions.ContextExtensionsKt; +import org.kiwix.kiwixmobile.core.main.AddNoteDialog; +import org.kiwix.kiwixmobile.core.main.MainActivity; +import org.kiwix.kiwixmobile.core.utils.LanguageUtils; +import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil; -import static org.kiwix.kiwixmobile.utils.Constants.RESULT_RESTART; -import static org.kiwix.kiwixmobile.utils.SharedPreferenceUtil.PREF_AUTONIGHTMODE; -import static org.kiwix.kiwixmobile.utils.SharedPreferenceUtil.PREF_LANG; -import static org.kiwix.kiwixmobile.utils.SharedPreferenceUtil.PREF_NIGHTMODE; -import static org.kiwix.kiwixmobile.utils.SharedPreferenceUtil.PREF_STORAGE; -import static org.kiwix.kiwixmobile.utils.SharedPreferenceUtil.PREF_WIFI_ONLY; -import static org.kiwix.kiwixmobile.utils.SharedPreferenceUtil.PREF_ZOOM; -import static org.kiwix.kiwixmobile.utils.SharedPreferenceUtil.PREF_ZOOM_ENABLED; -import static org.kiwix.kiwixmobile.utils.StyleUtils.dialogStyle; +import static org.kiwix.kiwixmobile.core.utils.Constants.RESULT_RESTART; +import static org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil.PREF_AUTONIGHTMODE; +import static org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil.PREF_LANG; +import static org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil.PREF_NIGHTMODE; +import static org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil.PREF_STORAGE; +import static org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil.PREF_WIFI_ONLY; +import static org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil.PREF_ZOOM; +import static org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil.PREF_ZOOM_ENABLED; +import static org.kiwix.kiwixmobile.core.utils.StyleUtils.dialogStyle; public class PrefsFragment extends PreferenceFragment implements SettingsContract.View, diff --git a/core/src/main/java/org/kiwix/kiwixmobile/settings/SettingsContract.java b/core/src/main/java/org/kiwix/kiwixmobile/core/settings/SettingsContract.java similarity index 65% rename from core/src/main/java/org/kiwix/kiwixmobile/settings/SettingsContract.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/settings/SettingsContract.java index 3d9dfb801..8dd1a3fff 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/settings/SettingsContract.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/settings/SettingsContract.java @@ -1,6 +1,6 @@ -package org.kiwix.kiwixmobile.settings; +package org.kiwix.kiwixmobile.core.settings; -import org.kiwix.kiwixmobile.base.BaseContract; +import org.kiwix.kiwixmobile.core.base.BaseContract; interface SettingsContract { interface View extends BaseContract.View { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/settings/SettingsPresenter.java b/core/src/main/java/org/kiwix/kiwixmobile/core/settings/SettingsPresenter.java similarity index 83% rename from core/src/main/java/org/kiwix/kiwixmobile/settings/SettingsPresenter.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/settings/SettingsPresenter.java index d3f964e62..fc77642ef 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/settings/SettingsPresenter.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/settings/SettingsPresenter.java @@ -1,11 +1,11 @@ -package org.kiwix.kiwixmobile.settings; +package org.kiwix.kiwixmobile.core.settings; import android.util.Log; import io.reactivex.CompletableObserver; import io.reactivex.disposables.Disposable; import javax.inject.Inject; -import org.kiwix.kiwixmobile.base.BasePresenter; -import org.kiwix.kiwixmobile.data.DataSource; +import org.kiwix.kiwixmobile.core.base.BasePresenter; +import org.kiwix.kiwixmobile.core.data.DataSource; class SettingsPresenter extends BasePresenter implements SettingsContract.Presenter { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/settings/SliderPreference.java b/core/src/main/java/org/kiwix/kiwixmobile/core/settings/SliderPreference.java similarity index 98% rename from core/src/main/java/org/kiwix/kiwixmobile/settings/SliderPreference.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/settings/SliderPreference.java index e9458edc9..4852243b5 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/settings/SliderPreference.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/settings/SliderPreference.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.settings; +package org.kiwix.kiwixmobile.core.settings; import android.content.Context; import android.content.res.TypedArray; @@ -26,7 +26,7 @@ import android.view.View; import android.widget.SeekBar; import android.widget.TextView; import org.kiwix.kiwixmobile.core.R; -import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil; +import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil; public class SliderPreference extends DialogPreference { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/settings/StorageCalculator.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/settings/StorageCalculator.kt similarity index 96% rename from core/src/main/java/org/kiwix/kiwixmobile/settings/StorageCalculator.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/settings/StorageCalculator.kt index 3d136e8b7..13c775b76 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/settings/StorageCalculator.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/settings/StorageCalculator.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.settings +package org.kiwix.kiwixmobile.core.settings import eu.mhutti1.utils.storage.Bytes import java.io.File diff --git a/core/src/main/java/org/kiwix/kiwixmobile/splash/SplashActivity.java b/core/src/main/java/org/kiwix/kiwixmobile/core/splash/SplashActivity.java similarity index 87% rename from core/src/main/java/org/kiwix/kiwixmobile/splash/SplashActivity.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/splash/SplashActivity.java index b4c286918..1fea18dda 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/splash/SplashActivity.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/splash/SplashActivity.java @@ -15,16 +15,16 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.splash; +package org.kiwix.kiwixmobile.core.splash; import android.content.Context; import android.content.Intent; import android.os.Bundle; import org.kiwix.kiwixmobile.core.BuildConfig; -import org.kiwix.kiwixmobile.base.BaseActivity; -import org.kiwix.kiwixmobile.error.ErrorActivity; -import org.kiwix.kiwixmobile.intro.IntroActivity; -import org.kiwix.kiwixmobile.main.MainActivity; +import org.kiwix.kiwixmobile.core.base.BaseActivity; +import org.kiwix.kiwixmobile.core.error.ErrorActivity; +import org.kiwix.kiwixmobile.core.intro.IntroActivity; +import org.kiwix.kiwixmobile.core.main.MainActivity; public class SplashActivity extends BaseActivity { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/utils/AlertDialogShower.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/AlertDialogShower.kt similarity index 92% rename from core/src/main/java/org/kiwix/kiwixmobile/utils/AlertDialogShower.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/utils/AlertDialogShower.kt index 65694c6f5..97290f717 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/utils/AlertDialogShower.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/AlertDialogShower.kt @@ -1,9 +1,9 @@ -package org.kiwix.kiwixmobile.utils +package org.kiwix.kiwixmobile.core.utils import android.app.Activity import androidx.appcompat.app.AlertDialog import org.kiwix.kiwixmobile.core.R -import org.kiwix.kiwixmobile.utils.KiwixDialog.StartHotspotManually +import org.kiwix.kiwixmobile.core.utils.KiwixDialog.StartHotspotManually import javax.inject.Inject class AlertDialogShower @Inject constructor( diff --git a/core/src/main/java/org/kiwix/kiwixmobile/utils/AnimationUtils.java b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/AnimationUtils.java similarity index 98% rename from core/src/main/java/org/kiwix/kiwixmobile/utils/AnimationUtils.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/utils/AnimationUtils.java index 0670c4754..f4c230b8b 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/utils/AnimationUtils.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/AnimationUtils.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.utils; +package org.kiwix.kiwixmobile.core.utils; import android.view.View; import android.view.ViewGroup; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/utils/BookUtils.java b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/BookUtils.java similarity index 97% rename from core/src/main/java/org/kiwix/kiwixmobile/utils/BookUtils.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/utils/BookUtils.java index 17ffb67fa..f617ec833 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/utils/BookUtils.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/BookUtils.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.utils; +package org.kiwix.kiwixmobile.core.utils; import java.util.HashMap; import java.util.Locale; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/utils/Constants.java b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/Constants.java similarity index 97% rename from core/src/main/java/org/kiwix/kiwixmobile/utils/Constants.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/utils/Constants.java index 51065b0de..3bccf1c8d 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/utils/Constants.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/Constants.java @@ -15,9 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.utils; - -import org.kiwix.kiwixmobile.core.BuildConfig; +package org.kiwix.kiwixmobile.core.utils; public final class Constants { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/utils/DialogShower.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/DialogShower.kt similarity index 95% rename from core/src/main/java/org/kiwix/kiwixmobile/utils/DialogShower.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/utils/DialogShower.kt index c13e9dfa1..80445eee7 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/utils/DialogShower.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/DialogShower.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.utils +package org.kiwix.kiwixmobile.core.utils interface DialogShower { fun show( diff --git a/core/src/main/java/org/kiwix/kiwixmobile/utils/DimenUtils.java b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/DimenUtils.java similarity index 97% rename from core/src/main/java/org/kiwix/kiwixmobile/utils/DimenUtils.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/utils/DimenUtils.java index 797d71970..7a00a5eaf 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/utils/DimenUtils.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/DimenUtils.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.utils; +package org.kiwix.kiwixmobile.core.utils; import android.app.Activity; import android.content.Context; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/utils/ImageUtils.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/ImageUtils.kt similarity index 88% rename from core/src/main/java/org/kiwix/kiwixmobile/utils/ImageUtils.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/utils/ImageUtils.kt index 6f165f0d0..04b07c16f 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/utils/ImageUtils.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/ImageUtils.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.utils +package org.kiwix.kiwixmobile.core.utils import android.graphics.Bitmap import android.graphics.Bitmap.createBitmap @@ -15,7 +15,11 @@ object ImageUtils { ): Bitmap? { val previousDrawingCacheState = viewToDrawFrom.isDrawingCacheEnabled viewToDrawFrom.isDrawingCacheEnabled = true - return getBitmapFromView(width, height, viewToDrawFrom) + return getBitmapFromView( + width, + height, + viewToDrawFrom + ) .also { viewToDrawFrom.isDrawingCacheEnabled = previousDrawingCacheState } } @@ -24,7 +28,12 @@ object ImageUtils { if (viewToDrawFrom.width <= 0 || viewToDrawFrom.height <= 0) { return viewToDrawFrom.measure(0, 0, MeasureSpec.UNSPECIFIED).let { if (it.width <= 0 || it.height <= 0) viewToDrawFrom.createBitmap() - else layoutAndCreateBitmap(it.width, it.height, viewToDrawFrom, it) + else layoutAndCreateBitmap( + it.width, + it.height, + viewToDrawFrom, + it + ) } } return viewToDrawFrom.createBitmap() diff --git a/core/src/main/java/org/kiwix/kiwixmobile/utils/KiwixDialog.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/KiwixDialog.kt similarity index 94% rename from core/src/main/java/org/kiwix/kiwixmobile/utils/KiwixDialog.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/utils/KiwixDialog.kt index caa18f16f..9cc0250e8 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/utils/KiwixDialog.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/KiwixDialog.kt @@ -1,8 +1,8 @@ -package org.kiwix.kiwixmobile.utils +package org.kiwix.kiwixmobile.core.utils import android.net.wifi.WifiConfiguration import org.kiwix.kiwixmobile.core.R -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk sealed class KiwixDialog( val title: Int?, diff --git a/core/src/main/java/org/kiwix/kiwixmobile/utils/LanguageContainer.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/LanguageContainer.kt similarity index 76% rename from core/src/main/java/org/kiwix/kiwixmobile/utils/LanguageContainer.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/utils/LanguageContainer.kt index 20653c4f4..700a9fe27 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/utils/LanguageContainer.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/LanguageContainer.kt @@ -1,9 +1,11 @@ -package org.kiwix.kiwixmobile.utils +package org.kiwix.kiwixmobile.core.utils import java.util.Locale class LanguageContainer private constructor(val languageCode: String, val languageName: String) { - constructor(languageCode: String) : this(languageCode, chooseLanguageName(languageCode)) + constructor(languageCode: String) : this(languageCode, + chooseLanguageName(languageCode) + ) companion object { private fun chooseLanguageName( diff --git a/core/src/main/java/org/kiwix/kiwixmobile/utils/LanguageUtils.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/LanguageUtils.kt similarity index 96% rename from core/src/main/java/org/kiwix/kiwixmobile/utils/LanguageUtils.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/utils/LanguageUtils.kt index 1a5587af1..465e13949 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/utils/LanguageUtils.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/LanguageUtils.kt @@ -17,7 +17,7 @@ * MA 02110-1301, USA. */ -package org.kiwix.kiwixmobile.utils +package org.kiwix.kiwixmobile.core.utils import android.content.Context import android.content.res.Configuration @@ -31,9 +31,9 @@ import android.view.InflateException import android.view.LayoutInflater import android.view.View import android.widget.TextView -import org.kiwix.kiwixmobile.extensions.locale -import org.kiwix.kiwixmobile.utils.Constants.TAG_KIWIX -import org.kiwix.kiwixmobile.utils.files.FileUtils +import org.kiwix.kiwixmobile.core.extensions.locale +import org.kiwix.kiwixmobile.core.utils.Constants.TAG_KIWIX +import org.kiwix.kiwixmobile.core.utils.files.FileUtils import java.text.Collator import java.util.Locale import java.util.MissingResourceException @@ -92,7 +92,10 @@ class LanguageUtils(private val context: Context) { val field = LayoutInflater::class.java.getDeclaredField("mFactorySet") field.isAccessible = true field.setBoolean(layoutInflater, false) - layoutInflater.factory = LayoutInflaterFactory(context, layoutInflater) + layoutInflater.factory = LayoutInflaterFactory( + context, + layoutInflater + ) } catch (e: NoSuchFieldException) { Log.w( TAG_KIWIX, diff --git a/core/src/main/java/org/kiwix/kiwixmobile/utils/NetworkUtils.java b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/NetworkUtils.java similarity index 96% rename from core/src/main/java/org/kiwix/kiwixmobile/utils/NetworkUtils.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/utils/NetworkUtils.java index afaf39b9d..3279f5288 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/utils/NetworkUtils.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/NetworkUtils.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.utils; +package org.kiwix.kiwixmobile.core.utils; import android.content.Context; import android.net.ConnectivityManager; @@ -25,8 +25,6 @@ import android.util.Log; import java.util.UUID; import org.kiwix.kiwixmobile.core.R; -import static org.kiwix.kiwixmobile.utils.Constants.TAG_KIWIX; - public class NetworkUtils { /** * check availability of any network @@ -117,7 +115,7 @@ public class NetworkUtils { details = details.trim().replaceAll(" +", " "); return details; } catch (Exception e) { - Log.d(TAG_KIWIX, "Context invalid url: " + url, e); + Log.d(Constants.TAG_KIWIX, "Context invalid url: " + url, e); return ""; } } diff --git a/core/src/main/java/org/kiwix/kiwixmobile/utils/ServerUtils.java b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/ServerUtils.java similarity index 97% rename from core/src/main/java/org/kiwix/kiwixmobile/utils/ServerUtils.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/utils/ServerUtils.java index b637425d3..5874dd2db 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/utils/ServerUtils.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/ServerUtils.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.utils; +package org.kiwix.kiwixmobile.core.utils; import androidx.annotation.NonNull; import androidx.annotation.Nullable; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/utils/SharedPreferenceUtil.java b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/SharedPreferenceUtil.java similarity index 98% rename from core/src/main/java/org/kiwix/kiwixmobile/utils/SharedPreferenceUtil.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/utils/SharedPreferenceUtil.java index 94f718ed8..085741232 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/utils/SharedPreferenceUtil.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/SharedPreferenceUtil.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.utils; +package org.kiwix.kiwixmobile.core.utils; import android.content.Context; import android.content.SharedPreferences; @@ -9,7 +9,7 @@ import io.reactivex.processors.PublishProcessor; import java.util.Calendar; import javax.inject.Inject; import javax.inject.Singleton; -import org.kiwix.kiwixmobile.KiwixApplication; +import org.kiwix.kiwixmobile.core.KiwixApplication; /** * Manager for the Default Shared Preferences of the application. diff --git a/core/src/main/java/org/kiwix/kiwixmobile/utils/StorageUtils.java b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/StorageUtils.java similarity index 95% rename from core/src/main/java/org/kiwix/kiwixmobile/utils/StorageUtils.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/utils/StorageUtils.java index 7e757340c..4ba406c37 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/utils/StorageUtils.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/StorageUtils.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.utils; +package org.kiwix.kiwixmobile.core.utils; public class StorageUtils { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/utils/StyleUtils.java b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/StyleUtils.java similarity index 95% rename from core/src/main/java/org/kiwix/kiwixmobile/utils/StyleUtils.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/utils/StyleUtils.java index cf7b66fe6..c3bce1730 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/utils/StyleUtils.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/StyleUtils.java @@ -17,7 +17,7 @@ * MA 02110-1301, USA. */ -package org.kiwix.kiwixmobile.utils; +package org.kiwix.kiwixmobile.core.utils; import android.content.Context; import android.os.Build; @@ -27,7 +27,7 @@ import android.util.AttributeSet; import android.util.Xml; import androidx.annotation.XmlRes; import org.kiwix.kiwixmobile.core.R; -import org.kiwix.kiwixmobile.main.MainActivity; +import org.kiwix.kiwixmobile.core.main.MainActivity; import org.xmlpull.v1.XmlPullParser; public class StyleUtils { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/utils/TestingUtils.java b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/TestingUtils.java similarity index 97% rename from core/src/main/java/org/kiwix/kiwixmobile/utils/TestingUtils.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/utils/TestingUtils.java index 1e32bd3b5..581ac9221 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/utils/TestingUtils.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/TestingUtils.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.utils; +package org.kiwix.kiwixmobile.core.utils; import java.util.HashSet; import java.util.Set; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/utils/UpdateUtils.java b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/UpdateUtils.java similarity index 54% rename from core/src/main/java/org/kiwix/kiwixmobile/utils/UpdateUtils.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/utils/UpdateUtils.java index f6db64ebe..9187b282c 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/utils/UpdateUtils.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/UpdateUtils.java @@ -1,8 +1,8 @@ -package org.kiwix.kiwixmobile.utils; +package org.kiwix.kiwixmobile.core.utils; -import org.kiwix.kiwixmobile.KiwixApplication; +import org.kiwix.kiwixmobile.core.KiwixApplication; -import static org.kiwix.kiwixmobile.utils.Constants.OLD_PROVIDER_DOMAIN; +import static org.kiwix.kiwixmobile.core.utils.Constants.OLD_PROVIDER_DOMAIN; public class UpdateUtils { public static String reformatProviderUrl(String url) { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/utils/files/FileSearch.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/files/FileSearch.kt similarity index 95% rename from core/src/main/java/org/kiwix/kiwixmobile/utils/files/FileSearch.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/utils/files/FileSearch.kt index f876d499d..6d37f160b 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/utils/files/FileSearch.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/files/FileSearch.kt @@ -17,7 +17,7 @@ * MA 02110-1301, USA. */ -package org.kiwix.kiwixmobile.utils.files +package org.kiwix.kiwixmobile.core.utils.files import android.content.Context import android.provider.MediaStore.Files @@ -27,8 +27,8 @@ import eu.mhutti1.utils.storage.StorageDeviceUtils import io.reactivex.Flowable import io.reactivex.functions.BiFunction import io.reactivex.schedulers.Schedulers -import org.kiwix.kiwixmobile.extensions.forEachRow -import org.kiwix.kiwixmobile.extensions.get +import org.kiwix.kiwixmobile.core.extensions.forEachRow +import org.kiwix.kiwixmobile.core.extensions.get import java.io.File import javax.inject.Inject diff --git a/core/src/main/java/org/kiwix/kiwixmobile/utils/files/FileUtils.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/files/FileUtils.kt similarity index 96% rename from core/src/main/java/org/kiwix/kiwixmobile/utils/files/FileUtils.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/utils/files/FileUtils.kt index 52a0f3211..8c8664ee5 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/utils/files/FileUtils.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/files/FileUtils.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.utils.files +package org.kiwix.kiwixmobile.core.utils.files import android.content.ContentUris import android.content.Context @@ -24,12 +24,12 @@ import android.os.Build import android.os.Environment import android.provider.DocumentsContract import android.util.Log -import org.kiwix.kiwixmobile.KiwixApplication import org.kiwix.kiwixmobile.core.BuildConfig -import org.kiwix.kiwixmobile.downloader.ChunkUtils -import org.kiwix.kiwixmobile.extensions.get -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity.Book -import org.kiwix.kiwixmobile.utils.Constants.TAG_KIWIX +import org.kiwix.kiwixmobile.core.KiwixApplication +import org.kiwix.kiwixmobile.core.downloader.ChunkUtils +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book +import org.kiwix.kiwixmobile.core.extensions.get +import org.kiwix.kiwixmobile.core.utils.Constants.TAG_KIWIX import java.io.File import java.io.IOException import java.util.ArrayList diff --git a/core/src/main/java/org/kiwix/kiwixmobile/webserver/WebServerHelper.java b/core/src/main/java/org/kiwix/kiwixmobile/core/webserver/WebServerHelper.java similarity index 92% rename from core/src/main/java/org/kiwix/kiwixmobile/webserver/WebServerHelper.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/webserver/WebServerHelper.java index ad6240063..8049c7b87 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/webserver/WebServerHelper.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/webserver/WebServerHelper.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.webserver; +package org.kiwix.kiwixmobile.core.webserver; import android.util.Log; import androidx.annotation.NonNull; @@ -10,10 +10,10 @@ import javax.inject.Inject; import org.kiwix.kiwixlib.JNIKiwixException; import org.kiwix.kiwixlib.JNIKiwixLibrary; import org.kiwix.kiwixlib.JNIKiwixServer; -import org.kiwix.kiwixmobile.utils.ServerUtils; -import org.kiwix.kiwixmobile.wifi_hotspot.IpAddressCallbacks; +import org.kiwix.kiwixmobile.core.utils.ServerUtils; +import org.kiwix.kiwixmobile.core.wifi_hotspot.IpAddressCallbacks; -import static org.kiwix.kiwixmobile.utils.ServerUtils.INVALID_IP; +import static org.kiwix.kiwixmobile.core.utils.ServerUtils.INVALID_IP; /** * WebServerHelper class is used to set up the suitable environment i.e. getting the diff --git a/core/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostActivity.java b/core/src/main/java/org/kiwix/kiwixmobile/core/webserver/ZimHostActivity.java similarity index 89% rename from core/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostActivity.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/webserver/ZimHostActivity.java index f2141ccac..935b92446 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostActivity.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/webserver/ZimHostActivity.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.webserver; +package org.kiwix.kiwixmobile.core.webserver; import android.app.ProgressDialog; import android.content.ComponentName; @@ -21,22 +21,21 @@ import java.util.ArrayList; import java.util.List; import javax.inject.Inject; import kotlin.Unit; -import kotlin.jvm.functions.Function0; import org.kiwix.kiwixmobile.core.R; -import org.kiwix.kiwixmobile.base.BaseActivity; import org.kiwix.kiwixmobile.core.R2; -import org.kiwix.kiwixmobile.utils.AlertDialogShower; -import org.kiwix.kiwixmobile.utils.KiwixDialog; -import org.kiwix.kiwixmobile.utils.ServerUtils; -import org.kiwix.kiwixmobile.wifi_hotspot.HotspotService; -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.SelectionMode; -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BookOnDiskDelegate; -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskAdapter; -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem; +import org.kiwix.kiwixmobile.core.base.BaseActivity; +import org.kiwix.kiwixmobile.core.utils.AlertDialogShower; +import org.kiwix.kiwixmobile.core.utils.KiwixDialog; +import org.kiwix.kiwixmobile.core.utils.ServerUtils; +import org.kiwix.kiwixmobile.core.wifi_hotspot.HotspotService; +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.SelectionMode; +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BookOnDiskDelegate; +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskAdapter; +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem; -import static org.kiwix.kiwixmobile.wifi_hotspot.HotspotService.ACTION_CHECK_IP_ADDRESS; -import static org.kiwix.kiwixmobile.wifi_hotspot.HotspotService.ACTION_START_SERVER; -import static org.kiwix.kiwixmobile.wifi_hotspot.HotspotService.ACTION_STOP_SERVER; +import static org.kiwix.kiwixmobile.core.wifi_hotspot.HotspotService.ACTION_CHECK_IP_ADDRESS; +import static org.kiwix.kiwixmobile.core.wifi_hotspot.HotspotService.ACTION_START_SERVER; +import static org.kiwix.kiwixmobile.core.wifi_hotspot.HotspotService.ACTION_STOP_SERVER; public class ZimHostActivity extends BaseActivity implements ZimHostCallbacks, ZimHostContract.View { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostCallbacks.java b/core/src/main/java/org/kiwix/kiwixmobile/core/webserver/ZimHostCallbacks.java similarity index 73% rename from core/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostCallbacks.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/webserver/ZimHostCallbacks.java index 8b601485e..7d50e157f 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostCallbacks.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/webserver/ZimHostCallbacks.java @@ -1,6 +1,5 @@ -package org.kiwix.kiwixmobile.webserver; +package org.kiwix.kiwixmobile.core.webserver; -import android.net.wifi.WifiConfiguration; import androidx.annotation.NonNull; public interface ZimHostCallbacks { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/webserver/ZimHostContract.java b/core/src/main/java/org/kiwix/kiwixmobile/core/webserver/ZimHostContract.java new file mode 100644 index 000000000..f3502cf15 --- /dev/null +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/webserver/ZimHostContract.java @@ -0,0 +1,18 @@ +package org.kiwix.kiwixmobile.core.webserver; + +import java.util.List; +import org.kiwix.kiwixmobile.core.base.BaseContract; +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem; + +class ZimHostContract { + + interface View + extends BaseContract.View { + void addBooks(List books); + } + + interface Presenter + extends BaseContract.Presenter { + void loadBooks(); + } +} diff --git a/core/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostModule.java b/core/src/main/java/org/kiwix/kiwixmobile/core/webserver/ZimHostModule.java similarity index 80% rename from core/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostModule.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/webserver/ZimHostModule.java index 885abd8c2..e2ec70380 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostModule.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/webserver/ZimHostModule.java @@ -1,9 +1,9 @@ -package org.kiwix.kiwixmobile.webserver; +package org.kiwix.kiwixmobile.core.webserver; import android.app.Activity; import dagger.Module; import dagger.Provides; -import org.kiwix.kiwixmobile.di.ActivityScope; +import org.kiwix.kiwixmobile.core.di.ActivityScope; @Module public class ZimHostModule { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostPresenter.java b/core/src/main/java/org/kiwix/kiwixmobile/core/webserver/ZimHostPresenter.java similarity index 77% rename from core/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostPresenter.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/webserver/ZimHostPresenter.java index 3f232eb06..401367da3 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostPresenter.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/webserver/ZimHostPresenter.java @@ -1,14 +1,14 @@ -package org.kiwix.kiwixmobile.webserver; +package org.kiwix.kiwixmobile.core.webserver; import android.util.Log; import io.reactivex.SingleObserver; import io.reactivex.disposables.Disposable; import java.util.List; import javax.inject.Inject; -import org.kiwix.kiwixmobile.base.BasePresenter; -import org.kiwix.kiwixmobile.data.DataSource; -import org.kiwix.kiwixmobile.di.ActivityScope; -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem; +import org.kiwix.kiwixmobile.core.base.BasePresenter; +import org.kiwix.kiwixmobile.core.data.DataSource; +import org.kiwix.kiwixmobile.core.di.ActivityScope; +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem; @ActivityScope class ZimHostPresenter extends BasePresenter diff --git a/core/src/main/java/org/kiwix/kiwixmobile/wifi_hotspot/HotspotNotificationManager.java b/core/src/main/java/org/kiwix/kiwixmobile/core/wifi_hotspot/HotspotNotificationManager.java similarity index 90% rename from core/src/main/java/org/kiwix/kiwixmobile/wifi_hotspot/HotspotNotificationManager.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/wifi_hotspot/HotspotNotificationManager.java index 2b8d12ce0..aa0ee8be3 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/wifi_hotspot/HotspotNotificationManager.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/wifi_hotspot/HotspotNotificationManager.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.wifi_hotspot; +package org.kiwix.kiwixmobile.core.wifi_hotspot; import android.app.Notification; import android.app.NotificationChannel; @@ -11,10 +11,8 @@ import androidx.annotation.NonNull; import androidx.core.app.NotificationCompat; import javax.inject.Inject; import org.kiwix.kiwixmobile.core.R; -import org.kiwix.kiwixmobile.utils.Constants; -import org.kiwix.kiwixmobile.webserver.ZimHostActivity; - -import static org.kiwix.kiwixmobile.wifi_hotspot.HotspotService.ACTION_STOP_SERVER; +import org.kiwix.kiwixmobile.core.utils.Constants; +import org.kiwix.kiwixmobile.core.webserver.ZimHostActivity; public class HotspotNotificationManager { @@ -51,7 +49,8 @@ public class HotspotNotificationManager { hotspotNotificationChannel(); - Intent stopIntent = new Intent(context, HotspotService.class).setAction(ACTION_STOP_SERVER); + Intent stopIntent = new Intent(context, HotspotService.class).setAction( + HotspotService.ACTION_STOP_SERVER); PendingIntent stopHotspot = PendingIntent.getService(context, 0, stopIntent, PendingIntent.FLAG_UPDATE_CURRENT); diff --git a/core/src/main/java/org/kiwix/kiwixmobile/wifi_hotspot/HotspotService.java b/core/src/main/java/org/kiwix/kiwixmobile/core/wifi_hotspot/HotspotService.java similarity index 86% rename from core/src/main/java/org/kiwix/kiwixmobile/wifi_hotspot/HotspotService.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/wifi_hotspot/HotspotService.java index 518eca90d..74f0dfb5c 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/wifi_hotspot/HotspotService.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/wifi_hotspot/HotspotService.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.wifi_hotspot; +package org.kiwix.kiwixmobile.core.wifi_hotspot; import android.app.Service; import android.content.Intent; @@ -8,15 +8,15 @@ import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import javax.inject.Inject; -import org.kiwix.kiwixmobile.KiwixApplication; +import org.kiwix.kiwixmobile.core.KiwixApplication; import org.kiwix.kiwixmobile.core.R; -import org.kiwix.kiwixmobile.extensions.ContextExtensionsKt; -import org.kiwix.kiwixmobile.utils.ServerUtils; -import org.kiwix.kiwixmobile.webserver.WebServerHelper; -import org.kiwix.kiwixmobile.webserver.ZimHostCallbacks; +import org.kiwix.kiwixmobile.core.extensions.ContextExtensionsKt; +import org.kiwix.kiwixmobile.core.utils.ServerUtils; +import org.kiwix.kiwixmobile.core.webserver.WebServerHelper; +import org.kiwix.kiwixmobile.core.webserver.ZimHostCallbacks; -import static org.kiwix.kiwixmobile.webserver.ZimHostActivity.SELECTED_ZIM_PATHS_KEY; -import static org.kiwix.kiwixmobile.wifi_hotspot.HotspotNotificationManager.HOTSPOT_NOTIFICATION_ID; +import static org.kiwix.kiwixmobile.core.webserver.ZimHostActivity.SELECTED_ZIM_PATHS_KEY; +import static org.kiwix.kiwixmobile.core.wifi_hotspot.HotspotNotificationManager.HOTSPOT_NOTIFICATION_ID; /** * HotspotService is used to add a foreground service for the wifi hotspot. diff --git a/core/src/main/java/org/kiwix/kiwixmobile/wifi_hotspot/HotspotStateReceiver.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/wifi_hotspot/HotspotStateReceiver.kt similarity index 86% rename from core/src/main/java/org/kiwix/kiwixmobile/wifi_hotspot/HotspotStateReceiver.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/wifi_hotspot/HotspotStateReceiver.kt index 03f273c97..e113ecc5c 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/wifi_hotspot/HotspotStateReceiver.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/wifi_hotspot/HotspotStateReceiver.kt @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.wifi_hotspot +package org.kiwix.kiwixmobile.core.wifi_hotspot import android.content.Context import android.content.Intent -import org.kiwix.kiwixmobile.wifi_hotspot.HotspotStateReceiver.HotspotState.DISABLED -import org.kiwix.kiwixmobile.zim_manager.BaseBroadcastReceiver +import org.kiwix.kiwixmobile.core.wifi_hotspot.HotspotStateReceiver.HotspotState.DISABLED +import org.kiwix.kiwixmobile.core.zim_manager.BaseBroadcastReceiver import javax.inject.Inject const val EXTRA_WIFI_AP_STATE = "wifi_state" @@ -42,7 +42,12 @@ class HotspotStateReceiver @Inject constructor(val callback: Callback) : BaseBro } private fun hotspotState(intent: Intent) = - HotspotState.from(intent.getIntExtra(EXTRA_WIFI_AP_STATE, -1)) + HotspotState.from( + intent.getIntExtra( + EXTRA_WIFI_AP_STATE, + -1 + ) + ) interface Callback { fun onHotspotDisabled() diff --git a/core/src/main/java/org/kiwix/kiwixmobile/wifi_hotspot/IpAddressCallbacks.java b/core/src/main/java/org/kiwix/kiwixmobile/core/wifi_hotspot/IpAddressCallbacks.java similarity index 65% rename from core/src/main/java/org/kiwix/kiwixmobile/wifi_hotspot/IpAddressCallbacks.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/wifi_hotspot/IpAddressCallbacks.java index e3da8a063..c5282d361 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/wifi_hotspot/IpAddressCallbacks.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/wifi_hotspot/IpAddressCallbacks.java @@ -1,8 +1,8 @@ -package org.kiwix.kiwixmobile.wifi_hotspot; +package org.kiwix.kiwixmobile.core.wifi_hotspot; public interface IpAddressCallbacks { void onIpAddressValid(); void onIpAddressInvalid(); -} \ No newline at end of file +} diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/BaseBroadcastReceiver.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/BaseBroadcastReceiver.kt similarity index 90% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/BaseBroadcastReceiver.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/BaseBroadcastReceiver.kt index 6371ee62f..d496d4f37 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/BaseBroadcastReceiver.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/BaseBroadcastReceiver.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager +package org.kiwix.kiwixmobile.core.zim_manager import android.content.BroadcastReceiver import android.content.Context diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/ConnectivityBroadcastReceiver.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/ConnectivityBroadcastReceiver.kt similarity index 80% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/ConnectivityBroadcastReceiver.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/ConnectivityBroadcastReceiver.kt index fbcc6a77a..2a021a695 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/ConnectivityBroadcastReceiver.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/ConnectivityBroadcastReceiver.kt @@ -1,17 +1,17 @@ -package org.kiwix.kiwixmobile.zim_manager +package org.kiwix.kiwixmobile.core.zim_manager import android.content.Context import android.content.Intent import android.net.ConnectivityManager import io.reactivex.Flowable import io.reactivex.processors.BehaviorProcessor -import org.kiwix.kiwixmobile.extensions.networkState +import org.kiwix.kiwixmobile.core.extensions.networkState import javax.inject.Inject class ConnectivityBroadcastReceiver @Inject constructor( private val connectivityManager: ConnectivityManager ) : - BaseBroadcastReceiver() { + org.kiwix.kiwixmobile.core.zim_manager.BaseBroadcastReceiver() { override val action: String = ConnectivityManager.CONNECTIVITY_ACTION diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/DefaultLanguageProvider.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/DefaultLanguageProvider.kt similarity index 84% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/DefaultLanguageProvider.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/DefaultLanguageProvider.kt index 3f6325116..0744d868d 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/DefaultLanguageProvider.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/DefaultLanguageProvider.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager +package org.kiwix.kiwixmobile.core.zim_manager import android.content.Context import javax.inject.Inject diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/Fat32Checker.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/Fat32Checker.kt similarity index 87% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/Fat32Checker.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/Fat32Checker.kt index d3a7fb5cf..1dca906dd 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/Fat32Checker.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/Fat32Checker.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.zim_manager +package org.kiwix.kiwixmobile.core.zim_manager import android.os.FileObserver import android.util.Log @@ -23,11 +23,11 @@ import io.reactivex.Flowable import io.reactivex.functions.BiFunction import io.reactivex.processors.BehaviorProcessor import io.reactivex.schedulers.Schedulers -import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil -import org.kiwix.kiwixmobile.zim_manager.Fat32Checker.FileSystemState.CanWrite4GbFile -import org.kiwix.kiwixmobile.zim_manager.Fat32Checker.FileSystemState.CannotWrite4GbFile -import org.kiwix.kiwixmobile.zim_manager.Fat32Checker.FileSystemState.NotEnoughSpaceFor4GbFile -import org.kiwix.kiwixmobile.zim_manager.Fat32Checker.FileSystemState.Unknown +import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil +import org.kiwix.kiwixmobile.core.zim_manager.Fat32Checker.FileSystemState.CanWrite4GbFile +import org.kiwix.kiwixmobile.core.zim_manager.Fat32Checker.FileSystemState.CannotWrite4GbFile +import org.kiwix.kiwixmobile.core.zim_manager.Fat32Checker.FileSystemState.NotEnoughSpaceFor4GbFile +import org.kiwix.kiwixmobile.core.zim_manager.Fat32Checker.FileSystemState.Unknown import java.io.File import java.io.RandomAccessFile import javax.inject.Inject diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/KiloByte.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/KiloByte.kt similarity index 91% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/KiloByte.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/KiloByte.kt index 6c128dc9c..4f61d2ff4 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/KiloByte.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/KiloByte.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager +package org.kiwix.kiwixmobile.core.zim_manager import java.text.DecimalFormat import kotlin.math.log10 diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/Language.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/Language.kt similarity index 96% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/Language.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/Language.kt index cb504a55d..731fd9ce1 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/Language.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/Language.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager +package org.kiwix.kiwixmobile.core.zim_manager import android.os.Parcelable import kotlinx.android.parcel.Parcelize diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/NetworkState.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/NetworkState.kt similarity index 55% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/NetworkState.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/NetworkState.kt index ec7465410..d80e8e474 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/NetworkState.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/NetworkState.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager +package org.kiwix.kiwixmobile.core.zim_manager enum class NetworkState { CONNECTED, diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/SectionsPagerAdapter.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/SectionsPagerAdapter.kt similarity index 85% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/SectionsPagerAdapter.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/SectionsPagerAdapter.kt index e26153f6c..dac14e457 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/SectionsPagerAdapter.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/SectionsPagerAdapter.kt @@ -15,15 +15,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.zim_manager +package org.kiwix.kiwixmobile.core.zim_manager import android.content.Context import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentPagerAdapter import org.kiwix.kiwixmobile.core.R -import org.kiwix.kiwixmobile.downloader.DownloadFragment -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.ZimFileSelectFragment -import org.kiwix.kiwixmobile.zim_manager.library_view.LibraryFragment +import org.kiwix.kiwixmobile.core.downloader.DownloadFragment +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.ZimFileSelectFragment +import org.kiwix.kiwixmobile.core.zim_manager.library_view.LibraryFragment class SectionsPagerAdapter( private val context: Context, diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/SimplePageChangeListener.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/SimplePageChangeListener.kt similarity index 90% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/SimplePageChangeListener.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/SimplePageChangeListener.kt index ce0db3225..f735d907a 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/SimplePageChangeListener.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/SimplePageChangeListener.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager +package org.kiwix.kiwixmobile.core.zim_manager import androidx.viewpager.widget.ViewPager.OnPageChangeListener diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/SimpleTextListener.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/SimpleTextListener.kt similarity index 88% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/SimpleTextListener.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/SimpleTextListener.kt index 3d32547cb..f9200cdac 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/SimpleTextListener.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/SimpleTextListener.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager +package org.kiwix.kiwixmobile.core.zim_manager import androidx.appcompat.widget.SearchView.OnQueryTextListener diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/ZimFileReader.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/ZimFileReader.kt similarity index 95% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/ZimFileReader.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/ZimFileReader.kt index c67f9fbe6..f50b18238 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/ZimFileReader.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/ZimFileReader.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.zim_manager +package org.kiwix.kiwixmobile.core.zim_manager import android.net.Uri import android.os.ParcelFileDescriptor @@ -30,11 +30,11 @@ import org.kiwix.kiwixlib.JNIKiwixInt import org.kiwix.kiwixlib.JNIKiwixReader import org.kiwix.kiwixlib.JNIKiwixString import org.kiwix.kiwixlib.Pair -import org.kiwix.kiwixmobile.KiwixApplication -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity.Book -import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil -import org.kiwix.kiwixmobile.utils.files.FileUtils -import org.kiwix.kiwixmobile.zim_manager.ZimFileReader.Companion.CONTENT_URI +import org.kiwix.kiwixmobile.core.KiwixApplication +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book +import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil +import org.kiwix.kiwixmobile.core.utils.files.FileUtils +import org.kiwix.kiwixmobile.core.zim_manager.ZimFileReader.Companion.CONTENT_URI import java.io.File import java.io.FileDescriptor import java.io.FileOutputStream diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/ZimManageActivity.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/ZimManageActivity.kt similarity index 88% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/ZimManageActivity.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/ZimManageActivity.kt index 3cf1ee825..a3741f965 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/ZimManageActivity.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/ZimManageActivity.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.zim_manager +package org.kiwix.kiwixmobile.core.zim_manager import android.app.Activity import android.content.Intent @@ -30,17 +30,17 @@ import androidx.lifecycle.ViewModelProvider import kotlinx.android.synthetic.main.zim_manager.manageViewPager import kotlinx.android.synthetic.main.zim_manager.tabs import kotlinx.android.synthetic.main.zim_manager.toolbar -import org.kiwix.kiwixmobile.KiwixApplication +import org.kiwix.kiwixmobile.core.KiwixApplication import org.kiwix.kiwixmobile.core.R -import org.kiwix.kiwixmobile.base.BaseActivity -import org.kiwix.kiwixmobile.database.newdb.dao.NewLanguagesDao -import org.kiwix.kiwixmobile.extensions.start -import org.kiwix.kiwixmobile.extensions.viewModel -import org.kiwix.kiwixmobile.language.LanguageActivity -import org.kiwix.kiwixmobile.main.MainActivity -import org.kiwix.kiwixmobile.utils.Constants.TAG_KIWIX -import org.kiwix.kiwixmobile.utils.LanguageUtils -import org.kiwix.kiwixmobile.zim_manager.local_file_transfer.LocalFileTransferActivity +import org.kiwix.kiwixmobile.core.base.BaseActivity +import org.kiwix.kiwixmobile.core.extensions.start +import org.kiwix.kiwixmobile.core.extensions.viewModel +import org.kiwix.kiwixmobile.core.language.LanguageActivity +import org.kiwix.kiwixmobile.core.main.MainActivity +import org.kiwix.kiwixmobile.core.newdb.dao.NewLanguagesDao +import org.kiwix.kiwixmobile.core.utils.Constants.TAG_KIWIX +import org.kiwix.kiwixmobile.core.utils.LanguageUtils +import org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer.LocalFileTransferActivity import java.io.File import javax.inject.Inject diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/ZimManageViewModel.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/ZimManageViewModel.kt similarity index 82% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/ZimManageViewModel.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/ZimManageViewModel.kt index d9aa0131a..5d243450b 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/ZimManageViewModel.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/ZimManageViewModel.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.zim_manager +package org.kiwix.kiwixmobile.core.zim_manager import android.app.Application import androidx.annotation.VisibleForTesting @@ -31,45 +31,45 @@ import io.reactivex.processors.BehaviorProcessor import io.reactivex.processors.PublishProcessor import io.reactivex.schedulers.Schedulers import org.kiwix.kiwixmobile.core.R -import org.kiwix.kiwixmobile.data.DataSource -import org.kiwix.kiwixmobile.data.remote.KiwixService -import org.kiwix.kiwixmobile.database.newdb.dao.FetchDownloadDao -import org.kiwix.kiwixmobile.database.newdb.dao.NewBookDao -import org.kiwix.kiwixmobile.database.newdb.dao.NewLanguagesDao -import org.kiwix.kiwixmobile.downloader.model.DownloadItem -import org.kiwix.kiwixmobile.downloader.model.DownloadModel -import org.kiwix.kiwixmobile.extensions.calculateSearchMatches -import org.kiwix.kiwixmobile.extensions.registerReceiver -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity.Book -import org.kiwix.kiwixmobile.utils.BookUtils -import org.kiwix.kiwixmobile.zim_manager.Fat32Checker.FileSystemState -import org.kiwix.kiwixmobile.zim_manager.Fat32Checker.FileSystemState.CanWrite4GbFile -import org.kiwix.kiwixmobile.zim_manager.Fat32Checker.FileSystemState.CannotWrite4GbFile -import org.kiwix.kiwixmobile.zim_manager.Fat32Checker.FileSystemState.NotEnoughSpaceFor4GbFile -import org.kiwix.kiwixmobile.zim_manager.Fat32Checker.FileSystemState.Unknown -import org.kiwix.kiwixmobile.zim_manager.NetworkState.CONNECTED -import org.kiwix.kiwixmobile.zim_manager.ZimManageViewModel.FileSelectActions.MultiModeFinished -import org.kiwix.kiwixmobile.zim_manager.ZimManageViewModel.FileSelectActions.RequestDeleteMultiSelection -import org.kiwix.kiwixmobile.zim_manager.ZimManageViewModel.FileSelectActions.RequestMultiSelection -import org.kiwix.kiwixmobile.zim_manager.ZimManageViewModel.FileSelectActions.RequestOpen -import org.kiwix.kiwixmobile.zim_manager.ZimManageViewModel.FileSelectActions.RequestSelect -import org.kiwix.kiwixmobile.zim_manager.ZimManageViewModel.FileSelectActions.RequestShareMultiSelection -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.FileSelectListState -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.SelectionMode.MULTI -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.SelectionMode.NORMAL -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.StorageObserver -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.effects.DeleteFiles -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.effects.None -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.effects.OpenFile -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.effects.ShareFiles -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.effects.SideEffect -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.effects.StartMultiSelection -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.LibraryListItem -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.LibraryListItem.BookItem -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.LibraryListItem.DividerItem +import org.kiwix.kiwixmobile.core.data.DataSource +import org.kiwix.kiwixmobile.core.data.remote.KiwixService +import org.kiwix.kiwixmobile.core.downloader.model.DownloadItem +import org.kiwix.kiwixmobile.core.downloader.model.DownloadModel +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book +import org.kiwix.kiwixmobile.core.extensions.calculateSearchMatches +import org.kiwix.kiwixmobile.core.extensions.registerReceiver +import org.kiwix.kiwixmobile.core.newdb.dao.FetchDownloadDao +import org.kiwix.kiwixmobile.core.newdb.dao.NewBookDao +import org.kiwix.kiwixmobile.core.newdb.dao.NewLanguagesDao +import org.kiwix.kiwixmobile.core.utils.BookUtils +import org.kiwix.kiwixmobile.core.zim_manager.Fat32Checker.FileSystemState +import org.kiwix.kiwixmobile.core.zim_manager.Fat32Checker.FileSystemState.CanWrite4GbFile +import org.kiwix.kiwixmobile.core.zim_manager.Fat32Checker.FileSystemState.CannotWrite4GbFile +import org.kiwix.kiwixmobile.core.zim_manager.Fat32Checker.FileSystemState.NotEnoughSpaceFor4GbFile +import org.kiwix.kiwixmobile.core.zim_manager.Fat32Checker.FileSystemState.Unknown +import org.kiwix.kiwixmobile.core.zim_manager.NetworkState.CONNECTED +import org.kiwix.kiwixmobile.core.zim_manager.ZimManageViewModel.FileSelectActions.MultiModeFinished +import org.kiwix.kiwixmobile.core.zim_manager.ZimManageViewModel.FileSelectActions.RequestDeleteMultiSelection +import org.kiwix.kiwixmobile.core.zim_manager.ZimManageViewModel.FileSelectActions.RequestMultiSelection +import org.kiwix.kiwixmobile.core.zim_manager.ZimManageViewModel.FileSelectActions.RequestOpen +import org.kiwix.kiwixmobile.core.zim_manager.ZimManageViewModel.FileSelectActions.RequestSelect +import org.kiwix.kiwixmobile.core.zim_manager.ZimManageViewModel.FileSelectActions.RequestShareMultiSelection +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.FileSelectListState +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.SelectionMode.MULTI +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.SelectionMode.NORMAL +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.StorageObserver +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.effects.DeleteFiles +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.effects.None +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.effects.OpenFile +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.effects.ShareFiles +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.effects.SideEffect +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.effects.StartMultiSelection +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.LibraryListItem +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.LibraryListItem.BookItem +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.LibraryListItem.DividerItem import java.util.LinkedList import java.util.Locale import java.util.concurrent.TimeUnit.MILLISECONDS diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/ZimReaderContainer.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/ZimReaderContainer.kt similarity index 98% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/ZimReaderContainer.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/ZimReaderContainer.kt index af4220c28..0b337fa42 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/ZimReaderContainer.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/ZimReaderContainer.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.zim_manager +package org.kiwix.kiwixmobile.core.zim_manager import android.net.Uri import org.kiwix.kiwixlib.JNIKiwixSearcher diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/ArticleCount.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/ArticleCount.kt similarity index 92% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/ArticleCount.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/ArticleCount.kt index 8da4ff153..2c0a9b2de 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/ArticleCount.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/ArticleCount.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager.fileselect_view +package org.kiwix.kiwixmobile.core.zim_manager.fileselect_view import android.content.Context import android.util.Log diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/FileSelectListState.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/FileSelectListState.kt similarity index 75% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/FileSelectListState.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/FileSelectListState.kt index 0b7c8993f..fe2b2661d 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/FileSelectListState.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/FileSelectListState.kt @@ -15,11 +15,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.zim_manager.fileselect_view +package org.kiwix.kiwixmobile.core.zim_manager.fileselect_view -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.SelectionMode.NORMAL -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.SelectionMode.NORMAL +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk data class FileSelectListState( val bookOnDiskListItems: List, diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/StorageObserver.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/StorageObserver.kt similarity index 71% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/StorageObserver.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/StorageObserver.kt index 7b095bd20..e3659f2db 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/StorageObserver.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/StorageObserver.kt @@ -1,12 +1,12 @@ -package org.kiwix.kiwixmobile.zim_manager.fileselect_view +package org.kiwix.kiwixmobile.core.zim_manager.fileselect_view import io.reactivex.functions.BiFunction import io.reactivex.schedulers.Schedulers -import org.kiwix.kiwixmobile.database.newdb.dao.FetchDownloadDao -import org.kiwix.kiwixmobile.downloader.model.DownloadModel -import org.kiwix.kiwixmobile.utils.files.FileSearch -import org.kiwix.kiwixmobile.zim_manager.ZimFileReader -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk +import org.kiwix.kiwixmobile.core.downloader.model.DownloadModel +import org.kiwix.kiwixmobile.core.newdb.dao.FetchDownloadDao +import org.kiwix.kiwixmobile.core.utils.files.FileSearch +import org.kiwix.kiwixmobile.core.zim_manager.ZimFileReader +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk import java.io.File import javax.inject.Inject diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/ZimFileSelectFragment.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/ZimFileSelectFragment.kt similarity index 77% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/ZimFileSelectFragment.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/ZimFileSelectFragment.kt index dbbd18fee..33c1da599 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/ZimFileSelectFragment.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/ZimFileSelectFragment.kt @@ -17,7 +17,7 @@ * MA 02110-1301, USA. */ -package org.kiwix.kiwixmobile.zim_manager.fileselect_view +package org.kiwix.kiwixmobile.core.zim_manager.fileselect_view import android.Manifest import android.content.pm.PackageManager @@ -36,21 +36,21 @@ import kotlinx.android.synthetic.main.zim_list.file_management_no_files import kotlinx.android.synthetic.main.zim_list.zim_swiperefresh import kotlinx.android.synthetic.main.zim_list.zimfilelist import org.kiwix.kiwixmobile.core.R -import org.kiwix.kiwixmobile.base.BaseFragment -import org.kiwix.kiwixmobile.di.components.ActivityComponent -import org.kiwix.kiwixmobile.extensions.toast -import org.kiwix.kiwixmobile.extensions.viewModel -import org.kiwix.kiwixmobile.utils.Constants.REQUEST_STORAGE_PERMISSION -import org.kiwix.kiwixmobile.utils.LanguageUtils -import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil -import org.kiwix.kiwixmobile.zim_manager.ZimManageViewModel -import org.kiwix.kiwixmobile.zim_manager.ZimManageViewModel.FileSelectActions -import org.kiwix.kiwixmobile.zim_manager.ZimManageViewModel.FileSelectActions.RequestMultiSelection -import org.kiwix.kiwixmobile.zim_manager.ZimManageViewModel.FileSelectActions.RequestOpen -import org.kiwix.kiwixmobile.zim_manager.ZimManageViewModel.FileSelectActions.RequestSelect -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BookOnDiskDelegate.BookDelegate -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BookOnDiskDelegate.LanguageDelegate -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskAdapter +import org.kiwix.kiwixmobile.core.base.BaseFragment +import org.kiwix.kiwixmobile.core.di.components.ActivityComponent +import org.kiwix.kiwixmobile.core.extensions.toast +import org.kiwix.kiwixmobile.core.extensions.viewModel +import org.kiwix.kiwixmobile.core.utils.Constants.REQUEST_STORAGE_PERMISSION +import org.kiwix.kiwixmobile.core.utils.LanguageUtils +import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil +import org.kiwix.kiwixmobile.core.zim_manager.ZimManageViewModel +import org.kiwix.kiwixmobile.core.zim_manager.ZimManageViewModel.FileSelectActions +import org.kiwix.kiwixmobile.core.zim_manager.ZimManageViewModel.FileSelectActions.RequestMultiSelection +import org.kiwix.kiwixmobile.core.zim_manager.ZimManageViewModel.FileSelectActions.RequestOpen +import org.kiwix.kiwixmobile.core.zim_manager.ZimManageViewModel.FileSelectActions.RequestSelect +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BookOnDiskDelegate.BookDelegate +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BookOnDiskDelegate.LanguageDelegate +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskAdapter import javax.inject.Inject class ZimFileSelectFragment : BaseFragment() { @@ -84,7 +84,8 @@ class ZimFileSelectFragment : BaseFragment() { container: ViewGroup?, savedInstanceState: Bundle? ): View? { - LanguageUtils(activity!!).changeFont(activity!!.layoutInflater, sharedPreferenceUtil) + LanguageUtils(activity!!) + .changeFont(activity!!.layoutInflater, sharedPreferenceUtil) return inflater.inflate(R.layout.zim_list, container, false) } diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/adapter/BookOnDiskDelegate.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/adapter/BookOnDiskDelegate.kt similarity index 73% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/adapter/BookOnDiskDelegate.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/adapter/BookOnDiskDelegate.kt index 7d8d2980d..9ddbef28d 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/adapter/BookOnDiskDelegate.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/adapter/BookOnDiskDelegate.kt @@ -15,19 +15,19 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter +package org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView.ViewHolder import org.kiwix.kiwixmobile.core.R -import org.kiwix.kiwixmobile.extensions.inflate -import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.SelectionMode -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.SelectionMode.NORMAL -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BookOnDiskViewHolder.BookViewHolder -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.LanguageItem -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.base.AbsDelegateAdapter +import org.kiwix.kiwixmobile.core.extensions.ViewGroupExtensions.inflate +import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.SelectionMode +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.SelectionMode.NORMAL +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BookOnDiskViewHolder.BookViewHolder +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.LanguageItem +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.base.AbsDelegateAdapter sealed class BookOnDiskDelegate> : AbsDelegateAdapter { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/adapter/BooksOnDiskAdapter.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/adapter/BooksOnDiskAdapter.kt new file mode 100644 index 000000000..a4b89942f --- /dev/null +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/adapter/BooksOnDiskAdapter.kt @@ -0,0 +1,12 @@ +package org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter + +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.base.AdapterDelegate +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.base.BaseDelegateAdapter + +class BooksOnDiskAdapter( + vararg delegates: AdapterDelegate +) : BaseDelegateAdapter( + *delegates +) { + override fun getIdFor(item: BooksOnDiskListItem) = item.id +} diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/adapter/BooksOnDiskListItem.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/adapter/BooksOnDiskListItem.kt similarity index 76% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/adapter/BooksOnDiskListItem.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/adapter/BooksOnDiskListItem.kt index 57ff6cbb2..c2a612319 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/adapter/BooksOnDiskListItem.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/adapter/BooksOnDiskListItem.kt @@ -1,9 +1,9 @@ -package org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter +package org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter -import org.kiwix.kiwixmobile.database.newdb.entities.BookOnDiskEntity -import org.kiwix.kiwixmobile.database.newdb.entities.FetchDownloadEntity -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity.Book -import org.kiwix.kiwixmobile.zim_manager.ZimFileReader +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book +import org.kiwix.kiwixmobile.core.newdb.entities.BookOnDiskEntity +import org.kiwix.kiwixmobile.core.newdb.entities.FetchDownloadEntity +import org.kiwix.kiwixmobile.core.zim_manager.ZimFileReader import java.io.File import java.util.Locale diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/adapter/BooksOnDiskViewHolder.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/adapter/BooksOnDiskViewHolder.kt similarity index 76% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/adapter/BooksOnDiskViewHolder.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/adapter/BooksOnDiskViewHolder.kt index 479b7c932..982882842 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/adapter/BooksOnDiskViewHolder.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/adapter/BooksOnDiskViewHolder.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter +package org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter import android.graphics.ColorMatrixColorFilter import android.view.View @@ -13,18 +13,18 @@ import kotlinx.android.synthetic.main.item_book.item_book_label_picture import kotlinx.android.synthetic.main.item_book.item_book_label_video import kotlinx.android.synthetic.main.item_book.item_book_size import kotlinx.android.synthetic.main.item_book.item_book_title -import org.kiwix.kiwixmobile.downloader.model.Base64String -import org.kiwix.kiwixmobile.extensions.setBitmap -import org.kiwix.kiwixmobile.main.KiwixWebView -import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil -import org.kiwix.kiwixmobile.zim_manager.KiloByte -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.ArticleCount -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.SelectionMode -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.SelectionMode.MULTI -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.SelectionMode.NORMAL -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.LanguageItem -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.base.BaseViewHolder +import org.kiwix.kiwixmobile.core.downloader.model.Base64String +import org.kiwix.kiwixmobile.core.extensions.setBitmap +import org.kiwix.kiwixmobile.core.main.KiwixWebView +import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil +import org.kiwix.kiwixmobile.core.zim_manager.KiloByte +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.ArticleCount +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.SelectionMode +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.SelectionMode.MULTI +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.SelectionMode.NORMAL +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.LanguageItem +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.base.BaseViewHolder sealed class BookOnDiskViewHolder(containerView: View) : BaseViewHolder(containerView) { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/effects/DeleteFiles.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/effects/DeleteFiles.kt similarity index 68% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/effects/DeleteFiles.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/effects/DeleteFiles.kt index 52aeb8aee..aa0c5bde4 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/effects/DeleteFiles.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/effects/DeleteFiles.kt @@ -1,14 +1,14 @@ -package org.kiwix.kiwixmobile.zim_manager.fileselect_view.effects +package org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.effects import android.app.Activity import org.kiwix.kiwixmobile.core.R.string -import org.kiwix.kiwixmobile.database.newdb.dao.NewBookDao -import org.kiwix.kiwixmobile.extensions.toast -import org.kiwix.kiwixmobile.utils.DialogShower -import org.kiwix.kiwixmobile.utils.KiwixDialog.DeleteZim -import org.kiwix.kiwixmobile.utils.files.FileUtils -import org.kiwix.kiwixmobile.zim_manager.ZimReaderContainer -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk +import org.kiwix.kiwixmobile.core.extensions.toast +import org.kiwix.kiwixmobile.core.newdb.dao.NewBookDao +import org.kiwix.kiwixmobile.core.utils.DialogShower +import org.kiwix.kiwixmobile.core.utils.KiwixDialog.DeleteZim +import org.kiwix.kiwixmobile.core.utils.files.FileUtils +import org.kiwix.kiwixmobile.core.zim_manager.ZimReaderContainer +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk import javax.inject.Inject class DeleteFiles(private val booksOnDiskListItem: List) : diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/effects/None.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/effects/None.kt similarity index 62% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/effects/None.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/effects/None.kt index 3d38f04c3..7dd847819 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/effects/None.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/effects/None.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager.fileselect_view.effects +package org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.effects import android.app.Activity diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/effects/OpenFile.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/effects/OpenFile.kt similarity index 79% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/effects/OpenFile.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/effects/OpenFile.kt index 1b453169e..53fa097e7 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/effects/OpenFile.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/effects/OpenFile.kt @@ -15,13 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.zim_manager.fileselect_view.effects +package org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.effects import android.app.Activity import org.kiwix.kiwixmobile.core.R -import org.kiwix.kiwixmobile.extensions.toast -import org.kiwix.kiwixmobile.zim_manager.ZimManageActivity -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk +import org.kiwix.kiwixmobile.core.extensions.toast +import org.kiwix.kiwixmobile.core.zim_manager.ZimManageActivity +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk class OpenFile(val bookOnDisk: BookOnDisk) : SideEffect { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/effects/ShareFiles.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/effects/ShareFiles.kt similarity index 88% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/effects/ShareFiles.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/effects/ShareFiles.kt index 8f04e6b19..34c275e0e 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/effects/ShareFiles.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/effects/ShareFiles.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager.fileselect_view.effects +package org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.effects import android.app.Activity import android.content.Intent @@ -6,7 +6,7 @@ import android.net.Uri import android.os.Build import androidx.core.content.FileProvider import org.kiwix.kiwixmobile.core.R -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk class ShareFiles(private val selectedBooks: List) : SideEffect { override fun invokeWith(activity: Activity) { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/effects/SideEffect.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/effects/SideEffect.kt similarity index 88% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/effects/SideEffect.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/effects/SideEffect.kt index 8806a40f4..6ba195cec 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/effects/SideEffect.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/effects/SideEffect.kt @@ -15,10 +15,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.zim_manager.fileselect_view.effects +package org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.effects import android.app.Activity -import org.kiwix.kiwixmobile.KiwixApplication +import org.kiwix.kiwixmobile.core.KiwixApplication interface SideEffect { fun invokeWith(activity: Activity): T diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/effects/StartMultiSelection.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/effects/StartMultiSelection.kt similarity index 57% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/effects/StartMultiSelection.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/effects/StartMultiSelection.kt index 77d9ea586..bb9818adf 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/effects/StartMultiSelection.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/effects/StartMultiSelection.kt @@ -1,14 +1,14 @@ -package org.kiwix.kiwixmobile.zim_manager.fileselect_view.effects +package org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.effects import android.app.Activity import android.view.ActionMode import io.reactivex.processors.PublishProcessor import org.kiwix.kiwixmobile.core.R -import org.kiwix.kiwixmobile.extensions.startActionMode -import org.kiwix.kiwixmobile.zim_manager.ZimManageViewModel.FileSelectActions -import org.kiwix.kiwixmobile.zim_manager.ZimManageViewModel.FileSelectActions.RequestDeleteMultiSelection -import org.kiwix.kiwixmobile.zim_manager.ZimManageViewModel.FileSelectActions.RequestShareMultiSelection -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem +import org.kiwix.kiwixmobile.core.extensions.startActionMode +import org.kiwix.kiwixmobile.core.zim_manager.ZimManageViewModel.FileSelectActions +import org.kiwix.kiwixmobile.core.zim_manager.ZimManageViewModel.FileSelectActions.RequestDeleteMultiSelection +import org.kiwix.kiwixmobile.core.zim_manager.ZimManageViewModel.FileSelectActions.RequestShareMultiSelection +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem data class StartMultiSelection( val bookOnDisk: BooksOnDiskListItem.BookOnDisk, diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/LibraryFragment.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/LibraryFragment.kt similarity index 79% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/LibraryFragment.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/LibraryFragment.kt index 86fd13083..b68b2cc41 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/LibraryFragment.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/LibraryFragment.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.zim_manager.library_view +package org.kiwix.kiwixmobile.core.zim_manager.library_view import android.net.ConnectivityManager import android.os.Bundle @@ -35,30 +35,30 @@ import kotlinx.android.synthetic.main.activity_library.libraryList import kotlinx.android.synthetic.main.activity_library.librarySwipeRefresh import org.kiwix.kiwixmobile.core.R import org.kiwix.kiwixmobile.core.R.string -import org.kiwix.kiwixmobile.base.BaseFragment -import org.kiwix.kiwixmobile.di.components.ActivityComponent -import org.kiwix.kiwixmobile.downloader.Downloader -import org.kiwix.kiwixmobile.extensions.snack -import org.kiwix.kiwixmobile.extensions.toast -import org.kiwix.kiwixmobile.extensions.viewModel -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity.Book -import org.kiwix.kiwixmobile.main.MainActivity -import org.kiwix.kiwixmobile.settings.StorageCalculator -import org.kiwix.kiwixmobile.utils.BookUtils -import org.kiwix.kiwixmobile.utils.DialogShower -import org.kiwix.kiwixmobile.utils.KiwixDialog.YesNoDialog.WifiOnly -import org.kiwix.kiwixmobile.utils.NetworkUtils -import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil -import org.kiwix.kiwixmobile.utils.TestingUtils -import org.kiwix.kiwixmobile.zim_manager.NetworkState -import org.kiwix.kiwixmobile.zim_manager.NetworkState.CONNECTED -import org.kiwix.kiwixmobile.zim_manager.NetworkState.NOT_CONNECTED -import org.kiwix.kiwixmobile.zim_manager.ZimManageViewModel -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.LibraryAdapter -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.LibraryDelegate.BookDelegate -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.LibraryDelegate.DividerDelegate -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.LibraryListItem -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.LibraryListItem.BookItem +import org.kiwix.kiwixmobile.core.base.BaseFragment +import org.kiwix.kiwixmobile.core.di.components.ActivityComponent +import org.kiwix.kiwixmobile.core.downloader.Downloader +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book +import org.kiwix.kiwixmobile.core.extensions.snack +import org.kiwix.kiwixmobile.core.extensions.toast +import org.kiwix.kiwixmobile.core.extensions.viewModel +import org.kiwix.kiwixmobile.core.main.MainActivity +import org.kiwix.kiwixmobile.core.settings.StorageCalculator +import org.kiwix.kiwixmobile.core.utils.BookUtils +import org.kiwix.kiwixmobile.core.utils.DialogShower +import org.kiwix.kiwixmobile.core.utils.KiwixDialog.YesNoDialog.WifiOnly +import org.kiwix.kiwixmobile.core.utils.NetworkUtils +import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil +import org.kiwix.kiwixmobile.core.utils.TestingUtils +import org.kiwix.kiwixmobile.core.zim_manager.NetworkState +import org.kiwix.kiwixmobile.core.zim_manager.NetworkState.CONNECTED +import org.kiwix.kiwixmobile.core.zim_manager.NetworkState.NOT_CONNECTED +import org.kiwix.kiwixmobile.core.zim_manager.ZimManageViewModel +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.LibraryAdapter +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.LibraryDelegate.BookDelegate +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.LibraryDelegate.DividerDelegate +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.LibraryListItem +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.LibraryListItem.BookItem import java.io.File import javax.inject.Inject diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/LibraryViewCallback.java b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/LibraryViewCallback.java similarity index 82% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/LibraryViewCallback.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/LibraryViewCallback.java index 51127f18f..066495791 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/LibraryViewCallback.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/LibraryViewCallback.java @@ -15,12 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.zim_manager.library_view; +package org.kiwix.kiwixmobile.core.zim_manager.library_view; import java.util.LinkedList; -import org.kiwix.kiwixmobile.base.BaseContract; -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity; -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity.Book; +import org.kiwix.kiwixmobile.core.base.BaseContract; +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity; +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book; /** * Created by EladKeyshawn on 06/04/2017. diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/LibraryAdapter.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/LibraryAdapter.kt similarity index 79% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/LibraryAdapter.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/LibraryAdapter.kt index e53189dd3..15896f8fe 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/LibraryAdapter.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/LibraryAdapter.kt @@ -17,10 +17,10 @@ * MA 02110-1301, USA. */ -package org.kiwix.kiwixmobile.zim_manager.library_view.adapter +package org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.base.AdapterDelegate -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.base.BaseDelegateAdapter +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.base.AdapterDelegate +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.base.BaseDelegateAdapter class LibraryAdapter( vararg delegates: AdapterDelegate diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/LibraryDelegate.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/LibraryDelegate.kt similarity index 70% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/LibraryDelegate.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/LibraryDelegate.kt index 361fefe0d..c0b86ad39 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/LibraryDelegate.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/LibraryDelegate.kt @@ -15,18 +15,18 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.zim_manager.library_view.adapter +package org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter import android.view.ViewGroup import org.kiwix.kiwixmobile.core.R import org.kiwix.kiwixmobile.core.R.layout -import org.kiwix.kiwixmobile.extensions.inflate -import org.kiwix.kiwixmobile.utils.BookUtils -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.LibraryListItem.BookItem -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.LibraryListItem.DividerItem -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.LibraryViewHolder.LibraryBookViewHolder -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.LibraryViewHolder.LibraryDividerViewHolder -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.base.AbsDelegateAdapter +import org.kiwix.kiwixmobile.core.extensions.ViewGroupExtensions.inflate +import org.kiwix.kiwixmobile.core.utils.BookUtils +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.LibraryListItem.BookItem +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.LibraryListItem.DividerItem +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.LibraryViewHolder.LibraryBookViewHolder +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.LibraryViewHolder.LibraryDividerViewHolder +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.base.AbsDelegateAdapter sealed class LibraryDelegate> : AbsDelegateAdapter { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/LibraryListItem.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/LibraryListItem.kt similarity index 68% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/LibraryListItem.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/LibraryListItem.kt index bde18998b..f79b9697a 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/LibraryListItem.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/LibraryListItem.kt @@ -1,6 +1,6 @@ -package org.kiwix.kiwixmobile.zim_manager.library_view.adapter +package org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity.Book +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book sealed class LibraryListItem { abstract val id: Long diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/LibraryViewHolder.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/LibraryViewHolder.kt similarity index 71% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/LibraryViewHolder.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/LibraryViewHolder.kt index 70c1a2901..b345a2475 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/LibraryViewHolder.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/LibraryViewHolder.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager.library_view.adapter +package org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter import android.view.View import kotlinx.android.synthetic.main.library_divider.divider_text @@ -11,16 +11,16 @@ import kotlinx.android.synthetic.main.library_item.language import kotlinx.android.synthetic.main.library_item.publisher import kotlinx.android.synthetic.main.library_item.size import kotlinx.android.synthetic.main.library_item.title -import org.kiwix.kiwixmobile.KiwixApplication -import org.kiwix.kiwixmobile.downloader.model.Base64String -import org.kiwix.kiwixmobile.extensions.setBitmap -import org.kiwix.kiwixmobile.extensions.setTextAndVisibility -import org.kiwix.kiwixmobile.utils.BookUtils -import org.kiwix.kiwixmobile.utils.NetworkUtils -import org.kiwix.kiwixmobile.zim_manager.KiloByte -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.LibraryListItem.BookItem -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.LibraryListItem.DividerItem -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.base.BaseViewHolder +import org.kiwix.kiwixmobile.core.KiwixApplication +import org.kiwix.kiwixmobile.core.downloader.model.Base64String +import org.kiwix.kiwixmobile.core.extensions.setBitmap +import org.kiwix.kiwixmobile.core.extensions.setTextAndVisibility +import org.kiwix.kiwixmobile.core.utils.BookUtils +import org.kiwix.kiwixmobile.core.utils.NetworkUtils +import org.kiwix.kiwixmobile.core.zim_manager.KiloByte +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.LibraryListItem.BookItem +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.LibraryListItem.DividerItem +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.base.BaseViewHolder sealed class LibraryViewHolder(containerView: View) : BaseViewHolder(containerView) { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/base/AbsDelegateAdapter.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/base/AbsDelegateAdapter.kt similarity index 94% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/base/AbsDelegateAdapter.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/base/AbsDelegateAdapter.kt index fcad993e2..1a5ff4932 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/base/AbsDelegateAdapter.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/base/AbsDelegateAdapter.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager.library_view.adapter.base +package org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.base import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/base/AdapterDelegate.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/base/AdapterDelegate.kt similarity index 79% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/base/AdapterDelegate.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/base/AdapterDelegate.kt index 471d371cc..65a503c3b 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/base/AdapterDelegate.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/base/AdapterDelegate.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager.library_view.adapter.base +package org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.base import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView.ViewHolder diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/base/AdapterDelegateManager.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/base/AdapterDelegateManager.kt similarity index 93% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/base/AdapterDelegateManager.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/base/AdapterDelegateManager.kt index 931ce4320..766e60057 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/base/AdapterDelegateManager.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/base/AdapterDelegateManager.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager.library_view.adapter.base +package org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.base import android.view.ViewGroup import androidx.collection.SparseArrayCompat diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/base/BaseDelegateAdapter.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/base/BaseDelegateAdapter.kt similarity index 96% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/base/BaseDelegateAdapter.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/base/BaseDelegateAdapter.kt index e6d9eefdd..201ae6150 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/base/BaseDelegateAdapter.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/base/BaseDelegateAdapter.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.zim_manager.library_view.adapter.base +package org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.base import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView.Adapter diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/base/BaseViewHolder.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/base/BaseViewHolder.kt similarity index 80% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/base/BaseViewHolder.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/base/BaseViewHolder.kt index a0e0ce4f1..7bca3e3f1 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/library_view/adapter/base/BaseViewHolder.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/library_view/adapter/base/BaseViewHolder.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager.library_view.adapter.base +package org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.base import android.view.View import androidx.recyclerview.widget.RecyclerView.ViewHolder diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/FileItem.java b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/FileItem.java similarity index 75% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/FileItem.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/FileItem.java index c551d0b24..514b5f7f4 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/FileItem.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/FileItem.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager.local_file_transfer; +package org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer; import android.net.Uri; import androidx.annotation.IntDef; @@ -6,10 +6,10 @@ import androidx.annotation.NonNull; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; -import static org.kiwix.kiwixmobile.zim_manager.local_file_transfer.FileItem.FileStatus.ERROR; -import static org.kiwix.kiwixmobile.zim_manager.local_file_transfer.FileItem.FileStatus.SENDING; -import static org.kiwix.kiwixmobile.zim_manager.local_file_transfer.FileItem.FileStatus.SENT; -import static org.kiwix.kiwixmobile.zim_manager.local_file_transfer.FileItem.FileStatus.TO_BE_SENT; +import static org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer.FileItem.FileStatus.ERROR; +import static org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer.FileItem.FileStatus.SENDING; +import static org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer.FileItem.FileStatus.SENT; +import static org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer.FileItem.FileStatus.TO_BE_SENT; /** * Helper class, part of the local file sharing module. diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/FileListAdapter.java b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/FileListAdapter.java similarity index 85% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/FileListAdapter.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/FileListAdapter.java index 77644df3a..e978b3d40 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/FileListAdapter.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/FileListAdapter.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager.local_file_transfer; +package org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer; import android.view.LayoutInflater; import android.view.View; @@ -14,10 +14,10 @@ import java.util.ArrayList; import org.kiwix.kiwixmobile.core.R; import org.kiwix.kiwixmobile.core.R2; -import static org.kiwix.kiwixmobile.zim_manager.local_file_transfer.FileItem.FileStatus.ERROR; -import static org.kiwix.kiwixmobile.zim_manager.local_file_transfer.FileItem.FileStatus.SENDING; -import static org.kiwix.kiwixmobile.zim_manager.local_file_transfer.FileItem.FileStatus.SENT; -import static org.kiwix.kiwixmobile.zim_manager.local_file_transfer.FileItem.FileStatus.TO_BE_SENT; +import static org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer.FileItem.FileStatus.ERROR; +import static org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer.FileItem.FileStatus.SENDING; +import static org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer.FileItem.FileStatus.SENT; +import static org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer.FileItem.FileStatus.TO_BE_SENT; /** * Helper class, part of the local file sharing module. diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/KiwixWifiP2pBroadcastReceiver.java b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/KiwixWifiP2pBroadcastReceiver.java similarity index 96% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/KiwixWifiP2pBroadcastReceiver.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/KiwixWifiP2pBroadcastReceiver.java index 261f3b2a9..21e7f4b3e 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/KiwixWifiP2pBroadcastReceiver.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/KiwixWifiP2pBroadcastReceiver.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager.local_file_transfer; +package org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer; import android.content.BroadcastReceiver; import android.content.Context; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/LocalFileTransferActivity.java b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/LocalFileTransferActivity.java similarity index 97% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/LocalFileTransferActivity.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/LocalFileTransferActivity.java index c8b52e793..8407edb18 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/LocalFileTransferActivity.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/LocalFileTransferActivity.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager.local_file_transfer; +package org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer; import android.Manifest; import android.annotation.SuppressLint; @@ -36,14 +36,12 @@ import java.util.List; import javax.inject.Inject; import kotlin.Unit; import kotlin.jvm.functions.Function0; -import org.kiwix.kiwixmobile.KiwixApplication; +import org.kiwix.kiwixmobile.core.KiwixApplication; import org.kiwix.kiwixmobile.core.R; import org.kiwix.kiwixmobile.core.R2; -import org.kiwix.kiwixmobile.utils.AlertDialogShower; -import org.kiwix.kiwixmobile.utils.KiwixDialog; -import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil; - -import static org.kiwix.kiwixmobile.zim_manager.local_file_transfer.WifiDirectManager.getDeviceStatus; +import org.kiwix.kiwixmobile.core.utils.AlertDialogShower; +import org.kiwix.kiwixmobile.core.utils.KiwixDialog; +import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil; /** * Created by @Aditya-Sood as a part of GSoC 2019. @@ -187,7 +185,7 @@ public class LocalFileTransferActivity extends AppCompatActivity implements // Update UI with user device's details if (userDevice != null) { deviceName.setText(userDevice.deviceName); - Log.d(TAG, getDeviceStatus(userDevice.status)); + Log.d(TAG, WifiDirectManager.getDeviceStatus(userDevice.status)); } } diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/PeerGroupHandshakeAsyncTask.java b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/PeerGroupHandshakeAsyncTask.java similarity index 98% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/PeerGroupHandshakeAsyncTask.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/PeerGroupHandshakeAsyncTask.java index 76b2e909c..c0d7f5312 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/PeerGroupHandshakeAsyncTask.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/PeerGroupHandshakeAsyncTask.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager.local_file_transfer; +package org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer; import android.os.AsyncTask; import android.util.Log; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/ReceiverDeviceAsyncTask.java b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/ReceiverDeviceAsyncTask.java similarity index 81% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/ReceiverDeviceAsyncTask.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/ReceiverDeviceAsyncTask.java index 8d09a9961..485620744 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/ReceiverDeviceAsyncTask.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/ReceiverDeviceAsyncTask.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager.local_file_transfer; +package org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer; import android.os.AsyncTask; import android.util.Log; @@ -12,11 +12,9 @@ import java.util.ArrayList; import org.kiwix.kiwixmobile.core.BuildConfig; import org.kiwix.kiwixmobile.core.R; -import static org.kiwix.kiwixmobile.zim_manager.local_file_transfer.FileItem.FileStatus.ERROR; -import static org.kiwix.kiwixmobile.zim_manager.local_file_transfer.FileItem.FileStatus.SENDING; -import static org.kiwix.kiwixmobile.zim_manager.local_file_transfer.FileItem.FileStatus.SENT; -import static org.kiwix.kiwixmobile.zim_manager.local_file_transfer.WifiDirectManager.FILE_TRANSFER_PORT; -import static org.kiwix.kiwixmobile.zim_manager.local_file_transfer.WifiDirectManager.copyToOutputStream; +import static org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer.FileItem.FileStatus.ERROR; +import static org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer.FileItem.FileStatus.SENDING; +import static org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer.FileItem.FileStatus.SENT; /** * Helper class for the local file sharing module. @@ -41,8 +39,8 @@ class ReceiverDeviceAsyncTask extends AsyncTask { @Override protected Boolean doInBackground(Void... voids) { - try (ServerSocket serverSocket = new ServerSocket(FILE_TRANSFER_PORT)) { - Log.d(TAG, "Server: Socket opened at " + FILE_TRANSFER_PORT); + try (ServerSocket serverSocket = new ServerSocket(WifiDirectManager.FILE_TRANSFER_PORT)) { + Log.d(TAG, "Server: Socket opened at " + WifiDirectManager.FILE_TRANSFER_PORT); final String zimStorageRootPath = wifiDirectManager.getZimStorageRootPath(); ArrayList fileItems = wifiDirectManager.getFilesForTransfer(); @@ -71,7 +69,7 @@ class ReceiverDeviceAsyncTask extends AsyncTask { boolean fileCreated = clientNoteFileLocation.createNewFile(); if (BuildConfig.DEBUG) Log.d(TAG, "File creation: " + fileCreated); - copyToOutputStream(client.getInputStream(), new FileOutputStream(clientNoteFileLocation)); + WifiDirectManager.copyToOutputStream(client.getInputStream(), new FileOutputStream(clientNoteFileLocation)); publishProgress(fileItemIndex, SENT); } catch (IOException e) { Log.e(TAG, e.getMessage()); diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/SenderDeviceAsyncTask.java b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/SenderDeviceAsyncTask.java similarity index 82% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/SenderDeviceAsyncTask.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/SenderDeviceAsyncTask.java index 74626b033..68d01938c 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/SenderDeviceAsyncTask.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/SenderDeviceAsyncTask.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager.local_file_transfer; +package org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer; import android.app.Activity; import android.content.ContentResolver; @@ -11,11 +11,9 @@ import java.net.InetSocketAddress; import java.net.Socket; import org.kiwix.kiwixmobile.core.BuildConfig; -import static org.kiwix.kiwixmobile.zim_manager.local_file_transfer.FileItem.FileStatus.ERROR; -import static org.kiwix.kiwixmobile.zim_manager.local_file_transfer.FileItem.FileStatus.SENDING; -import static org.kiwix.kiwixmobile.zim_manager.local_file_transfer.FileItem.FileStatus.SENT; -import static org.kiwix.kiwixmobile.zim_manager.local_file_transfer.WifiDirectManager.FILE_TRANSFER_PORT; -import static org.kiwix.kiwixmobile.zim_manager.local_file_transfer.WifiDirectManager.copyToOutputStream; +import static org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer.FileItem.FileStatus.ERROR; +import static org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer.FileItem.FileStatus.SENDING; +import static org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer.FileItem.FileStatus.SENT; /** * Helper class for the local file sharing module. @@ -58,14 +56,14 @@ class SenderDeviceAsyncTask extends AsyncTask { InputStream fileInputStream = contentResolver.openInputStream(fileItem.getFileUri())) { socket.bind(null); - socket.connect((new InetSocketAddress(hostAddress, FILE_TRANSFER_PORT)), 15000); + socket.connect((new InetSocketAddress(hostAddress, WifiDirectManager.FILE_TRANSFER_PORT)), 15000); Log.d(TAG, "Sender socket connected to server - " + socket.isConnected()); publishProgress(fileIndex, SENDING); OutputStream socketOutputStream = socket.getOutputStream(); - copyToOutputStream(fileInputStream, socketOutputStream); + WifiDirectManager.copyToOutputStream(fileInputStream, socketOutputStream); if (BuildConfig.DEBUG) Log.d(TAG, "Sender: Data written"); publishProgress(fileIndex, SENT); } catch (IOException e) { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/WifiDirectManager.java b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/WifiDirectManager.java similarity index 97% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/WifiDirectManager.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/WifiDirectManager.java index 614fc1862..e62d54d7d 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/WifiDirectManager.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/WifiDirectManager.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager.local_file_transfer; +package org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer; import android.app.Activity; import android.content.BroadcastReceiver; @@ -27,13 +27,13 @@ import kotlin.Unit; import kotlin.jvm.functions.Function0; import org.kiwix.kiwixmobile.core.BuildConfig; import org.kiwix.kiwixmobile.core.R; -import org.kiwix.kiwixmobile.utils.AlertDialogShower; -import org.kiwix.kiwixmobile.utils.KiwixDialog; -import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil; +import org.kiwix.kiwixmobile.core.utils.AlertDialogShower; +import org.kiwix.kiwixmobile.core.utils.KiwixDialog; +import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil; import static android.os.Looper.getMainLooper; -import static org.kiwix.kiwixmobile.zim_manager.local_file_transfer.FileItem.FileStatus.ERROR; -import static org.kiwix.kiwixmobile.zim_manager.local_file_transfer.LocalFileTransferActivity.showToast; +import static org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer.FileItem.FileStatus.ERROR; +import static org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer.LocalFileTransferActivity.showToast; /** * Manager for the Wifi-P2p API, used in the local file transfer module diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/WifiPeerListAdapter.java b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/WifiPeerListAdapter.java similarity index 89% rename from core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/WifiPeerListAdapter.java rename to core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/WifiPeerListAdapter.java index c5ac27d69..31cd0b91a 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/WifiPeerListAdapter.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/zim_manager/local_file_transfer/WifiPeerListAdapter.java @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager.local_file_transfer; +package org.kiwix.kiwixmobile.core.zim_manager.local_file_transfer; import android.app.Activity; import android.content.Context; @@ -17,8 +17,6 @@ import java.util.List; import org.kiwix.kiwixmobile.core.R; import org.kiwix.kiwixmobile.core.R2; -import static org.kiwix.kiwixmobile.zim_manager.local_file_transfer.WifiDirectManager.getDeviceStatus; - /** * Helper class, part of the local file sharing module. * @@ -57,7 +55,7 @@ public class WifiPeerListAdapter extends ArrayAdapter { if (device != null) { viewHolder.deviceName.setText(device.deviceName); - Log.d(TAG, getDeviceStatus(device.status)); + Log.d(TAG, WifiDirectManager.getDeviceStatus(device.status)); } return rowView; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/extensions/ConnectivityManagerExtensions.kt b/core/src/main/java/org/kiwix/kiwixmobile/extensions/ConnectivityManagerExtensions.kt deleted file mode 100644 index c6cf7d3c7..000000000 --- a/core/src/main/java/org/kiwix/kiwixmobile/extensions/ConnectivityManagerExtensions.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.kiwix.kiwixmobile.extensions - -import android.net.ConnectivityManager -import org.kiwix.kiwixmobile.zim_manager.NetworkState -import org.kiwix.kiwixmobile.zim_manager.NetworkState.CONNECTED -import org.kiwix.kiwixmobile.zim_manager.NetworkState.NOT_CONNECTED - -val ConnectivityManager.networkState: NetworkState - get() = if (activeNetworkInfo?.isConnected == true) - CONNECTED - else - NOT_CONNECTED diff --git a/core/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostContract.java b/core/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostContract.java deleted file mode 100644 index c33d0c08a..000000000 --- a/core/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostContract.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.kiwix.kiwixmobile.webserver; - -import java.util.List; -import org.kiwix.kiwixmobile.base.BaseContract; -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem; - -class ZimHostContract { - - interface View - extends BaseContract.View { - void addBooks(List books); - } - - interface Presenter - extends BaseContract.Presenter { - void loadBooks(); - } -} diff --git a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/adapter/BooksOnDiskAdapter.kt b/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/adapter/BooksOnDiskAdapter.kt deleted file mode 100644 index 6986a9e16..000000000 --- a/core/src/main/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/adapter/BooksOnDiskAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter - -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.base.AdapterDelegate -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.base.BaseDelegateAdapter - -class BooksOnDiskAdapter( - vararg delegates: AdapterDelegate -) : BaseDelegateAdapter( - *delegates -) { - override fun getIdFor(item: BooksOnDiskListItem) = item.id -} diff --git a/core/src/main/res/layout/activity_intro.xml b/core/src/main/res/layout/activity_intro.xml index 7d872fc2f..0d5cd55e9 100644 --- a/core/src/main/res/layout/activity_intro.xml +++ b/core/src/main/res/layout/activity_intro.xml @@ -7,7 +7,7 @@ tools:context=".intro.IntroActivity" > - - diff --git a/core/src/main/res/xml/preferences.xml b/core/src/main/res/xml/preferences.xml index ac6242446..4f44a9caf 100644 --- a/core/src/main/res/xml/preferences.xml +++ b/core/src/main/res/xml/preferences.xml @@ -3,25 +3,25 @@ android:key="pref_display" android:title="@string/pref_display_title"> - - - - - - - - - -. */ -package org.kiwix.kiwixmobile +package org.kiwix.kiwixmobile.core import androidx.arch.core.executor.ArchTaskExecutor import androidx.arch.core.executor.TaskExecutor diff --git a/core/src/test/java/org/kiwix/kiwixmobile/TestUtilitiyFunctions.kt b/core/src/test/java/org/kiwix/kiwixmobile/core/TestUtilitiyFunctions.kt similarity index 97% rename from core/src/test/java/org/kiwix/kiwixmobile/TestUtilitiyFunctions.kt rename to core/src/test/java/org/kiwix/kiwixmobile/core/TestUtilitiyFunctions.kt index 1f7029941..b279d303a 100644 --- a/core/src/test/java/org/kiwix/kiwixmobile/TestUtilitiyFunctions.kt +++ b/core/src/test/java/org/kiwix/kiwixmobile/core/TestUtilitiyFunctions.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile +package org.kiwix.kiwixmobile.core import io.reactivex.Scheduler import io.reactivex.android.plugins.RxAndroidPlugins diff --git a/core/src/test/java/org/kiwix/kiwixmobile/downloader/ChunkUtilsTest.kt b/core/src/test/java/org/kiwix/kiwixmobile/core/downloader/ChunkUtilsTest.kt similarity index 97% rename from core/src/test/java/org/kiwix/kiwixmobile/downloader/ChunkUtilsTest.kt rename to core/src/test/java/org/kiwix/kiwixmobile/core/downloader/ChunkUtilsTest.kt index cded39113..5adc1a523 100644 --- a/core/src/test/java/org/kiwix/kiwixmobile/downloader/ChunkUtilsTest.kt +++ b/core/src/test/java/org/kiwix/kiwixmobile/core/downloader/ChunkUtilsTest.kt @@ -16,14 +16,14 @@ * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.downloader +package org.kiwix.kiwixmobile.core.downloader import io.mockk.every import io.mockk.mockkStatic import org.assertj.core.api.Java6Assertions.assertThat import org.junit.Assert.assertEquals import org.junit.jupiter.api.Test -import org.kiwix.kiwixmobile.utils.StorageUtils +import org.kiwix.kiwixmobile.core.utils.StorageUtils class ChunkUtilsTest { @@ -31,7 +31,7 @@ class ChunkUtilsTest { "http://mirror.netcologne.de/kiwix/zim/wikipedia/wikipedia_af_all_nopic_2016-05.zim" init { - mockkStatic("org.kiwix.kiwixmobile.utils.StorageUtils") + mockkStatic(StorageUtils::class) every { StorageUtils.getFileNameFromUrl(url) }.returns("TestFileName") every { StorageUtils.getFileNameFromUrl("TestURL") }.returns("TestFileName.xml") } diff --git a/core/src/test/java/org/kiwix/kiwixmobile/library/entity/MetaLinkNetworkEntityTest.java b/core/src/test/java/org/kiwix/kiwixmobile/core/entity/MetaLinkNetworkEntityTest.java similarity index 98% rename from core/src/test/java/org/kiwix/kiwixmobile/library/entity/MetaLinkNetworkEntityTest.java rename to core/src/test/java/org/kiwix/kiwixmobile/core/entity/MetaLinkNetworkEntityTest.java index c05e944ac..049b7aafe 100644 --- a/core/src/test/java/org/kiwix/kiwixmobile/library/entity/MetaLinkNetworkEntityTest.java +++ b/core/src/test/java/org/kiwix/kiwixmobile/core/entity/MetaLinkNetworkEntityTest.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.library.entity; +package org.kiwix.kiwixmobile.core.entity; import org.hamcrest.CoreMatchers; import org.hamcrest.Description; diff --git a/core/src/test/java/org/kiwix/kiwixmobile/language/adapter/LanguageDelegateTest.kt b/core/src/test/java/org/kiwix/kiwixmobile/core/language/adapter/LanguageDelegateTest.kt similarity index 70% rename from core/src/test/java/org/kiwix/kiwixmobile/language/adapter/LanguageDelegateTest.kt rename to core/src/test/java/org/kiwix/kiwixmobile/core/language/adapter/LanguageDelegateTest.kt index 9b216e350..81b274f01 100644 --- a/core/src/test/java/org/kiwix/kiwixmobile/language/adapter/LanguageDelegateTest.kt +++ b/core/src/test/java/org/kiwix/kiwixmobile/core/language/adapter/LanguageDelegateTest.kt @@ -1,20 +1,21 @@ -package org.kiwix.kiwixmobile.language.adapter +package org.kiwix.kiwixmobile.core.language.adapter import android.view.ViewGroup import io.mockk.every import io.mockk.mockk -import io.mockk.mockkStatic +import io.mockk.mockkObject import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Nested import org.junit.jupiter.api.Test import org.kiwix.kiwixmobile.core.R -import org.kiwix.kiwixmobile.extensions.inflate -import org.kiwix.kiwixmobile.language.adapter.LanguageDelegate.HeaderDelegate -import org.kiwix.kiwixmobile.language.adapter.LanguageDelegate.LanguageItemDelegate -import org.kiwix.kiwixmobile.language.adapter.LanguageListItem.HeaderItem -import org.kiwix.kiwixmobile.language.adapter.LanguageListItem.LanguageItem -import org.kiwix.kiwixmobile.language.adapter.LanguageListViewHolder.HeaderViewHolder -import org.kiwix.kiwixmobile.language.adapter.LanguageListViewHolder.LanguageViewHolder +import org.kiwix.kiwixmobile.core.extensions.ViewGroupExtensions +import org.kiwix.kiwixmobile.core.extensions.ViewGroupExtensions.inflate +import org.kiwix.kiwixmobile.core.language.adapter.LanguageDelegate.HeaderDelegate +import org.kiwix.kiwixmobile.core.language.adapter.LanguageDelegate.LanguageItemDelegate +import org.kiwix.kiwixmobile.core.language.adapter.LanguageListItem.HeaderItem +import org.kiwix.kiwixmobile.core.language.adapter.LanguageListItem.LanguageItem +import org.kiwix.kiwixmobile.core.language.adapter.LanguageListViewHolder.HeaderViewHolder +import org.kiwix.kiwixmobile.core.language.adapter.LanguageListViewHolder.LanguageViewHolder /* * Kiwix Android @@ -45,7 +46,7 @@ class LanguageDelegateTest { @Test fun `creates HeaderViewHolder`() { val parent = mockk() - mockkStatic("org.kiwix.kiwixmobile.extensions.ViewGroupExtensionsKt") + mockkObject(ViewGroupExtensions) every { parent.inflate(R.layout.header_date, false) } returns mockk(relaxed = true) assertThat(HeaderDelegate().createViewHolder(parent)) .isInstanceOf(HeaderViewHolder::class.java) @@ -60,9 +61,9 @@ class LanguageDelegateTest { } @Test - fun `creates HeaderViewHolder`() { + fun `creates LanguageViewHolder`() { val parent = mockk() - mockkStatic("org.kiwix.kiwixmobile.extensions.ViewGroupExtensionsKt") + mockkObject(ViewGroupExtensions) every { parent.inflate(R.layout.item_language, false) } returns mockk(relaxed = true) val clickAction = mockk<(LanguageItem) -> Unit>() assertThat(LanguageItemDelegate(clickAction).createViewHolder(parent)) diff --git a/core/src/test/java/org/kiwix/kiwixmobile/language/viewmodel/LanguageViewModelTest.kt b/core/src/test/java/org/kiwix/kiwixmobile/core/language/viewmodel/LanguageViewModelTest.kt similarity index 79% rename from core/src/test/java/org/kiwix/kiwixmobile/language/viewmodel/LanguageViewModelTest.kt rename to core/src/test/java/org/kiwix/kiwixmobile/core/language/viewmodel/LanguageViewModelTest.kt index 277f7f08c..5c2d6a1ca 100644 --- a/core/src/test/java/org/kiwix/kiwixmobile/language/viewmodel/LanguageViewModelTest.kt +++ b/core/src/test/java/org/kiwix/kiwixmobile/core/language/viewmodel/LanguageViewModelTest.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.language.viewmodel +package org.kiwix.kiwixmobile.core.language.viewmodel import com.jraska.livedata.test import io.mockk.clearAllMocks @@ -28,20 +28,20 @@ import org.junit.jupiter.api.AfterAll import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -import org.kiwix.kiwixmobile.InstantExecutorExtension -import org.kiwix.kiwixmobile.database.newdb.dao.NewLanguagesDao -import org.kiwix.kiwixmobile.language -import org.kiwix.kiwixmobile.language.viewmodel.Action.Filter -import org.kiwix.kiwixmobile.language.viewmodel.Action.SaveAll -import org.kiwix.kiwixmobile.language.viewmodel.Action.Select -import org.kiwix.kiwixmobile.language.viewmodel.Action.UpdateLanguages -import org.kiwix.kiwixmobile.language.viewmodel.State.Content -import org.kiwix.kiwixmobile.language.viewmodel.State.Loading -import org.kiwix.kiwixmobile.language.viewmodel.State.Saving -import org.kiwix.kiwixmobile.languageItem -import org.kiwix.kiwixmobile.resetSchedulers -import org.kiwix.kiwixmobile.setScheduler -import org.kiwix.kiwixmobile.zim_manager.Language +import org.kiwix.kiwixmobile.core.InstantExecutorExtension +import org.kiwix.kiwixmobile.core.newdb.dao.NewLanguagesDao +import org.kiwix.kiwixmobile.core.language +import org.kiwix.kiwixmobile.core.language.viewmodel.Action.Filter +import org.kiwix.kiwixmobile.core.language.viewmodel.Action.SaveAll +import org.kiwix.kiwixmobile.core.language.viewmodel.Action.Select +import org.kiwix.kiwixmobile.core.language.viewmodel.Action.UpdateLanguages +import org.kiwix.kiwixmobile.core.language.viewmodel.State.Content +import org.kiwix.kiwixmobile.core.language.viewmodel.State.Loading +import org.kiwix.kiwixmobile.core.language.viewmodel.State.Saving +import org.kiwix.kiwixmobile.core.languageItem +import org.kiwix.kiwixmobile.core.resetSchedulers +import org.kiwix.kiwixmobile.core.setScheduler +import org.kiwix.kiwixmobile.core.zim_manager.Language @ExtendWith(InstantExecutorExtension::class) class LanguageViewModelTest { @@ -63,7 +63,8 @@ class LanguageViewModelTest { fun init() { clearAllMocks() every { newLanguagesDao.languages() } returns languages - languageViewModel = LanguageViewModel(newLanguagesDao) + languageViewModel = + LanguageViewModel(newLanguagesDao) } @Test @@ -143,7 +144,12 @@ class LanguageViewModelTest { .also { languageViewModel.actions.offer(SaveAll) } - .assertValues(SaveLanguagesAndFinish(listOf(), newLanguagesDao)) + .assertValues( + SaveLanguagesAndFinish( + listOf(), + newLanguagesDao + ) + ) languageViewModel.state.test() .assertValueHistory(Saving) } diff --git a/core/src/test/java/org/kiwix/kiwixmobile/language/viewmodel/SaveLanguagesAndFinishTest.kt b/core/src/test/java/org/kiwix/kiwixmobile/core/language/viewmodel/SaveLanguagesAndFinishTest.kt similarity index 83% rename from core/src/test/java/org/kiwix/kiwixmobile/language/viewmodel/SaveLanguagesAndFinishTest.kt rename to core/src/test/java/org/kiwix/kiwixmobile/core/language/viewmodel/SaveLanguagesAndFinishTest.kt index 74770c717..3e6423248 100644 --- a/core/src/test/java/org/kiwix/kiwixmobile/language/viewmodel/SaveLanguagesAndFinishTest.kt +++ b/core/src/test/java/org/kiwix/kiwixmobile/core/language/viewmodel/SaveLanguagesAndFinishTest.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.language.viewmodel +package org.kiwix.kiwixmobile.core.language.viewmodel /* * Kiwix Android @@ -23,10 +23,10 @@ import io.mockk.mockk import io.mockk.verify import io.reactivex.schedulers.Schedulers import org.junit.jupiter.api.Test -import org.kiwix.kiwixmobile.database.newdb.dao.NewLanguagesDao -import org.kiwix.kiwixmobile.resetSchedulers -import org.kiwix.kiwixmobile.setScheduler -import org.kiwix.kiwixmobile.zim_manager.Language +import org.kiwix.kiwixmobile.core.newdb.dao.NewLanguagesDao +import org.kiwix.kiwixmobile.core.resetSchedulers +import org.kiwix.kiwixmobile.core.setScheduler +import org.kiwix.kiwixmobile.core.zim_manager.Language class SaveLanguagesAndFinishTest { diff --git a/core/src/test/java/org/kiwix/kiwixmobile/language/viewmodel/StateTest.kt b/core/src/test/java/org/kiwix/kiwixmobile/core/language/viewmodel/StateTest.kt similarity index 84% rename from core/src/test/java/org/kiwix/kiwixmobile/language/viewmodel/StateTest.kt rename to core/src/test/java/org/kiwix/kiwixmobile/core/language/viewmodel/StateTest.kt index 78de45f5f..f37e615b3 100644 --- a/core/src/test/java/org/kiwix/kiwixmobile/language/viewmodel/StateTest.kt +++ b/core/src/test/java/org/kiwix/kiwixmobile/core/language/viewmodel/StateTest.kt @@ -16,15 +16,15 @@ * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.language.viewmodel +package org.kiwix.kiwixmobile.core.language.viewmodel import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Nested import org.junit.jupiter.api.Test -import org.kiwix.kiwixmobile.language -import org.kiwix.kiwixmobile.language.adapter.LanguageListItem.HeaderItem -import org.kiwix.kiwixmobile.language.adapter.LanguageListItem.LanguageItem -import org.kiwix.kiwixmobile.language.viewmodel.State.Content +import org.kiwix.kiwixmobile.core.language +import org.kiwix.kiwixmobile.core.language.adapter.LanguageListItem.HeaderItem +import org.kiwix.kiwixmobile.core.language.adapter.LanguageListItem.LanguageItem +import org.kiwix.kiwixmobile.core.language.viewmodel.State.Content class StateTest { @Nested diff --git a/core/src/test/java/org/kiwix/kiwixmobile/settings/StorageCalculatorTest.kt b/core/src/test/java/org/kiwix/kiwixmobile/core/settings/StorageCalculatorTest.kt similarity index 97% rename from core/src/test/java/org/kiwix/kiwixmobile/settings/StorageCalculatorTest.kt rename to core/src/test/java/org/kiwix/kiwixmobile/core/settings/StorageCalculatorTest.kt index f70ae1957..13fe8e633 100644 --- a/core/src/test/java/org/kiwix/kiwixmobile/settings/StorageCalculatorTest.kt +++ b/core/src/test/java/org/kiwix/kiwixmobile/core/settings/StorageCalculatorTest.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.settings +package org.kiwix.kiwixmobile.core.settings /* * Kiwix Android diff --git a/core/src/test/java/org/kiwix/kiwixmobile/utils/BookUtilsTest.kt b/core/src/test/java/org/kiwix/kiwixmobile/core/utils/BookUtilsTest.kt similarity index 97% rename from core/src/test/java/org/kiwix/kiwixmobile/utils/BookUtilsTest.kt rename to core/src/test/java/org/kiwix/kiwixmobile/core/utils/BookUtilsTest.kt index 86fb5f891..cfdd32bec 100644 --- a/core/src/test/java/org/kiwix/kiwixmobile/utils/BookUtilsTest.kt +++ b/core/src/test/java/org/kiwix/kiwixmobile/core/utils/BookUtilsTest.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.utils +package org.kiwix.kiwixmobile.core.utils import org.junit.Assert.assertEquals import org.junit.jupiter.api.Test diff --git a/core/src/test/java/org/kiwix/kiwixmobile/utils/NetworkUtilsTest.kt b/core/src/test/java/org/kiwix/kiwixmobile/core/utils/NetworkUtilsTest.kt similarity index 97% rename from core/src/test/java/org/kiwix/kiwixmobile/utils/NetworkUtilsTest.kt rename to core/src/test/java/org/kiwix/kiwixmobile/core/utils/NetworkUtilsTest.kt index d0a0594ae..933ef8c18 100644 --- a/core/src/test/java/org/kiwix/kiwixmobile/utils/NetworkUtilsTest.kt +++ b/core/src/test/java/org/kiwix/kiwixmobile/core/utils/NetworkUtilsTest.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.utils +package org.kiwix.kiwixmobile.core.utils import android.content.Context import android.net.ConnectivityManager @@ -166,7 +166,8 @@ class NetworkUtilsTest { // Standard case // Here the Method should return the substring between the first '?' character and the nearest '/' character preceeding it assertEquals( - "File Name from URL standard case", "search", NetworkUtils.getFileNameFromUrl( + "File Name from URL standard case", "search", + NetworkUtils.getFileNameFromUrl( "https://www.google.com/search?source=hp&ei=zs4LW6W1E5n6rQH65Z-wDQ&q=" + "kiwix+android&oq=kiwix+android&gs_l=psy-ab.3..." + "2590.6259.0.6504.14.12.0.0.0.0.263.485.2-2.2.0...." + @@ -192,7 +193,9 @@ class NetworkUtilsTest { every { (context.getString(R.string.zim_no_vid)) } returns "No Videos" every { (context.getString(R.string.zim_simple)) } returns "Simple" - assertEquals("URL Parsing on empty string", "", NetworkUtils.parseURL(context, "")) + assertEquals("URL Parsing on empty string", "", + NetworkUtils.parseURL(context, "") + ) // Using the standard Kiwix Download URLs assertEquals( diff --git a/core/src/test/java/org/kiwix/kiwixmobile/utils/files/FileSearchTest.kt b/core/src/test/java/org/kiwix/kiwixmobile/core/utils/files/FileSearchTest.kt similarity index 97% rename from core/src/test/java/org/kiwix/kiwixmobile/utils/files/FileSearchTest.kt rename to core/src/test/java/org/kiwix/kiwixmobile/core/utils/files/FileSearchTest.kt index 6babb0b30..60915e697 100644 --- a/core/src/test/java/org/kiwix/kiwixmobile/utils/files/FileSearchTest.kt +++ b/core/src/test/java/org/kiwix/kiwixmobile/core/utils/files/FileSearchTest.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.utils.files +package org.kiwix.kiwixmobile.core.utils.files import android.content.ContentResolver import android.content.Context @@ -35,8 +35,8 @@ import org.junit.jupiter.api.AfterAll import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Nested import org.junit.jupiter.api.Test -import org.kiwix.kiwixmobile.resetSchedulers -import org.kiwix.kiwixmobile.setScheduler +import org.kiwix.kiwixmobile.core.resetSchedulers +import org.kiwix.kiwixmobile.core.setScheduler import java.io.File class FileSearchTest { diff --git a/core/src/test/java/org/kiwix/kiwixmobile/utils/files/FileUtilsTest.kt b/core/src/test/java/org/kiwix/kiwixmobile/core/utils/files/FileUtilsTest.kt similarity index 89% rename from core/src/test/java/org/kiwix/kiwixmobile/utils/files/FileUtilsTest.kt rename to core/src/test/java/org/kiwix/kiwixmobile/core/utils/files/FileUtilsTest.kt index 6163011b5..43c8acdf9 100644 --- a/core/src/test/java/org/kiwix/kiwixmobile/utils/files/FileUtilsTest.kt +++ b/core/src/test/java/org/kiwix/kiwixmobile/core/utils/files/FileUtilsTest.kt @@ -16,15 +16,17 @@ * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.utils.files +package org.kiwix.kiwixmobile.core.utils.files import io.mockk.clearMocks import io.mockk.every import io.mockk.mockk +import io.mockk.mockkStatic import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity.Book +import org.kiwix.kiwixmobile.core.KiwixApplication +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book import java.io.File class FileUtilsTest { @@ -71,6 +73,8 @@ class FileUtilsTest { fileExists: Boolean ) { expect(extension, fileExists) + mockkStatic(KiwixApplication::class) + every { KiwixApplication.getInstance().packageName } returns "mock_package" val files = FileUtils.getAllZimParts(testBook) assertThat(files.size).isEqualTo(1) .withFailMessage("Only a single book is returned in case the file has extension $extension") diff --git a/core/src/test/java/org/kiwix/kiwixmobile/zim_manager/LanguageTest.kt b/core/src/test/java/org/kiwix/kiwixmobile/core/zim_manager/LanguageTest.kt similarity index 96% rename from core/src/test/java/org/kiwix/kiwixmobile/zim_manager/LanguageTest.kt rename to core/src/test/java/org/kiwix/kiwixmobile/core/zim_manager/LanguageTest.kt index 3c70ee037..edaa32d5e 100644 --- a/core/src/test/java/org/kiwix/kiwixmobile/zim_manager/LanguageTest.kt +++ b/core/src/test/java/org/kiwix/kiwixmobile/core/zim_manager/LanguageTest.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager +package org.kiwix.kiwixmobile.core.zim_manager /* * Kiwix Android @@ -22,7 +22,7 @@ import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Assertions.assertThrows import org.junit.jupiter.api.Nested import org.junit.jupiter.api.Test -import org.kiwix.kiwixmobile.language +import org.kiwix.kiwixmobile.core.language class LanguageTest { diff --git a/core/src/test/java/org/kiwix/kiwixmobile/zim_manager/ZimManageViewModelTest.kt b/core/src/test/java/org/kiwix/kiwixmobile/core/zim_manager/ZimManageViewModelTest.kt similarity index 87% rename from core/src/test/java/org/kiwix/kiwixmobile/zim_manager/ZimManageViewModelTest.kt rename to core/src/test/java/org/kiwix/kiwixmobile/core/zim_manager/ZimManageViewModelTest.kt index d9edc4c26..5cfa1161a 100644 --- a/core/src/test/java/org/kiwix/kiwixmobile/zim_manager/ZimManageViewModelTest.kt +++ b/core/src/test/java/org/kiwix/kiwixmobile/core/zim_manager/ZimManageViewModelTest.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package org.kiwix.kiwixmobile.zim_manager +package org.kiwix.kiwixmobile.core.zim_manager import android.app.Application import com.jraska.livedata.test @@ -33,34 +33,34 @@ import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Nested import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -import org.kiwix.kiwixmobile.InstantExecutorExtension +import org.kiwix.kiwixmobile.core.InstantExecutorExtension import org.kiwix.kiwixmobile.core.R -import org.kiwix.kiwixmobile.book -import org.kiwix.kiwixmobile.bookOnDisk -import org.kiwix.kiwixmobile.data.DataSource -import org.kiwix.kiwixmobile.data.remote.KiwixService -import org.kiwix.kiwixmobile.database.newdb.dao.FetchDownloadDao -import org.kiwix.kiwixmobile.database.newdb.dao.NewBookDao -import org.kiwix.kiwixmobile.database.newdb.dao.NewLanguagesDao -import org.kiwix.kiwixmobile.downloadItem -import org.kiwix.kiwixmobile.downloadModel -import org.kiwix.kiwixmobile.downloader.model.DownloadModel -import org.kiwix.kiwixmobile.language -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity.Book -import org.kiwix.kiwixmobile.libraryNetworkEntity -import org.kiwix.kiwixmobile.resetSchedulers -import org.kiwix.kiwixmobile.setScheduler -import org.kiwix.kiwixmobile.utils.BookUtils -import org.kiwix.kiwixmobile.zim_manager.Fat32Checker.FileSystemState -import org.kiwix.kiwixmobile.zim_manager.Fat32Checker.FileSystemState.CanWrite4GbFile -import org.kiwix.kiwixmobile.zim_manager.Fat32Checker.FileSystemState.CannotWrite4GbFile -import org.kiwix.kiwixmobile.zim_manager.NetworkState.CONNECTED -import org.kiwix.kiwixmobile.zim_manager.NetworkState.NOT_CONNECTED -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.FileSelectListState -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.StorageObserver -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk -import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.LibraryListItem +import org.kiwix.kiwixmobile.core.book +import org.kiwix.kiwixmobile.core.bookOnDisk +import org.kiwix.kiwixmobile.core.data.DataSource +import org.kiwix.kiwixmobile.core.data.remote.KiwixService +import org.kiwix.kiwixmobile.core.newdb.dao.FetchDownloadDao +import org.kiwix.kiwixmobile.core.newdb.dao.NewBookDao +import org.kiwix.kiwixmobile.core.newdb.dao.NewLanguagesDao +import org.kiwix.kiwixmobile.core.downloadItem +import org.kiwix.kiwixmobile.core.downloadModel +import org.kiwix.kiwixmobile.core.downloader.model.DownloadModel +import org.kiwix.kiwixmobile.core.language +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book +import org.kiwix.kiwixmobile.core.libraryNetworkEntity +import org.kiwix.kiwixmobile.core.resetSchedulers +import org.kiwix.kiwixmobile.core.setScheduler +import org.kiwix.kiwixmobile.core.utils.BookUtils +import org.kiwix.kiwixmobile.core.zim_manager.Fat32Checker.FileSystemState +import org.kiwix.kiwixmobile.core.zim_manager.Fat32Checker.FileSystemState.CanWrite4GbFile +import org.kiwix.kiwixmobile.core.zim_manager.Fat32Checker.FileSystemState.CannotWrite4GbFile +import org.kiwix.kiwixmobile.core.zim_manager.NetworkState.CONNECTED +import org.kiwix.kiwixmobile.core.zim_manager.NetworkState.NOT_CONNECTED +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.FileSelectListState +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.StorageObserver +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk +import org.kiwix.kiwixmobile.core.zim_manager.library_view.adapter.LibraryListItem import java.util.Locale import java.util.concurrent.TimeUnit.MILLISECONDS import java.util.concurrent.TimeUnit.SECONDS diff --git a/core/src/test/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/StorageObserverTest.kt b/core/src/test/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/StorageObserverTest.kt similarity index 80% rename from core/src/test/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/StorageObserverTest.kt rename to core/src/test/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/StorageObserverTest.kt index bdaa81975..787298bc0 100644 --- a/core/src/test/java/org/kiwix/kiwixmobile/zim_manager/fileselect_view/StorageObserverTest.kt +++ b/core/src/test/java/org/kiwix/kiwixmobile/core/zim_manager/fileselect_view/StorageObserverTest.kt @@ -1,4 +1,4 @@ -package org.kiwix.kiwixmobile.zim_manager.fileselect_view +package org.kiwix.kiwixmobile.core.zim_manager.fileselect_view /* * Kiwix Android @@ -26,16 +26,16 @@ import io.reactivex.schedulers.Schedulers import org.junit.jupiter.api.AfterAll import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test -import org.kiwix.kiwixmobile.book -import org.kiwix.kiwixmobile.bookOnDisk -import org.kiwix.kiwixmobile.database.newdb.dao.FetchDownloadDao -import org.kiwix.kiwixmobile.downloader.model.DownloadModel -import org.kiwix.kiwixmobile.resetSchedulers -import org.kiwix.kiwixmobile.setScheduler -import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil -import org.kiwix.kiwixmobile.utils.files.FileSearch -import org.kiwix.kiwixmobile.zim_manager.ZimFileReader -import org.kiwix.kiwixmobile.zim_manager.ZimFileReader.Factory +import org.kiwix.kiwixmobile.core.book +import org.kiwix.kiwixmobile.core.bookOnDisk +import org.kiwix.kiwixmobile.core.newdb.dao.FetchDownloadDao +import org.kiwix.kiwixmobile.core.downloader.model.DownloadModel +import org.kiwix.kiwixmobile.core.resetSchedulers +import org.kiwix.kiwixmobile.core.setScheduler +import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil +import org.kiwix.kiwixmobile.core.utils.files.FileSearch +import org.kiwix.kiwixmobile.core.zim_manager.ZimFileReader +import org.kiwix.kiwixmobile.core.zim_manager.ZimFileReader.Factory import java.io.File class StorageObserverTest { @@ -68,7 +68,11 @@ class StorageObserverTest { every { fileSearch.scan() } returns files every { downloadDao.downloads() } returns downloads every { readerFactory.create(file) } returns zimFileReader - storageObserver = StorageObserver(downloadDao, fileSearch, readerFactory) + storageObserver = StorageObserver( + downloadDao, + fileSearch, + readerFactory + ) } @Test diff --git a/core/src/testShared/org/kiwix/kiwixmobile/TestConstants.kt b/core/src/testShared/org/kiwix/kiwixmobile/core/TestConstants.kt similarity index 95% rename from core/src/testShared/org/kiwix/kiwixmobile/TestConstants.kt rename to core/src/testShared/org/kiwix/kiwixmobile/core/TestConstants.kt index 74bc0cd2e..a31fa9628 100644 --- a/core/src/testShared/org/kiwix/kiwixmobile/TestConstants.kt +++ b/core/src/testShared/org/kiwix/kiwixmobile/core/TestConstants.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile +package org.kiwix.kiwixmobile.core const val TEST_PORT = 8080 const val MOCK_BASE_URL = "http://localhost:$TEST_PORT/" diff --git a/core/src/testShared/org/kiwix/kiwixmobile/TestModelFunctions.kt b/core/src/testShared/org/kiwix/kiwixmobile/core/TestModelFunctions.kt similarity index 76% rename from core/src/testShared/org/kiwix/kiwixmobile/TestModelFunctions.kt rename to core/src/testShared/org/kiwix/kiwixmobile/core/TestModelFunctions.kt index 413bc9d2c..4a48c3576 100644 --- a/core/src/testShared/org/kiwix/kiwixmobile/TestModelFunctions.kt +++ b/core/src/testShared/org/kiwix/kiwixmobile/core/TestModelFunctions.kt @@ -15,26 +15,26 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.kiwix.kiwixmobile +package org.kiwix.kiwixmobile.core import com.tonyodev.fetch2.Error import com.tonyodev.fetch2.Status import com.tonyodev.fetch2.Status.NONE -import org.kiwix.kiwixmobile.downloader.model.Base64String -import org.kiwix.kiwixmobile.downloader.model.DownloadItem -import org.kiwix.kiwixmobile.downloader.model.DownloadModel -import org.kiwix.kiwixmobile.downloader.model.DownloadState -import org.kiwix.kiwixmobile.downloader.model.DownloadState.Pending -import org.kiwix.kiwixmobile.downloader.model.Seconds -import org.kiwix.kiwixmobile.language.adapter.LanguageListItem.LanguageItem -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity -import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity.Book -import org.kiwix.kiwixmobile.library.entity.MetaLinkNetworkEntity -import org.kiwix.kiwixmobile.library.entity.MetaLinkNetworkEntity.FileElement -import org.kiwix.kiwixmobile.library.entity.MetaLinkNetworkEntity.Pieces -import org.kiwix.kiwixmobile.library.entity.MetaLinkNetworkEntity.Url -import org.kiwix.kiwixmobile.zim_manager.Language -import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk +import org.kiwix.kiwixmobile.core.downloader.model.Base64String +import org.kiwix.kiwixmobile.core.downloader.model.DownloadItem +import org.kiwix.kiwixmobile.core.downloader.model.DownloadModel +import org.kiwix.kiwixmobile.core.downloader.model.DownloadState +import org.kiwix.kiwixmobile.core.downloader.model.DownloadState.Pending +import org.kiwix.kiwixmobile.core.downloader.model.Seconds +import org.kiwix.kiwixmobile.core.language.adapter.LanguageListItem.LanguageItem +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity +import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book +import org.kiwix.kiwixmobile.core.entity.MetaLinkNetworkEntity +import org.kiwix.kiwixmobile.core.entity.MetaLinkNetworkEntity.FileElement +import org.kiwix.kiwixmobile.core.entity.MetaLinkNetworkEntity.Pieces +import org.kiwix.kiwixmobile.core.entity.MetaLinkNetworkEntity.Url +import org.kiwix.kiwixmobile.core.zim_manager.Language +import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk import java.io.File import java.util.LinkedList @@ -62,13 +62,17 @@ fun downloadModel( fun downloadItem( downloadId: Long = 1L, - favIcon: Base64String = Base64String("favIcon"), + favIcon: Base64String = Base64String( + "favIcon" + ), title: String = "title", description: String = "description", bytesDownloaded: Long = 1L, totalSizeBytes: Long = 1L, progress: Int = 1, - eta: Seconds = Seconds(0), + eta: Seconds = Seconds( + 0 + ), state: DownloadState = Pending ) = DownloadItem( diff --git a/custom/build.gradle b/custom/build.gradle index 08ade3ebe..01234b9d9 100644 --- a/custom/build.gradle +++ b/custom/build.gradle @@ -3,6 +3,8 @@ import groovy.json.JsonSlurper apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' +apply plugin: 'jacoco-android' +apply plugin: "org.jlleitschuh.gradle.ktlint" String[] archs = ['arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64'] @@ -164,7 +166,16 @@ android { baseline file("lint-baseline.xml") } } +ktlint { + android = true +} +jacoco { + toolVersion = "0.8.3" +} +tasks.withType(Test) { + jacoco.includeNoLocationClasses = true +} dependencies { implementation project(':core') implementation(Libs.appcompat) diff --git a/custom/lint-baseline.xml b/custom/lint-baseline.xml index af7e1028d..384db6600 100644 --- a/custom/lint-baseline.xml +++ b/custom/lint-baseline.xml @@ -8,6 +8,39 @@ file="..\..\..\.android\lint\customlint.jar"/> + + + + + + + + + + + + @@ -43,7 +43,7 @@ android:resource="@xml/shortcuts" /> @@ -160,17 +160,17 @@ - - - - + + + + - + @@ -184,10 +184,10 @@ android:resource="@xml/kiwix_widget_provider_info" /> - + - - - - + + + + + android:value=".core.main.MainActivity" /> diff --git a/settings.gradle b/settings.gradle index 632f13724..d4fb2c08c 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,4 @@ include ':core' include ':app' include ':custom' +rootProject.name='kiwix-android'