├── .gitignore ├── DEVELOPER.md ├── LICENSE ├── README.md ├── app ├── .gitignore ├── build.gradle.kts ├── proguard-rules.pro ├── schemas │ └── com.hefengbao.jingmo.data.database.AppDatabase │ │ ├── 1.json │ │ ├── 10.json │ │ ├── 11.json │ │ ├── 12.json │ │ ├── 13.json │ │ ├── 14.json │ │ ├── 15.json │ │ ├── 16.json │ │ ├── 17.json │ │ ├── 18.json │ │ ├── 19.json │ │ ├── 2.json │ │ ├── 20.json │ │ ├── 21.json │ │ ├── 22.json │ │ ├── 23.json │ │ ├── 24.json │ │ ├── 25.json │ │ ├── 26.json │ │ ├── 27.json │ │ ├── 3.json │ │ ├── 4.json │ │ ├── 5.json │ │ ├── 6.json │ │ ├── 7.json │ │ ├── 8.json │ │ └── 9.json └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── hefengbao │ │ └── jingmo │ │ └── ExampleInstrumentedTest.kt │ ├── debug │ └── res │ │ └── values │ │ └── strings.xml │ ├── main │ ├── AndroidManifest.xml │ ├── assets │ │ └── hanzi │ │ │ ├── bg.png │ │ │ ├── hanzi-writer.min.js │ │ │ ├── index.html │ │ │ └── jquery-3.7.1.min.js │ ├── ic_launcher-playstore.png │ ├── java │ │ └── com │ │ │ └── hefengbao │ │ │ └── jingmo │ │ │ ├── App.kt │ │ │ ├── MainActivity.kt │ │ │ ├── MainActivityViewModel.kt │ │ │ ├── base │ │ │ └── BaseViewModel.kt │ │ │ ├── common │ │ │ ├── Constant.kt │ │ │ ├── ElevationTokens.kt │ │ │ ├── ext │ │ │ │ ├── ColorScheme.kt │ │ │ │ ├── ContextExt.kt │ │ │ │ └── StringExt.kt │ │ │ ├── network │ │ │ │ ├── AppDispatchers.kt │ │ │ │ ├── Result.kt │ │ │ │ ├── SafeApiCall.kt │ │ │ │ └── di │ │ │ │ │ ├── CoroutineScopesModule.kt │ │ │ │ │ └── DispatchersModule.kt │ │ │ ├── storage │ │ │ │ └── AndroidImageDownloader.kt │ │ │ └── util │ │ │ │ ├── ClipboardUtil.kt │ │ │ │ ├── FileUtil.kt │ │ │ │ └── SystemUtil.kt │ │ │ ├── data │ │ │ ├── database │ │ │ │ ├── AppDatabase.kt │ │ │ │ ├── dao │ │ │ │ │ ├── ChinaWorldCulturalHeritageDao.kt │ │ │ │ │ ├── ChineseAntitheticalCoupletDao.kt │ │ │ │ │ ├── ChineseDictionaryDao.kt │ │ │ │ │ ├── ChineseExpressionDao.kt │ │ │ │ │ ├── ChineseIdiomDao.kt │ │ │ │ │ ├── ChineseKnowledgeDao.kt │ │ │ │ │ ├── ChineseLyricDao.kt │ │ │ │ │ ├── ChineseModernPoetryDao.kt │ │ │ │ │ ├── ChineseProverbDao.kt │ │ │ │ │ ├── ChineseQuoteDao.kt │ │ │ │ │ ├── ChineseRiddleDao.kt │ │ │ │ │ ├── ChineseTongueTwisterDao.kt │ │ │ │ │ ├── ChineseWisecrackDao.kt │ │ │ │ │ ├── ClassicalLiteratureClassicPoemDao.kt │ │ │ │ │ ├── ClassicalLiteraturePeopleDao.kt │ │ │ │ │ ├── ClassicalLiteratureSentenceDao.kt │ │ │ │ │ └── ClassicalLiteratureWritingDao.kt │ │ │ │ ├── entity │ │ │ │ │ ├── china │ │ │ │ │ │ └── WorldCulturalHeritageEntity.kt │ │ │ │ │ ├── chinese │ │ │ │ │ │ ├── AntitheticalCoupletCollectionEntity.kt │ │ │ │ │ │ ├── AntitheticalCoupletEntity.kt │ │ │ │ │ │ ├── DictionaryCollectionEntity.kt │ │ │ │ │ │ ├── DictionaryEntity.kt │ │ │ │ │ │ ├── DictionaryPinyinEntity.kt │ │ │ │ │ │ ├── ExpressionCollectionEntity.kt │ │ │ │ │ │ ├── ExpressionEntity.kt │ │ │ │ │ │ ├── IdiomCollectionEntity.kt │ │ │ │ │ │ ├── IdiomEntity.kt │ │ │ │ │ │ ├── KnowledgeCollectionEntity.kt │ │ │ │ │ │ ├── KnowledgeEntity.kt │ │ │ │ │ │ ├── KnowledgeFtsEntity.kt │ │ │ │ │ │ ├── LyricCollectionEntity.kt │ │ │ │ │ │ ├── LyricEntity.kt │ │ │ │ │ │ ├── LyricFtsEntity.kt │ │ │ │ │ │ ├── ModernPoetryCollectionEntity.kt │ │ │ │ │ │ ├── ModernPoetryEntity.kt │ │ │ │ │ │ ├── ModernPoetryFtsEntity.kt │ │ │ │ │ │ ├── ProverbCollectionEntity.kt │ │ │ │ │ │ ├── ProverbEntity.kt │ │ │ │ │ │ ├── ProverbFtsEntity.kt │ │ │ │ │ │ ├── QuoteCollectionEntity.kt │ │ │ │ │ │ ├── QuoteEntity.kt │ │ │ │ │ │ ├── QuoteFtsEntity.kt │ │ │ │ │ │ ├── RiddleEntity.kt │ │ │ │ │ │ ├── TongueTwisterEntity.kt │ │ │ │ │ │ ├── WisecrackCollectionEntity.kt │ │ │ │ │ │ └── WisecrackEntity.kt │ │ │ │ │ └── classicalliterature │ │ │ │ │ │ ├── ClassicPoemCollectionEntity.kt │ │ │ │ │ │ ├── ClassicPoemEntity.kt │ │ │ │ │ │ ├── ClassicPoemFtsEntity.kt │ │ │ │ │ │ ├── PeopleEntity.kt │ │ │ │ │ │ ├── SentenceCollectionEntity.kt │ │ │ │ │ │ ├── SentenceEntity.kt │ │ │ │ │ │ ├── WritingCollectionEntity.kt │ │ │ │ │ │ ├── WritingEntity.kt │ │ │ │ │ │ └── WritingFtsEntity.kt │ │ │ │ └── util │ │ │ │ │ ├── IntListConverter.kt │ │ │ │ │ ├── PeopleAliasListConverter.kt │ │ │ │ │ ├── PeopleDetailListConverter.kt │ │ │ │ │ ├── PeopleHometownListConverter.kt │ │ │ │ │ ├── StringListConverter.kt │ │ │ │ │ ├── WritingAllusionListConverter.kt │ │ │ │ │ ├── WritingClauseListConverter.kt │ │ │ │ │ ├── WritingCommentListConverter.kt │ │ │ │ │ └── WritingQuoteListConverter.kt │ │ │ ├── datastore │ │ │ │ ├── AppPreference.kt │ │ │ │ ├── DatasetPreference.kt │ │ │ │ ├── HomePreference.kt │ │ │ │ └── ReadStatusPreference.kt │ │ │ ├── enums │ │ │ │ └── writing │ │ │ │ │ └── CommentType.kt │ │ │ ├── model │ │ │ │ ├── AppStatus.kt │ │ │ │ ├── Dataset.kt │ │ │ │ ├── DatasetVersion.kt │ │ │ │ ├── HomeItem.kt │ │ │ │ ├── IdTitle.kt │ │ │ │ ├── Link.kt │ │ │ │ ├── ReadStatus.kt │ │ │ │ ├── UserData.kt │ │ │ │ ├── Version.kt │ │ │ │ ├── china │ │ │ │ │ └── WorldCulturalHeritage.kt │ │ │ │ ├── chinese │ │ │ │ │ ├── AntitheticalCouplet.kt │ │ │ │ │ ├── Dictionary.kt │ │ │ │ │ ├── Expression.kt │ │ │ │ │ ├── ExpressionWrapper.kt │ │ │ │ │ ├── Idiom.kt │ │ │ │ │ ├── IdiomWrapper.kt │ │ │ │ │ ├── Knowledge.kt │ │ │ │ │ ├── Lyric.kt │ │ │ │ │ ├── ModernPoetry.kt │ │ │ │ │ ├── Proverb.kt │ │ │ │ │ ├── Quote.kt │ │ │ │ │ ├── Riddle.kt │ │ │ │ │ ├── TongueTwister.kt │ │ │ │ │ ├── Wisecrack.kt │ │ │ │ │ └── character │ │ │ │ │ │ ├── Pinyin.kt │ │ │ │ │ │ ├── Radical.kt │ │ │ │ │ │ └── Stroke.kt │ │ │ │ ├── classicalliterature │ │ │ │ │ ├── ClassicPoem.kt │ │ │ │ │ ├── People.kt │ │ │ │ │ ├── PeopleWrapper.kt │ │ │ │ │ ├── Sentence.kt │ │ │ │ │ ├── Writing.kt │ │ │ │ │ ├── WritingWrapper.kt │ │ │ │ │ ├── people │ │ │ │ │ │ ├── Alias.kt │ │ │ │ │ │ ├── Detail.kt │ │ │ │ │ │ └── Hometown.kt │ │ │ │ │ └── writing │ │ │ │ │ │ ├── Allusion.kt │ │ │ │ │ │ ├── CharDict.kt │ │ │ │ │ │ ├── Clause.kt │ │ │ │ │ │ ├── Comment.kt │ │ │ │ │ │ ├── Quote.kt │ │ │ │ │ │ ├── Tune.kt │ │ │ │ │ │ └── WordDict.kt │ │ │ │ ├── theme │ │ │ │ │ ├── DarkThemeConfig.kt │ │ │ │ │ └── ThemeBrand.kt │ │ │ │ └── traditionalculture │ │ │ │ │ ├── Color.kt │ │ │ │ │ ├── Festival.kt │ │ │ │ │ └── SolarTerm.kt │ │ │ ├── network │ │ │ │ ├── CustomDispatchers.kt │ │ │ │ ├── JvmUnitTestFakeAssetManager.kt │ │ │ │ ├── Network.kt │ │ │ │ ├── NetworkDataSource.kt │ │ │ │ ├── fake │ │ │ │ │ ├── FakeAssetManager.kt │ │ │ │ │ └── FakeNetworkDataSource.kt │ │ │ │ └── retrofit │ │ │ │ │ ├── Api.kt │ │ │ │ │ └── NetworkImpl.kt │ │ │ └── repository │ │ │ │ ├── LinksRepository.kt │ │ │ │ ├── LinksRepositoryImpl.kt │ │ │ │ ├── china │ │ │ │ ├── WorldCultureHeritageRepository.kt │ │ │ │ └── WorldCultureHeritageRepositoryImpl.kt │ │ │ │ ├── chinese │ │ │ │ ├── AntitheticalCoupletRepository.kt │ │ │ │ ├── AntitheticalCoupletRepositoryImpl.kt │ │ │ │ ├── CharacterRepository.kt │ │ │ │ ├── CharacterRepositoryImpl.kt │ │ │ │ ├── ExpressionRepository.kt │ │ │ │ ├── ExpressionRepositoryImpl.kt │ │ │ │ ├── IdiomRepository.kt │ │ │ │ ├── IdiomRepositoryImpl.kt │ │ │ │ ├── KnowledgeRepository.kt │ │ │ │ ├── KnowledgeRepositoryImpl.kt │ │ │ │ ├── LyricRepository.kt │ │ │ │ ├── LyricRepositoryImpl.kt │ │ │ │ ├── ModernPoetryRepository.kt │ │ │ │ ├── ModernPoetryRepositoryImpl.kt │ │ │ │ ├── ProverbRepository.kt │ │ │ │ ├── ProverbRepositoryImpl.kt │ │ │ │ ├── QuoteRepository.kt │ │ │ │ ├── QuoteRepositoryImpl.kt │ │ │ │ ├── RiddleRepository.kt │ │ │ │ ├── RiddleRepositoryImpl.kt │ │ │ │ ├── TongueTwisterRepository.kt │ │ │ │ ├── TongueTwisterRepositoryImpl.kt │ │ │ │ ├── WisecrackRepository.kt │ │ │ │ └── WisecrackRepositoryImpl.kt │ │ │ │ ├── classicalliterature │ │ │ │ ├── ClassicPoemRepository.kt │ │ │ │ ├── ClassicPoemRepositoryImpl.kt │ │ │ │ ├── PeopleRepository.kt │ │ │ │ ├── PeopleRepositoryImpl.kt │ │ │ │ ├── SentenceRepository.kt │ │ │ │ ├── SentenceRepositoryImpl.kt │ │ │ │ ├── WritingRepository.kt │ │ │ │ └── WritingRepositoryImpl.kt │ │ │ │ ├── settings │ │ │ │ ├── HomeItemRepository.kt │ │ │ │ ├── HomeItemRepositoryImpl.kt │ │ │ │ ├── ImportRepository.kt │ │ │ │ ├── ImportRepositoryImpl.kt │ │ │ │ ├── NetworkDatasourceRepository.kt │ │ │ │ ├── NetworkDatasourceRepositoryImpl.kt │ │ │ │ ├── PreferenceRepository.kt │ │ │ │ ├── PreferenceRepositoryImpl.kt │ │ │ │ ├── ThemeRepository.kt │ │ │ │ └── ThemeRepositoryImpl.kt │ │ │ │ └── traditionalculture │ │ │ │ ├── ColorRepository.kt │ │ │ │ ├── ColorRepositoryImpl.kt │ │ │ │ ├── FestivalRepository.kt │ │ │ │ ├── FestivalRepositoryImpl.kt │ │ │ │ ├── SolarTermsRepository.kt │ │ │ │ └── SolarTermsRepositoryImpl.kt │ │ │ ├── di │ │ │ ├── AppModule.kt │ │ │ ├── CoroutineDispatcherModule.kt │ │ │ ├── CoroutineQualifier.kt │ │ │ ├── CoroutineScopesModule.kt │ │ │ ├── DataModule.kt │ │ │ ├── DatabaseModule.kt │ │ │ ├── DispatchersModule.kt │ │ │ ├── NetworkDatasourceModule.kt │ │ │ └── NetworkModule.kt │ │ │ ├── route │ │ │ └── AppNavHost.kt │ │ │ ├── ui │ │ │ ├── component │ │ │ │ ├── BackgroundTitle.kt │ │ │ │ ├── CaptureScaffold.kt │ │ │ │ ├── SimpleScaffold.kt │ │ │ │ ├── SimpleSearchScaffold.kt │ │ │ │ └── webview │ │ │ │ │ ├── JavaScriptInterface.kt │ │ │ │ │ ├── RYWebView.kt │ │ │ │ │ ├── WebViewClient.kt │ │ │ │ │ ├── WebViewHtml.kt │ │ │ │ │ ├── WebViewLayout.kt │ │ │ │ │ ├── WebViewScript.kt │ │ │ │ │ └── WebViewStyle.kt │ │ │ ├── screen │ │ │ │ ├── ReaderImageScreen.kt │ │ │ │ ├── china │ │ │ │ │ └── worldcultureheritage │ │ │ │ │ │ ├── WorldCultureHeritageIndexScreen.kt │ │ │ │ │ │ ├── WorldCultureHeritageIndexViewModel.kt │ │ │ │ │ │ ├── WorldCultureHeritageShowScreen.kt │ │ │ │ │ │ ├── WorldCultureHeritageShowViewModel.kt │ │ │ │ │ │ └── nav │ │ │ │ │ │ ├── WorldCultureHeritageIndexNav.kt │ │ │ │ │ │ └── WorldCultureHeritageShowNav.kt │ │ │ │ ├── chinese │ │ │ │ │ ├── antitheticalcouplet │ │ │ │ │ │ ├── AntitheticalCoupletBookmarksScreen.kt │ │ │ │ │ │ ├── AntitheticalCoupletBookmarksViewModel.kt │ │ │ │ │ │ ├── AntitheticalCoupletCaptureScreen.kt │ │ │ │ │ │ ├── AntitheticalCoupletCaptureViewModel.kt │ │ │ │ │ │ ├── AntitheticalCoupletIndexScreen.kt │ │ │ │ │ │ ├── AntitheticalCoupletIndexViewModel.kt │ │ │ │ │ │ ├── AntitheticalCoupletReadScreen.kt │ │ │ │ │ │ ├── AntitheticalCoupletReadViewModel.kt │ │ │ │ │ │ ├── AntitheticalCoupletSearchScreen.kt │ │ │ │ │ │ ├── AntitheticalCoupletSearchViewModel.kt │ │ │ │ │ │ ├── AntitheticalCoupletShowScreen.kt │ │ │ │ │ │ ├── AntitheticalCoupletShowViewModel.kt │ │ │ │ │ │ ├── components │ │ │ │ │ │ │ └── AntitheticalCoupletPanel.kt │ │ │ │ │ │ └── nav │ │ │ │ │ │ │ ├── AntitheticalCoupletBookmarksNav.kt │ │ │ │ │ │ │ ├── AntitheticalCoupletCaptureNav.kt │ │ │ │ │ │ │ ├── AntitheticalCoupletIndexNav.kt │ │ │ │ │ │ │ ├── AntitheticalCoupletReadNav.kt │ │ │ │ │ │ │ ├── AntitheticalCoupletSearchNav.kt │ │ │ │ │ │ │ └── AntitheticalCoupletShowNav.kt │ │ │ │ │ ├── character │ │ │ │ │ │ ├── CharacterBookmarksScreen.kt │ │ │ │ │ │ ├── CharacterBookmarksViewModel.kt │ │ │ │ │ │ ├── CharacterIndexScreen.kt │ │ │ │ │ │ ├── CharacterPinyinIndexScreen.kt │ │ │ │ │ │ ├── CharacterPinyinIndexViewModel.kt │ │ │ │ │ │ ├── CharacterRadicalIndexViewModel.kt │ │ │ │ │ │ ├── CharacterRadicalndexScreen.kt │ │ │ │ │ │ ├── CharacterSearchListScreen.kt │ │ │ │ │ │ ├── CharacterSearchListViewModel.kt │ │ │ │ │ │ ├── CharacterShowScreen.kt │ │ │ │ │ │ ├── CharacterShowViewModel.kt │ │ │ │ │ │ ├── CharacterStrokeIndexViewModel.kt │ │ │ │ │ │ ├── CharacterStrokeScreen.kt │ │ │ │ │ │ ├── CharacterStrokelndexScreen.kt │ │ │ │ │ │ └── nav │ │ │ │ │ │ │ ├── CharacterBookmarksNav.kt │ │ │ │ │ │ │ ├── CharacterIndexNav.kt │ │ │ │ │ │ │ ├── CharacterPinyinIndexNav.kt │ │ │ │ │ │ │ ├── CharacterRadicalIndexNav.kt │ │ │ │ │ │ │ ├── CharacterSearchListNav.kt │ │ │ │ │ │ │ ├── CharacterShowNav.kt │ │ │ │ │ │ │ ├── CharacterStrokeIndexNav.kt │ │ │ │ │ │ │ └── CharacterStrokeNav.kt │ │ │ │ │ ├── expression │ │ │ │ │ │ ├── ExpressionBookmarksScreen.kt │ │ │ │ │ │ ├── ExpressionBookmarksViewModel.kt │ │ │ │ │ │ ├── ExpressionIndexScreen.kt │ │ │ │ │ │ ├── ExpressionIndexViewModel.kt │ │ │ │ │ │ ├── ExpressionSearchScreen.kt │ │ │ │ │ │ ├── ExpressionSearchViewModel.kt │ │ │ │ │ │ ├── ExpressionShowScreen.kt │ │ │ │ │ │ ├── ExpressionShowViewModel.kt │ │ │ │ │ │ ├── components │ │ │ │ │ │ │ └── ExpressionPanel.kt │ │ │ │ │ │ └── nav │ │ │ │ │ │ │ ├── ExpressionBookmarksNav.kt │ │ │ │ │ │ │ ├── ExpressionIndexNav.kt │ │ │ │ │ │ │ ├── ExpressionSearchNav.kt │ │ │ │ │ │ │ └── ExpressionShowNav.kt │ │ │ │ │ ├── idiom │ │ │ │ │ │ ├── IdiomBookmarksScreen.kt │ │ │ │ │ │ ├── IdiomBookmarksViewModel.kt │ │ │ │ │ │ ├── IdiomCaptureScreen.kt │ │ │ │ │ │ ├── IdiomCaptureViewModel.kt │ │ │ │ │ │ ├── IdiomIndexScreen.kt │ │ │ │ │ │ ├── IdiomIndexViewModel.kt │ │ │ │ │ │ ├── IdiomReadScreen.kt │ │ │ │ │ │ ├── IdiomReadViewModel.kt │ │ │ │ │ │ ├── IdiomSearchScreen.kt │ │ │ │ │ │ ├── IdiomSearchViewModel.kt │ │ │ │ │ │ ├── IdiomShowScreen.kt │ │ │ │ │ │ ├── IdiomShowViewModel.kt │ │ │ │ │ │ ├── components │ │ │ │ │ │ │ └── IdiomPanel.kt │ │ │ │ │ │ └── nav │ │ │ │ │ │ │ ├── IdiomBookmarksNav.kt │ │ │ │ │ │ │ ├── IdiomCaptureNav.kt │ │ │ │ │ │ │ ├── IdiomIndexNav.kt │ │ │ │ │ │ │ ├── IdiomReadNav.kt │ │ │ │ │ │ │ ├── IdiomSearchNav.kt │ │ │ │ │ │ │ └── IdiomShowNav.kt │ │ │ │ │ ├── knowledge │ │ │ │ │ │ ├── KnowledgeBookmarksScreen.kt │ │ │ │ │ │ ├── KnowledgeBookmarksViewModel.kt │ │ │ │ │ │ ├── KnowledgeIndexScreen.kt │ │ │ │ │ │ ├── KnowledgeIndexViewModel.kt │ │ │ │ │ │ ├── KnowledgeReadScreen.kt │ │ │ │ │ │ ├── KnowledgeReadViewModel.kt │ │ │ │ │ │ ├── KnowledgeSearchScreen.kt │ │ │ │ │ │ ├── KnowledgeSearchViewModel.kt │ │ │ │ │ │ ├── KnowledgeShowScreen.kt │ │ │ │ │ │ ├── KnowledgeShowViewModel.kt │ │ │ │ │ │ ├── components │ │ │ │ │ │ │ └── KnowledgePanel.kt │ │ │ │ │ │ └── nav │ │ │ │ │ │ │ ├── KnowledgeBookmarksNav.kt │ │ │ │ │ │ │ ├── KnowledgeIndexNav.kt │ │ │ │ │ │ │ ├── KnowledgeReadNav.kt │ │ │ │ │ │ │ ├── KnowledgeSearchNav.kt │ │ │ │ │ │ │ └── KnowledgeShowNav.kt │ │ │ │ │ ├── lyric │ │ │ │ │ │ ├── LyricBookmarksScreen.kt │ │ │ │ │ │ ├── LyricBookmarksViewModel.kt │ │ │ │ │ │ ├── LyricIndexScreen.kt │ │ │ │ │ │ ├── LyricIndexViewModel.kt │ │ │ │ │ │ ├── LyricReadScreen.kt │ │ │ │ │ │ ├── LyricReadViewModel.kt │ │ │ │ │ │ ├── LyricSearchScreen.kt │ │ │ │ │ │ ├── LyricSearchViewModel.kt │ │ │ │ │ │ ├── LyricShowScreen.kt │ │ │ │ │ │ ├── LyricShowViewModel.kt │ │ │ │ │ │ ├── components │ │ │ │ │ │ │ └── LyricPanel.kt │ │ │ │ │ │ └── nav │ │ │ │ │ │ │ ├── LyricBookmarksNav.kt │ │ │ │ │ │ │ ├── LyricIndexNav.kt │ │ │ │ │ │ │ ├── LyricReadNav.kt │ │ │ │ │ │ │ ├── LyricSearchNav.kt │ │ │ │ │ │ │ └── LyricShowNav.kt │ │ │ │ │ ├── poetry │ │ │ │ │ │ ├── ModernPoetryBookmarksScreen.kt │ │ │ │ │ │ ├── ModernPoetryBookmarksViewModel.kt │ │ │ │ │ │ ├── ModernPoetryIndexScreen.kt │ │ │ │ │ │ ├── ModernPoetryIndexViewModel.kt │ │ │ │ │ │ ├── ModernPoetryReadScreen.kt │ │ │ │ │ │ ├── ModernPoetryReadViewModel.kt │ │ │ │ │ │ ├── ModernPoetrySearchScreen.kt │ │ │ │ │ │ ├── ModernPoetrySearchViewModel.kt │ │ │ │ │ │ ├── ModernPoetryShowScreen.kt │ │ │ │ │ │ ├── ModernPoetryShowViewModel.kt │ │ │ │ │ │ ├── components │ │ │ │ │ │ │ └── ModernPoetryPanel.kt │ │ │ │ │ │ └── nav │ │ │ │ │ │ │ ├── ModernPoetryBookmarksNav.kt │ │ │ │ │ │ │ ├── ModernPoetryIndexNav.kt │ │ │ │ │ │ │ ├── ModernPoetryReadNav.kt │ │ │ │ │ │ │ ├── ModernPoetrySearchNav.kt │ │ │ │ │ │ │ └── ModernPoetryShowNav.kt │ │ │ │ │ ├── proverb │ │ │ │ │ │ ├── ProverbBookmarksScreen.kt │ │ │ │ │ │ ├── ProverbBookmarksViewModel.kt │ │ │ │ │ │ ├── ProverbIndexScreen.kt │ │ │ │ │ │ ├── ProverbIndexViewModel.kt │ │ │ │ │ │ ├── ProverbReadScreen.kt │ │ │ │ │ │ ├── ProverbReadViewModel.kt │ │ │ │ │ │ ├── ProverbSearchScreen.kt │ │ │ │ │ │ ├── ProverbSearchViewModel.kt │ │ │ │ │ │ ├── ProverbShowScreen.kt │ │ │ │ │ │ ├── ProverbShowViewModel.kt │ │ │ │ │ │ ├── components │ │ │ │ │ │ │ └── ProverbPanel.kt │ │ │ │ │ │ └── nav │ │ │ │ │ │ │ ├── ProverbBookmarksNav.kt │ │ │ │ │ │ │ ├── ProverbIndexNav.kt │ │ │ │ │ │ │ ├── ProverbReadNav.kt │ │ │ │ │ │ │ ├── ProverbSearchNav.kt │ │ │ │ │ │ │ └── ProverbShowNav.kt │ │ │ │ │ ├── quote │ │ │ │ │ │ ├── QuoteBookmarksScreen.kt │ │ │ │ │ │ ├── QuoteBookmarksViewModel.kt │ │ │ │ │ │ ├── QuoteIndexScreen.kt │ │ │ │ │ │ ├── QuoteIndexViewModel.kt │ │ │ │ │ │ ├── QuoteReadScreen.kt │ │ │ │ │ │ ├── QuoteReadViewModel.kt │ │ │ │ │ │ ├── QuoteSearchScreen.kt │ │ │ │ │ │ ├── QuoteSearchViewModel.kt │ │ │ │ │ │ ├── QuoteShowScreen.kt │ │ │ │ │ │ ├── QuoteShowViewModel.kt │ │ │ │ │ │ ├── components │ │ │ │ │ │ │ └── QuotePanel.kt │ │ │ │ │ │ └── nav │ │ │ │ │ │ │ ├── QuoteBookmarksNav.kt │ │ │ │ │ │ │ ├── QuoteIndexNav.kt │ │ │ │ │ │ │ ├── QuoteReadNav.kt │ │ │ │ │ │ │ ├── QuoteSearchNav.kt │ │ │ │ │ │ │ └── QuoteShowNav.kt │ │ │ │ │ ├── riddle │ │ │ │ │ │ ├── RiddleIndexScreen.kt │ │ │ │ │ │ ├── RiddleIndexViewModel.kt │ │ │ │ │ │ ├── RiddleInfoScreen.kt │ │ │ │ │ │ ├── RiddleReadScreen.kt │ │ │ │ │ │ ├── RiddleReadViewModel.kt │ │ │ │ │ │ ├── RiddleSearchScreen.kt │ │ │ │ │ │ ├── RiddleSearchViewModel.kt │ │ │ │ │ │ └── nav │ │ │ │ │ │ │ ├── RiddleIndexNav.kt │ │ │ │ │ │ │ ├── RiddleInfoNav.kt │ │ │ │ │ │ │ ├── RiddleReadNav.kt │ │ │ │ │ │ │ └── RiddleSearchNav.kt │ │ │ │ │ ├── tonguetwister │ │ │ │ │ │ ├── TongueTwisterIndexScreen.kt │ │ │ │ │ │ ├── TongueTwisterIndexViewModel.kt │ │ │ │ │ │ ├── TongueTwisterShowScreen.kt │ │ │ │ │ │ ├── TongueTwisterShowViewModel.kt │ │ │ │ │ │ └── nav │ │ │ │ │ │ │ ├── TongueTwisterIndexNav.kt │ │ │ │ │ │ │ └── TongueTwisterShowNav.kt │ │ │ │ │ └── wisecrack │ │ │ │ │ │ ├── WisecrackBookmarksScreen.kt │ │ │ │ │ │ ├── WisecrackBookmarksViewModel.kt │ │ │ │ │ │ ├── WisecrackCaptureScreen.kt │ │ │ │ │ │ ├── WisecrackCaptureViewModel.kt │ │ │ │ │ │ ├── WisecrackIndexScreen.kt │ │ │ │ │ │ ├── WisecrackIndexViewModel.kt │ │ │ │ │ │ ├── WisecrackReadScreen.kt │ │ │ │ │ │ ├── WisecrackReadViewModel.kt │ │ │ │ │ │ ├── WisecrackSearchScreen.kt │ │ │ │ │ │ ├── WisecrackSearchViewModel.kt │ │ │ │ │ │ ├── WisecrackShowScreen.kt │ │ │ │ │ │ ├── WisecrackShowViewModel.kt │ │ │ │ │ │ ├── components │ │ │ │ │ │ └── WisecrackShowPanel.kt │ │ │ │ │ │ └── nav │ │ │ │ │ │ ├── WisecrackBookmarksNav.kt │ │ │ │ │ │ ├── WisecrackCaptureNav.kt │ │ │ │ │ │ ├── WisecrackIndexNav.kt │ │ │ │ │ │ ├── WisecrackReadNav.kt │ │ │ │ │ │ ├── WisecrackSearchNav.kt │ │ │ │ │ │ └── WisecrackShowNav.kt │ │ │ │ ├── classicalliterature │ │ │ │ │ ├── classicpoem │ │ │ │ │ │ ├── ClassicPoemBookmarksScreen.kt │ │ │ │ │ │ ├── ClassicPoemBookmarksViewModel.kt │ │ │ │ │ │ ├── ClassicPoemIndexScreen.kt │ │ │ │ │ │ ├── ClassicPoemIndexViewModel.kt │ │ │ │ │ │ ├── ClassicPoemReadScreen.kt │ │ │ │ │ │ ├── ClassicPoemReadViewModel.kt │ │ │ │ │ │ ├── ClassicPoemSearchScreen.kt │ │ │ │ │ │ ├── ClassicPoemSearchScreenViewModel.kt │ │ │ │ │ │ ├── ClassicPoemShowScreen.kt │ │ │ │ │ │ ├── ClassicPoemShowViewModel.kt │ │ │ │ │ │ ├── components │ │ │ │ │ │ │ └── ClassicPoemPanel.kt │ │ │ │ │ │ └── nav │ │ │ │ │ │ │ ├── ClassicPoemBookmarksNav.kt │ │ │ │ │ │ │ ├── ClassicPoemIndexNav.kt │ │ │ │ │ │ │ ├── ClassicPoemReadNav.kt │ │ │ │ │ │ │ ├── ClassicPoemSearchNav.kt │ │ │ │ │ │ │ └── ClassicPoemShowNav.kt │ │ │ │ │ ├── people │ │ │ │ │ │ ├── PeopleIndexViewModel.kt │ │ │ │ │ │ ├── PeopleSearchScreen.kt │ │ │ │ │ │ ├── PeopleSearchViewModel.kt │ │ │ │ │ │ ├── PeopleShowViewModel.kt │ │ │ │ │ │ ├── PoepleIndexScreen.kt │ │ │ │ │ │ ├── PoepleShowScreen.kt │ │ │ │ │ │ ├── components │ │ │ │ │ │ │ └── PeoplePanel.kt │ │ │ │ │ │ └── nav │ │ │ │ │ │ │ ├── PeopleIndexNav.kt │ │ │ │ │ │ │ ├── PeopleSearchNav.kt │ │ │ │ │ │ │ └── PoepleShowNav.kt │ │ │ │ │ ├── sentence │ │ │ │ │ │ ├── SentenceBookmarksScreen.kt │ │ │ │ │ │ ├── SentenceBookmarksViewModel.kt │ │ │ │ │ │ ├── SentenceCaptureScreen.kt │ │ │ │ │ │ ├── SentenceCaptureViewModel.kt │ │ │ │ │ │ ├── SentenceIndexScreen.kt │ │ │ │ │ │ ├── SentenceIndexViewModel.kt │ │ │ │ │ │ ├── SentenceReadScreen.kt │ │ │ │ │ │ ├── SentenceReadViewModel.kt │ │ │ │ │ │ ├── SentenceSearchScreen.kt │ │ │ │ │ │ ├── SentenceSearchViewModel.kt │ │ │ │ │ │ └── nav │ │ │ │ │ │ │ ├── SentenceBookmarksNav.kt │ │ │ │ │ │ │ ├── SentenceCaptureNav.kt │ │ │ │ │ │ │ ├── SentenceIndexNav.kt │ │ │ │ │ │ │ ├── SentenceReadNav.kt │ │ │ │ │ │ │ └── SentenceSearchNav.kt │ │ │ │ │ └── writing │ │ │ │ │ │ ├── WritingBookmarksScreen.kt │ │ │ │ │ │ ├── WritingBookmarksViewModel.kt │ │ │ │ │ │ ├── WritingCaptureScreen.kt │ │ │ │ │ │ ├── WritingCaptureViewModel.kt │ │ │ │ │ │ ├── WritingIndexScreen.kt │ │ │ │ │ │ ├── WritingIndexViewModel.kt │ │ │ │ │ │ ├── WritingReadScreen.kt │ │ │ │ │ │ ├── WritingReadViewModel.kt │ │ │ │ │ │ ├── WritingSearchScreen.kt │ │ │ │ │ │ ├── WritingSearchViewModel.kt │ │ │ │ │ │ ├── WritingShowScreen.kt │ │ │ │ │ │ ├── WritingShowViewModel.kt │ │ │ │ │ │ ├── components │ │ │ │ │ │ └── WritingPanel.kt │ │ │ │ │ │ └── nav │ │ │ │ │ │ ├── WritingBookmarksNav.kt │ │ │ │ │ │ ├── WritingCaptureNav.kt │ │ │ │ │ │ ├── WritingIndexNav.kt │ │ │ │ │ │ ├── WritingReadNav.kt │ │ │ │ │ │ ├── WritingSearchNav.kt │ │ │ │ │ │ └── WritingShowNav.kt │ │ │ │ ├── home │ │ │ │ │ ├── HomeScreen.kt │ │ │ │ │ ├── HomeViewModel.kt │ │ │ │ │ └── nav │ │ │ │ │ │ └── HomeNav.kt │ │ │ │ ├── link │ │ │ │ │ ├── LinkIndexScreen.kt │ │ │ │ │ ├── LinkIndexViewModel.kt │ │ │ │ │ └── nav │ │ │ │ │ │ └── LinkIndexNav.kt │ │ │ │ ├── settings │ │ │ │ │ ├── AboutScreen.kt │ │ │ │ │ ├── HomeItemManagerScreen.kt │ │ │ │ │ ├── HomeItemManagerViewModel.kt │ │ │ │ │ ├── ImportDataScreen.kt │ │ │ │ │ ├── ImportDataViewModel.kt │ │ │ │ │ ├── PrivacyScreen.kt │ │ │ │ │ ├── SettingsScreen.kt │ │ │ │ │ ├── SyncDataScreen.kt │ │ │ │ │ ├── SyncDataViewModel.kt │ │ │ │ │ ├── ThemeDialog.kt │ │ │ │ │ ├── ThemeDialogViewModel.kt │ │ │ │ │ ├── components │ │ │ │ │ │ └── SettingsTitle.kt │ │ │ │ │ └── nav │ │ │ │ │ │ ├── AboutNav.kt │ │ │ │ │ │ ├── DataNav.kt │ │ │ │ │ │ ├── HomeItemManagerNav.kt │ │ │ │ │ │ ├── ImportNav.kt │ │ │ │ │ │ ├── PrivacyNav.kt │ │ │ │ │ │ └── SettingsNav.kt │ │ │ │ └── traditionalculture │ │ │ │ │ ├── calendar │ │ │ │ │ ├── CalendarIndexScreen.kt │ │ │ │ │ └── nav │ │ │ │ │ │ └── CalendarIndexNav.kt │ │ │ │ │ ├── color │ │ │ │ │ ├── ColorIndexScreen.kt │ │ │ │ │ ├── ColorIndexViewModel.kt │ │ │ │ │ ├── ColorShowScreen.kt │ │ │ │ │ ├── ColorShowViewModel.kt │ │ │ │ │ └── nav │ │ │ │ │ │ ├── ColorIndexNav.kt │ │ │ │ │ │ └── ColorShowNav.kt │ │ │ │ │ ├── festival │ │ │ │ │ ├── FestivalIndexScreen.kt │ │ │ │ │ ├── FestivalIndexViewModel.kt │ │ │ │ │ ├── FestivalScreen.kt │ │ │ │ │ ├── FestivalViewModel.kt │ │ │ │ │ └── nav │ │ │ │ │ │ ├── FestivalIndexNav.kt │ │ │ │ │ │ └── FestivalShowNav.kt │ │ │ │ │ └── solarterm │ │ │ │ │ ├── SolarTermIndex.kt │ │ │ │ │ ├── SolarTermIndexViewModel.kt │ │ │ │ │ ├── SolarTermShowScreen.kt │ │ │ │ │ ├── SolarTermShowViewModel.kt │ │ │ │ │ └── nav │ │ │ │ │ ├── SolarTermIndexNav.kt │ │ │ │ │ └── SolarTermShowNav.kt │ │ │ └── theme │ │ │ │ ├── Background.kt │ │ │ │ ├── Color.kt │ │ │ │ ├── Gradient.kt │ │ │ │ ├── Theme.kt │ │ │ │ ├── Tint.kt │ │ │ │ └── Type.kt │ │ │ └── widgets │ │ │ ├── ChineseIdiomWidget.kt │ │ │ ├── ClassicalLiteraturePoemWidget.kt │ │ │ └── ClassicalLiteratureSentenceWidget.kt │ ├── proto │ │ └── user_preferences.proto │ └── res │ │ ├── drawable-anydpi │ │ └── ic_actionbar_tab.xml │ │ ├── drawable-hdpi │ │ └── ic_actionbar_tab.png │ │ ├── drawable-mdpi │ │ └── ic_actionbar_tab.png │ │ ├── drawable-night │ │ ├── ic_logo.xml │ │ └── ic_splash.xml │ │ ├── drawable-xhdpi │ │ └── ic_actionbar_tab.png │ │ ├── drawable-xxhdpi │ │ └── ic_actionbar_tab.png │ │ ├── drawable │ │ ├── ic_launcher_foreground.xml │ │ ├── ic_logo.xml │ │ ├── ic_nowinlife.jpg │ │ ├── ic_nowinlife_black.png │ │ ├── ic_nowinlife_white.png │ │ ├── ic_splash.xml │ │ ├── widget_idiom_preview.png │ │ ├── widget_poem_preview.png │ │ └── widget_poem_sentence_preview.png │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── values │ │ ├── colors.xml │ │ ├── ic_launcher_background.xml │ │ ├── strings.xml │ │ └── themes.xml │ │ └── xml │ │ ├── backup_rules.xml │ │ ├── data_extraction_rules.xml │ │ ├── idiom_widget_info.xml │ │ ├── network_security_config.xml │ │ ├── poem_sentence_widget_info.xml │ │ └── poem_widget_info.xml │ └── test │ └── java │ └── com │ └── hefengbao │ └── jingmo │ └── ExampleUnitTest.kt ├── build.gradle.kts ├── gradle.properties ├── gradle ├── libs.versions.toml └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── screenshot ├── 1.png ├── 2.png ├── alipay.jpg ├── d │ └── 1.jpg ├── logo.png ├── v1.13.0.png ├── v1.14.0.png ├── wechatpay.png └── 公众号.png └── settings.gradle.kts /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea 5 | .DS_Store 6 | /build 7 | /captures 8 | .externalNativeBuild 9 | .cxx 10 | local.properties 11 | keystore.properties 12 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /release -------------------------------------------------------------------------------- /app/src/androidTest/java/com/hefengbao/jingmo/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.hefengbao.jingmo 2 | 3 | import androidx.test.ext.junit.runners.AndroidJUnit4 4 | import androidx.test.platform.app.InstrumentationRegistry 5 | import org.junit.Assert.* 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | /** 10 | * Instrumented test, which will execute on an Android device. 11 | * 12 | * See [testing documentation](http://d.android.com/tools/testing). 13 | */ 14 | @RunWith(AndroidJUnit4::class) 15 | class ExampleInstrumentedTest { 16 | @Test 17 | fun useAppContext() { 18 | // Context of the app under test. 19 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 20 | assertEquals("com.hefengbao.wenqu", appContext.packageName) 21 | } 22 | } -------------------------------------------------------------------------------- /app/src/debug/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 京墨Debug 4 | -------------------------------------------------------------------------------- /app/src/main/assets/hanzi/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/app/src/main/assets/hanzi/bg.png -------------------------------------------------------------------------------- /app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/App.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo 11 | 12 | import android.app.Application 13 | import com.tencent.bugly.crashreport.CrashReport 14 | import dagger.hilt.android.HiltAndroidApp 15 | 16 | @HiltAndroidApp 17 | class App : Application() { 18 | override fun onCreate() { 19 | super.onCreate() 20 | 21 | CrashReport.initCrashReport(applicationContext, "f75198f767", BuildConfig.DEBUG) 22 | } 23 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/base/BaseViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.base 11 | 12 | import androidx.lifecycle.ViewModel 13 | 14 | open class BaseViewModel : ViewModel() -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/common/Constant.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.common 11 | 12 | object Constant { 13 | const val DB_NAME = "jingmo.db" 14 | const val DATASTORE_NAME = "jingmo" 15 | const val DATASTORE_DATASET_NAME = "jingmo_dataset" 16 | const val DATASTORE_READ_STATUS_NAME = "jingmo_read_status" 17 | const val DATASTORE_HOME = "jingmo_home" 18 | 19 | const val URI = "https://hefengbao.github.io/jingmo" 20 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/common/ElevationTokens.kt: -------------------------------------------------------------------------------- 1 | package com.hefengbao.jingmo.common 2 | 3 | object ElevationTokens { 4 | 5 | const val Level0 = 0 6 | const val Level1 = 1 7 | const val Level2 = 3 8 | const val Level3 = 6 9 | const val Level4 = 8 10 | const val Level5 = 12 11 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/common/network/AppDispatchers.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.common.network 11 | 12 | import javax.inject.Qualifier 13 | import kotlin.annotation.AnnotationRetention.RUNTIME 14 | 15 | @Qualifier 16 | @Retention(RUNTIME) 17 | annotation class Dispatcher(val dispatcher: AppDispatchers) 18 | 19 | enum class AppDispatchers { 20 | Default, 21 | IO, 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/common/network/Result.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.common.network 11 | 12 | import kotlinx.coroutines.flow.Flow 13 | import kotlinx.coroutines.flow.catch 14 | import kotlinx.coroutines.flow.map 15 | import kotlinx.coroutines.flow.onStart 16 | 17 | sealed interface Result { 18 | data class Success(val data: T) : Result 19 | data class Error(val exception: Throwable? = null) : Result 20 | object Loading : Result 21 | } 22 | 23 | fun Flow.asResult(): Flow> { 24 | return this 25 | .map> { 26 | Result.Success(it) 27 | } 28 | .onStart { emit(Result.Loading) } 29 | .catch { emit(Result.Error(it)) } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/common/network/SafeApiCall.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.common.network 11 | 12 | import kotlinx.coroutines.CancellationException 13 | import kotlinx.coroutines.Dispatchers 14 | import kotlinx.coroutines.withContext 15 | 16 | interface SafeApiCall { 17 | suspend fun safeApiCall( 18 | apiCall: suspend () -> T 19 | ): Result { 20 | return withContext(Dispatchers.IO) { 21 | try { 22 | Result.Success(apiCall.invoke()) 23 | } catch (cancellationException: CancellationException) { 24 | throw cancellationException 25 | } catch (throwable: Throwable) { 26 | Result.Error(throwable) 27 | } 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/common/network/di/DispatchersModule.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.common.network.di 11 | 12 | import com.hefengbao.jingmo.common.network.AppDispatchers.Default 13 | import com.hefengbao.jingmo.common.network.AppDispatchers.IO 14 | import com.hefengbao.jingmo.common.network.Dispatcher 15 | import dagger.Module 16 | import dagger.Provides 17 | import dagger.hilt.InstallIn 18 | import dagger.hilt.components.SingletonComponent 19 | import kotlinx.coroutines.CoroutineDispatcher 20 | import kotlinx.coroutines.Dispatchers 21 | 22 | @Module 23 | @InstallIn(SingletonComponent::class) 24 | object DispatchersModule { 25 | @Provides 26 | @Dispatcher(IO) 27 | fun providesIODispatcher(): CoroutineDispatcher = Dispatchers.IO 28 | 29 | @Provides 30 | @Dispatcher(Default) 31 | fun providesDefaultDispatcher(): CoroutineDispatcher = Dispatchers.Default 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/china/WorldCulturalHeritageEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.china 11 | 12 | import androidx.room.Entity 13 | import androidx.room.PrimaryKey 14 | 15 | @Entity(tableName = "china_world_cultural_heritage") 16 | data class WorldCulturalHeritageEntity( 17 | @PrimaryKey 18 | val id: Int, 19 | val name: String, 20 | val year: String, 21 | val year2: String?, 22 | val level: String, 23 | val address: String, 24 | val image: String, 25 | val content: String 26 | ) 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/AntitheticalCoupletCollectionEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.chinese 11 | 12 | import androidx.room.ColumnInfo 13 | import androidx.room.Entity 14 | import androidx.room.Index 15 | import androidx.room.PrimaryKey 16 | 17 | /** 18 | * 对联书签 19 | */ 20 | @Entity(tableName = "chinese_antithetical_couplet_collections", indices = [Index("collected_at")]) 21 | data class AntitheticalCoupletCollectionEntity( 22 | @PrimaryKey 23 | val id: Int 24 | ) { 25 | @ColumnInfo(name = "collected_at") 26 | var collectedAt: Long = System.currentTimeMillis() 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/AntitheticalCoupletEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.chinese 11 | 12 | import androidx.room.Entity 13 | import androidx.room.PrimaryKey 14 | 15 | @Entity(tableName = "chinese_antithetical_couplets") 16 | data class AntitheticalCoupletEntity( 17 | @PrimaryKey 18 | val id: Int, 19 | val body: String, 20 | val description: String?, 21 | val image: String? = null 22 | ) 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/DictionaryCollectionEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.chinese 11 | 12 | import androidx.room.ColumnInfo 13 | import androidx.room.Entity 14 | import androidx.room.Index 15 | import androidx.room.PrimaryKey 16 | 17 | /** 18 | * 字典书签 19 | */ 20 | @Entity(tableName = "dictionary_collections", indices = [Index("collected_at")]) 21 | data class DictionaryCollectionEntity( 22 | @PrimaryKey 23 | val id: Int 24 | ) { 25 | @ColumnInfo(name = "collected_at") 26 | var collectedAt: Long = System.currentTimeMillis() 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/DictionaryEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.chinese 11 | 12 | import androidx.room.ColumnInfo 13 | import androidx.room.Entity 14 | import androidx.room.PrimaryKey 15 | 16 | @Entity(tableName = "dictionary") 17 | data class DictionaryEntity( 18 | @PrimaryKey 19 | val id: Int, 20 | val char: String, 21 | val wubi: String?, 22 | val radical: String?, 23 | val stroke: Int, 24 | val pinyin: String?, 25 | @ColumnInfo("simple_explanation") 26 | val simpleExplanation: String?, 27 | val explanation: String?, 28 | val loanword: Boolean, 29 | ) 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/DictionaryPinyinEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.chinese 11 | 12 | import androidx.room.ColumnInfo 13 | import androidx.room.Entity 14 | import androidx.room.PrimaryKey 15 | 16 | @Entity(tableName = "dictionary_pinyin") 17 | data class DictionaryPinyinEntity( 18 | @PrimaryKey(autoGenerate = true) 19 | val id: Int? = null, 20 | @ColumnInfo("dictionary_id") 21 | val dictionaryId: Int, 22 | val pinyin: String, 23 | ) 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/ExpressionCollectionEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.chinese 11 | 12 | import androidx.room.ColumnInfo 13 | import androidx.room.Entity 14 | import androidx.room.Index 15 | import androidx.room.PrimaryKey 16 | 17 | /** 18 | * 字典书签 19 | */ 20 | @Entity(tableName = "chinese_expression_collections", indices = [Index("collected_at")]) 21 | data class ExpressionCollectionEntity( 22 | @PrimaryKey 23 | val id: Int 24 | ) { 25 | @ColumnInfo(name = "collected_at") 26 | var collectedAt: Long = System.currentTimeMillis() 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/ExpressionEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.chinese 11 | 12 | import androidx.room.Entity 13 | import androidx.room.PrimaryKey 14 | 15 | /** 16 | * 词语 17 | */ 18 | @Entity(tableName = "chinese_expressions") 19 | data class ExpressionEntity( 20 | @PrimaryKey 21 | val id: Int, 22 | val word: String, 23 | val pinyin: String, 24 | val abbr: String? = null, 25 | val explanation: String? = null 26 | ) 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/IdiomCollectionEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.chinese 11 | 12 | import androidx.room.ColumnInfo 13 | import androidx.room.Entity 14 | import androidx.room.Index 15 | import androidx.room.PrimaryKey 16 | 17 | /** 18 | * 成语书签 19 | */ 20 | @Entity(tableName = "idiom_collections", indices = [Index("collected_at")]) 21 | data class IdiomCollectionEntity( 22 | @PrimaryKey 23 | val id: Int 24 | ) { 25 | @ColumnInfo(name = "collected_at") 26 | var collectedAt: Long = System.currentTimeMillis() 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/KnowledgeCollectionEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.chinese 11 | 12 | import androidx.room.ColumnInfo 13 | import androidx.room.Entity 14 | import androidx.room.Index 15 | import androidx.room.PrimaryKey 16 | 17 | /** 18 | * 知识卡片书签 19 | */ 20 | @Entity(tableName = "chinese_knowledge_collections", indices = [Index("collected_at")]) 21 | data class KnowledgeCollectionEntity( 22 | @PrimaryKey 23 | val id: Int 24 | ) { 25 | @ColumnInfo(name = "collected_at") 26 | var collectedAt: Long = System.currentTimeMillis() 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/KnowledgeEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.chinese 11 | 12 | import androidx.room.Entity 13 | import androidx.room.PrimaryKey 14 | 15 | @Entity(tableName = "chinese_knowledge") 16 | data class KnowledgeEntity( 17 | @PrimaryKey 18 | val id: Int, 19 | val content: String, 20 | val label: String, 21 | val url: String?, 22 | ) 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/KnowledgeFtsEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.chinese 11 | 12 | import androidx.room.ColumnInfo 13 | import androidx.room.Entity 14 | import androidx.room.Fts4 15 | import androidx.room.FtsOptions 16 | import androidx.room.PrimaryKey 17 | 18 | @Fts4( 19 | tokenizer = FtsOptions.TOKENIZER_ICU, 20 | contentEntity = KnowledgeEntity::class, 21 | ) 22 | @Entity(tableName = "chinese_knowledge_fts") 23 | data class KnowledgeFtsEntity( 24 | @PrimaryKey 25 | @ColumnInfo("rowid") 26 | val id: Int, 27 | val content: String 28 | ) 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/LyricCollectionEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.chinese 11 | 12 | import androidx.room.ColumnInfo 13 | import androidx.room.Entity 14 | import androidx.room.Index 15 | import androidx.room.PrimaryKey 16 | 17 | /** 18 | * 歌词书签 19 | */ 20 | @Entity(tableName = "lyric_collections", indices = [Index("collected_at")]) 21 | data class LyricCollectionEntity( 22 | @PrimaryKey 23 | val id: Int 24 | ) { 25 | @ColumnInfo(name = "collected_at") 26 | var collectedAt: Long = System.currentTimeMillis() 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/LyricEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.chinese 11 | 12 | import androidx.room.Entity 13 | import androidx.room.PrimaryKey 14 | 15 | @Entity(tableName = "lyrics") 16 | data class LyricEntity( 17 | @PrimaryKey 18 | val id: Int, 19 | val title: String, 20 | val writer: String?, 21 | val singer: String?, 22 | val content: String 23 | ) 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/LyricFtsEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.chinese 11 | 12 | import androidx.room.ColumnInfo 13 | import androidx.room.Entity 14 | import androidx.room.Fts4 15 | import androidx.room.FtsOptions 16 | import androidx.room.PrimaryKey 17 | 18 | @Fts4( 19 | tokenizer = FtsOptions.TOKENIZER_ICU, 20 | contentEntity = LyricEntity::class, 21 | ) 22 | @Entity(tableName = "lyrics_fts") 23 | data class LyricFtsEntity( 24 | @PrimaryKey 25 | @ColumnInfo("rowid") 26 | val id: Int, 27 | val title: String, 28 | val writer: String?, 29 | val singer: String?, 30 | val content: String 31 | ) 32 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/ModernPoetryCollectionEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.chinese 11 | 12 | import androidx.room.ColumnInfo 13 | import androidx.room.Entity 14 | import androidx.room.Index 15 | import androidx.room.PrimaryKey 16 | 17 | @Entity(tableName = "chinese_modern_poetry_collections", indices = [Index("collected_at")]) 18 | data class ModernPoetryCollectionEntity( 19 | @PrimaryKey 20 | val id: Int 21 | ) { 22 | @ColumnInfo(name = "collected_at") 23 | var collectedAt: Long = System.currentTimeMillis() 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/ModernPoetryEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.chinese 11 | 12 | import androidx.room.ColumnInfo 13 | import androidx.room.Entity 14 | import androidx.room.PrimaryKey 15 | 16 | @Entity(tableName = "chinese_modern_poetry") 17 | data class ModernPoetryEntity( 18 | @PrimaryKey 19 | val id: Int, 20 | val title: String, 21 | val author: String, 22 | val content: String, 23 | val zhu: String?, 24 | val yi: String?, 25 | val shang: String?, 26 | @ColumnInfo("author_info") 27 | val authorInfo: String? 28 | ) 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/ModernPoetryFtsEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.chinese 11 | 12 | import androidx.room.ColumnInfo 13 | import androidx.room.Entity 14 | import androidx.room.Fts4 15 | import androidx.room.FtsOptions 16 | import androidx.room.PrimaryKey 17 | 18 | @Fts4( 19 | tokenizer = FtsOptions.TOKENIZER_ICU, 20 | contentEntity = ModernPoetryEntity::class 21 | ) 22 | @Entity(tableName = "chinese_modern_poetry_fts") 23 | data class ModernPoetryFtsEntity( 24 | @PrimaryKey 25 | @ColumnInfo("rowid") 26 | val id: Int, 27 | val content: String 28 | ) 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/ProverbCollectionEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.chinese 11 | 12 | import androidx.room.ColumnInfo 13 | import androidx.room.Entity 14 | import androidx.room.Index 15 | import androidx.room.PrimaryKey 16 | 17 | /** 18 | * 谚语书签 19 | */ 20 | @Entity(tableName = "proverb_collections", indices = [Index("collected_at")]) 21 | data class ProverbCollectionEntity( 22 | @PrimaryKey 23 | val id: Int 24 | ) { 25 | @ColumnInfo(name = "collected_at") 26 | var collectedAt: Long = System.currentTimeMillis() 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/ProverbEntity.kt: -------------------------------------------------------------------------------- 1 | package com.hefengbao.jingmo.data.database.entity.chinese 2 | 3 | import androidx.room.Entity 4 | import androidx.room.PrimaryKey 5 | 6 | @Entity(tableName = "proverbs") 7 | data class ProverbEntity( 8 | @PrimaryKey 9 | val id: Int, 10 | val content: String 11 | ) 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/ProverbFtsEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.chinese 11 | 12 | import androidx.room.ColumnInfo 13 | import androidx.room.Entity 14 | import androidx.room.Fts4 15 | import androidx.room.FtsOptions 16 | import androidx.room.PrimaryKey 17 | 18 | @Fts4( 19 | tokenizer = FtsOptions.TOKENIZER_ICU, 20 | contentEntity = ProverbEntity::class, 21 | ) 22 | @Entity(tableName = "proverbs_fts") 23 | data class ProverbFtsEntity( 24 | @PrimaryKey 25 | @ColumnInfo("rowid") 26 | val id: Int, 27 | val content: String 28 | ) 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/QuoteCollectionEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.chinese 11 | 12 | import androidx.room.ColumnInfo 13 | import androidx.room.Entity 14 | import androidx.room.Index 15 | import androidx.room.PrimaryKey 16 | 17 | /** 18 | * 句子书签 19 | */ 20 | @Entity(tableName = "chinese_quote_collections", indices = [Index("collected_at")]) 21 | data class QuoteCollectionEntity( 22 | @PrimaryKey 23 | val id: Int 24 | ) { 25 | @ColumnInfo(name = "collected_at") 26 | var collectedAt: Long = System.currentTimeMillis() 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/QuoteEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.chinese 11 | 12 | import androidx.room.Entity 13 | import androidx.room.PrimaryKey 14 | 15 | @Entity(tableName = "chinese_quotes") 16 | data class QuoteEntity( 17 | @PrimaryKey 18 | val id: Int, 19 | val content: String, 20 | val author: String, 21 | val from: String 22 | ) 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/QuoteFtsEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.chinese 11 | 12 | import androidx.room.ColumnInfo 13 | import androidx.room.Entity 14 | import androidx.room.Fts4 15 | import androidx.room.FtsOptions 16 | import androidx.room.PrimaryKey 17 | 18 | @Fts4( 19 | tokenizer = FtsOptions.TOKENIZER_ICU, 20 | contentEntity = QuoteEntity::class 21 | ) 22 | @Entity(tableName = "chinese_quotes_fts") 23 | data class QuoteFtsEntity( 24 | @PrimaryKey 25 | @ColumnInfo("rowid") 26 | val id: Int, 27 | val content: String 28 | ) 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/RiddleEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.chinese 11 | 12 | import androidx.room.Entity 13 | import androidx.room.PrimaryKey 14 | 15 | @Entity(tableName = "riddles") 16 | data class RiddleEntity( 17 | @PrimaryKey 18 | val id: Int, 19 | val puzzle: String, 20 | val answer: String 21 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/TongueTwisterEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.chinese 11 | 12 | import androidx.room.Entity 13 | import androidx.room.PrimaryKey 14 | 15 | @Entity(tableName = "tongue_twisters") 16 | data class TongueTwisterEntity( 17 | @PrimaryKey 18 | val id: Int, 19 | val title: String, 20 | val content: String, 21 | val content2: String?, 22 | ) 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/WisecrackCollectionEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.chinese 11 | 12 | import androidx.room.ColumnInfo 13 | import androidx.room.Entity 14 | import androidx.room.Index 15 | import androidx.room.PrimaryKey 16 | 17 | /** 18 | * 歇后语书签 19 | */ 20 | @Entity(tableName = "chinese_wisecrack_collections", indices = [Index("collected_at")]) 21 | data class WisecrackCollectionEntity( 22 | @PrimaryKey 23 | val id: Int 24 | ) { 25 | @ColumnInfo(name = "collected_at") 26 | var collectedAt: Long = System.currentTimeMillis() 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/chinese/WisecrackEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.chinese 11 | 12 | import androidx.room.ColumnInfo 13 | import androidx.room.Entity 14 | import androidx.room.PrimaryKey 15 | 16 | /** 17 | * 歇后语 18 | */ 19 | @Entity("chinese_wisecracks") 20 | data class WisecrackEntity( 21 | @PrimaryKey 22 | val id: Int, 23 | val riddle: String, 24 | val answer: String, 25 | @ColumnInfo(name = "first_word") 26 | val firstWord: String, 27 | @ColumnInfo(name = "first_letter") 28 | val firstLetter: String 29 | ) 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/classicalliterature/ClassicPoemCollectionEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.classicalliterature 11 | 12 | import androidx.room.ColumnInfo 13 | import androidx.room.Entity 14 | import androidx.room.PrimaryKey 15 | 16 | @Entity(tableName = "classic_poem_collections") 17 | data class ClassicPoemCollectionEntity( 18 | @PrimaryKey 19 | val id: Int, 20 | ) { 21 | @ColumnInfo(name = "collected_at") 22 | var collectedAt: Long = System.currentTimeMillis() 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/classicalliterature/ClassicPoemEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.classicalliterature 11 | 12 | import androidx.room.ColumnInfo 13 | import androidx.room.Entity 14 | import androidx.room.PrimaryKey 15 | 16 | /** 17 | * 经典诗文 18 | */ 19 | @Entity(tableName = "classic_poems") 20 | data class ClassicPoemEntity( 21 | @PrimaryKey 22 | val id: Int, 23 | val dynasty: String, 24 | val writer: String, 25 | @ColumnInfo(name = "writer_introduction") 26 | val writerIntroduction: String?, 27 | val title: String, 28 | val subtitle: String?, 29 | val preface: String?, 30 | val content: String, 31 | val annotation: String?, 32 | val translation: String?, 33 | @ColumnInfo(name = "creative_background") 34 | val creativeBackground: String?, 35 | val explain: String?, 36 | val comment: String?, 37 | val collection: String, 38 | val category: String? 39 | ) 40 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/classicalliterature/ClassicPoemFtsEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.classicalliterature 11 | 12 | import androidx.room.ColumnInfo 13 | import androidx.room.Entity 14 | import androidx.room.Fts4 15 | import androidx.room.FtsOptions 16 | import androidx.room.PrimaryKey 17 | 18 | @Fts4( 19 | tokenizer = FtsOptions.TOKENIZER_ICU, 20 | contentEntity = ClassicPoemEntity::class, 21 | ) 22 | @Entity(tableName = "classic_poems_fts") 23 | data class ClassicPoemFtsEntity( 24 | @PrimaryKey 25 | @ColumnInfo("rowid") 26 | val id: Int, 27 | val writer: String, 28 | val title: String, 29 | val content: String, 30 | ) 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/classicalliterature/SentenceCollectionEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.classicalliterature 11 | 12 | import androidx.room.ColumnInfo 13 | import androidx.room.Entity 14 | import androidx.room.Index 15 | import androidx.room.PrimaryKey 16 | 17 | /** 18 | * 诗文名句书签 19 | */ 20 | @Entity(tableName = "poem_sentence_collections", indices = [Index("collected_at")]) 21 | data class SentenceCollectionEntity( 22 | @PrimaryKey 23 | val id: Int 24 | ) { 25 | @ColumnInfo(name = "collected_at") 26 | var collectedAt: Long = System.currentTimeMillis() 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/classicalliterature/SentenceEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.classicalliterature 11 | 12 | import androidx.room.ColumnInfo 13 | import androidx.room.Entity 14 | import androidx.room.PrimaryKey 15 | 16 | @Entity(tableName = "poem_sentences") 17 | data class SentenceEntity( 18 | @PrimaryKey 19 | val id: Int, 20 | val content: String, 21 | val from: String, 22 | @ColumnInfo("poem_id") 23 | val poemId: Int? 24 | ) 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/classicalliterature/WritingCollectionEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.classicalliterature 11 | 12 | import androidx.room.ColumnInfo 13 | import androidx.room.Entity 14 | import androidx.room.Index 15 | import androidx.room.PrimaryKey 16 | 17 | /** 18 | * 诗文书签 19 | */ 20 | @Entity(tableName = "writing_collections", indices = [Index("collected_at")]) 21 | data class WritingCollectionEntity( 22 | @PrimaryKey 23 | val id: Int 24 | ) { 25 | @ColumnInfo(name = "collected_at") 26 | var collectedAt: Long = System.currentTimeMillis() 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/entity/classicalliterature/WritingFtsEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.entity.classicalliterature 11 | 12 | import androidx.room.ColumnInfo 13 | import androidx.room.Entity 14 | import androidx.room.Fts4 15 | import androidx.room.FtsOptions 16 | import androidx.room.PrimaryKey 17 | 18 | @Fts4( 19 | tokenizer = FtsOptions.TOKENIZER_ICU, 20 | contentEntity = WritingEntity::class, 21 | ) 22 | @Entity(tableName = "writing_fts") 23 | data class WritingFtsEntity( 24 | @PrimaryKey 25 | @ColumnInfo("rowid") 26 | val id: Int, 27 | val author: String?, 28 | val title2: String?, 29 | val content: String?, 30 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/util/IntListConverter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.util 11 | 12 | import androidx.room.TypeConverter 13 | import kotlinx.serialization.encodeToString 14 | import kotlinx.serialization.json.Json 15 | 16 | class IntListConverter { 17 | @TypeConverter 18 | fun listToString(list: List?): String? { 19 | return if (list == null) { 20 | null 21 | } else { 22 | Json.encodeToString(list) 23 | } 24 | } 25 | 26 | @TypeConverter 27 | fun stringToList(str: String?): List? { 28 | return if (str == null) { 29 | null 30 | } else { 31 | Json.decodeFromString(str) 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/util/PeopleAliasListConverter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.util 11 | 12 | import androidx.room.TypeConverter 13 | import com.hefengbao.jingmo.data.model.classicalliterature.people.Alias 14 | import kotlinx.serialization.encodeToString 15 | import kotlinx.serialization.json.Json 16 | 17 | class PeopleAliasListConverter { 18 | @TypeConverter 19 | fun listToString(list: List?): String? { 20 | return if (list == null) { 21 | null 22 | } else { 23 | Json.encodeToString(list) 24 | } 25 | } 26 | 27 | @TypeConverter 28 | fun stringToList(str: String?): List? { 29 | return if (str == null) { 30 | null 31 | } else { 32 | Json.decodeFromString(str) 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/util/PeopleDetailListConverter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.util 11 | 12 | import androidx.room.TypeConverter 13 | import com.hefengbao.jingmo.data.model.classicalliterature.people.Detail 14 | import kotlinx.serialization.encodeToString 15 | import kotlinx.serialization.json.Json 16 | 17 | class PeopleDetailListConverter { 18 | @TypeConverter 19 | fun listToString(list: List?): String? { 20 | return if (list == null) { 21 | null 22 | } else { 23 | Json.encodeToString(list) 24 | } 25 | } 26 | 27 | @TypeConverter 28 | fun stringToList(str: String?): List? { 29 | return if (str == null) { 30 | null 31 | } else { 32 | Json.decodeFromString(str) 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/util/PeopleHometownListConverter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.util 11 | 12 | import androidx.room.TypeConverter 13 | import com.hefengbao.jingmo.data.model.classicalliterature.people.Hometown 14 | import kotlinx.serialization.encodeToString 15 | import kotlinx.serialization.json.Json 16 | 17 | class PeopleHometownListConverter { 18 | @TypeConverter 19 | fun listToString(list: List?): String? { 20 | return if (list == null) { 21 | null 22 | } else { 23 | Json.encodeToString(list) 24 | } 25 | } 26 | 27 | @TypeConverter 28 | fun stringToList(str: String?): List? { 29 | return if (str == null) { 30 | null 31 | } else { 32 | Json.decodeFromString(str) 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/util/StringListConverter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.util 11 | 12 | import androidx.room.TypeConverter 13 | import kotlinx.serialization.encodeToString 14 | import kotlinx.serialization.json.Json 15 | 16 | class StringListConverter { 17 | @TypeConverter 18 | fun listToString(list: List?): String? { 19 | return if (list == null) { 20 | null 21 | } else { 22 | Json.encodeToString(list) 23 | } 24 | } 25 | 26 | @TypeConverter 27 | fun stringToList(str: String?): List? { 28 | return if (str == null) { 29 | null 30 | } else { 31 | Json.decodeFromString(str) 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/util/WritingAllusionListConverter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.util 11 | 12 | import androidx.room.TypeConverter 13 | import com.hefengbao.jingmo.data.model.classicalliterature.writing.Allusion 14 | import kotlinx.serialization.encodeToString 15 | import kotlinx.serialization.json.Json 16 | 17 | class WritingAllusionListConverter { 18 | @TypeConverter 19 | fun listToString(list: List?): String? { 20 | return if (list == null) { 21 | null 22 | } else { 23 | Json.encodeToString(list) 24 | } 25 | } 26 | 27 | @TypeConverter 28 | fun stringToList(str: String?): List? { 29 | return if (str == null) { 30 | null 31 | } else { 32 | Json.decodeFromString(str) 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/util/WritingClauseListConverter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.util 11 | 12 | import androidx.room.TypeConverter 13 | import com.hefengbao.jingmo.data.model.classicalliterature.writing.Clause 14 | import kotlinx.serialization.encodeToString 15 | import kotlinx.serialization.json.Json 16 | 17 | class WritingClauseListConverter { 18 | @TypeConverter 19 | fun listToString(list: List?): String? { 20 | return if (list == null) { 21 | null 22 | } else { 23 | Json.encodeToString(list) 24 | } 25 | } 26 | 27 | @TypeConverter 28 | fun stringToList(str: String?): List? { 29 | return if (str == null) { 30 | null 31 | } else { 32 | Json.decodeFromString(str) 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/util/WritingCommentListConverter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.util 11 | 12 | import androidx.room.TypeConverter 13 | import com.hefengbao.jingmo.data.model.classicalliterature.writing.Comment 14 | import kotlinx.serialization.encodeToString 15 | import kotlinx.serialization.json.Json 16 | 17 | class WritingCommentListConverter { 18 | @TypeConverter 19 | fun listToString(list: List?): String? { 20 | return if (list == null) { 21 | null 22 | } else { 23 | Json.encodeToString(list) 24 | } 25 | } 26 | 27 | @TypeConverter 28 | fun stringToList(str: String?): List? { 29 | return if (str == null) { 30 | null 31 | } else { 32 | Json.decodeFromString(str) 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/database/util/WritingQuoteListConverter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.database.util 11 | 12 | import androidx.room.TypeConverter 13 | import com.hefengbao.jingmo.data.model.classicalliterature.writing.Quote 14 | import kotlinx.serialization.encodeToString 15 | import kotlinx.serialization.json.Json 16 | 17 | class WritingQuoteListConverter { 18 | @TypeConverter 19 | fun listToString(list: List?): String? { 20 | return if (list == null) { 21 | null 22 | } else { 23 | Json.encodeToString(list) 24 | } 25 | } 26 | 27 | @TypeConverter 28 | fun stringToList(str: String?): List? { 29 | return if (str == null) { 30 | null 31 | } else { 32 | Json.decodeFromString(str) 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/enums/writing/CommentType.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.enums.writing 11 | 12 | enum class CommentType(val type: String) { 13 | Text("Text"), 14 | CharDictInJson("CharDictInJson"), 15 | WordDictInJson("WordDictInJson"), 16 | AllusionKey("AllusionKey"), 17 | Image("Image"), 18 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/AppStatus.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model 11 | 12 | import com.hefengbao.jingmo.data.model.theme.DarkThemeConfig 13 | import com.hefengbao.jingmo.data.model.theme.ThemeBrand 14 | 15 | data class AppStatus( 16 | val captureTextColor: String, 17 | val captureBackgroundColor: String, 18 | val themeBrand: ThemeBrand, 19 | val darkThemeConfig: DarkThemeConfig, 20 | val useDynamicColor: Boolean, 21 | val showSyncDataTip: Boolean, 22 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/Dataset.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model 11 | 12 | import kotlinx.serialization.Serializable 13 | 14 | @Serializable 15 | data class Dataset( 16 | val id: Int, 17 | val name: String, 18 | val count: Int, 19 | val version: Int 20 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/IdTitle.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model 11 | 12 | data class IdTitle( 13 | val id: Int, 14 | val title: String 15 | ) 16 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/Link.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model 11 | 12 | data class Link( 13 | val title: String, 14 | val desc: String, 15 | val url: String 16 | ) 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/ReadStatus.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information: Int, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model 11 | 12 | data class ReadStatus( 13 | val chineseAntitheticalCoupletLastReadId: Int, 14 | val chineseIdiomsLastReadId: Int, 15 | val chineseKnowledgeLastReadId: Int, 16 | val chineseLyricLastReadId: Int, 17 | val chineseModernPoetryLastReadId: Int, 18 | val chineseProverbLastReadId: Int, 19 | val chineseQuoteLastReadId: Int, 20 | val chineseRiddlesLastReadId: Int, 21 | val chineseTongueTwistersLastReadId: Int, 22 | val chineseWisecracksLastReadId: Int, 23 | val classicLiteratureClassicPoemsLastReadId: Int, 24 | val classicLiteraturePeopleLastReadId: Int, 25 | val classicLiteratureSentencesLastReadId: Int, 26 | val classicLiteratureWritingsLastReadId: Int, 27 | ) 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/UserData.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model 11 | 12 | import com.hefengbao.jingmo.data.model.theme.DarkThemeConfig 13 | import com.hefengbao.jingmo.data.model.theme.ThemeBrand 14 | 15 | data class UserData( 16 | val themeBrand: ThemeBrand, 17 | val darkThemeConfig: DarkThemeConfig, 18 | val useDynamicColor: Boolean, 19 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/china/WorldCulturalHeritage.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.china 11 | 12 | import com.hefengbao.jingmo.data.database.entity.china.WorldCulturalHeritageEntity 13 | import kotlinx.serialization.Serializable 14 | 15 | /** 16 | * 中国的世界文化遗产 17 | */ 18 | @Serializable 19 | data class WorldCulturalHeritage( 20 | val id: Int, 21 | val name: String, 22 | val year: String, 23 | val year2: String?, 24 | val level: String, 25 | val address: String, 26 | val image: String, 27 | val content: String 28 | ) 29 | 30 | fun WorldCulturalHeritage.asWorldCulturalHeritageEntity() = WorldCulturalHeritageEntity( 31 | id, name, year, year2, level, address, image, content 32 | ) 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/chinese/AntitheticalCouplet.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.chinese 11 | 12 | import com.hefengbao.jingmo.data.database.entity.chinese.AntitheticalCoupletEntity 13 | import kotlinx.serialization.Serializable 14 | 15 | @Serializable 16 | data class AntitheticalCouplet( 17 | val id: Int, 18 | val body: String, 19 | val description: String?, 20 | val image: String? = null 21 | ) 22 | 23 | 24 | fun AntitheticalCouplet.asAntitheticalCoupletEntity() = AntitheticalCoupletEntity( 25 | id, body, description, image 26 | ) 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/chinese/Dictionary.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.chinese 11 | 12 | import com.hefengbao.jingmo.data.database.entity.chinese.DictionaryEntity 13 | import kotlinx.serialization.SerialName 14 | import kotlinx.serialization.Serializable 15 | 16 | /** 17 | * 汉字 18 | */ 19 | @Serializable 20 | data class Dictionary( 21 | val id: Int, 22 | val char: String, 23 | val wubi: String?, 24 | val radical: String?, 25 | val stroke: Int, 26 | val pinyin: String?, 27 | val pinyin2: List?, 28 | @SerialName("simple_explanation") 29 | val simpleExplanation: String?, 30 | val explanation: String?, 31 | val loanword: Boolean, 32 | ) 33 | 34 | fun Dictionary.asDictionaryEntity() = DictionaryEntity( 35 | id, char, wubi, radical, stroke, pinyin, simpleExplanation, explanation, loanword 36 | ) 37 | 38 | @Serializable 39 | data class DictionaryWrapper( 40 | val data: List, 41 | @SerialName("next_page") 42 | val nextPage: String? 43 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/chinese/Expression.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.chinese 11 | 12 | import com.hefengbao.jingmo.data.database.entity.chinese.ExpressionEntity 13 | import kotlinx.serialization.Serializable 14 | 15 | /** 16 | * 词语 17 | */ 18 | @Serializable 19 | data class ChineseExpression( 20 | val id: Int, 21 | val word: String, 22 | val pinyin: String, 23 | val abbr: String? = null, 24 | val explanation: String? = null 25 | ) 26 | 27 | fun ChineseExpression.asChineseExpressionEntity() = ExpressionEntity( 28 | id, word, pinyin, abbr, explanation 29 | ) 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/chinese/ExpressionWrapper.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.chinese 11 | 12 | import kotlinx.serialization.SerialName 13 | import kotlinx.serialization.Serializable 14 | 15 | /** 16 | * 词语 17 | */ 18 | @Serializable 19 | data class ExpressionWrapper( 20 | val data: List, 21 | @SerialName("next_page") 22 | val nextPage: String? 23 | ) 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/chinese/IdiomWrapper.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.chinese 11 | 12 | import kotlinx.serialization.SerialName 13 | import kotlinx.serialization.Serializable 14 | 15 | @Serializable 16 | data class IdiomWrapper( 17 | val data: List, 18 | @SerialName("next_page") 19 | val nextPage: String? 20 | ) 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/chinese/Knowledge.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.chinese 11 | 12 | import com.hefengbao.jingmo.data.database.entity.chinese.KnowledgeEntity 13 | import kotlinx.serialization.Serializable 14 | 15 | /** 16 | * 只是卡片 17 | */ 18 | @Serializable 19 | data class ChineseKnowledge( 20 | val id: Int, 21 | val content: String, 22 | val label: String, 23 | val url: String?, 24 | ) 25 | 26 | fun ChineseKnowledge.asChineseKnowledgeEntity() = KnowledgeEntity( 27 | id, content, label, url 28 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/chinese/Lyric.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.chinese 11 | 12 | import com.hefengbao.jingmo.data.database.entity.chinese.LyricEntity 13 | import kotlinx.serialization.Serializable 14 | 15 | /** 16 | * 歌词 17 | */ 18 | @Serializable 19 | data class Lyric( 20 | val id: Int, 21 | val title: String, 22 | val writer: String?, 23 | val singer: String?, 24 | val content: String 25 | ) 26 | 27 | fun Lyric.asLyricEntity() = LyricEntity( 28 | id, title, writer, singer, content 29 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/chinese/ModernPoetry.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.chinese 11 | 12 | import com.hefengbao.jingmo.data.database.entity.chinese.ModernPoetryEntity 13 | import kotlinx.serialization.SerialName 14 | import kotlinx.serialization.Serializable 15 | 16 | @Serializable 17 | data class ModernPoetry( 18 | val id: Int, 19 | val title: String, 20 | val author: String, 21 | val content: String, 22 | val zhu: String?, 23 | val yi: String?, 24 | val shang: String?, 25 | @SerialName("author_info") 26 | val authorInfo: String? 27 | ) 28 | 29 | fun ModernPoetry.asModernPoetryEntity() = ModernPoetryEntity( 30 | id, title, author, content, zhu, yi, shang, authorInfo 31 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/chinese/Proverb.kt: -------------------------------------------------------------------------------- 1 | package com.hefengbao.jingmo.data.model.chinese 2 | 3 | import com.hefengbao.jingmo.data.database.entity.chinese.ProverbEntity 4 | import kotlinx.serialization.Serializable 5 | 6 | /** 7 | * 谚语 8 | */ 9 | @Serializable 10 | data class Proverb( 11 | val id: Int, 12 | val content: String 13 | ) 14 | 15 | 16 | fun Proverb.asProverbEntity() = ProverbEntity( 17 | id, content 18 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/chinese/Quote.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.chinese 11 | 12 | import com.hefengbao.jingmo.data.database.entity.chinese.QuoteEntity 13 | import kotlinx.serialization.Serializable 14 | 15 | @Serializable 16 | data class Quote( 17 | val id: Int, 18 | val content: String, 19 | val author: String, 20 | val from: String 21 | ) 22 | 23 | fun Quote.asQuoteEntity() = QuoteEntity( 24 | id, content, author, from 25 | ) 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/chinese/Riddle.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.chinese 11 | 12 | import com.hefengbao.jingmo.data.database.entity.chinese.RiddleEntity 13 | import kotlinx.serialization.Serializable 14 | 15 | /** 16 | * 谜语 17 | */ 18 | @Serializable 19 | data class Riddle( 20 | val id: Int, 21 | val puzzle: String, 22 | val answer: String 23 | ) 24 | 25 | fun Riddle.asRiddleEntity() = RiddleEntity( 26 | id, puzzle, answer 27 | ) 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/chinese/TongueTwister.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.chinese 11 | 12 | import com.hefengbao.jingmo.data.database.entity.chinese.TongueTwisterEntity 13 | import kotlinx.serialization.Serializable 14 | 15 | /** 16 | * 绕口令 17 | */ 18 | @Serializable 19 | data class TongueTwister( 20 | val id: Int, 21 | val title: String, 22 | val content: String, 23 | val content2: String?, 24 | ) 25 | 26 | fun TongueTwister.asTongueTwisterEntity() = TongueTwisterEntity( 27 | id = id, 28 | title = title, 29 | content = content, 30 | content2 = content2, 31 | ) 32 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/chinese/Wisecrack.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.chinese 11 | 12 | import com.hefengbao.jingmo.data.database.entity.chinese.WisecrackEntity 13 | import kotlinx.serialization.SerialName 14 | import kotlinx.serialization.Serializable 15 | 16 | /** 17 | * 歇后语 18 | */ 19 | @Serializable 20 | data class ChineseWisecrack( 21 | val id: Int, 22 | val riddle: String, 23 | val answer: String, 24 | @SerialName("first_word") 25 | val firstWord: String = "", 26 | @SerialName("first_letter") 27 | val firstLetter: String = "" 28 | ) 29 | 30 | fun ChineseWisecrack.asChineseWisecrackEntity() = WisecrackEntity( 31 | id, riddle, answer, firstWord, firstLetter 32 | ) 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/chinese/character/Pinyin.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.chinese.character 11 | 12 | data class Pinyin( 13 | val alphabet: String, 14 | val pinyin: List 15 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/chinese/character/Radical.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.chinese.character 11 | 12 | data class Radical( 13 | val stroke: String, 14 | val radicals: List 15 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/chinese/character/Stroke.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.chinese.character 11 | 12 | data class Stroke( 13 | val label: String, 14 | val stroke: Int, 15 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/classicalliterature/PeopleWrapper.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.classicalliterature 11 | 12 | import kotlinx.serialization.SerialName 13 | import kotlinx.serialization.Serializable 14 | 15 | @Serializable 16 | data class PeopleWrapper( 17 | val data: List, 18 | @SerialName("next_page") 19 | val nextPage: String? 20 | ) 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/classicalliterature/Sentence.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.classicalliterature 11 | 12 | import com.hefengbao.jingmo.data.database.entity.classicalliterature.SentenceEntity 13 | import kotlinx.serialization.SerialName 14 | import kotlinx.serialization.Serializable 15 | 16 | @Serializable 17 | data class PoemSentence( 18 | val id: Int, 19 | val content: String, 20 | val from: String, 21 | @SerialName("poem_id") 22 | val poemId: Int? = null 23 | ) 24 | 25 | fun PoemSentence.asPoemSentenceEntity() = SentenceEntity( 26 | id, content, from, poemId 27 | ) 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/classicalliterature/WritingWrapper.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.classicalliterature 11 | 12 | import kotlinx.serialization.SerialName 13 | import kotlinx.serialization.Serializable 14 | 15 | @Serializable 16 | data class WritingWrapper( 17 | val data: List, 18 | @SerialName("next_page") 19 | val nextPage: Int? 20 | ) 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/classicalliterature/people/Alias.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.classicalliterature.people 11 | 12 | import kotlinx.serialization.SerialName 13 | import kotlinx.serialization.Serializable 14 | 15 | /** 16 | * 人物别名 17 | */ 18 | @Serializable 19 | data class Alias( 20 | @SerialName("Name") 21 | val name: String, 22 | @SerialName("Type") 23 | val type: String 24 | ) 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/classicalliterature/people/Detail.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.classicalliterature.people 11 | 12 | import kotlinx.serialization.SerialName 13 | import kotlinx.serialization.Serializable 14 | 15 | /** 16 | * 人物资料 17 | */ 18 | @Serializable 19 | data class Detail( 20 | @SerialName("Book") 21 | val book: String, 22 | @SerialName("Section") 23 | val section: String?, 24 | @SerialName("Content") 25 | val content: String?, 26 | @SerialName("IsReview") 27 | val isReview: Boolean, 28 | @SerialName("ReferrenceUrls") 29 | val referenceUrls: List? 30 | ) 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/classicalliterature/people/Hometown.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.classicalliterature.people 11 | 12 | import kotlinx.serialization.SerialName 13 | import kotlinx.serialization.Serializable 14 | 15 | /** 16 | * 人物家乡 17 | */ 18 | @Serializable 19 | data class Hometown( 20 | @SerialName("RegionId") 21 | val regionId: String, 22 | @SerialName("Name") 23 | val name: String 24 | ) 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/classicalliterature/writing/Allusion.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.classicalliterature.writing 11 | 12 | import kotlinx.serialization.SerialName 13 | import kotlinx.serialization.Serializable 14 | 15 | /** 16 | * 引用典故数据 17 | */ 18 | @Serializable 19 | data class Allusion( 20 | @SerialName("AllusionIndex") 21 | val allusionIndex: Int, 22 | @SerialName("AllusionKey") 23 | val allusionKey: String, 24 | @SerialName("SentenceIndex") 25 | val sentenceIndex: Int, 26 | ) 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/classicalliterature/writing/CharDict.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.classicalliterature.writing 11 | 12 | import kotlinx.serialization.Serializable 13 | 14 | @Serializable 15 | data class CharDict( 16 | val OriginalChar: String, 17 | val Comments: List 18 | ) 19 | 20 | @Serializable 21 | data class CharComment( 22 | val Character: String, 23 | val Origin: String, 24 | val Explains: List 25 | ) 26 | 27 | @Serializable 28 | data class Explain( 29 | val Type: String,// Example,Explain,Spell,KXSpell 30 | val Content: String, 31 | ) 32 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/classicalliterature/writing/Clause.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.classicalliterature.writing 11 | 12 | import kotlinx.serialization.SerialName 13 | import kotlinx.serialization.Serializable 14 | 15 | @Serializable 16 | data class Clause( 17 | @SerialName("Content") 18 | val content: String, 19 | @SerialName("Comments") 20 | val comments: List?, 21 | @SerialName("BreakAfter") 22 | val breakAfter: Int? 23 | ) 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/classicalliterature/writing/Comment.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.classicalliterature.writing 11 | 12 | import kotlinx.serialization.SerialName 13 | import kotlinx.serialization.Serializable 14 | 15 | @Serializable 16 | data class Comment( 17 | @SerialName("Category") 18 | val category: String?, 19 | @SerialName("Content") 20 | val content: String, 21 | @SerialName("Type") 22 | val type: String, 23 | @SerialName("Index") 24 | val index: Int 25 | ) 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/classicalliterature/writing/Quote.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.classicalliterature.writing 11 | 12 | import kotlinx.serialization.SerialName 13 | import kotlinx.serialization.Serializable 14 | 15 | @Serializable 16 | data class Quote( 17 | @SerialName("Book") 18 | val book: String?, 19 | @SerialName("Section") 20 | val section: String?, 21 | @SerialName("Content") 22 | val content: String?, 23 | @SerialName("IsComment") 24 | val isComment: Boolean = false, 25 | @SerialName("ReferrenceUrls") 26 | val referenceUrls: List? 27 | ) 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/classicalliterature/writing/Tune.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.classicalliterature.writing 11 | 12 | import kotlinx.serialization.SerialName 13 | import kotlinx.serialization.Serializable 14 | 15 | @Serializable 16 | data class Tune( 17 | @SerialName("Name") 18 | val name: String? = null, 19 | @SerialName("Id") 20 | val id: Int?, 21 | ) 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/classicalliterature/writing/WordDict.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.classicalliterature.writing 11 | 12 | import kotlinx.serialization.Serializable 13 | 14 | @Serializable 15 | data class WordDict( 16 | val Id: Int, 17 | val Text: String, 18 | val CountInPoem: Int, 19 | val Traditional: String? = null, 20 | val Explains: List, 21 | val Categories: List? = null, 22 | val Spells: String? = null, 23 | val ContainsUnknownSpell: Boolean 24 | ) 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/theme/DarkThemeConfig.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.theme 11 | 12 | enum class DarkThemeConfig { 13 | FOLLOW_SYSTEM, 14 | LIGHT, 15 | DARK; 16 | 17 | companion object { 18 | infix fun from(value: String): DarkThemeConfig = 19 | DarkThemeConfig.entries.firstOrNull { it.name == value } ?: FOLLOW_SYSTEM 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/theme/ThemeBrand.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.theme 11 | 12 | enum class ThemeBrand { 13 | DEFAULT, 14 | ANDROID; 15 | 16 | companion object { 17 | infix fun from(value: String): ThemeBrand = 18 | ThemeBrand.entries.firstOrNull { it.name == value } ?: DEFAULT 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/traditionalculture/Color.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.traditionalculture 11 | 12 | data class Color( 13 | val id: String, 14 | val name: String, 15 | val traName: String, 16 | val colorSeries: String, 17 | val pinyin: String, 18 | val fontColor: String, 19 | val isBright: Boolean, 20 | val rgb: List, 21 | val hex: String, 22 | val cmyk: List, 23 | val desc: String, 24 | val figure: String 25 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/traditionalculture/Festival.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.traditionalculture 11 | 12 | data class Festival( 13 | val id: Int, 14 | val name: String, 15 | val alias: String, 16 | val desc: String, 17 | val images: List = emptyList(), 18 | val url: String, 19 | val comments: List = emptyList() 20 | ) 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/model/traditionalculture/SolarTerm.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.model.traditionalculture 11 | 12 | data class SolarTerm( 13 | val id: Int, 14 | val type: String, 15 | val name: String, 16 | val alias: String, 17 | val desc: String, 18 | val url: String 19 | ) 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/network/CustomDispatchers.kt: -------------------------------------------------------------------------------- 1 | package com.hefengbao.jingmo.data.network 2 | 3 | import javax.inject.Qualifier 4 | import kotlin.annotation.AnnotationRetention.RUNTIME 5 | 6 | @Qualifier 7 | @Retention(RUNTIME) 8 | annotation class Dispatcher(val dispatchers: CustomDispatchers) 9 | 10 | enum class CustomDispatchers { 11 | Default, 12 | IO, 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/network/NetworkDataSource.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.network 11 | 12 | interface NetworkDataSource 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/network/fake/FakeAssetManager.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.network.fake 11 | 12 | import java.io.InputStream 13 | 14 | fun interface FakeAssetManager { 15 | fun open(fileName: String): InputStream 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/network/fake/FakeNetworkDataSource.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.network.fake 11 | 12 | import com.hefengbao.jingmo.common.network.AppDispatchers 13 | import com.hefengbao.jingmo.common.network.Dispatcher 14 | import com.hefengbao.jingmo.data.network.JvmUnitTestFakeAssetManager 15 | import com.hefengbao.jingmo.data.network.NetworkDataSource 16 | import kotlinx.coroutines.CoroutineDispatcher 17 | import kotlinx.serialization.json.Json 18 | import javax.inject.Inject 19 | 20 | /** 21 | * [NetworkDataSource] implementation that provides static news resources to aid development 22 | */ 23 | class FakeNetworkDataSource @Inject constructor( 24 | @Dispatcher(AppDispatchers.IO) private val ioDispatcher: CoroutineDispatcher, 25 | private val networkJson: Json, 26 | private val assets: FakeAssetManager = JvmUnitTestFakeAssetManager, 27 | ) : NetworkDataSource -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/repository/LinksRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.repository 11 | 12 | import com.hefengbao.jingmo.data.model.Link 13 | 14 | interface LinksRepository { 15 | fun list(): List 16 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/repository/LinksRepositoryImpl.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.repository 11 | 12 | import com.hefengbao.jingmo.data.model.Link 13 | import javax.inject.Inject 14 | 15 | class LinksRepositoryImpl @Inject constructor() : LinksRepository { 16 | override fun list(): List { 17 | return listOf( 18 | Link( 19 | title = "智慧中小学", 20 | desc = "国家中小学智慧教育平台", 21 | url = "https://basic.smartedu.cn/" 22 | ), 23 | Link( 24 | title = "鲁迅博物馆", 25 | desc = "鲁迅说过这话吗?", 26 | url = "http://www.luxunmuseum.com.cn/cx/" 27 | ), 28 | Link( 29 | title = "中国大百科全书", 30 | desc = "第三版网络版", 31 | url = "https://www.zgbk.com" 32 | ), 33 | ) 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/repository/china/WorldCultureHeritageRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.repository.china 11 | 12 | import com.hefengbao.jingmo.data.database.entity.china.WorldCulturalHeritageEntity 13 | import kotlinx.coroutines.flow.Flow 14 | 15 | interface WorldCultureHeritageRepository { 16 | fun get(id: Int): Flow 17 | fun list(): Flow> 18 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/repository/china/WorldCultureHeritageRepositoryImpl.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.repository.china 11 | 12 | import com.hefengbao.jingmo.data.database.dao.ChinaWorldCulturalHeritageDao 13 | import com.hefengbao.jingmo.data.database.entity.china.WorldCulturalHeritageEntity 14 | import kotlinx.coroutines.flow.Flow 15 | import javax.inject.Inject 16 | 17 | class WorldCultureHeritageRepositoryImpl @Inject constructor( 18 | private val dao: ChinaWorldCulturalHeritageDao 19 | ) : WorldCultureHeritageRepository { 20 | override fun get(id: Int): Flow = dao.get(id) 21 | 22 | override fun list(): Flow> = dao.list() 23 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/repository/chinese/ExpressionRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.repository.chinese 11 | 12 | import androidx.paging.PagingData 13 | import com.hefengbao.jingmo.data.database.entity.chinese.ExpressionCollectionEntity 14 | import com.hefengbao.jingmo.data.database.entity.chinese.ExpressionEntity 15 | import kotlinx.coroutines.flow.Flow 16 | 17 | interface ExpressionRepository { 18 | fun get(id: Int): Flow 19 | fun random(): Flow 20 | fun search(query: String): Flow> 21 | fun collections(): Flow> 22 | suspend fun collect(entity: ExpressionCollectionEntity) 23 | suspend fun uncollect(id: Int) 24 | fun isCollect(id: Int): Flow 25 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/repository/chinese/IdiomRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.repository.chinese 11 | 12 | import androidx.paging.PagingData 13 | import com.hefengbao.jingmo.data.database.entity.chinese.IdiomCollectionEntity 14 | import com.hefengbao.jingmo.data.database.entity.chinese.IdiomEntity 15 | import kotlinx.coroutines.flow.Flow 16 | 17 | interface IdiomRepository { 18 | fun get(id: Int): Flow 19 | fun random(): Flow 20 | fun getNextId(id: Int): Flow 21 | fun getPrevId(id: Int): Flow 22 | fun list(): Flow> 23 | fun search(query: String): Flow> 24 | fun collections(): Flow> 25 | suspend fun collect(entity: IdiomCollectionEntity) 26 | suspend fun uncollect(id: Int) 27 | fun isCollect(id: Int): Flow 28 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/repository/chinese/KnowledgeRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.repository.chinese 11 | 12 | import androidx.paging.PagingData 13 | import com.hefengbao.jingmo.data.database.entity.chinese.KnowledgeCollectionEntity 14 | import com.hefengbao.jingmo.data.database.entity.chinese.KnowledgeEntity 15 | import kotlinx.coroutines.flow.Flow 16 | 17 | interface KnowledgeRepository { 18 | suspend fun insert(entity: KnowledgeEntity) 19 | fun get(id: Int): Flow 20 | fun random(): Flow 21 | fun search(query: String): Flow> 22 | fun collections(): Flow> 23 | fun total(): Flow 24 | fun getNextId(id: Int): Flow 25 | fun getPrevId(id: Int): Flow 26 | fun isCollect(id: Int): Flow 27 | suspend fun collect(entity: KnowledgeCollectionEntity) 28 | suspend fun uncollect(id: Int) 29 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/repository/chinese/LyricRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.repository.chinese 11 | 12 | import androidx.paging.PagingData 13 | import com.hefengbao.jingmo.data.database.entity.chinese.LyricCollectionEntity 14 | import com.hefengbao.jingmo.data.database.entity.chinese.LyricEntity 15 | import kotlinx.coroutines.flow.Flow 16 | 17 | interface LyricRepository { 18 | fun get(id: Int): Flow 19 | fun random(): Flow 20 | fun search(query: String): Flow> 21 | fun collections(): Flow> 22 | fun total(): Flow 23 | fun isCollect(id: Int): Flow 24 | fun prevId(id: Int): Flow 25 | fun nextId(id: Int): Flow 26 | suspend fun collect(entity: LyricCollectionEntity) 27 | suspend fun uncollect(id: Int) 28 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/repository/chinese/ModernPoetryRepository.kt: -------------------------------------------------------------------------------- 1 | package com.hefengbao.jingmo.data.repository.chinese 2 | 3 | import androidx.paging.PagingData 4 | import com.hefengbao.jingmo.data.database.entity.chinese.ModernPoetryCollectionEntity 5 | import com.hefengbao.jingmo.data.database.entity.chinese.ModernPoetryEntity 6 | import kotlinx.coroutines.flow.Flow 7 | 8 | interface ModernPoetryRepository { 9 | suspend fun insert(entity: ModernPoetryEntity) 10 | fun get(id: Int): Flow 11 | fun random(): Flow 12 | fun search(query: String): Flow> 13 | fun collections(): Flow> 14 | fun total(): Flow 15 | fun prevId(id: Int): Flow 16 | fun nextId(id: Int): Flow 17 | fun isCollect(id: Int): Flow 18 | suspend fun collect(entity: ModernPoetryCollectionEntity) 19 | suspend fun uncollect(id: Int) 20 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/repository/chinese/ProverbRepository.kt: -------------------------------------------------------------------------------- 1 | package com.hefengbao.jingmo.data.repository.chinese 2 | 3 | import androidx.paging.PagingData 4 | import com.hefengbao.jingmo.data.database.entity.chinese.ProverbCollectionEntity 5 | import com.hefengbao.jingmo.data.database.entity.chinese.ProverbEntity 6 | import kotlinx.coroutines.flow.Flow 7 | 8 | interface ProverbRepository { 9 | suspend fun insert(entity: ProverbEntity) 10 | fun get(id: Int): Flow 11 | fun random(): Flow 12 | fun search(query: String): Flow> 13 | fun collections(): Flow> 14 | fun total(): Flow 15 | fun prevId(id: Int): Flow 16 | fun nextId(id: Int): Flow 17 | fun isCollect(id: Int): Flow 18 | suspend fun collect(entity: ProverbCollectionEntity) 19 | suspend fun uncollect(id: Int) 20 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/repository/chinese/QuoteRepository.kt: -------------------------------------------------------------------------------- 1 | package com.hefengbao.jingmo.data.repository.chinese 2 | 3 | import androidx.paging.PagingData 4 | import com.hefengbao.jingmo.data.database.entity.chinese.QuoteCollectionEntity 5 | import com.hefengbao.jingmo.data.database.entity.chinese.QuoteEntity 6 | import kotlinx.coroutines.flow.Flow 7 | 8 | interface QuoteRepository { 9 | suspend fun insert(entity: QuoteEntity) 10 | fun get(id: Int): Flow 11 | fun random(): Flow 12 | fun search(query: String): Flow> 13 | fun collections(): Flow> 14 | fun total(): Flow 15 | fun prevId(id: Int): Flow 16 | fun nextId(id: Int): Flow 17 | fun isCollect(id: Int): Flow 18 | suspend fun collect(entity: QuoteCollectionEntity) 19 | suspend fun uncollect(id: Int) 20 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/repository/chinese/RiddleRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.repository.chinese 11 | 12 | import com.hefengbao.jingmo.data.database.entity.chinese.RiddleEntity 13 | import kotlinx.coroutines.flow.Flow 14 | 15 | interface RiddleRepository { 16 | fun get(id: Int): Flow 17 | fun getNextId(id: Int): Flow 18 | fun getPrevId(id: Int): Flow 19 | fun random(): Flow 20 | fun search(query: String): Flow> 21 | suspend fun clear() 22 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/repository/chinese/RiddleRepositoryImpl.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.repository.chinese 11 | 12 | import com.hefengbao.jingmo.data.database.dao.ChineseRiddleDao 13 | import com.hefengbao.jingmo.data.database.entity.chinese.RiddleEntity 14 | import kotlinx.coroutines.flow.Flow 15 | import javax.inject.Inject 16 | 17 | class RiddleRepositoryImpl @Inject constructor( 18 | private val dao: ChineseRiddleDao 19 | ) : RiddleRepository { 20 | override fun get(id: Int): Flow = dao.get(id) 21 | 22 | override fun getNextId(id: Int): Flow = dao.getNextId(id) 23 | 24 | override fun getPrevId(id: Int): Flow = dao.getPrevId(id) 25 | 26 | override fun random(): Flow = dao.random() 27 | 28 | override fun search(query: String): Flow> = 29 | dao.search("%$query%") 30 | 31 | override suspend fun clear() = dao.clear() 32 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/repository/chinese/TongueTwisterRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.repository.chinese 11 | 12 | import com.hefengbao.jingmo.data.database.entity.chinese.TongueTwisterEntity 13 | import kotlinx.coroutines.flow.Flow 14 | 15 | interface TongueTwisterRepository { 16 | fun get(id: Int): Flow 17 | fun getNextId(id: Int): Flow 18 | fun getPrevId(id: Int): Flow 19 | fun search(): Flow> 20 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/repository/chinese/TongueTwisterRepositoryImpl.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.repository.chinese 11 | 12 | import com.hefengbao.jingmo.data.database.dao.ChineseTongueTwisterDao 13 | import com.hefengbao.jingmo.data.database.entity.chinese.TongueTwisterEntity 14 | import kotlinx.coroutines.flow.Flow 15 | import javax.inject.Inject 16 | 17 | class TongueTwisterRepositoryImpl @Inject constructor( 18 | private val dao: ChineseTongueTwisterDao 19 | ) : TongueTwisterRepository { 20 | override fun get(id: Int): Flow = dao.get(id) 21 | 22 | override fun getNextId(id: Int): Flow = dao.getNextId(id) 23 | 24 | override fun getPrevId(id: Int): Flow = dao.getPrevId(id) 25 | 26 | override fun search(): Flow> = 27 | dao.list() 28 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/repository/chinese/WisecrackRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.repository.chinese 11 | 12 | import androidx.paging.PagingData 13 | import com.hefengbao.jingmo.data.database.entity.chinese.WisecrackCollectionEntity 14 | import com.hefengbao.jingmo.data.database.entity.chinese.WisecrackEntity 15 | import kotlinx.coroutines.flow.Flow 16 | 17 | interface WisecrackRepository { 18 | fun get(id: Int): Flow 19 | fun random(): Flow 20 | fun getNextId(id: Int): Flow 21 | fun getPrevId(id: Int): Flow 22 | fun search(query: String): Flow> 23 | fun collections(): Flow> 24 | suspend fun collect(entity: WisecrackCollectionEntity) 25 | suspend fun uncollect(id: Int) 26 | fun isCollect(id: Int): Flow 27 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/repository/classicalliterature/PeopleRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.repository.classicalliterature 11 | 12 | import com.hefengbao.jingmo.data.database.entity.classicalliterature.PeopleEntity 13 | import kotlinx.coroutines.flow.Flow 14 | 15 | interface PeopleRepository { 16 | fun random(): Flow 17 | fun get(id: Int): Flow 18 | fun getByName(name: String): Flow 19 | fun search(query: String): Flow> 20 | fun recommendList(): List 21 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/repository/classicalliterature/SentenceRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.repository.classicalliterature 11 | 12 | import androidx.paging.PagingData 13 | import com.hefengbao.jingmo.data.database.entity.classicalliterature.SentenceCollectionEntity 14 | import com.hefengbao.jingmo.data.database.entity.classicalliterature.SentenceEntity 15 | import kotlinx.coroutines.flow.Flow 16 | 17 | interface SentenceRepository { 18 | fun get(id: Int): Flow 19 | fun random(): Flow 20 | fun getNextId(id: Int): Flow 21 | fun getPrevId(id: Int): Flow 22 | fun search(query: String): Flow> 23 | fun collections(): Flow> 24 | suspend fun collect(entity: SentenceCollectionEntity) 25 | suspend fun uncollect(id: Int) 26 | fun isCollect(id: Int): Flow 27 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/repository/settings/ThemeRepository.kt: -------------------------------------------------------------------------------- 1 | package com.hefengbao.jingmo.data.repository.settings 2 | 3 | import com.hefengbao.jingmo.data.model.AppStatus 4 | import com.hefengbao.jingmo.data.model.theme.DarkThemeConfig 5 | import com.hefengbao.jingmo.data.model.theme.ThemeBrand 6 | import kotlinx.coroutines.flow.Flow 7 | 8 | interface ThemeRepository { 9 | val appStatus: Flow 10 | 11 | /** 12 | * Sets the desired theme brand. 13 | */ 14 | suspend fun setThemeBrand(themeBrand: ThemeBrand) 15 | 16 | /** 17 | * Sets the desired dark theme config. 18 | */ 19 | suspend fun setDarkThemeConfig(darkThemeConfig: DarkThemeConfig) 20 | 21 | /** 22 | * Sets the preferred dynamic color config. 23 | */ 24 | suspend fun setDynamicColorPreference(useDynamicColor: Boolean) 25 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/repository/settings/ThemeRepositoryImpl.kt: -------------------------------------------------------------------------------- 1 | package com.hefengbao.jingmo.data.repository.settings 2 | 3 | import com.hefengbao.jingmo.data.datastore.AppPreference 4 | import com.hefengbao.jingmo.data.model.AppStatus 5 | import com.hefengbao.jingmo.data.model.theme.DarkThemeConfig 6 | import com.hefengbao.jingmo.data.model.theme.ThemeBrand 7 | import kotlinx.coroutines.flow.Flow 8 | import javax.inject.Inject 9 | 10 | class ThemeRepositoryImpl @Inject constructor( 11 | private val preference: AppPreference 12 | ) : ThemeRepository { 13 | override val appStatus: Flow 14 | get() = preference.appStatus 15 | 16 | override suspend fun setThemeBrand(themeBrand: ThemeBrand) = 17 | preference.setThemeBrand(themeBrand) 18 | 19 | override suspend fun setDarkThemeConfig(darkThemeConfig: DarkThemeConfig) = 20 | preference.setDarkThemeConfig(darkThemeConfig) 21 | 22 | override suspend fun setDynamicColorPreference(useDynamicColor: Boolean) = 23 | preference.setUseDynamicColor(useDynamicColor) 24 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/repository/traditionalculture/ColorRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.repository.traditionalculture 11 | 12 | import com.hefengbao.jingmo.data.model.traditionalculture.Color 13 | 14 | interface ColorRepository { 15 | fun list(): List 16 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/repository/traditionalculture/FestivalRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.repository.traditionalculture 11 | 12 | import com.hefengbao.jingmo.data.model.traditionalculture.Festival 13 | 14 | interface FestivalRepository { 15 | fun list(): List 16 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/data/repository/traditionalculture/SolarTermsRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.data.repository.traditionalculture 11 | 12 | import com.hefengbao.jingmo.data.model.traditionalculture.SolarTerm 13 | 14 | interface SolarTermsRepository { 15 | fun list(): List 16 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/di/CoroutineDispatcherModule.kt: -------------------------------------------------------------------------------- 1 | package com.hefengbao.jingmo.di 2 | 3 | import dagger.Module 4 | import dagger.Provides 5 | import dagger.hilt.InstallIn 6 | import dagger.hilt.components.SingletonComponent 7 | import kotlinx.coroutines.CoroutineDispatcher 8 | import kotlinx.coroutines.Dispatchers 9 | 10 | /** 11 | * Provides global coroutine dispatcher. 12 | * 13 | * - [Dispatchers.Main] 14 | * - [Dispatchers.Main.immediate] 15 | * - [Dispatchers.IO] 16 | * - [Dispatchers.Default] 17 | */ 18 | @Module 19 | @InstallIn(SingletonComponent::class) 20 | object CoroutineDispatcherModule { 21 | 22 | @Provides 23 | @DefaultDispatcher 24 | fun provideDefaultDispatcher(): CoroutineDispatcher = Dispatchers.Default 25 | 26 | @Provides 27 | @IODispatcher 28 | fun provideIODispatcher(): CoroutineDispatcher = Dispatchers.IO 29 | 30 | @Provides 31 | @MainDispatcher 32 | fun provideMainDispatcher(): CoroutineDispatcher = Dispatchers.Main 33 | 34 | @Provides 35 | @MainImmediateDispatcher 36 | fun provideMainImmediateDispatcher(): CoroutineDispatcher = Dispatchers.Main.immediate 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/di/CoroutineQualifier.kt: -------------------------------------------------------------------------------- 1 | package com.hefengbao.jingmo.di 2 | 3 | import javax.inject.Qualifier 4 | 5 | /** 6 | * @see CoroutineDispatcherModule.provideDefaultDispatcher 7 | */ 8 | @Retention(AnnotationRetention.RUNTIME) 9 | @Qualifier 10 | annotation class DefaultDispatcher 11 | 12 | /** 13 | * @see CoroutineDispatcherModule.provideIODispatcher 14 | */ 15 | @Retention(AnnotationRetention.RUNTIME) 16 | @Qualifier 17 | annotation class IODispatcher 18 | 19 | /** 20 | * @see CoroutineDispatcherModule.provideMainDispatcher 21 | */ 22 | @Retention(AnnotationRetention.RUNTIME) 23 | @Qualifier 24 | annotation class MainDispatcher 25 | 26 | /** 27 | * @see CoroutineDispatcherModule.provideMainImmediateDispatcher 28 | */ 29 | @Retention(AnnotationRetention.BINARY) 30 | @Qualifier 31 | annotation class MainImmediateDispatcher 32 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/di/CoroutineScopesModule.kt: -------------------------------------------------------------------------------- 1 | package com.hefengbao.jingmo.di 2 | 3 | import com.hefengbao.jingmo.data.network.CustomDispatchers 4 | import com.hefengbao.jingmo.data.network.Dispatcher 5 | import dagger.Module 6 | import dagger.Provides 7 | import dagger.hilt.InstallIn 8 | import dagger.hilt.components.SingletonComponent 9 | import kotlinx.coroutines.CoroutineDispatcher 10 | import kotlinx.coroutines.CoroutineScope 11 | import kotlinx.coroutines.SupervisorJob 12 | import javax.inject.Qualifier 13 | import javax.inject.Singleton 14 | 15 | @Retention(AnnotationRetention.RUNTIME) 16 | @Qualifier 17 | annotation class ApplicationScope 18 | 19 | @Module 20 | @InstallIn(SingletonComponent::class) 21 | object CoroutineScopesModule { 22 | @Provides 23 | @Singleton 24 | @ApplicationScope 25 | fun providesCoroutineScope( 26 | @Dispatcher(CustomDispatchers.Default) dispatcher: CoroutineDispatcher, 27 | ): CoroutineScope = CoroutineScope(SupervisorJob() + dispatcher) 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/di/DispatchersModule.kt: -------------------------------------------------------------------------------- 1 | package com.hefengbao.jingmo.di 2 | 3 | import com.hefengbao.jingmo.data.network.CustomDispatchers 4 | import com.hefengbao.jingmo.data.network.Dispatcher 5 | import dagger.Module 6 | import dagger.Provides 7 | import dagger.hilt.InstallIn 8 | import dagger.hilt.components.SingletonComponent 9 | import kotlinx.coroutines.CoroutineDispatcher 10 | import kotlinx.coroutines.Dispatchers 11 | 12 | @Module 13 | @InstallIn(SingletonComponent::class) 14 | object DispatchersModule { 15 | @Provides 16 | @Dispatcher(CustomDispatchers.IO) 17 | fun providesIODispatchers(): CoroutineDispatcher = Dispatchers.IO 18 | 19 | @Provides 20 | @Dispatcher(CustomDispatchers.Default) 21 | fun providesDefaultDispatcher(): CoroutineDispatcher = Dispatchers.Default 22 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/di/NetworkDatasourceModule.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.di 11 | 12 | import com.hefengbao.jingmo.data.network.Network 13 | import com.hefengbao.jingmo.data.network.retrofit.NetworkImpl 14 | import dagger.Binds 15 | import dagger.Module 16 | import dagger.hilt.InstallIn 17 | import dagger.hilt.components.SingletonComponent 18 | 19 | @Module 20 | @InstallIn(SingletonComponent::class) 21 | interface NetworkDatasourceModule { 22 | @Binds 23 | fun bindsNetwork( 24 | networkImpl: NetworkImpl 25 | ): Network 26 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/component/BackgroundTitle.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.component 11 | 12 | import androidx.compose.foundation.background 13 | import androidx.compose.foundation.layout.padding 14 | import androidx.compose.foundation.shape.RoundedCornerShape 15 | import androidx.compose.material3.MaterialTheme 16 | import androidx.compose.material3.Text 17 | import androidx.compose.runtime.Composable 18 | import androidx.compose.ui.Modifier 19 | import androidx.compose.ui.draw.clip 20 | import androidx.compose.ui.unit.dp 21 | 22 | @Composable 23 | fun BackgroundTitle(title: String) { 24 | Text( 25 | text = title, 26 | modifier = Modifier 27 | .clip(RoundedCornerShape(16.dp)) 28 | .background(color = MaterialTheme.colorScheme.primary) 29 | .padding(16.dp, 8.dp), 30 | color = MaterialTheme.colorScheme.onPrimary, 31 | style = MaterialTheme.typography.titleSmall 32 | ) 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/component/webview/JavaScriptInterface.kt: -------------------------------------------------------------------------------- 1 | package com.hefengbao.jingmo.ui.component.webview 2 | 3 | import android.webkit.JavascriptInterface 4 | 5 | interface JavaScriptInterface { 6 | 7 | @JavascriptInterface 8 | fun onImgTagClick(imgUrl: String?, alt: String?) 9 | 10 | companion object { 11 | 12 | const val NAME = "JavaScriptInterface" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/component/webview/WebViewHtml.kt: -------------------------------------------------------------------------------- 1 | package com.hefengbao.jingmo.ui.component.webview 2 | 3 | object WebViewHtml { 4 | 5 | const val HTML: String = """ 6 | 7 | 8 | 9 | 10 | 11 | 14 | 15 | 16 | 17 |
18 | 19 |
20 | %s 21 |
22 |
23 | 26 | 27 | 28 | """ 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/china/worldcultureheritage/WorldCultureHeritageIndexViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.china.worldcultureheritage 11 | 12 | import androidx.lifecycle.ViewModel 13 | import androidx.lifecycle.viewModelScope 14 | import com.hefengbao.jingmo.data.repository.china.WorldCultureHeritageRepository 15 | import dagger.hilt.android.lifecycle.HiltViewModel 16 | import kotlinx.coroutines.flow.SharingStarted 17 | import kotlinx.coroutines.flow.stateIn 18 | import javax.inject.Inject 19 | 20 | @HiltViewModel 21 | class WorldCultureHeritageIndexViewModel @Inject constructor( 22 | repository: WorldCultureHeritageRepository 23 | ) : ViewModel() { 24 | val list = repository.list().stateIn( 25 | scope = viewModelScope, 26 | started = SharingStarted.WhileSubscribed(5_000), 27 | initialValue = emptyList() 28 | ) 29 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/antitheticalcouplet/AntitheticalCoupletBookmarksViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.antitheticalcouplet 11 | 12 | import androidx.lifecycle.ViewModel 13 | import androidx.lifecycle.viewModelScope 14 | import androidx.paging.PagingData 15 | import com.hefengbao.jingmo.data.repository.chinese.AntitheticalCoupletRepository 16 | import dagger.hilt.android.lifecycle.HiltViewModel 17 | import kotlinx.coroutines.flow.SharingStarted 18 | import kotlinx.coroutines.flow.stateIn 19 | import javax.inject.Inject 20 | 21 | @HiltViewModel 22 | class AntitheticalCoupletBookmarksViewModel @Inject constructor( 23 | repository: AntitheticalCoupletRepository 24 | ) : ViewModel() { 25 | val items = repository.collections().stateIn( 26 | scope = viewModelScope, 27 | started = SharingStarted.WhileSubscribed(5_000), 28 | initialValue = PagingData.empty() 29 | ) 30 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/antitheticalcouplet/nav/AntitheticalCoupletBookmarksNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.antitheticalcouplet.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.antitheticalcouplet.AntitheticalCoupletBookmarksRoute 16 | 17 | private const val ROUTE = "chinese_antithetical_couplet_bookmarks" 18 | 19 | fun NavController.navigateToChineseAntitheticalCoupletBookmarksScreen() { 20 | this.navigate(ROUTE) { 21 | launchSingleTop = true 22 | } 23 | } 24 | 25 | fun NavGraphBuilder.chineseAntitheticalCoupletBookmarksScreen( 26 | onBackClick: () -> Unit, 27 | onItemClick: (Int) -> Unit 28 | ) { 29 | composable(ROUTE) { 30 | AntitheticalCoupletBookmarksRoute(onBackClick = onBackClick, onItemClick = onItemClick) 31 | } 32 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/antitheticalcouplet/nav/AntitheticalCoupletReadNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.antitheticalcouplet.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.antitheticalcouplet.AntitheticalCoupletReadRoute 16 | 17 | private const val ROUTE = "chinese_antithetical_couplet_read" 18 | 19 | fun NavController.navigateToChineseAntitheticalCoupletReadScreen() { 20 | this.navigate(ROUTE) 21 | } 22 | 23 | fun NavGraphBuilder.chineseAntitheticalCoupletReadScreen( 24 | onBackClick: () -> Unit, 25 | onCaptureClick: (Int) -> Unit 26 | ) { 27 | composable(ROUTE) { 28 | AntitheticalCoupletReadRoute( 29 | onBackClick = onBackClick, 30 | onCaptureClick = onCaptureClick 31 | ) 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/antitheticalcouplet/nav/AntitheticalCoupletSearchNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.antitheticalcouplet.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.antitheticalcouplet.AntitheticalCoupletSearchRoute 16 | 17 | private const val ROUTE = "chinese_antithetical_couplet_search" 18 | 19 | fun NavController.navigateToChineseAntitheticalCoupletSearchScreen() { 20 | this.navigate(ROUTE) 21 | } 22 | 23 | fun NavGraphBuilder.chineseAntitheticalCoupletSearchScreen( 24 | onBackClick: () -> Unit, 25 | onItemClick: (Int) -> Unit, 26 | ) { 27 | composable(ROUTE) { 28 | AntitheticalCoupletSearchRoute( 29 | onBackClick = onBackClick, 30 | onItemClick = onItemClick, 31 | ) 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/character/CharacterBookmarksViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.character 11 | 12 | import androidx.lifecycle.ViewModel 13 | import androidx.lifecycle.viewModelScope 14 | import androidx.paging.cachedIn 15 | import com.hefengbao.jingmo.data.repository.chinese.CharacterRepository 16 | import dagger.hilt.android.lifecycle.HiltViewModel 17 | import javax.inject.Inject 18 | 19 | @HiltViewModel 20 | class CharacterBookmarksViewModel @Inject constructor( 21 | repository: CharacterRepository 22 | ) : ViewModel() { 23 | val items = repository.collections().cachedIn(viewModelScope) 24 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/character/CharacterPinyinIndexViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.character 11 | 12 | import androidx.lifecycle.ViewModel 13 | import com.hefengbao.jingmo.data.repository.chinese.CharacterRepository 14 | import dagger.hilt.android.lifecycle.HiltViewModel 15 | import javax.inject.Inject 16 | 17 | @HiltViewModel 18 | class CharacterPinyinIndexViewModel @Inject constructor( 19 | repository: CharacterRepository 20 | ) : ViewModel() { 21 | val pinyins = repository.pinyins() 22 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/character/CharacterRadicalIndexViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.character 11 | 12 | import androidx.lifecycle.ViewModel 13 | import com.hefengbao.jingmo.data.repository.chinese.CharacterRepository 14 | import dagger.hilt.android.lifecycle.HiltViewModel 15 | import javax.inject.Inject 16 | 17 | @HiltViewModel 18 | class CharacterRadicalIndexViewModel @Inject constructor( 19 | repository: CharacterRepository 20 | ) : ViewModel() { 21 | val radicals = repository.radicals() 22 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/character/CharacterStrokeIndexViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.character 11 | 12 | import androidx.lifecycle.ViewModel 13 | import com.hefengbao.jingmo.data.repository.chinese.CharacterRepository 14 | import dagger.hilt.android.lifecycle.HiltViewModel 15 | import javax.inject.Inject 16 | 17 | @HiltViewModel 18 | class CharacterStrokeIndexViewModel @Inject constructor( 19 | repository: CharacterRepository 20 | ) : ViewModel() { 21 | val strokes = repository.strokes() 22 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/character/nav/CharacterBookmarksNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.character.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.character.CharacterBookmarksRoute 16 | 17 | private const val ROUTE = "chinese_character_bookmarks" 18 | 19 | fun NavController.navigateToChineseCharacterBookmarksScreen() { 20 | this.navigate(ROUTE) { 21 | launchSingleTop = true 22 | } 23 | } 24 | 25 | fun NavGraphBuilder.chineseCharacterBookmarksScreen( 26 | onBackClick: () -> Unit, 27 | onItemClick: (Int) -> Unit 28 | ) { 29 | composable(route = ROUTE) { 30 | CharacterBookmarksRoute(onBackClick = onBackClick, onItemClick = onItemClick) 31 | } 32 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/character/nav/CharacterPinyinIndexNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.character.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.character.CharacterPinyinIndexRoute 16 | 17 | 18 | private const val ROUTE = "chinese_character_pinyin_index" 19 | 20 | fun NavController.navigateToChineseCharacterPinyinIndexScreen() { 21 | this.navigate(ROUTE) { 22 | launchSingleTop = true 23 | } 24 | } 25 | 26 | fun NavGraphBuilder.chineseCharacterPinyinIndexScreen( 27 | onBackClick: () -> Unit, 28 | onItemClick: (String, String) -> Unit, 29 | ) { 30 | composable(ROUTE) { 31 | CharacterPinyinIndexRoute( 32 | onBackClick = onBackClick, 33 | onItemClick = onItemClick 34 | ) 35 | } 36 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/character/nav/CharacterRadicalIndexNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.character.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.character.CharacterRadicalIndexRoute 16 | 17 | private const val ROUTE = "chinese_character_radical_index" 18 | 19 | fun NavController.navigateToChineseCharacterRadicalIndexScreen() { 20 | this.navigate(ROUTE) { 21 | launchSingleTop = true 22 | } 23 | } 24 | 25 | fun NavGraphBuilder.chineseCharacterRadicalIndexScreen( 26 | onBackClick: () -> Unit, 27 | onItemClick: (String, String) -> Unit, 28 | ) { 29 | composable(ROUTE) { 30 | CharacterRadicalIndexRoute( 31 | onBackClick = onBackClick, 32 | onItemClick = onItemClick 33 | ) 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/character/nav/CharacterStrokeIndexNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.character.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.character.CharacterStrokeIndexRoute 16 | 17 | private const val ROUTE = "chinese_character_stroke_index" 18 | 19 | fun NavController.navigateToChineseCharacterStrokeIndexScreen() { 20 | this.navigate(ROUTE) { 21 | launchSingleTop = true 22 | } 23 | } 24 | 25 | fun NavGraphBuilder.chineseCharacterStrokeIndexScreen( 26 | onBackClick: () -> Unit, 27 | onItemClick: (String, String) -> Unit, 28 | ) { 29 | composable(ROUTE) { 30 | CharacterStrokeIndexRoute( 31 | onBackClick = onBackClick, 32 | onItemClick = onItemClick 33 | ) 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/character/nav/CharacterStrokeNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.character.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.character.ChineseCharacterStrokeRoute 16 | 17 | private const val ROUTE = "chinese_character_stroke" 18 | 19 | fun NavController.navigateToChineseCharacterStrokeScreen() { 20 | this.navigate(ROUTE) 21 | } 22 | 23 | fun NavGraphBuilder.chineseCharacterStrokeScreen( 24 | onBackClick: () -> Unit, 25 | ) { 26 | composable(ROUTE) { 27 | ChineseCharacterStrokeRoute( 28 | onBackClick = onBackClick 29 | ) 30 | } 31 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/expression/ExpressionBookmarksViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.expression 11 | 12 | import androidx.lifecycle.ViewModel 13 | import androidx.lifecycle.viewModelScope 14 | import androidx.paging.cachedIn 15 | import com.hefengbao.jingmo.data.repository.chinese.ExpressionRepository 16 | import dagger.hilt.android.lifecycle.HiltViewModel 17 | import javax.inject.Inject 18 | 19 | @HiltViewModel 20 | class ExpressionBookmarksViewModel @Inject constructor( 21 | repository: ExpressionRepository 22 | ) : ViewModel() { 23 | val expressions = repository.collections().cachedIn(viewModelScope) 24 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/expression/nav/ExpressionBookmarksNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.expression.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.expression.ExpressionBookmarksRoute 16 | 17 | private const val ROUTE = "chinese_expression_bookmarks" 18 | 19 | fun NavController.navigateToChineseExpressionBookmarksScreen() { 20 | this.navigate(ROUTE) { 21 | launchSingleTop = true 22 | } 23 | } 24 | 25 | fun NavGraphBuilder.chineseExpressionBookmarksScreen( 26 | onBackClick: () -> Unit, 27 | onItemClick: (Int) -> Unit 28 | ) { 29 | composable(route = ROUTE) { 30 | ExpressionBookmarksRoute(onBackClick = onBackClick, onItemClick = onItemClick) 31 | } 32 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/expression/nav/ExpressionSearchNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.expression.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.expression.ChineseExpressionSearchRoute 16 | 17 | private const val ROUTE = "chinese_expression_search" 18 | 19 | fun NavController.navigateToChineseExpressionSearchScreen() { 20 | this.navigate(ROUTE) { 21 | launchSingleTop = true 22 | } 23 | } 24 | 25 | fun NavGraphBuilder.chineseExpressionSearchScreen( 26 | onBackClick: () -> Unit, 27 | onItemClick: (Int) -> Unit 28 | ) { 29 | composable(ROUTE) { 30 | ChineseExpressionSearchRoute(onBackClick = onBackClick, onItemClick = onItemClick) 31 | } 32 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/idiom/IdiomBookmarksViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.idiom 11 | 12 | import androidx.lifecycle.ViewModel 13 | import androidx.lifecycle.viewModelScope 14 | import androidx.paging.cachedIn 15 | import com.hefengbao.jingmo.data.repository.chinese.IdiomRepository 16 | import dagger.hilt.android.lifecycle.HiltViewModel 17 | import javax.inject.Inject 18 | 19 | @HiltViewModel 20 | class IdiomBookmarksViewModel @Inject constructor( 21 | repository: IdiomRepository 22 | ) : ViewModel() { 23 | val bookmarks = repository.collections().cachedIn(viewModelScope) 24 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/idiom/nav/IdiomBookmarksNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.idiom.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.idiom.IdiomBookmarksRoute 16 | 17 | private const val ROUTE = "chinese_idiom_bookmarks" 18 | 19 | fun NavController.navigateToChineseIdiomBookmarksScreen() { 20 | this.navigate(ROUTE) { 21 | launchSingleTop = true 22 | } 23 | } 24 | 25 | fun NavGraphBuilder.chineseIdiomBookmarksScreen( 26 | onBackClick: () -> Unit, 27 | onItemClick: (Int) -> Unit 28 | ) { 29 | composable(ROUTE) { 30 | IdiomBookmarksRoute(onBackClick = onBackClick, onItemClick = onItemClick) 31 | } 32 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/idiom/nav/IdiomReadNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.idiom.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.idiom.IdiomReadRoute 16 | 17 | private const val ROUTE = "chinese_idiom_read" 18 | 19 | fun NavController.navigateToChineseIdiomReadScreen() { 20 | this.navigate(ROUTE) 21 | } 22 | 23 | fun NavGraphBuilder.chineseIdiomReadScreen( 24 | onBackClick: () -> Unit, 25 | onCaptureClick: (Int) -> Unit 26 | ) { 27 | composable(ROUTE) { 28 | IdiomReadRoute( 29 | onBackClick = onBackClick, 30 | onCaptureClick = onCaptureClick 31 | ) 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/idiom/nav/IdiomSearchNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.idiom.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.idiom.IdiomSearchRoute 16 | 17 | private const val ROUTE = "chinese_idiom_search" 18 | 19 | fun NavController.navigateToChineseIdiomSearchScreen() { 20 | this.navigate(ROUTE) 21 | } 22 | 23 | fun NavGraphBuilder.chineseIdiomSearchScreen( 24 | onBackClick: () -> Unit, 25 | onItemClick: (Int) -> Unit, 26 | ) { 27 | composable(ROUTE) { 28 | IdiomSearchRoute( 29 | onBackClick = onBackClick, 30 | onItemClick = onItemClick, 31 | ) 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/knowledge/KnowledgeBookmarksViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.knowledge 11 | 12 | import androidx.lifecycle.ViewModel 13 | import androidx.lifecycle.viewModelScope 14 | import androidx.paging.cachedIn 15 | import com.hefengbao.jingmo.data.repository.chinese.KnowledgeRepository 16 | import dagger.hilt.android.lifecycle.HiltViewModel 17 | import javax.inject.Inject 18 | 19 | @HiltViewModel 20 | class KnowledgeBookmarksViewModel @Inject constructor( 21 | repository: KnowledgeRepository, 22 | ) : ViewModel() { 23 | val collections = repository.collections().cachedIn(viewModelScope) 24 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/knowledge/nav/KnowledgeBookmarksNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.knowledge.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.knowledge.KnowledgeBookmarksRoute 16 | 17 | private const val ROUTE = "chinese_knowledge_bookmarks" 18 | 19 | fun NavController.navigateToChineseKnowledgeBookmarksScreen() { 20 | this.navigate(ROUTE) { launchSingleTop = true } 21 | } 22 | 23 | fun NavGraphBuilder.chineseKnowledgeBookmarksScreen( 24 | onBackClick: () -> Unit, 25 | onItemClick: (Int) -> Unit, 26 | ) { 27 | composable(ROUTE) { 28 | KnowledgeBookmarksRoute( 29 | onBackClick = onBackClick, 30 | onItemClick = onItemClick 31 | ) 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/knowledge/nav/KnowledgeReadNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.knowledge.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.knowledge.ChineseKnowledgeReadRoute 16 | 17 | private const val ROUTE = "chinese_knowledge_read" 18 | 19 | fun NavController.navigateToChineseKnowledgeReadScreen() { 20 | this.navigate(ROUTE) 21 | } 22 | 23 | fun NavGraphBuilder.chineseKnowledgeReadScreen( 24 | onBackClick: () -> Unit, 25 | ) { 26 | composable(ROUTE) { 27 | ChineseKnowledgeReadRoute( 28 | onBackClick = onBackClick, 29 | ) 30 | } 31 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/knowledge/nav/KnowledgeSearchNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.knowledge.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.knowledge.KnowledgeSearchRoute 16 | 17 | private const val ROUTE = "chinese_knowledge_search" 18 | 19 | fun NavController.navigateToChineseKnowSearchScreen() { 20 | this.navigate(ROUTE) 21 | } 22 | 23 | fun NavGraphBuilder.chineseKnowledgeSearchScreen( 24 | onBackClick: () -> Unit, 25 | onItemClick: (Int) -> Unit 26 | ) { 27 | composable(ROUTE) { 28 | KnowledgeSearchRoute( 29 | onBackClick = onBackClick, 30 | onItemClick = onItemClick 31 | ) 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/lyric/LyricBookmarksViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.lyric 11 | 12 | import androidx.lifecycle.ViewModel 13 | import androidx.lifecycle.viewModelScope 14 | import androidx.paging.cachedIn 15 | import com.hefengbao.jingmo.data.repository.chinese.LyricRepository 16 | import dagger.hilt.android.lifecycle.HiltViewModel 17 | import javax.inject.Inject 18 | 19 | @HiltViewModel 20 | class LyricBookmarksViewModel @Inject constructor( 21 | repository: LyricRepository, 22 | ) : ViewModel() { 23 | val lyricEntityCollections = repository.collections().cachedIn(viewModelScope) 24 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/lyric/nav/LyricBookmarksNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.lyric.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.lyric.LyricBookmarksRoute 16 | 17 | private const val ROUTE = "chinese_lyric_bookmarks" 18 | 19 | fun NavController.navigateToChineseLyricBookmarksScreen() { 20 | this.navigate(ROUTE) { launchSingleTop = true } 21 | } 22 | 23 | fun NavGraphBuilder.chineseLyricBookmarksScreen( 24 | onBackClick: () -> Unit, 25 | onItemClick: (Int) -> Unit, 26 | ) { 27 | composable(ROUTE) { 28 | LyricBookmarksRoute( 29 | onBackClick = onBackClick, 30 | onItemClick = onItemClick 31 | ) 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/lyric/nav/LyricReadNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.lyric.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.lyric.LyricReadRoute 16 | 17 | private const val ROUTE = "chinese_lyric_read" 18 | 19 | fun NavController.navigateToChineseLyricReadScreen() { 20 | this.navigate(ROUTE) { 21 | launchSingleTop = true 22 | } 23 | } 24 | 25 | fun NavGraphBuilder.chineseLyricReadScreen( 26 | onBackClick: () -> Unit 27 | ) { 28 | composable(ROUTE) { 29 | LyricReadRoute( 30 | onBackClick = onBackClick 31 | ) 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/lyric/nav/LyricSearchNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.lyric.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.lyric.LyricSearchRoute 16 | 17 | private const val ROUTE = "chinese_lyric_search" 18 | 19 | fun NavController.navigateToChineseLyricSearchScreen() { 20 | this.navigate(ROUTE) { 21 | launchSingleTop = true 22 | } 23 | } 24 | 25 | fun NavGraphBuilder.chineseLyricSearchScreen( 26 | onBackClick: () -> Unit, 27 | onItemClick: (Int) -> Unit, 28 | ) { 29 | composable(ROUTE) { 30 | LyricSearchRoute( 31 | onBackClick = onBackClick, 32 | onItemClick = onItemClick 33 | ) 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/poetry/ModernPoetryBookmarksViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.poetry 11 | 12 | import androidx.lifecycle.ViewModel 13 | import androidx.lifecycle.viewModelScope 14 | import androidx.paging.cachedIn 15 | import com.hefengbao.jingmo.data.repository.chinese.ModernPoetryRepository 16 | import dagger.hilt.android.lifecycle.HiltViewModel 17 | import javax.inject.Inject 18 | 19 | @HiltViewModel 20 | class ModernPoetryBookmarksViewModel @Inject constructor( 21 | repository: ModernPoetryRepository, 22 | ) : ViewModel() { 23 | val collections = repository.collections().cachedIn(viewModelScope) 24 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/poetry/nav/ModernPoetryBookmarksNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.poetry.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.poetry.ModernPoetryBookmarksRoute 16 | 17 | private const val ROUTE = "chinese_modern_poetry_bookmarks" 18 | 19 | fun NavController.navigateToChineseModernPoetryBookmarksScreen() { 20 | this.navigate(ROUTE) { launchSingleTop = true } 21 | } 22 | 23 | fun NavGraphBuilder.chineseModernPoetryBookmarksScreen( 24 | onBackClick: () -> Unit, 25 | onItemClick: (Int) -> Unit, 26 | ) { 27 | composable(ROUTE) { 28 | ModernPoetryBookmarksRoute( 29 | onBackClick = onBackClick, 30 | onItemClick = onItemClick 31 | ) 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/poetry/nav/ModernPoetryReadNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.poetry.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.poetry.ModernPoetryReadRoute 16 | 17 | private const val ROUTE = "chinese_modern_poetry_read" 18 | 19 | fun NavController.navigateToChineseModernPoetryReadScreen() { 20 | this.navigate(ROUTE) 21 | } 22 | 23 | fun NavGraphBuilder.chineseModernPoetryReadScreen( 24 | onBackClick: () -> Unit 25 | ) { 26 | composable(ROUTE) { 27 | ModernPoetryReadRoute(onBackClick = onBackClick) 28 | } 29 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/poetry/nav/ModernPoetrySearchNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.poetry.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.poetry.ModernPoetrySearchRoute 16 | 17 | private const val ROUTE = "chinese_modern_poetry_search" 18 | 19 | fun NavController.navigateToChineseModernPoetrySearchScreen() { 20 | this.navigate(ROUTE) { 21 | launchSingleTop = true 22 | } 23 | } 24 | 25 | fun NavGraphBuilder.chineseModernPoetrySearchScreen( 26 | onBackClick: () -> Unit, 27 | onItemClick: (Int) -> Unit, 28 | ) { 29 | composable(ROUTE) { 30 | ModernPoetrySearchRoute( 31 | onBackClick = onBackClick, 32 | onItemClick = onItemClick 33 | ) 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/proverb/ProverbBookmarksViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.proverb 11 | 12 | import androidx.lifecycle.ViewModel 13 | import androidx.lifecycle.viewModelScope 14 | import androidx.paging.cachedIn 15 | import com.hefengbao.jingmo.data.repository.chinese.ProverbRepository 16 | import dagger.hilt.android.lifecycle.HiltViewModel 17 | import javax.inject.Inject 18 | 19 | @HiltViewModel 20 | class ProverbBookmarksViewModel @Inject constructor( 21 | repository: ProverbRepository, 22 | ) : ViewModel() { 23 | val proverbEntityCollections = repository.collections().cachedIn(viewModelScope) 24 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/proverb/nav/ProverbBookmarksNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.proverb.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.proverb.ProverbBookmarksRoute 16 | 17 | private const val ROUTE = "chinese_proverb_bookmarks" 18 | 19 | fun NavController.navigateToChineseProverbBookmarksScreen() { 20 | this.navigate(ROUTE) { launchSingleTop = true } 21 | } 22 | 23 | fun NavGraphBuilder.chineseProverbBookmarksScreen( 24 | onBackClick: () -> Unit, 25 | onItemClick: (Int) -> Unit, 26 | ) { 27 | composable(ROUTE) { 28 | ProverbBookmarksRoute( 29 | onBackClick = onBackClick, 30 | onItemClick = onItemClick 31 | ) 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/proverb/nav/ProverbReadNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.proverb.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.proverb.ProverbReadRoute 16 | 17 | private const val ROUTE = "chinese_proverb_read" 18 | 19 | fun NavController.navigateToChineseProverbReadScreen() { 20 | this.navigate(ROUTE) 21 | } 22 | 23 | fun NavGraphBuilder.chineseProverbReadScreen( 24 | onBackClick: () -> Unit 25 | ) { 26 | composable(ROUTE) { 27 | ProverbReadRoute(onBackClick = onBackClick) 28 | } 29 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/proverb/nav/ProverbSearchNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.proverb.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.proverb.ProverbSearchRoute 16 | 17 | private const val ROUTE = "chinese_proverb_search" 18 | 19 | fun NavController.navigateToChineseProverbSearchScreen() { 20 | this.navigate(ROUTE) { 21 | launchSingleTop = true 22 | } 23 | } 24 | 25 | fun NavGraphBuilder.chineseProverbSearchScreen( 26 | onBackClick: () -> Unit, 27 | onItemClick: (Int) -> Unit, 28 | ) { 29 | composable(ROUTE) { 30 | ProverbSearchRoute( 31 | onBackClick = onBackClick, 32 | onItemClick = onItemClick 33 | ) 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/quote/QuoteBookmarksViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.quote 11 | 12 | import androidx.lifecycle.ViewModel 13 | import androidx.lifecycle.viewModelScope 14 | import androidx.paging.cachedIn 15 | import com.hefengbao.jingmo.data.repository.chinese.QuoteRepository 16 | import dagger.hilt.android.lifecycle.HiltViewModel 17 | import javax.inject.Inject 18 | 19 | @HiltViewModel 20 | class QuoteBookmarksViewModel @Inject constructor( 21 | repository: QuoteRepository, 22 | ) : ViewModel() { 23 | val collections = repository.collections().cachedIn(viewModelScope) 24 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/quote/nav/QuoteBookmarksNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.quote.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.quote.QuoteBookmarksRoute 16 | 17 | private const val ROUTE = "chinese_quote_bookmarks" 18 | 19 | fun NavController.navigateToChineseQuoteBookmarksScreen() { 20 | this.navigate(ROUTE) { launchSingleTop = true } 21 | } 22 | 23 | fun NavGraphBuilder.chineseQuoteBookmarksScreen( 24 | onBackClick: () -> Unit, 25 | onItemClick: (Int) -> Unit, 26 | ) { 27 | composable(ROUTE) { 28 | QuoteBookmarksRoute( 29 | onBackClick = onBackClick, 30 | onItemClick = onItemClick 31 | ) 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/quote/nav/QuoteReadNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.quote.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.quote.QuoteReadRoute 16 | 17 | private const val ROUTE = "chinese_quote_read" 18 | 19 | fun NavController.navigateToChineseQuoteReadScreen() { 20 | this.navigate(ROUTE) 21 | } 22 | 23 | fun NavGraphBuilder.chineseQuoteReadScreen( 24 | onBackClick: () -> Unit 25 | ) { 26 | composable(ROUTE) { 27 | QuoteReadRoute(onBackClick = onBackClick) 28 | } 29 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/quote/nav/QuoteSearchNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.quote.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.quote.QuoteSearchRoute 16 | 17 | private const val ROUTE = "chinese_quote_search" 18 | 19 | fun NavController.navigateToChineseQuoteSearchScreen() { 20 | this.navigate(ROUTE) { 21 | launchSingleTop = true 22 | } 23 | } 24 | 25 | fun NavGraphBuilder.chineseQuoteSearchScreen( 26 | onBackClick: () -> Unit, 27 | onItemClick: (Int) -> Unit, 28 | ) { 29 | composable(ROUTE) { 30 | QuoteSearchRoute( 31 | onBackClick = onBackClick, 32 | onItemClick = onItemClick 33 | ) 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/riddle/nav/RiddleInfoNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.riddle.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.riddle.RiddleInfoRoute 16 | 17 | private const val ROUTE = "chinese_riddle_info" 18 | 19 | fun NavController.navigateToChineseRiddleInfoScreen() { 20 | this.navigate(ROUTE) 21 | } 22 | 23 | fun NavGraphBuilder.chineseRiddleInfoScreen( 24 | onBackClick: () -> Unit, 25 | ) { 26 | composable(ROUTE) { 27 | RiddleInfoRoute( 28 | onBackClick = onBackClick 29 | ) 30 | } 31 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/riddle/nav/RiddleReadNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.riddle.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.riddle.RiddleReadRoute 16 | 17 | private const val ROUTE = "chinese_riddle_read" 18 | 19 | fun NavController.navigateToChineseRiddleReadScreen() { 20 | this.navigate(ROUTE) 21 | } 22 | 23 | fun NavGraphBuilder.chineseRiddleReadScreen( 24 | onBackClick: () -> Unit, 25 | onInfoClick: () -> Unit, 26 | ) { 27 | composable( 28 | route = ROUTE 29 | ) { 30 | RiddleReadRoute( 31 | onBackClick = onBackClick, 32 | onInfoClick = onInfoClick, 33 | ) 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/riddle/nav/RiddleSearchNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.riddle.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.riddle.RiddleSearchRoute 16 | 17 | private const val ROUTE = "chinese_riddle_search" 18 | 19 | fun NavController.navigateToChineseRiddleSearchScreen() { 20 | this.navigate(ROUTE) 21 | } 22 | 23 | fun NavGraphBuilder.chineseRiddleSearchScreen( 24 | onBackClick: () -> Unit 25 | ) { 26 | composable(ROUTE) { 27 | RiddleSearchRoute( 28 | onBackClick = onBackClick 29 | ) 30 | } 31 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/wisecrack/WisecrackBookmarksViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.wisecrack 11 | 12 | import androidx.lifecycle.ViewModel 13 | import androidx.lifecycle.viewModelScope 14 | import androidx.paging.cachedIn 15 | import com.hefengbao.jingmo.data.repository.chinese.WisecrackRepository 16 | import dagger.hilt.android.lifecycle.HiltViewModel 17 | import kotlinx.coroutines.launch 18 | import javax.inject.Inject 19 | 20 | @HiltViewModel 21 | class WisecrackBookmarksViewModel @Inject constructor( 22 | private val repository: WisecrackRepository 23 | ) : ViewModel() { 24 | val bookmarks = repository.collections().cachedIn(viewModelScope) 25 | 26 | fun setUncollect(id: Int) { 27 | viewModelScope.launch { 28 | repository.uncollect(id) 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/wisecrack/nav/WisecrackBookmarksNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.wisecrack.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.wisecrack.ChineseWisecrackBookmarksRoute 16 | 17 | private const val ROUTE = "chinese_wisecrack_bookmarks" 18 | 19 | fun NavController.navigateToChineseWisecrackBookmarksScreen() { 20 | this.navigate(ROUTE) 21 | } 22 | 23 | fun NavGraphBuilder.chineseWisecrackBookmarksScreen( 24 | onBackClick: () -> Unit 25 | ) { 26 | composable(ROUTE) { 27 | ChineseWisecrackBookmarksRoute( 28 | onBackClick = onBackClick 29 | ) 30 | } 31 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/wisecrack/nav/WisecrackReadNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.wisecrack.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.wisecrack.ChineseWisecrackReadRoute 16 | 17 | private const val ROUTE = "chinese_wisecrack_read" 18 | 19 | fun NavController.navigateToChineseWisecrackReadScreen() { 20 | this.navigate(ROUTE) { 21 | launchSingleTop = true 22 | } 23 | } 24 | 25 | fun NavGraphBuilder.chineseWisecrackReadScreen( 26 | onBackClick: () -> Unit, 27 | onCaptureClick: (Int) -> Unit, 28 | ) { 29 | composable(ROUTE) { 30 | ChineseWisecrackReadRoute( 31 | onBackClick = onBackClick, 32 | onCaptureClick = onCaptureClick, 33 | ) 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/chinese/wisecrack/nav/WisecrackSearchNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.chinese.wisecrack.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.chinese.wisecrack.ChineseWisecrackSearchRoute 16 | 17 | private const val ROUTE = "chinese_wisecrack_search" 18 | 19 | fun NavController.navigateToChineseWisecrackSearchScreen() { 20 | this.navigate(ROUTE) 21 | } 22 | 23 | fun NavGraphBuilder.chineseWisecrackSearchScreen( 24 | onBackClick: () -> Unit, 25 | onItemClick: (id: Int) -> Unit 26 | ) { 27 | composable(ROUTE) { 28 | ChineseWisecrackSearchRoute( 29 | onBackClick = onBackClick, 30 | onItemClick = onItemClick 31 | ) 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/classicalliterature/classicpoem/ClassicPoemBookmarksViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.classicalliterature.classicpoem 11 | 12 | import androidx.lifecycle.ViewModel 13 | import androidx.lifecycle.viewModelScope 14 | import androidx.paging.cachedIn 15 | import com.hefengbao.jingmo.data.repository.classicalliterature.ClassicPoemRepository 16 | import dagger.hilt.android.lifecycle.HiltViewModel 17 | import javax.inject.Inject 18 | 19 | @HiltViewModel 20 | class ClassicPoemBookmarksViewModel @Inject constructor( 21 | repository: ClassicPoemRepository 22 | ) : ViewModel() { 23 | val poems = repository.collections().cachedIn(viewModelScope) 24 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/classicalliterature/classicpoem/nav/ClassicPoemReadNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.classicalliterature.classicpoem.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.classicalliterature.classicpoem.ClassicPoemReadRoute 16 | 17 | private const val ROUTE = "classical_literature_classic_poem_read" 18 | 19 | fun NavController.navigateToClassicalLiteratureClassicPoemReadScreen() { 20 | this.navigate(ROUTE) { 21 | launchSingleTop = true 22 | } 23 | } 24 | 25 | fun NavGraphBuilder.classicalLiteratureClassicPoemReadScreen( 26 | onBackClick: () -> Unit 27 | ) { 28 | composable(ROUTE) { 29 | ClassicPoemReadRoute( 30 | onBackClick = onBackClick 31 | ) 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/classicalliterature/classicpoem/nav/ClassicPoemSearchNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.classicalliterature.classicpoem.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.classicalliterature.classicpoem.ClassicPoemSearchRoute 16 | 17 | private const val ROUTE = "classical_literature_classic_poem_search" 18 | 19 | fun NavController.navigateToClassicalLiteratureClassicPoemSearchScreen() { 20 | this.navigate(ROUTE) { 21 | launchSingleTop = true 22 | } 23 | } 24 | 25 | fun NavGraphBuilder.classicalLiteratureClassicPoemSearchScreen( 26 | onBackClick: () -> Unit, 27 | onItemClick: (Int) -> Unit 28 | ) { 29 | composable(ROUTE) { 30 | ClassicPoemSearchRoute(onBackClick = onBackClick, onItemClick = onItemClick) 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/classicalliterature/sentence/SentenceBookmarksViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.classicalliterature.sentence 11 | 12 | import androidx.lifecycle.ViewModel 13 | import androidx.lifecycle.viewModelScope 14 | import androidx.paging.cachedIn 15 | import com.hefengbao.jingmo.data.repository.classicalliterature.SentenceRepository 16 | import dagger.hilt.android.lifecycle.HiltViewModel 17 | import kotlinx.coroutines.launch 18 | import javax.inject.Inject 19 | 20 | @HiltViewModel 21 | class SentenceBookmarksViewModel @Inject constructor( 22 | private val repository: SentenceRepository 23 | ) : ViewModel() { 24 | val bookmarks = repository.collections().cachedIn(viewModelScope) 25 | 26 | fun setUncollect(id: Int) { 27 | viewModelScope.launch { 28 | repository.uncollect(id) 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/classicalliterature/sentence/nav/SentenceBookmarksNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.classicalliterature.sentence.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.classicalliterature.sentence.SentenceBookmarksRoute 16 | 17 | private const val ROUTE = "classical_literature_sentence_bookmarks" 18 | 19 | fun NavController.navigateToClassicalLiteratureSentenceBookmarksScreen() { 20 | this.navigate(ROUTE) { 21 | launchSingleTop = true 22 | } 23 | } 24 | 25 | fun NavGraphBuilder.classicalLiteratureSentenceBookmarksScreen( 26 | onBackClick: () -> Unit 27 | ) { 28 | composable(ROUTE) { 29 | SentenceBookmarksRoute( 30 | onBackClick = onBackClick 31 | ) 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/classicalliterature/sentence/nav/SentenceReadNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.classicalliterature.sentence.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.classicalliterature.sentence.SentenceReadRoute 16 | 17 | private const val ROUTE = "classical_literature_sentence_read" 18 | 19 | fun NavController.navigateToClassicalLiteratureSentenceReadScreen() { 20 | this.navigate(ROUTE) { 21 | launchSingleTop = true 22 | } 23 | } 24 | 25 | fun NavGraphBuilder.classicalLiteratureSentenceReadScreen( 26 | onBackClick: () -> Unit, 27 | onCaptureClick: (Int) -> Unit, 28 | ) { 29 | composable(ROUTE) { 30 | SentenceReadRoute(onBackClick = onBackClick, onCaptureClick = onCaptureClick) 31 | } 32 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/classicalliterature/sentence/nav/SentenceSearchNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.classicalliterature.sentence.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.classicalliterature.sentence.SentenceSearchRoute 16 | 17 | private const val ROUTE = "classical_literature_sentence_search" 18 | 19 | fun NavController.navigateToClassicalLiteratureSentenceSearchScreen() { 20 | this.navigate(ROUTE) 21 | } 22 | 23 | fun NavGraphBuilder.classicalLiteratureSentenceSearchScreen( 24 | onBackClick: () -> Unit, 25 | onCaptureClick: (Int) -> Unit, 26 | ) { 27 | composable( 28 | ROUTE 29 | ) { 30 | SentenceSearchRoute( 31 | onBackClick = onBackClick, 32 | onCardClick = onCaptureClick 33 | ) 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/classicalliterature/writing/WritingBookmarksViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.classicalliterature.writing 11 | 12 | import androidx.lifecycle.ViewModel 13 | import androidx.lifecycle.viewModelScope 14 | import androidx.paging.cachedIn 15 | import com.hefengbao.jingmo.data.repository.classicalliterature.WritingRepository 16 | import dagger.hilt.android.lifecycle.HiltViewModel 17 | import javax.inject.Inject 18 | 19 | @HiltViewModel 20 | class WritingBookmarksViewModel @Inject constructor( 21 | writingRepository: WritingRepository 22 | ) : ViewModel() { 23 | val writings = writingRepository.collections().cachedIn(viewModelScope) 24 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/classicalliterature/writing/nav/WritingBookmarksNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.classicalliterature.writing.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.classicalliterature.writing.WritingBookmarksRoute 16 | 17 | private const val ROUTE = "classical_literature_writing_bookmarks" 18 | 19 | fun NavController.navigateToClassicalLiteratureWritingBookmarksScreen() { 20 | this.navigate(ROUTE) { 21 | launchSingleTop = true 22 | } 23 | } 24 | 25 | fun NavGraphBuilder.classicalLiteratureWritingBookmarksScreen( 26 | onBackClick: () -> Unit, 27 | onItemClick: (id: Int) -> Unit, 28 | ) { 29 | composable(ROUTE) { 30 | WritingBookmarksRoute( 31 | onBackClick = onBackClick, 32 | onItemClick = onItemClick 33 | ) 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/classicalliterature/writing/nav/WritingReadNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.classicalliterature.writing.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.classicalliterature.writing.WritingReadRoute 16 | 17 | private const val ROUTE = "classical_literature_writing_read" 18 | 19 | fun NavController.navigateToClassicalLiteratureWritingReadScreen() { 20 | this.navigate(ROUTE) { 21 | launchSingleTop = true 22 | } 23 | } 24 | 25 | fun NavGraphBuilder.classicalLiteratureWritingReadScreen( 26 | onBackClick: () -> Unit, 27 | onCaptureClick: (Int) -> Unit, 28 | ) { 29 | composable(ROUTE) { 30 | WritingReadRoute( 31 | onBackClick = onBackClick, 32 | onCaptureClick = onCaptureClick 33 | ) 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/classicalliterature/writing/nav/WritingSearchNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.classicalliterature.writing.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.classicalliterature.writing.WritingSearchRoute 16 | 17 | private const val ROUTE = "classical_literature_writing_search" 18 | 19 | fun NavController.navigateToClassicalLiteratureWritingSearchScreen() { 20 | this.navigate(ROUTE) { 21 | launchSingleTop = true 22 | } 23 | } 24 | 25 | fun NavGraphBuilder.classicalLiteratureWritingSearchScreen( 26 | onBackClick: () -> Unit, 27 | onItemClick: (id: String) -> Unit, 28 | ) { 29 | composable( 30 | route = ROUTE, 31 | ) { 32 | WritingSearchRoute( 33 | onBackClick = onBackClick, 34 | onItemClick = onItemClick, 35 | ) 36 | } 37 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/link/LinkIndexViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.link 11 | 12 | import androidx.lifecycle.ViewModel 13 | import androidx.lifecycle.viewModelScope 14 | import com.hefengbao.jingmo.data.model.Link 15 | import com.hefengbao.jingmo.data.repository.LinksRepository 16 | import dagger.hilt.android.lifecycle.HiltViewModel 17 | import kotlinx.coroutines.flow.MutableStateFlow 18 | import kotlinx.coroutines.flow.StateFlow 19 | import kotlinx.coroutines.launch 20 | import javax.inject.Inject 21 | 22 | @HiltViewModel 23 | class LinkIndexViewModel @Inject constructor( 24 | private val repository: LinksRepository 25 | ) : ViewModel() { 26 | private val _links: MutableStateFlow> = MutableStateFlow(emptyList()) 27 | val links: StateFlow> = _links 28 | 29 | fun getList() { 30 | viewModelScope.launch { 31 | _links.value = repository.list() 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/link/nav/LinkIndexNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.link.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.link.LinkIndexRoute 16 | 17 | private const val ROUTE = "link_index" 18 | 19 | fun NavController.navigateToLinkIndexScreen() { 20 | this.navigate(ROUTE) 21 | } 22 | 23 | fun NavGraphBuilder.linkIndexScreen( 24 | onBackClick: () -> Unit 25 | ) { 26 | composable( 27 | route = ROUTE 28 | ) { 29 | LinkIndexRoute( 30 | onBackClick = onBackClick 31 | ) 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/settings/components/SettingsTitle.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.settings.components 11 | 12 | import androidx.compose.foundation.layout.fillMaxWidth 13 | import androidx.compose.foundation.layout.padding 14 | import androidx.compose.material3.MaterialTheme 15 | import androidx.compose.material3.Text 16 | import androidx.compose.runtime.Composable 17 | import androidx.compose.ui.Modifier 18 | import androidx.compose.ui.unit.dp 19 | 20 | @Composable 21 | fun SettingsTitle(modifier: Modifier = Modifier, title: String) { 22 | Text( 23 | modifier = modifier 24 | .fillMaxWidth() 25 | .padding(16.dp, 8.dp), 26 | text = title, 27 | style = MaterialTheme.typography.labelLarge, 28 | color = MaterialTheme.colorScheme.onBackground.copy(alpha = .5f), 29 | ) 30 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/settings/nav/AboutNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.settings.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.settings.AboutRoute 16 | 17 | private const val ROUTE_ABOUT = "about" 18 | 19 | fun NavController.navigateToAboutScreen() { 20 | this.navigate(ROUTE_ABOUT) 21 | } 22 | 23 | fun NavGraphBuilder.aboutScreen( 24 | onBackClick: () -> Unit 25 | ) { 26 | composable(ROUTE_ABOUT) { 27 | AboutRoute(onBackClick) 28 | } 29 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/settings/nav/DataNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.settings.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.settings.DataRoute 16 | 17 | private const val ROUTE_DATA = "settings_data" 18 | 19 | fun NavController.navigateToSettingsDataScreen() { 20 | this.navigate(ROUTE_DATA) 21 | } 22 | 23 | fun NavGraphBuilder.settingsDataScreen( 24 | onBackClick: () -> Unit 25 | ) { 26 | composable(ROUTE_DATA) { 27 | DataRoute( 28 | onBackClick = onBackClick 29 | ) 30 | } 31 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/settings/nav/HomeItemManagerNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.settings.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.settings.HomeItemManagerRoute 16 | 17 | private const val ROUTE = "settings_homeitemmanager" 18 | 19 | fun NavController.navigateToHomeItemManagerScreen() { 20 | this.navigate(ROUTE) { 21 | launchSingleTop = true 22 | } 23 | } 24 | 25 | fun NavGraphBuilder.homeItemManagerScreen( 26 | onBackClick: () -> Unit 27 | ) { 28 | composable(ROUTE) { 29 | HomeItemManagerRoute( 30 | onBackClick = onBackClick 31 | ) 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/settings/nav/ImportNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.settings.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.settings.ImportRoute 16 | 17 | private const val ROUTE = "settings_import_data" 18 | 19 | fun NavController.navigateToImportScreen() { 20 | this.navigate(ROUTE) { 21 | launchSingleTop = true 22 | } 23 | } 24 | 25 | fun NavGraphBuilder.importScreen( 26 | onBackClick: () -> Unit 27 | ) { 28 | composable(ROUTE) { 29 | ImportRoute( 30 | onBackClick = onBackClick 31 | ) 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/screen/settings/nav/PrivacyNav.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.screen.settings.nav 11 | 12 | import androidx.navigation.NavController 13 | import androidx.navigation.NavGraphBuilder 14 | import androidx.navigation.compose.composable 15 | import com.hefengbao.jingmo.ui.screen.settings.PrivacyRoute 16 | 17 | private const val ROUTE_PRIVACY = "privacy" 18 | 19 | fun NavController.navigateToPrivacyScreen() { 20 | this.navigate(ROUTE_PRIVACY) 21 | } 22 | 23 | fun NavGraphBuilder.privacyScreen( 24 | onBackClick: () -> Unit 25 | ) { 26 | composable(ROUTE_PRIVACY) { 27 | PrivacyRoute(onBackClick) 28 | } 29 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/theme/Background.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.theme 11 | 12 | import androidx.compose.runtime.Immutable 13 | import androidx.compose.runtime.staticCompositionLocalOf 14 | import androidx.compose.ui.graphics.Color 15 | import androidx.compose.ui.unit.Dp 16 | 17 | /** 18 | * A class to model background color and tonal elevation values for Now in Android. 19 | */ 20 | @Immutable 21 | data class BackgroundTheme( 22 | val color: Color = Color.Unspecified, 23 | val tonalElevation: Dp = Dp.Unspecified, 24 | ) 25 | 26 | /** 27 | * A composition local for [BackgroundTheme]. 28 | */ 29 | val LocalBackgroundTheme = staticCompositionLocalOf { BackgroundTheme() } 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/theme/Gradient.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.theme 11 | 12 | import androidx.compose.runtime.Immutable 13 | import androidx.compose.runtime.staticCompositionLocalOf 14 | import androidx.compose.ui.graphics.Color 15 | 16 | /** 17 | * A class to model gradient color values for Now in Android. 18 | * 19 | * @param top The top gradient color to be rendered. 20 | * @param bottom The bottom gradient color to be rendered. 21 | * @param container The container gradient color over which the gradient will be rendered. 22 | */ 23 | @Immutable 24 | data class GradientColors( 25 | val top: Color = Color.Unspecified, 26 | val bottom: Color = Color.Unspecified, 27 | val container: Color = Color.Unspecified, 28 | ) 29 | 30 | /** 31 | * A composition local for [GradientColors]. 32 | */ 33 | val LocalGradientColors = staticCompositionLocalOf { GradientColors() } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/hefengbao/jingmo/ui/theme/Tint.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the 京墨(jingmo)APP. 3 | * 4 | * (c) 贺丰宝(hefengbao) 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | package com.hefengbao.jingmo.ui.theme 11 | 12 | import androidx.compose.runtime.Immutable 13 | import androidx.compose.runtime.staticCompositionLocalOf 14 | import androidx.compose.ui.graphics.Color 15 | 16 | /** 17 | * A class to model background color and tonal elevation values for Now in Android. 18 | */ 19 | @Immutable 20 | data class TintTheme( 21 | val iconTint: Color = Color.Unspecified, 22 | ) 23 | 24 | /** 25 | * A composition local for [TintTheme]. 26 | */ 27 | val LocalTintTheme = staticCompositionLocalOf { TintTheme() } 28 | -------------------------------------------------------------------------------- /app/src/main/proto/user_preferences.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | option java_package = "com.hefengbao.jingmo.datastore"; 4 | option java_multiple_files = true; 5 | 6 | message UserPreferences { 7 | 8 | bool poem_synced = 16; 9 | uint32 poem_count = 17; 10 | uint32 poem_last_read_id = 18; 11 | bool tag_synced = 19; 12 | uint32 tag_count = 20; 13 | bool poem_tag_synced = 21; 14 | uint32 poem_tag_count = 22; 15 | bool writer_synced = 23; 16 | uint32 writer_count = 24; 17 | bool poem_sentence_synced = 25; 18 | uint32 poem_sentence_count = 26; 19 | uint32 poem_sentence_last_read_id = 27; 20 | bool idiom_synced = 28; 21 | uint32 idiom_count = 29; 22 | uint32 idiom_last_read_id = 30; 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_actionbar_tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/app/src/main/res/drawable-hdpi/ic_actionbar_tab.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_actionbar_tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/app/src/main/res/drawable-mdpi/ic_actionbar_tab.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_actionbar_tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/app/src/main/res/drawable-xhdpi/ic_actionbar_tab.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_actionbar_tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/app/src/main/res/drawable-xxhdpi/ic_actionbar_tab.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_nowinlife.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/app/src/main/res/drawable/ic_nowinlife.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_nowinlife_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/app/src/main/res/drawable/ic_nowinlife_black.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_nowinlife_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/app/src/main/res/drawable/ic_nowinlife_white.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/widget_idiom_preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/app/src/main/res/drawable/widget_idiom_preview.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/widget_poem_preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/app/src/main/res/drawable/widget_poem_preview.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/widget_poem_sentence_preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/app/src/main/res/drawable/widget_poem_sentence_preview.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/app/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/app/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 15 | 16 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/xml/backup_rules.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/xml/data_extraction_rules.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 12 | 13 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/xml/idiom_widget_info.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/xml/network_security_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | hefengbao.github.io 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/xml/poem_sentence_widget_info.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/xml/poem_widget_info.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/test/java/com/hefengbao/jingmo/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.hefengbao.jingmo 2 | 3 | import org.junit.Assert.assertEquals 4 | import org.junit.Test 5 | 6 | /** 7 | * Example local unit test, which will execute on the development machine (host). 8 | * 9 | * See [testing documentation](http://d.android.com/tools/testing). 10 | */ 11 | class ExampleUnitTest { 12 | @Test 13 | fun addition_isCorrect() { 14 | assertEquals(4, 2 + 2) 15 | } 16 | } -------------------------------------------------------------------------------- /build.gradle.kts: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | @Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed 3 | plugins { 4 | alias(libs.plugins.com.android.application) apply false 5 | alias(libs.plugins.org.jetbrains.kotlin.android) apply false 6 | alias(libs.plugins.hilt) apply false 7 | alias(libs.plugins.ksp) apply false 8 | alias(libs.plugins.kotlin.serialization) apply false 9 | alias(libs.plugins.kotlin.compose.compiler) apply false 10 | } 11 | true // Needed to make the Suppress annotation work for the plugins block -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Aug 17 14:07:48 CST 2023 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /screenshot/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/screenshot/1.png -------------------------------------------------------------------------------- /screenshot/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/screenshot/2.png -------------------------------------------------------------------------------- /screenshot/alipay.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/screenshot/alipay.jpg -------------------------------------------------------------------------------- /screenshot/d/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/screenshot/d/1.jpg -------------------------------------------------------------------------------- /screenshot/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/screenshot/logo.png -------------------------------------------------------------------------------- /screenshot/v1.13.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/screenshot/v1.13.0.png -------------------------------------------------------------------------------- /screenshot/v1.14.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/screenshot/v1.14.0.png -------------------------------------------------------------------------------- /screenshot/wechatpay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/screenshot/wechatpay.png -------------------------------------------------------------------------------- /screenshot/公众号.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hefengbao/jingmo/503b345369fbf80c9ac921bcf31cf0e073d2c64a/screenshot/公众号.png -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | gradlePluginPortal() 6 | } 7 | } 8 | dependencyResolutionManagement { 9 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 10 | repositories { 11 | google() 12 | mavenCentral() 13 | } 14 | } 15 | 16 | rootProject.name = "jingmo" 17 | include(":app") 18 | --------------------------------------------------------------------------------