Compare commits

...

155 Commits

Author SHA1 Message Date
nyagami 8f6c390dc2 Fix issues reported by pre-alpha users - patch 2 (#906)
* delete background_action key before action done

* force to delete BACKGROUND_ACTION.
in case app is shutdowned while running bg actions
2024-01-24 09:02:53 +07:00
nyagami 0cf75fd6f9 Fix: pre-alpha-patch-1 (#905)
* fix: wrong version checker, update lastused

* fix: only show update dialog if newer version

* fix: remove chapter id in chapter item

* fix: date in chapter drawer

* fix: decode uri for local epub

* fix: simpler SetCategoriesModal

* fix: not allow local as default

* fix: no delay on selfhost backup/restore
2024-01-22 23:08:27 +07:00
nyagami b823c913b5 Last step to Alpha (#904)
* update CONTRIBUTING.md

* fix: change host branch

* fix: remove showToast from plugin sandbox

* update actions

* update version
2024-01-22 08:55:30 +07:00
nyagami 01e6e9873e More fetch, add urlencode (#903)
* feat: add fetchText

* minor: add urlencode
2024-01-21 15:35:01 +07:00
nyagami d299e91a93 Merge pull request #897 from nyagami/main-feats
Add some features from main, improve UI
2024-01-21 13:05:32 +07:00
nyagami 430e5712fa fix: add chapter number, fix novel screen ui 2024-01-20 20:49:16 +07:00
nyagami 551425c018 feat: artist name,
fix: chapter release as local time
2024-01-20 18:26:45 +07:00
nyagami 665bca00ea fix: regex freeze app 2024-01-18 23:16:09 +07:00
nyagami 2ec6032673 chores: add translations 2024-01-18 15:40:37 +07:00
nyagami d52f630775 fix: circle requires in deleteCachedNovels 2024-01-18 15:04:22 +07:00
nyagami 3e7f51e9ae feat: custom UserAgent 2024-01-18 14:56:31 +07:00
nyagami bc977fd0cb feat: useUserAgent 2024-01-18 14:23:32 +07:00
nyagami deef93172b fix: clear novel settings when deleting 2024-01-18 14:12:26 +07:00
nyagami fa8b69a630 fix: chapter drawer layout 2024-01-18 14:07:04 +07:00
nyagami abd8d65914 fix: cleanup 2024-01-18 12:50:36 +07:00
Nyagami c71dda77d4 feat: save novel cover to download folder (if possible)
remove clear cached covers
2024-01-18 00:18:57 +07:00
Nyagami c2caee6ef9 replace FastImage by regular Image
- Glide -> Fresco (image loader)
2024-01-17 18:41:22 +07:00
Nyagami e2588908c1 minor: page number required in searchNovels 2024-01-16 17:39:40 +07:00
Nyagami 9b36043a00 feat: search next page 2024-01-15 23:24:19 +07:00
Nyagami 72fe3bb0f3 remove Flipper (which may cause internet stuck) 2024-01-15 21:01:13 +07:00
Nyagami 9f75945cf6 fix: skip chapter when error downloading 2024-01-15 20:47:36 +07:00
Nyagami 82f2b4e3b5 fix: filter picker value text color 2024-01-15 20:22:15 +07:00
Nyagami bdb7eb4521 fix: expo notification icon (not app icon) 2024-01-15 19:59:37 +07:00
Nyagami c42f0a0bb0 fix: background actions notification icon 2024-01-15 19:57:37 +07:00
Nyagami a33db07583 fix: expo notification icon 2024-01-15 19:45:23 +07:00
Nyagami 2b99c3d17d fix: android user-agent 2024-01-14 23:22:48 +07:00
Nyagami 6ea1ecb43d fix: handle fetchApi for 2 kind of headers 2024-01-14 23:22:18 +07:00
Nyagami bbe5ccea81 remove cookie stuffs 2024-01-14 23:19:05 +07:00
Nyagami da3a589c88 refactor MMKV backup data to util 2024-01-14 14:56:47 +07:00
Nyagami 26b312372e add tracker client variables for build action 2024-01-14 14:22:13 +07:00
Nyagami 39dc3ec8d6 fix: center label when no badge in library 2024-01-14 11:34:04 +07:00
Nyagami 560848f5d5 fix: reader bottom tab border 2024-01-14 11:32:55 +07:00
Nyagami 0bbd0da68c fix: ui for tracker 2024-01-14 10:24:39 +07:00
Nyagami bbdd569522 fix: jump to chapter modal keyboard 2024-01-14 10:02:08 +07:00
Nyagami 937e789b67 fix: exclude some MMKV keys when backup 2024-01-14 09:47:58 +07:00
Nyagami f8647a8e49 upgrade react-native-paper to fix modal ondismis 2024-01-14 02:12:12 +07:00
Nyagami f93bceb136 remove play button from history 2024-01-13 22:46:58 +07:00
Nyagami e8d343893f add animated fab 2024-01-13 22:38:48 +07:00
Nyagami 769ff36352 custom js, css modal 2024-01-13 22:02:30 +07:00
Nyagami 1253f44413 update ui for installed plugined 2024-01-13 17:52:02 +07:00
Nyagami 1c802c5e3b fix: update plugin logic 2024-01-13 17:50:55 +07:00
Nyagami a19b374cb4 fix: small plugin card, loading when installing 2024-01-13 16:25:53 +07:00
nyagami 420603f911 Replace Redux thunk by react native MMKV (#893)
* refactor: useBoolean hook

* refactor: useGithubUpdateChecker hook

* refactor: move showToast to utils

* refactor: useBackHandler hook

* refactor: useTextToSpeech hook

* refactor: useDeviceOrientation hook

* refactor: usePreviousRouteName hook

* refactor: useFullscreenMode hook

* refactor: useSearch hook

* refactor: useTheme hook

* fix: remove updates reducer

* refactor: useCategories hook

* refactor: useHistory hook

* refactor: useLibrarySettings hook
remove unused useCategories hook

* fix: reanimated version for expo

* refactor: library, chatper hooks

* refactor: app, browse settings hooks

* refactor: usePlugins hook

* fix: max depth in useEffect, plugins state logic

* feat: add Anilist tracker

* refactor: useTracker hook

* useTrackedNovel hook

* minor fixs

* refactor: useNovel hook

* minor fix: book mark button

* refactor: useDownload hook

* fix: migrate function

* remove redux + cleanup

* update node version for build

* fix: download Queue, migrate action

* fix: increaes hit slop for thumb, add reader playground

* fix: plugins not updated when installing while searching

* fix: safe plugin management

* Squashed commit of the following:

commit 51968f66bdd69f28f1863b5668f9511ba53c3fff
Author: Nyagami <hoangquan05112002@gmail.com>
Date:   Sat Jan 13 13:20:33 2024 +0700

    better logic for download progress bar

commit 5069de11644e7aece39efc73dfd80d093982b032
Author: Nyagami <hoangquan05112002@gmail.com>
Date:   Sat Jan 13 13:14:33 2024 +0700

    fix: delete BACKGROUND_ACTION in finally clause

commit 181103e994831da6744d122faaa60c48da529a63
Author: Nyagami <hoangquan05112002@gmail.com>
Date:   Sat Jan 13 13:10:56 2024 +0700

    update react-native-background-actions
2024-01-13 14:28:24 +05:30
nyagami 7a6710dc0b feat: Google Drive Backup (#872)
* setup google signin

* minify build scripts, add google signin modal

* feat: Drive backup

* feat: drive restore

* fix: remote backup

* upgrade react native to stable version
+ less build configs

* fix: path separator.
feat: sync backup between 2 methods

* legacy backup

* fix: expo speech
2024-01-07 16:58:05 +05:30
Marcin Majewski 7262f1d249 Filters Redesign (#856)
New filters system adding intelisense

Co-authored-by: Rajarshee Chatterjee <rajarshee.adm@gmail.com>
2023-12-27 19:36:45 +05:30
nyagami 5c12540071 refactor: Convert Javascript files into Typescript (#845)
* cheaper debug build

* index.ts, App.tsx

* TS for navigators

* TS NovelScreen

* TS Reader Screen

* TS More Screen

* TS Source Screen

* TS Browse Settings Screen

* TS Global Search Screen

* fix: useNavigation for more stack

* fix: Composite Types for More Screen

* TS Browse + Migrate Screen

* TS Settings Screen

* TS util

* TS services

* fix: Library query

* TS Components

* refactor: settingsSliceV1

* refactor: Preference reducer

* TS for MAL

* refactor: Native modules

* Not TS the entry file

* fix: zip folder entry, special file name

* fix: plugin is undefined if 'local'

* fix: add param for morestack navigation

* fix: Component is bool

* fix: novel reducer

* fix: not updating local novels
2023-12-27 19:35:05 +05:30
nyagami 7fbdd92117 feat: Import EPUB (#833)
* implement classes for plugins

* feat: plugin manages UA, cookie itself

* fix: repo path

* safer regexString

* feat: EpubParser native module

* add reject to parser

* local category, better insert category trigger

* add isLocal field to Novel

* category update logic for local novels

* feat: import epub

* delete downloaded folder when delete novel

* local novel screen

* update build.yml

* fix: novel without cover
2023-11-10 18:31:09 +05:30
nyagami 5c818be5ab refactor: Classes for Plugins (#824)
* implement classes for plugins

* feat: plugin manages UA, cookie itself

* fix: repo path

* safer regexString
2023-11-04 15:46:18 +05:30
nyagami 1b25acba26 refactor: Using classes for reader UI (#775)
using classes
2023-09-15 07:46:28 +05:30
nyagami 434d03615c fix: Remove Description and Protected (#753) 2023-08-22 18:07:20 +05:30
nyagami 9bde9528df feat: FileSystem, Highlight TTS (#741)
* fix restoreCategory

* feat: using file for js, css
- cheaper seekbar (maybe)
- cheaper showScrollPercentage
- autoSaveInterval
- cheaper loading image
- cheaper error images handler (no need protected attribute anymore)

* feat: store downloads in file

* move plugins to app download folder

* Feat: Hightlight TTS
- optimise render chapter text
- scroll fix
2023-08-18 21:44:05 +05:30
nyagami 191975f0f9 Tssupport, backup AppVersion (#680)
* add exports variable

* fix: remove pinned and lasteUsed after uninstall

* fix: language filter for installed plugin

* create index for Chapter in novelId

* reorder headers parame in fetchApi

* remove Language from plugin libs

* fix: not backup empty cover

* feat: backup app version

* fix: chapter index

* feat: checkAppVersion when restoring

* update: using normal exports instead of default
move fetchFile into fetch.ts

* defaultCoverUri -> defaultCover
2023-08-17 08:49:28 +05:30
nyagami f8895b80b4 fix: wrong mincroll in Update, History. TS Reader, Navigation (Main) (#665)
* fetch prev&next chapter and text at the same time.

* typescript for Main and Reader (and some related screens)

* fix: update time order

* feat: three dots button for browse

* fix: reader got wrong minscroll

* remove unused package drawer

* fix: seekbar bottom position

* add data-set in script (Reader)
2023-08-17 08:49:14 +05:30
nyagami e5c73615f1 feat: Remote Backup (#659)
* feat: remote backup (novel, category)

* feat: full backup

* fix: throw when downloading without installed plugin

* update: using websocket to tranfer data

* remote restore

* error handler for restore

* normalize code by recursion

* Not backuping tracker.
Because users can share their backup.
And tracker setting cotains their own token.

* fix: not create .nomedia in download dir

* fix:  2 children have same key in filter input

* fix: 2 children have same key in Picker Item
2023-06-30 09:41:10 +05:30
K1ngfish3r 800eb5ee30 Update pluginManager.ts (#661)
add showToast
2023-06-30 09:39:16 +05:30
nyagami 721b7edf1c fix: new github path for plugins json files (#636)
* change plugins host

* remove suffix

* update: new github path
2023-05-16 21:10:36 +05:30
nyagami 27501b223d fix: Update Plugins Host (#627)
* change plugins host

* remove suffix
2023-05-11 21:08:21 +05:30
nyagami 0e5c4b8243 feat: Plugins & Rework Database (#579)
* remove AsyncStorage, disable hermes

* init

* update logic

* update libs for plugins

* move interface to types

* refactor, add language type

* small refactor of languages

* getPlugin

* update alias

* collect plugin on launch

* update interface Plugin

* move lang to PluginItem

* implement install plugins

* fix plugins reference

* fix fetching logic

* fix empty list

* refactor Browscreen

* implement searchNovels

* refactor plugin reducer

* try to remove old sources

* try to refactor

* tabview with theme, remove rn-fetch-blob

* update lib for plugin, temp fix for browse

* try to replace source by plugin in db

* many updates

* update db

* fix queries error

* update db

* update db

* update History table

* update db types

* format table name

* rename service

* rename field

* refactor interfaces

* update constrait

* update novel queries

* update constrait

* update novel and category queries

* more flexible category

* update library queris

* create category trigger, add constraints

* sync variables name with js rule :(

* setup database 90%

* updates queries

* queries to add novel to lib

* remove delete updates => delete download

* minor

* app work 20%

* query default one time

* createdb first

* remove 90% sources

* fix library queries

* temporary fix

* remove all source

* remove old languages constant

* update trigger

* update types

* refactor types, update trigger, refactor queries

* at least can go to novel screen

* update novel redux

* can go to novel screen

* remove generator

* change sourceId to pluginId

* can read chapter :(

* minor fix

* can use history screen

* unique key in historyscreen

* remove never use hook

* at least can use reader

* minor

* fix download queries

* fix history and chapterDrawer doenst need setNovel

* fix last read

* update click heart to follow novel

* insertNovel

* long press novels in library,

* change default category by move up

* update edit category, fix foreign constrait

* loading before get novel done

* fix categories were added.
Dont know why trigger didnt work.
So I decide to use normal queries

* fix errors when edit infos

* shorter init plugin

* fix stats screen

* minor fix for seekbar

* set re-request, fix download chapter

* hard fix:), maybe refactor it later

* must use sum to count :D

* update query

* fix migrate screen

* minor fix

* fix migrate screen and global search display

* minor

* quick fix for update screen

* update plugin props

* lol :D

* Backup work now.
But need to install plugins

* restore error backup

* If get novel without chapters. Fetch it again

* if all error novels are restored, remove error file

* minor fix

* remove never used packages.

* Complete plugin feature. Bump to RN 0.69.
I will write a  changelog soon

* fetchFile for app side

* Fix: transparent bottem sheet, undefined index.
hideNavigationBar causes transparent bottem sheet (still opening but invisible.
Hope to find an actual fix later

* newUpdateDialog without markdown

* fix: Browse plugins behaviors

* fix: reader screen crashs when plugin is not installed

* Minor fix: undefined variables when updating

* minor fix: fetchFile return base64

* only update newversion

* fix: buildReleas succesfully but app crashes when opening.
from: https://github.com/facebook/react-native/issues/34114

* fix: webview send correct body height

* Refactor: remove HistoryTable.
remove PluginStatus

* Refactor: Migrate Update and History into Chapter.
- remove nerver used hook: useChapter

* fix: edit categories modal in novel screen

* minor: LL date format

* minor: remove html2text lib

* minor: migrate inlibrary novel

* Migrate novel and clean up

* small fix for migrate function

* Database Diagram

* optimise: O(1) to determine if lastread is read

* fix: position could be undefined

* refactor: change prop name. postion.position -> postion.offsetY

* fix filter

* fix: missing param in parseChapterNumber

* not a good fix, but it works xD

* fix: Text trunct almost title, should find a better fix later.

* enable feature: migrate from browse screen

* add data-plugin-id tag

* no `ghost` novel (which has no category)

* minor fix: detele all novel categories when removing novel form lib

* minor: deleteDownloadsSnackbar

* edit warning

* add chapter tag on preview

* add id for plugin, novel, chapter. smaller padding

* Use BottomSheetModal

* implement cookies bypass

* default language filter

* change default user agent

* shorter langue native name

* missing NOVEL_ERROR

* add filterInputs

* correct spelling :)

* add dayjs

* minor: remove console.log

* update site for pluginItem

* update icon,

* minor: remove unnecessary things
2023-05-08 07:09:20 +05:30
Jaydeep Patel 2d986f263d feat: Add custom Javascript (Closes #572) (#575)
feat: Add custom Javascript
2023-03-11 11:52:16 +05:30
Rajarshee Chatterjee 684463754c chore: Update translations (#546)
* New translations strings.json (Vietnamese)
[ci skip]

* New translations strings.json (Romanian)
[ci skip]

* New translations strings.json (French)
[ci skip]

* New translations strings.json (Spanish)
[ci skip]

* New translations strings.json (Afrikaans)
[ci skip]

* New translations strings.json (Arabic)
[ci skip]

* New translations strings.json (Catalan)
[ci skip]

* New translations strings.json (Czech)
[ci skip]

* New translations strings.json (Danish)
[ci skip]

* New translations strings.json (German)
[ci skip]

* New translations strings.json (Greek)
[ci skip]

* New translations strings.json (Finnish)
[ci skip]

* New translations strings.json (Hebrew)
[ci skip]

* New translations strings.json (Hungarian)
[ci skip]

* New translations strings.json (Italian)
[ci skip]

* New translations strings.json (Japanese)
[ci skip]

* New translations strings.json (Korean)
[ci skip]

* New translations strings.json (Dutch)
[ci skip]

* New translations strings.json (Norwegian)
[ci skip]

* New translations strings.json (Polish)
[ci skip]

* New translations strings.json (Portuguese)
[ci skip]

* New translations strings.json (Russian)
[ci skip]

* New translations strings.json (Albanian)
[ci skip]

* New translations strings.json (Serbian (Cyrillic))
[ci skip]

* New translations strings.json (Swedish)
[ci skip]

* New translations strings.json (Turkish)
[ci skip]

* New translations strings.json (Ukrainian)
[ci skip]

* New translations strings.json (Chinese Simplified)
[ci skip]

* New translations strings.json (Chinese Traditional)
[ci skip]

* New translations strings.json (Vietnamese)
[ci skip]

* New translations strings.json (Portuguese, Brazilian)
[ci skip]

* New translations strings.json (Indonesian)
[ci skip]

* New translations strings.json (Hindi)
[ci skip]

* New translations strings.json (Romanian)
[ci skip]

* New translations strings.json (French)
[ci skip]

* New translations strings.json (Spanish)
[ci skip]

* New translations strings.json (Afrikaans)
[ci skip]

* New translations strings.json (Arabic)
[ci skip]

* New translations strings.json (Catalan)
[ci skip]

* New translations strings.json (Czech)
[ci skip]

* New translations strings.json (Danish)
[ci skip]

* New translations strings.json (German)
[ci skip]

* New translations strings.json (Greek)
[ci skip]

* New translations strings.json (Finnish)
[ci skip]

* New translations strings.json (Hebrew)
[ci skip]

* New translations strings.json (Hungarian)
[ci skip]

* New translations strings.json (Italian)
[ci skip]

* New translations strings.json (Japanese)
[ci skip]

* New translations strings.json (Korean)
[ci skip]

* New translations strings.json (Dutch)
[ci skip]

* New translations strings.json (Norwegian)
[ci skip]

* New translations strings.json (Polish)
[ci skip]

* New translations strings.json (Portuguese)
[ci skip]

* New translations strings.json (Russian)
[ci skip]

* New translations strings.json (Albanian)
[ci skip]

* New translations strings.json (Serbian (Cyrillic))
[ci skip]

* New translations strings.json (Swedish)
[ci skip]

* New translations strings.json (Turkish)
[ci skip]

* New translations strings.json (Ukrainian)
[ci skip]

* New translations strings.json (Chinese Simplified)
[ci skip]

* New translations strings.json (Chinese Traditional)
[ci skip]

* New translations strings.json (Vietnamese)
[ci skip]

* New translations strings.json (Portuguese, Brazilian)
[ci skip]

* New translations strings.json (Indonesian)
[ci skip]

* New translations strings.json (Hindi)
[ci skip]

* New translations strings.json (Russian)
[ci skip]

* New translations strings.json (Turkish)
[ci skip]

* New translations strings.json (Spanish)
[ci skip]

* New translations strings.json (Portuguese, Brazilian)
[ci skip]

* New translations strings.json (Vietnamese)
[ci skip]

* New translations strings.json (Romanian)
[ci skip]

* New translations strings.json (French)
[ci skip]

* New translations strings.json (Spanish)
[ci skip]

* New translations strings.json (Afrikaans)
[ci skip]

* New translations strings.json (Arabic)
[ci skip]

* New translations strings.json (Catalan)
[ci skip]

* New translations strings.json (Czech)
[ci skip]

* New translations strings.json (Danish)
[ci skip]

* New translations strings.json (German)
[ci skip]

* New translations strings.json (Greek)
[ci skip]

* New translations strings.json (Finnish)
[ci skip]

* New translations strings.json (Hebrew)
[ci skip]

* New translations strings.json (Hungarian)
[ci skip]

* New translations strings.json (Italian)
[ci skip]

* New translations strings.json (Japanese)
[ci skip]

* New translations strings.json (Korean)
[ci skip]

* New translations strings.json (Dutch)
[ci skip]

* New translations strings.json (Norwegian)
[ci skip]

* New translations strings.json (Polish)
[ci skip]

* New translations strings.json (Portuguese)
[ci skip]

* New translations strings.json (Russian)
[ci skip]

* New translations strings.json (Albanian)
[ci skip]

* New translations strings.json (Serbian (Cyrillic))
[ci skip]

* New translations strings.json (Swedish)
[ci skip]

* New translations strings.json (Turkish)
[ci skip]

* New translations strings.json (Ukrainian)
[ci skip]

* New translations strings.json (Chinese Simplified)
[ci skip]

* New translations strings.json (Chinese Traditional)
[ci skip]

* New translations strings.json (Vietnamese)
[ci skip]

* New translations strings.json (Portuguese, Brazilian)
[ci skip]

* New translations strings.json (Indonesian)
[ci skip]

* New translations strings.json (Hindi)
[ci skip]

* New translations strings.json (Vietnamese)
[ci skip]
2023-03-05 12:08:28 +05:30
Rajarshee Chatterjee 6879d77ef1 feat: Add Last Updated Sort (Closes #482) 2023-03-05 11:56:02 +05:30
Rajarshee Chatterjee 41ed198a1d refactor: Remove totalPages 2023-03-05 11:39:52 +05:30
Rajarshee Chatterjee 550e116be5 feat: Add Chapter Name Sort (Closes #525) 2023-03-05 11:12:43 +05:30
Rajarshee Chatterjee 1c21c180ab refactor: Tweak Updates Card 2023-03-05 11:08:53 +05:30
nyagami 08860c0715 fix: Minor Fixes and Optimizations (#566)
Closes #557
2023-03-05 09:43:00 +05:30
K1ngfish3r d65170c85a Minor: prerequisites/build cmd to CONTRIBUTING.md (#565)
* Minor: prerequisites/build cmd to CONTRIBUTING.md

* switch npm start under developing section

* link CONTRIBUTING.md in README.md

* make clearer
2023-03-01 14:30:39 +05:30
Patrick Loser cf19eb6892 feat: Collapsible Updates and Downloads (#562)
* implemented extendable list for updates

* finished creating extendable list (buggy deleteChapter)

* fixed downloadbutton bug

* fixed ts problems

* set navigatetonovel to onLongPress

* removed

* key fixes

* implemented extendable list for updates

* finished creating extendable list (buggy deleteChapter)

* fixed downloadbutton bug

* fixed ts problems

* set navigatetonovel to onLongPress

* removed

* key fixes

* translation strings

* single chapter + style updates

* removed test method
2023-03-01 14:29:48 +05:30
nyagami 3289f357d9 refactor: Downloading Images Logic (#554)
* default language for browse source.
To test this. please clear all all app data

* fix: for some reason, locale from expo is uncorrect

* bypass some sites with referer in header.

* update logic for loading img on reader.
some sources should have headers when fetch image data

* minor fix

* fix warning: 2 childs have the same key

* fix(download): Download chapter image fixes

- Saving images in binary form, not utf-8 base64 so that gallery etc can see them
- Downloads work with new WebViewReader's image loading features
- Added loading icons when images are loading asynchronusely

* fix(dq.ts): DownloadQueries type

* fix(img): remove delayed-src from downloaded imgs

* fix(download): Fix promise rejection and css issue

- Fix promise rejection when trying to overwrite image file (shouldn't happen in production, but it miraculously did in dev)
- Fix CSS class 'loadIcon' not being applied to downladed chapter image loader icons and loader spinners not spinning
- Made loader spinners smaller. Now they look "a bit better" (according to my friend whom I showed the spinners)

* fix(loadimg): Change loadImage to smaller one

* fix(loadImg): change the class to load-img

* minor fix

* fix hako source: popular novels and novel cover

* update sendHeight logic

---------

Co-authored-by: SkillGG <skilletssgames@gmail.com>
2023-02-26 13:15:13 +05:30
K1ngfish3r fe2b2524a7 feat(source): Add Pawread (#561)
Closes LNReader/lnreader-sources#439
2023-02-23 07:40:27 +05:30
Patrick Loser 2e4ff916aa fix(source): Foxaholic (#563) 2023-02-23 07:38:38 +05:30
K1ngfish3r b40e9331d7 fix(source): SakuraNovel (#560)
Closes LNReader/lnreader-sources#456
2023-02-22 10:05:45 +05:30
Rajarshee Chatterjee 84a2561c41 Minor Fixes 2023-02-18 14:02:04 +05:30
K1ngfish3r 929bd2c97d feat(source): Add New multiSrc WQMangaStreamScraper & PandaMtl (#552)
Closes #LNReader/lnreader-sources#453
2023-02-18 09:00:20 +05:30
Rajarshee Chatterjee 9028a82318 Minor Fix 2023-02-17 23:22:17 +05:30
Rajarshee Chatterjee c6c41a2d1b Cleanup 2023-02-17 22:59:20 +05:30
Nyagami 9a0c08e7b8 refactor: Remove Swipe Margins (#553)
* refactor swipeGesture, remove swipeMargin

* trying to resolve conflict

* again :(

* cleanup
2023-02-17 22:21:17 +05:30
Patrick Loser 0abdff25eb feat: Add Settings and Translations (#548)
* started setting repositioning

* started setting repositioning

* added novel badges and sort to general + some js to ts

* translations General

* readersettingsscreen + fix font style selection in Bottomsheet

* started setting repositioning

* added novel badges and sort to general + some js to ts

* translations General

* readersettingsscreen + fix font style selection in Bottomsheet

* update

* ts map

* small fix
2023-02-17 21:39:30 +05:30
Patrick Loser f238b20f6d fix: Cleanup Sources (#545)
* removed Asada Translation (dead)

* update boxnovel.online to cratenovel

* fixed Daonovel

* updated fastnovel.net to fastnovel.org

* removed JPMTL (dead)

* removed Kisslightnovels (dead)

* removed Asada Translation (dead)

* update boxnovel.online to cratenovel

* fixed Daonovel

* updated fastnovel.net to fastnovel.org

* removed JPMTL (dead)

* removed Kisslightnovels (dead)

* update latestnovel to lightnovelfull (Doesn't work since there are multiple pages and can't find source API)

* fixed LightNovelReader search and metadata

* added ts-ignore to sourceManager

* removed LightNovelsHub (dead)

* fixed lnmtl metadata

* update mtnovel to novelfull.net

* fixed MTL-Novel

* removed MTL-Corner (dead)

* fixed mylovenovel

* removed NovelCake (dead)

* removed NovelOwl (is lightnovelfull.com)

* removed NovelPassion (dead)

* removed NovelsCafe (dead)

* removed NovelsRock (dead)

* removed noveltrench (dead)

* fixed novelupdatescc partly (can't open Novel)

* fixed OnlyMTL

* tried fix still broken but lists some novels

* removed SkyNovel (dead)

* changed scraping page of wuxiacity

* removed wuxiaworldcloud (dead)

* fixed wuxiaworld.site

* removed wuxiaworldsite (broken website)

* removed Asada Translation (dead)

* update boxnovel.online to cratenovel

* fixed Daonovel

* updated fastnovel.net to fastnovel.org

* removed JPMTL (dead)

* removed Kisslightnovels (dead)

* update latestnovel to lightnovelfull (Doesn't work since there are multiple pages and can't find source API)

* fixed LightNovelReader search and metadata

* added ts-ignore to sourceManager

* removed LightNovelsHub (dead)

* fixed lnmtl metadata

* update mtnovel to novelfull.net

* fixed MTL-Novel

* removed MTL-Corner (dead)

* fixed mylovenovel

* removed NovelCake (dead)

* removed NovelOwl (is lightnovelfull.com)

* removed NovelPassion (dead)

* removed NovelsCafe (dead)

* removed NovelsRock (dead)

* removed noveltrench (dead)

* fixed novelupdatescc partly (can't open Novel)

* fixed OnlyMTL

* tried fix still broken but lists some novels

* removed SkyNovel (dead)

* changed scraping page of wuxiacity

* removed wuxiaworldcloud (dead)

* fixed wuxiaworld.site

* removed wuxiaworldsite (broken website)

* fixed errors

* removed readfreenovel (without js list only kidsbooks and crashes the app)

* small change
2023-02-17 16:40:05 +05:30
Nyagami cc9022cf12 fix: App Crashing when Deleting Downloaded Chapter (#549)
* fix: app crashes when deleting downloaded chapter

* fix lint
2023-02-17 09:23:05 +05:30
Rajarshee Chatterjee fbadd41733 Minor Fix 2023-02-17 09:19:57 +05:30
Rajarshee Chatterjee c30b884428 refactor: Replace lodash with lodash-es 2023-02-17 09:17:28 +05:30
dependabot[bot] 8fc9e04d97 chore(deps): bump @sideway/formula from 3.0.0 to 3.0.1 (#532)
Bumps [@sideway/formula](https://github.com/sideway/formula) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/sideway/formula/releases)
- [Commits](https://github.com/sideway/formula/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: "@sideway/formula"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-17 09:00:44 +05:30
dependabot[bot] 84bc83b7a2 chore(deps): bump ua-parser-js from 0.7.31 to 0.7.33 (#519)
Bumps [ua-parser-js](https://github.com/faisalman/ua-parser-js) from 0.7.31 to 0.7.33.
- [Release notes](https://github.com/faisalman/ua-parser-js/releases)
- [Changelog](https://github.com/faisalman/ua-parser-js/blob/master/changelog.md)
- [Commits](https://github.com/faisalman/ua-parser-js/compare/0.7.31...0.7.33)

---
updated-dependencies:
- dependency-name: ua-parser-js
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-17 09:00:36 +05:30
dependabot[bot] 2bb0c28591 chore(deps): bump minimatch from 3.0.4 to 3.1.2 (#469)
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-17 09:00:09 +05:30
dependabot[bot] 52ae111e98 chore(deps): bump @xmldom/xmldom from 0.7.5 to 0.7.9 (#491)
Bumps [@xmldom/xmldom](https://github.com/xmldom/xmldom) from 0.7.5 to 0.7.9.
- [Release notes](https://github.com/xmldom/xmldom/releases)
- [Changelog](https://github.com/xmldom/xmldom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/xmldom/xmldom/compare/0.7.5...0.7.9)

---
updated-dependencies:
- dependency-name: "@xmldom/xmldom"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-17 08:59:51 +05:30
dependabot[bot] ecd383b586 chore(deps): bump decode-uri-component from 0.2.0 to 0.2.2 (#490)
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-17 08:59:41 +05:30
Rajarshee Chatterjee 606b2c8f12 Cleanup 2023-02-17 08:55:36 +05:30
Nyagami d9bbae444a refactor: Remove Text Reader (#538)
* auto scroll using saved position.
not using currentScroll cause it maybe baka sometimes

* merge 2 navigate chapter function

* merge text and web scroll. enable scrollToTop for web

* seekbar display better after sliding

* minor fix

* trying to remove wvUseNewSwipes var

* Starting remove TextView.
Firstly, always use WebView

* remove useWebViewForChapter var

* remove TextView related thing

* scroll to save position when layout on

* always scroll with mooth mode

* no need scrollview

* move volume scroll effect

* complete the removal

* Better logic for volumeButton.
change state name

* also rename showsipemargins state

* drawerSwipe doesnt support webview.
So maybe re-implement if it supports one day

* update logic for autoScroll

* wrap useCallback for saveProgress

* only position state is enough

* remove reset progree in mark as read action

* mini fix for volumebutton. rename state variables

* fix bug on volumeButton.
2023-02-17 05:08:16 +05:30
K1ngfish3r 2e9a7adc2c fix(source): Add Author and Status for WPMangaStreamScraper (#547)
Closes LNReader/lnreader-sources#444
2023-02-17 04:57:59 +05:30
K1ngfish3r 63909bf52e fix(source): Update WPMangaStreamScraper's Cover Selector (#543)
* fixes images on noblemtl

* fix images on noblemtl

* fix ESLint errors
2023-02-15 23:18:58 +05:30
Vigneshwar M 8fe1dacab0 feat(source): Add Agitoon (#542)
* add: kr sources

* add: latest/popular novels

* bug: parseNovelAndChapters()

* fix: parse parseNovelAndChapters bug and add: parseChapter

* add: search feature

* add: popular gets the popular list of the current day; refactor

* fix: 'chapterId doesnt exist'

* fix: reverted back the package-lock.json file

---------

Co-authored-by: Vigneshwar M <vigneshwarm@Vigneshwars-MacBook-Pro.local>
2023-02-15 22:39:20 +05:30
Rajarshee Chatterjee a193656cb2 Update Crowdin configuration file 2023-02-15 09:53:55 +05:30
Rajarshee Chatterjee ed23040287 chore: Update Translation Locales 2023-02-15 09:48:11 +05:30
Rajarshee Chatterjee c9d834a2f0 chore: Update translations (#521)
* New translations strings.json (Vietnamese)
[ci skip]

* New translations strings.json (Portuguese, Brazilian)
[ci skip]

* New translations strings.json (Romanian)
[ci skip]

* New translations strings.json (French)
[ci skip]

* New translations strings.json (Spanish)
[ci skip]

* New translations strings.json (Afrikaans)
[ci skip]

* New translations strings.json (Arabic)
[ci skip]

* New translations strings.json (Catalan)
[ci skip]

* New translations strings.json (Czech)
[ci skip]

* New translations strings.json (Danish)
[ci skip]

* New translations strings.json (German)
[ci skip]

* New translations strings.json (Greek)
[ci skip]

* New translations strings.json (Finnish)
[ci skip]

* New translations strings.json (Hebrew)
[ci skip]

* New translations strings.json (Hungarian)
[ci skip]

* New translations strings.json (Italian)
[ci skip]

* New translations strings.json (Japanese)
[ci skip]

* New translations strings.json (Korean)
[ci skip]

* New translations strings.json (Dutch)
[ci skip]

* New translations strings.json (Norwegian)
[ci skip]

* New translations strings.json (Polish)
[ci skip]

* New translations strings.json (Portuguese)
[ci skip]

* New translations strings.json (Russian)
[ci skip]

* New translations strings.json (Albanian)
[ci skip]

* New translations strings.json (Serbian (Cyrillic))
[ci skip]

* New translations strings.json (Swedish)
[ci skip]

* New translations strings.json (Turkish)
[ci skip]

* New translations strings.json (Ukrainian)
[ci skip]

* New translations strings.json (Chinese Simplified)
[ci skip]

* New translations strings.json (Indonesian)
[ci skip]

* New translations strings.json (Hindi)
[ci skip]

* New translations strings.json (Russian)
[ci skip]

* New translations strings.json (Portuguese, Brazilian)
[ci skip]

* New translations strings.json (Arabic)
[ci skip]

* New translations strings.json (Chinese Simplified)
[ci skip]

* New translations strings.json (Vietnamese)
[ci skip]

* New translations strings.json (Vietnamese)
[ci skip]

* New translations strings.json (Chinese Simplified)
[ci skip]
2023-02-14 15:21:32 +05:30
Nyagami 7faabc5d9c fix: Update Seekbar Position Logic (#535)
* fix slider displays uncorrectly, rearrange seekbar props

* Removal contensize variable, using math to solve.
Also need percen of device height as float.
Format readerscreen.js easilier to read (at least for me :>)

* set loadding when "scroll to" is unnecessary

* enable scroll even on loading (no making re-rerender)

* add attributes to chapter element for custom css

* shorten variable name. remove unuse function

* seekbar display more correctly for webview.
removal duplicate var

* trying to removal webViewScroll state

* Seekbar should work properly.
Need to implement save position.
And sync TextView and WebView

* just rearrange props to make easier for handling

* using state currentScroll instead of scrollPercentage

* share offsetY between text and web view.
Still issue when turn back from web to text. It cant scroll back.

* this should work well, unless users touch so fast

* clean up code

* use Promise.all instead

* the same logic but shoten code

* not saving croll when closing layout
2023-02-14 15:19:43 +05:30
Rajarshee Chatterjee 330abf25d7 fix(source): Add reverseChapters Option in WPMangaStreamScraper 2023-02-14 15:15:51 +05:30
Rajarshee Chatterjee d75ef3f444 feat(source): Add NobleMtl
Closes LNReader/lnreader-sources #409
2023-02-13 09:42:49 +05:30
Rajarshee Chatterjee 6e665dabf4 fix(source): Add sourceId in WPMangaStreamScraper 2023-02-13 09:42:49 +05:30
Nyagami 12b83f4de7 fix: Simplify TTS Logic to Prevent Freezing the App (#530)
* simply tts to prevent it freezes the app

* ensure tts uses the chapter text. correct spelling
2023-02-09 13:07:43 +05:30
Rajarshee Chatterjee 518f73f6fd Update README.md 2023-01-31 07:49:45 +05:30
Rajarshee Chatterjee cab9a83dc0 Release v1.1.14 2023-01-29 20:53:08 +05:30
Rajarshee Chatterjee 934798809d Minor Fixes 2023-01-29 20:45:49 +05:30
Rajarshee Chatterjee 4ceacdf324 fix(source): IndoWebNovel
Closes LNReader/lnreader-sources#405
2023-01-29 18:24:13 +05:30
Rajarshee Chatterjee 650ed2ff67 Minor Fixes 2023-01-29 18:22:30 +05:30
Rajarshee Chatterjee c38fc3232e chore: Update translations (#493)
* New translations strings.json (French)
[ci skip]

* New translations strings.json (Romanian)
[ci skip]

* New translations strings.json (Spanish)
[ci skip]

* New translations strings.json (Afrikaans)
[ci skip]

* New translations strings.json (Arabic)
[ci skip]

* New translations strings.json (Catalan)
[ci skip]

* New translations strings.json (Czech)
[ci skip]

* New translations strings.json (Danish)
[ci skip]

* New translations strings.json (German)
[ci skip]

* New translations strings.json (Greek)
[ci skip]

* New translations strings.json (Finnish)
[ci skip]

* New translations strings.json (Hebrew)
[ci skip]

* New translations strings.json (Hungarian)
[ci skip]

* New translations strings.json (Italian)
[ci skip]

* New translations strings.json (Japanese)
[ci skip]

* New translations strings.json (Korean)
[ci skip]

* New translations strings.json (Dutch)
[ci skip]

* New translations strings.json (Norwegian)
[ci skip]

* New translations strings.json (Polish)
[ci skip]

* New translations strings.json (Portuguese)
[ci skip]

* New translations strings.json (Russian)
[ci skip]

* New translations strings.json (Albanian)
[ci skip]

* New translations strings.json (Serbian (Cyrillic))
[ci skip]

* New translations strings.json (Swedish)
[ci skip]

* New translations strings.json (Turkish)
[ci skip]

* New translations strings.json (Ukrainian)
[ci skip]

* New translations strings.json (Chinese Simplified)
[ci skip]

* New translations strings.json (Vietnamese)
[ci skip]

* New translations strings.json (Portuguese, Brazilian)
[ci skip]

* New translations strings.json (Indonesian)
[ci skip]

* New translations strings.json (Hindi)
[ci skip]

* New translations strings.json (French)
[ci skip]

* New translations strings.json (French)
[ci skip]

* New translations strings.json (Turkish)
[ci skip]

* New translations strings.json (Russian)
[ci skip]

* New translations strings.json (Russian)
[ci skip]

* New translations strings.json (Russian)
[ci skip]

* New translations strings.json (German)
[ci skip]

* New translations strings.json (Portuguese, Brazilian)
[ci skip]

* New translations strings.json (Portuguese, Brazilian)
[ci skip]

* New translations strings.json (Indonesian)
[ci skip]

* New translations strings.json (Vietnamese)
[ci skip]

* New translations strings.json (Portuguese, Brazilian)
[ci skip]
2023-01-29 17:11:26 +05:30
Rajarshee Chatterjee f109c5747e fix: Fix Lint 2023-01-29 17:09:07 +05:30
Rajarshee Chatterjee 79b4db0cd2 fix: Reader Settings Screen Crash (Closes #322) 2023-01-29 17:05:11 +05:30
Rajarshee Chatterjee 8858ea3d94 fix(source): Minor Fixes 2023-01-29 17:03:59 +05:30
Rajarshee Chatterjee dea534557e fix(source): Ranobes
Closes LNReader/lnreader-sources#435
2023-01-29 16:20:08 +05:30
Rajarshee Chatterjee 0b112d9465 Minor Fixes 2023-01-29 16:09:00 +05:30
Rajarshee Chatterjee ddb8cd402a refactor: Use Batch Queries 2023-01-29 15:14:00 +05:30
Rajarshee Chatterjee 172145278f feat: Bypass Cloudflare
Closes LNReader/lnreader-sources#146
Closes LNReader/lnreader-sources#172
Closes LNReader/lnreader-sources#150
Closes LNReader/lnreader-sources#319
Closes LNReader/lnreader-sources#397
Closes LNReader/lnreader-sources#404
Closes LNReader/lnreader-sources#406
Closes LNReader/lnreader-sources#407
Closes LNReader/lnreader-sources#411
2023-01-29 14:53:42 +05:30
Rider21 7acb63e0f0 fix(source): Jaomix (#520)
* fix

* Update jaomix.js
2023-01-29 10:56:54 +05:30
Patrick Loser deefc10d41 feat: New Bottom Sheet Package (#515)
* setup

* implemented new bottomsheets

* set containerHeight

* NovelBottomSheet fix

* fixed BottomInsets

* edited FilterBottomSheet + cleanup

* TrackSheet + cleanup

* removal of rn-sliding-up-panel

Closes #506
2023-01-13 05:02:45 +05:30
Patrick Loser 7880cd0187 fix: Bottom Navbar Icon Color (#513)
* fixed library button color

* changed to onSecondaryContainer
2023-01-13 04:56:15 +05:30
Patrick Loser 9a594c4dd3 feat: Skeleton Loading Screens (#510)
* CategorySkeletonLoading

* getLoadingColors

* UpdatesSkeletonLoading

* Loading for Migrate

* HistorySkeletonLoading

* HistoryScreen fix

* HistoryScreen fix

* GlobalSearchLoading name change

* SourceScreenSkeletonLoading + implementation in Library + set unread fix

* set SkeletonLoading for LoadingMoreIndicator

* ESLint fix
2023-01-11 06:52:53 +05:30
Rajarshee Chatterjee 11a32d6776 fix: Mark Chapter as Read on TTS Finish (Closes #466) 2022-12-30 10:36:11 +05:30
Rajarshee Chatterjee 49e4e87f9e feat: Add Error Boundary 2022-12-30 10:28:54 +05:30
Rajarshee Chatterjee 1d0d7be968 Minor Fixes 2022-12-30 10:20:59 +05:30
Patrick Loser 06c5efd3a6 feat: Skeleton Loading Screens (#504)
* chapter drawer themed textcolor

* started with skeleton loading

* added new package

* added way to adebt to reader styles

* MAL loading

* type fix

* SourceScreenLoading

* NovelScreenLoading

* ESLint fix

* cleanup

* resolved conflict

* GlobalSearchLoading

Co-authored-by: Patrick <patrick.los@proton.me>
2022-12-28 13:20:44 +05:30
Patrick Loser 6d67c67d5f feat: Animated Splashscreen (#499)
* chapter drawer themed textcolor

* animated splashscreen

* added lotti animation

* splashscreen centered

* upgrade to android sdk 31

* reverted sdk changes

* fixed unstyled bars

* fixed animation

Co-authored-by: Patrick <patrick.los@proton.me>
2022-12-22 16:03:49 +05:30
Patrick Loser e559824718 feat: FAB for Last Read Chapter in Library (#500)
* chapter drawer themed textcolor

* added FAB to Library screen + some insets

* Added Settings butten

Co-authored-by: Patrick <patrick.los@proton.me>
2022-12-20 21:39:30 +05:30
Patrick Loser 2aaedfcfbf feat: Adaptive Icon (#497)
Closes #475

Co-authored-by: Patrick <patrick.los@proton.me>
2022-12-18 21:26:44 +05:30
Rajarshee Chatterjee 4cbd52a369 fix: Tweak Jump to Modal UI 2022-12-10 18:55:55 +05:30
Patrick Loser 87a42d2766 fix: Chapter Drawer Themed Text Color (#492)
Co-authored-by: Patrick <patrick.los@proton.me>
2022-12-10 17:08:22 +05:30
Patrick Loser 1453c39fc3 feat: Jump to Chapter Modal Redesign (#486)
* start up

* started to change jumpToChapterModal

* finished JumpToChapterModal redesign

* delete of results and no result if no text

* edited listElement width

* reverted (automatic) changes in package-lock and build.gradle

* design changes & bugfixes

* added translations

Co-authored-by: Patrick <patrick.los@proton.me>

Closes #472
2022-12-10 16:36:46 +05:30
Rajarshee Chatterjee eccb84b4a3 chore: Update translations (#448)
* New translations strings.json (Japanese)
[ci skip]

* New translations strings.json (Japanese)
[ci skip]

* New translations strings.json (Japanese)
[ci skip]

* New translations strings.json (Norwegian)
[ci skip]

* New translations strings.json (Indonesian)
[ci skip]

* New translations strings.json (Portuguese, Brazilian)
[ci skip]

* New translations strings.json (Vietnamese)
[ci skip]

* New translations strings.json (Chinese Traditional)
[ci skip]

* New translations strings.json (Ukrainian)
[ci skip]

* New translations strings.json (Turkish)
[ci skip]

* New translations strings.json (Swedish)
[ci skip]

* New translations strings.json (Serbian (Cyrillic))
[ci skip]

* New translations strings.json (Albanian)
[ci skip]

* New translations strings.json (Russian)
[ci skip]

* New translations strings.json (Portuguese)
[ci skip]

* New translations strings.json (Polish)
[ci skip]

* New translations strings.json (Dutch)
[ci skip]

* New translations strings.json (Romanian)
[ci skip]

* New translations strings.json (Korean)
[ci skip]

* New translations strings.json (Italian)
[ci skip]

* New translations strings.json (Hungarian)
[ci skip]

* New translations strings.json (Hebrew)
[ci skip]

* New translations strings.json (Finnish)
[ci skip]

* New translations strings.json (Greek)
[ci skip]

* New translations strings.json (German)
[ci skip]

* New translations strings.json (Danish)
[ci skip]

* New translations strings.json (Czech)
[ci skip]

* New translations strings.json (Catalan)
[ci skip]

* New translations strings.json (Arabic)
[ci skip]

* New translations strings.json (Afrikaans)
[ci skip]

* New translations strings.json (Spanish)
[ci skip]

* New translations strings.json (French)
[ci skip]

* New translations strings.json (Hindi)
[ci skip]

* New translations strings.json (Turkish)
[ci skip]

* New translations strings.json (Dutch)
[ci skip]

* New translations strings.json (Dutch)
[ci skip]

* New translations strings.json (Arabic)
[ci skip]

* New translations strings.json (Turkish)
[ci skip]

* New translations strings.json (Turkish)
[ci skip]

* New translations strings.json (Turkish)
[ci skip]

* New translations strings.json (Russian)
[ci skip]

* New translations strings.json (Russian)
[ci skip]

* New translations strings.json (Arabic)
[ci skip]

* New translations strings.json (French)
[ci skip]

* New translations strings.json (French)
[ci skip]
2022-12-10 10:18:57 +05:30
Rajarshee Chatterjee 3d69f46b44 fix: Minor Fixes 2022-12-10 10:09:55 +05:30
Rajarshee Chatterjee cc94bbd152 fix: Tweak Chapter Drawer UI 2022-12-10 09:34:29 +05:30
Patrick Loser 599224a5d4 feat: Chapter Drawer (#485)
* start up

* started with the implementation of chapter_Drawer

* changed data transer via route and the navigation between chapters

* changed ReadButton and butten at the end of chapter

* changed ReadButton and butten at the end of chapter

* changed ReadButton and butten at the end of chapter

* worked on behaviour, added buttons and styled

* fixed Buttons

* highlighted current chapter

* fixed bug caused of fast scrolling

* Changed Padding/Margin Behaviour of WebViewReader for Drawer to work properly

* fixed gradients in chapter list

* changed GestureRecognizer back

* shorted given props at chapter change

* fixed and changed scroll behaviour

* added Translation

* Changed drawer chapter naming

* review

* added chapterDrawer setting

* unessecary

* swipe optional for normal ReaderScreen, impossible for WebView, openDrawerButton in the middle of footer

* changed setting name "chapterDrawer" to "useChapterDrawerSwipeNavigation"

* put useNovel Hook in chapterDrawer and reverted navigate functions

* reverted changes from original ReaderScreen line 356-359

* removed Chapter transformation

* fixed switch between chapters and mistake in switch

* unified nacigation Params + changed name and location of handleNavigateChapterParams

* fixed loading problems from other screens than Novel and added LoadingScreenV2

Co-authored-by: Patrick <patrick.los@proton.me>
Co-authored-by: Patrick Loser <69157453+AustriaGamer@users.noreply.github.com>
2022-12-10 08:39:43 +05:30
Rajarshee Chatterjee 70a22518be fix(source): NovelUpdates: Add WordPress Selector
Closes LNReader/lnreader-sources#412
2022-12-09 21:15:29 +05:30
Rajarshee Chatterjee 900a569886 fix(source): NovelRingan: Remove Duplicated Chapter Text
Closes LNReader/lnreader-sources#414
2022-12-09 10:44:19 +05:30
Rajarshee Chatterjee 6e851eed94 fix(source): ReadLightNovel Search
Closes LNReader/lnreader-sources#371
2022-12-09 10:27:17 +05:30
Rajarshee Chatterjee a2ceba9019 fix(source): ReinoWuxia
Closes LNReader/lnreader-sources#186
2022-12-09 10:11:29 +05:30
Rajarshee Chatterjee 412f216bf5 fix(source): ReadNovelFull
Closes LNReader/lnreader-sources#325
2022-12-09 09:58:09 +05:30
dependabot[bot] 1e2dddf46c chore(deps): bump qs from 6.10.1 to 6.10.3 (#488)
Bumps [qs](https://github.com/ljharb/qs) from 6.10.1 to 6.10.3.
- [Release notes](https://github.com/ljharb/qs/releases)
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.10.1...v6.10.3)

---
updated-dependencies:
- dependency-name: qs
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-08 09:10:30 +05:30
Rider21 3e526658bf fix(source): Ranobes (#489) 2022-12-07 09:22:59 +05:30
Rider21 15cdeb30ad fix(source): Update Rulate (#483)
update
2022-12-02 07:03:47 +05:30
Marcin Majewski 3cb573681f fix(delete_chapter): Excessive number of pending callbacks warn (#481)
* fix(delete_chapter): fix delete all not working

Sometimes there would be "Excessive number of pending callbacks" warn shown.
Removing chapters in batches of 10 (I tried 30 but it was still an issue) seems to work fine now.
TODO: Add some icon about deletion status and make it not lag the entire app.

* fix(delete_chapter): always-coccurent deletion

Make deleting chapters do 3 coccurent deletion at a time making it work similarly to bluebird's `Promise.map(,{coccurent:3})` and removing the `Excessive number of pending callbacks` warn gone.

* Remove unnecesarry console.log
2022-11-26 06:48:53 +05:30
Rajarshee Chatterjee 383c8f791b fix: Stats Screen Fixes 2022-11-05 23:13:02 +05:30
Rajarshee Chatterjee 125632b9ff fix: Workaround for Build Failures
https://github.com/facebook/react-native/issues/35210
2022-11-05 23:12:29 +05:30
Rider21 cb67d17747 Fix Date String (#457)
* typo correction

* fix image

* agree
2022-10-26 17:43:11 +05:30
Rajarshee Chatterjee 7ec578639e feat: Stats Screen 2022-10-24 08:08:28 +05:30
Rajarshee Chatterjee a1d6e1d6ce fix(source): WBNovel: Update Language
Closes LNReader/lnreader-sources##408
2022-10-24 07:02:04 +05:30
Rajarshee Chatterjee 1fed66792d build: Upload Artifact 2022-10-22 09:57:26 +05:30
Rajarshee Chatterjee abc815e413 Revert "chore(deps): bump react-native-reanimated from 2.2.4 to 2.10.0" (#455)
Revert "chore(deps): bump react-native-reanimated from 2.2.4 to 2.10.0 (#452)"

This reverts commit 8cb27bf95f.
2022-10-21 17:02:49 +05:30
dependabot[bot] 8cb27bf95f chore(deps): bump react-native-reanimated from 2.2.4 to 2.10.0 (#452)
Bumps [react-native-reanimated](https://github.com/software-mansion/react-native-reanimated) from 2.2.4 to 2.10.0.
- [Release notes](https://github.com/software-mansion/react-native-reanimated/releases)
- [Commits](https://github.com/software-mansion/react-native-reanimated/compare/2.2.4...2.10.0)

---
updated-dependencies:
- dependency-name: react-native-reanimated
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-21 16:44:28 +05:30
Rajarshee Chatterjee a84ee5ade4 chore: Update translations (#424)
* New translations strings.json (French)
[ci skip]

* New translations strings.json (Russian)
[ci skip]

* New translations strings.json (Russian)
[ci skip]

* New translations strings.json (Ukrainian)
[ci skip]

* New translations strings.json (Russian)
[ci skip]

* New translations strings.json (Russian)
[ci skip]

* New translations strings.json (Indonesian)
[ci skip]

* New translations strings.json (Indonesian)
[ci skip]
2022-10-10 20:01:49 +05:30
Rajarshee Chatterjee 30ce798c2a feat(source): Add WebNovelOku (Closes LNReader/lnreader-sources#378) 2022-10-10 19:59:22 +05:30
Rajarshee Chatterjee 5ed221648c fix: Add Cloudflare Error Message for LightNovelPub 2022-09-27 21:01:11 +05:30
Rajarshee Chatterjee 93bc5f19ff fix: Update NovelTrench baseUrl (Closes LNReader/lnreader-sources#385) 2022-09-27 08:56:12 +05:30
Rider21 d527319901 feat(source): Add AuthorToday (#434)
* AuthorToday

* fix

* prettier

* test

* ok
2022-09-11 11:57:18 +05:30
Rhino 20470929e5 fix: updates tab sort as data displayed is wrong when release datetime similar (#427)
* Added following sources Zetro Translation, Nocturne, Asada Translation and Sugar Babies

* added time stamp to backup file

* fixed: updates tab sort as data displayed is wrong when release datetime similar
2022-09-10 17:19:15 +05:30
J. Fronny 69dc329fdb build: Generate versionCode (#432)
* Generate versionCode

* Fix comment
2022-09-10 17:18:27 +05:30
Rajarshee Chatterjee 78165b072e Release v1.1.13 2022-09-02 09:30:49 +05:30
561 changed files with 36014 additions and 60511 deletions
-3
View File
@@ -1,3 +0,0 @@
# Windows files
[*.bat]
end_of_line = crlf
-3
View File
@@ -1,3 +0,0 @@
# Windows files should use crlf line endings
# https://help.github.com/articles/dealing-with-line-endings/
*.bat text eol=crlf
+3 -3
View File
@@ -45,7 +45,7 @@ body:
label: LNReader version
description: You can find your LNReader version in **More → About**.
placeholder: |
Example: "1.1.12"
Example: "2.0.0"
validations:
required: true
@@ -86,9 +86,9 @@ body:
required: true
- label: I have written a short but informative title.
required: true
- label: If this is an issue with an source, I should be opening an issue in the [sources repository](https://github.com/lnreader/lnreader-sources/issues/new/choose).
- label: If this is an issue with a source, I should be opening an issue in the [sources repository](https://github.com/lnreader/lnreader-sources/issues/new/choose).
required: true
- label: I have updated the app to version **[1.1.12](https://github.com/lnreader/lnreader/releases/latest)**.
- label: I have updated the app to version **[2.0.0](https://github.com/lnreader/lnreader/releases/latest)**.
required: true
- label: I will fill out all of the requested information in this form.
required: true
+1 -1
View File
@@ -34,7 +34,7 @@ body:
required: true
- label: If this is an issue with a source, I should be opening an issue in the [sources repository](https://github.com/LNReader/lnreader-sources/issues/new/choose).
required: true
- label: I have updated the app to version **[1.1.12](https://github.com/LNReader/lnreader/releases/latest)**.
- label: I have updated the app to version **[2.0.0](https://github.com/LNReader/lnreader/releases/latest)**.
required: true
- label: I will fill out all of the requested information in this form.
required: true
+28 -6
View File
@@ -2,25 +2,36 @@ name: CI
on:
push:
branches:
- main
- master
jobs:
build-android:
name: Build App
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Clone Repository (Latest)
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install Dependencies
run: |
npm install --legacy-peer-deps
npm install
- name: Create .env
run: |
cat > .env << EOF
MYANIMELIST_CLIENT_ID=${{ vars.MYANIMELIST_CLIENT_ID }}
ANILIST_CLIENT_ID=${{ vars.ANILIST_CLIENT_ID }}
EOF
- name: Cache Gradle Wrapper
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Cache Gradle Dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
@@ -33,3 +44,14 @@ jobs:
- name: Build Android Release
run: |
cd android && ./gradlew assembleRelease --no-daemon
- name: Set Env
run: |
set -x
echo "COMMIT_COUNT=$(git rev-list --count HEAD)" >> $GITHUB_ENV
- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: LNReader-r${{ env.COMMIT_COUNT }}
path: android/app/build/outputs/apk/release/app-release.apk
+3 -3
View File
@@ -2,10 +2,10 @@ name: CI
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
jobs:
build:
@@ -14,6 +14,6 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Install modules
run: npm i --legacy-peer-deps
run: npm install
- name: Run ESLint
run: npm run lint
+2 -1
View File
@@ -8,7 +8,8 @@ npm-debug.*
*.mobileprovision
*.orig.*
web-build/
.env
reader_playground/index.html
# macOS
.DS_Store
+1
View File
@@ -0,0 +1 @@
18
-39
View File
@@ -1,39 +0,0 @@
import { enableFreeze } from 'react-native-screens';
enableFreeze(true);
import React, { useEffect } from 'react';
import { StatusBar } from 'react-native';
import { Provider as PaperProvider } from 'react-native-paper';
import { Provider } from 'react-redux';
import { persistor, store } from './src/redux/store';
import { PersistGate } from 'redux-persist/lib/integration/react';
import * as SplashScreen from 'expo-splash-screen';
import Main from './src/navigators/Main';
import { createDatabase } from './src/database/db';
import { SafeAreaProvider } from 'react-native-safe-area-context';
const App = () => {
useEffect(() => {
SplashScreen.preventAutoHideAsync();
createDatabase();
}, []);
return (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<SafeAreaProvider>
<PaperProvider>
<StatusBar translucent={true} backgroundColor="transparent" />
<Main />
</PaperProvider>
</SafeAreaProvider>
</PersistGate>
</Provider>
);
};
export default App;
+62
View File
@@ -0,0 +1,62 @@
import 'react-native-gesture-handler';
import { enableFreeze } from 'react-native-screens';
enableFreeze(true);
import React, { useEffect } from 'react';
import { StatusBar } from 'react-native';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import LottieSplashScreen from 'react-native-lottie-splash-screen';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { Provider as PaperProvider } from 'react-native-paper';
import * as Notifications from 'expo-notifications';
import BackgroundService from 'react-native-background-actions';
import { createTables } from '@database/db';
import AppErrorBoundary from '@components/AppErrorBoundary/AppErrorBoundary';
import { collectPlugins } from '@plugins/pluginManager';
import Main from './src/navigators/Main';
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
import { usePlugins } from '@hooks/persisted';
import { MMKVStorage } from '@utils/mmkv/mmkv';
import { BACKGROUND_ACTION } from '@services/constants';
Notifications.setNotificationHandler({
handleNotification: async () => {
return {
shouldShowAlert: true,
shouldPlaySound: true,
shouldSetBadge: true,
};
},
});
const App = () => {
const { refreshPlugins } = usePlugins();
useEffect(() => {
createTables();
collectPlugins().then(() => LottieSplashScreen.hide());
refreshPlugins();
if (!BackgroundService.isRunning()) {
MMKVStorage.delete(BACKGROUND_ACTION);
}
}, []);
return (
<GestureHandlerRootView style={{ flex: 1 }}>
<AppErrorBoundary>
<SafeAreaProvider>
<PaperProvider>
<BottomSheetModalProvider>
<StatusBar translucent={true} backgroundColor="transparent" />
<Main />
</BottomSheetModalProvider>
</PaperProvider>
</SafeAreaProvider>
</AppErrorBoundary>
</GestureHandlerRootView>
);
};
export default App;
+66 -4
View File
@@ -7,6 +7,11 @@ Contributions are welcome and are greatly appreciated!
After forking to your own github org or account, do the following steps to get started:
```bash
# prerequisites
node --version <= 16.13.1 (for version management, get nvm [recommended])
java sdk --version <= 11 (for version management, get jenv [optional])
android sdk (https://developer.android.com/studio)
# clone your fork to your local machine
git clone https://github.com/<your-account-name>/lnreader.git
@@ -16,18 +21,32 @@ cd lnreader
# install dependencies
npm install
# run metro for development
npm start
# build the apk (the built apk will be found in ~/lnreader/android/app/build/outputs/apk/release/)
npm run buildRelease
```
### Developing on Android
While the packager is running and you have an Android device or emulator connected to your computer, build and launch the Android app.
You will need an Android device or emulator connected to your computer as well as an IDE of your choice. (eg: vscode)
```
```bash
# prerequisites
adb (https://developer.android.com/studio/command-line/adb)
IDE
# check if android device/emulator is connected
adb devices
# run metro for development
npm start
# then to view on your android device (new terminal)
npm run android
```
To view any changes to the app with new code, save your code and press "r" on the metro terminal to
reload it. The app on the android device/emulator will reload shortly.
### Style & Linting
This codebase's linting rules are enforced using [ESLint](http://eslint.org/).
@@ -38,3 +57,46 @@ codebase, however you can always check to see if the source code is compliant by
```bash
npm run lint
```
# Database
```mermaid
erDiagram
Category ||--|{ NovelCategory : contains
Category{
INTEGER id PK
TEXT name
INTEGER sort
}
NovelCategory{
INTEGER id PK
INTEGER novelId FK
INTEGER categoryId FK "default: whose sort = 1"
}
Novel ||--|{ NovelCategory : contains
Novel{
INTEGER id PK
TEXT url
TEXT pluginId
TEXT name
TEXT cover
TEXT summary
TEXT author
TEXT artist
TEXT status
TEXT genres
INTEGER inLibrary "default: 0"
}
Novel ||--o| Chapter : has
Chapter{
INTEGER id PK
INTEGER novelId FK
text url
TEXT name
TEXT releaseTime
INTEGER bookmark "default: 0"
INTEGER unread "default: 1"
TEXT readTime
INTEGER isDownloaded "default: 0"
TEXT updatedTime
TEXT chapterNumber
}
```
+6 -2
View File
@@ -9,7 +9,7 @@
</p>
<div align="center">
<a href="https://github.com/LNReader/lnreader/actions/workflows/build.yml">
<img alt="GitHub Workflow Status" src="https://img.shields.io/github/workflow/status/LNReader/lnreader/CI">
<img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/LNReader/lnreader/build.yml?branch=main">
</a>
<a href="https://discord.gg/QdcWN4MD63">
<img alt="Discord Chat" src="https://img.shields.io/discord/835746409357246465.svg?logo=discord&logoColor=white&logoWidth=20&labelColor=7289DA&label=Discord&color=17cf48">
@@ -43,6 +43,10 @@ LNReader does not have any affiliation with the content providers available.
Source requests should be created at [LNReader/lnreader-sources](https://github.com/LNReader/lnreader-sources).
## Building & Contributing
See [CONTRIBUTING.md](./CONTRIBUTING.md)
## License
[MIT ](https://github.com/rajarsheechatterjee/lnreader/blob/main/LICENSE)
[MIT](https://github.com/rajarsheechatterjee/lnreader/blob/main/LICENSE)
+104 -131
View File
@@ -1,148 +1,118 @@
apply plugin: "com.android.application"
apply plugin: "com.facebook.react"
import com.android.build.OutputFile
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
* bundleAssetName: "index.android.bundle",
*
* // the entry file for bundle generation. If none specified and
* // "index.android.js" exists, it will be used. Otherwise "index.js" is
* // default. Can be overridden with ENTRY_FILE environment variable.
* entryFile: "index.android.js",
*
* // https://reactnative.dev/docs/performance#enable-the-ram-format
* bundleCommand: "ram-bundle",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
*
* // whether to bundle JS and assets in another build variant (if configured).
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
* // The configuration property can be in the following formats
* // 'bundleIn${productFlavor}${buildType}'
* // 'bundleIn${buildType}'
* // bundleInFreeDebug: true,
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
* // where to put the JS bundle asset in debug mode
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
*
* // where to put the JS bundle asset in release mode
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in debug mode
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in release mode
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
*
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
* This is the configuration block to customize your React Native Android app.
* By default you don't need to apply any configuration, just uncomment the lines you need.
*/
react {
/* Folders */
// The root of your project, i.e. where "package.json" lives. Default is '..'
// root = file("../")
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
// reactNativeDir = file("../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen
// codegenDir = file("../node_modules/react-native-codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
// cliFile = file("../node_modules/react-native/cli.js")
project.ext.react = [
enableHermes: true
]
/* Variants */
// The list of variants to that are debuggable. For those we're going to
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
// debuggableVariants = ["liteDebug", "prodDebug"]
apply from: '../../node_modules/react-native-unimodules/gradle.groovy'
apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/expo-constants/scripts/get-app-config-android.gradle"
/* Bundling */
// A list containing the node command and its flags. Default is just 'node'.
// nodeExecutableAndArgs = ["node"]
//
// The command to run when bundling. By default is 'bundle'
// bundleCommand = "ram-bundle"
//
// The path to the CLI configuration file. Default is empty.
// bundleConfig = file(../rn-cli.config.js)
//
// The name of the generated asset file containing your JS bundle
// bundleAssetName = "MyApplication.android.bundle"
//
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
// entryFile = file("../js/index.android.js")
//
// A list of extra flags to pass to the 'bundle' commands.
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
// extraPackagerArgs = []
/* Hermes Commands */
// The hermes compiler command to run. By default it is 'hermesc'
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
//
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
// hermesFlags = ["-O", "-output-source-map"]
}
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
* Set this to true to create four separate APKs instead of one,
* one for each native architecture. This is useful if you don't
* use App Bundles (https://developer.android.com/guide/app-bundle/)
* and want to have separate APKs to upload to the Play Store.
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
*/
def enableProguardInReleaseBuilds = false
/**
* The preferred build flavor of JavaScriptCore.
* The preferred build flavor of JavaScriptCore (JSC).
*
* For example, to use the international variant, you can use:
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
*
* The international variant includes ICU i18n library and necessary data
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
* give correct results when using with locales other than en-US. Note that
* give correct results when using with locales other than en-US. Note that
* this variant is about 6MiB larger per architecture than default.
*/
def jscFlavor = 'org.webkit:android-jsc:+'
/**
* Whether to enable the Hermes VM.
*
* This should be set on project.ext.react and mirrored here. If it is not set
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
* and the benefits of using Hermes will therefore be sharply reduced.
* Private function to get the list of Native Architectures you want to build.
* This reads the value from reactNativeArchitectures in your gradle.properties
* file and works together with the --active-arch-only flag of react-native run-android.
*/
def enableHermes = project.ext.react.get("enableHermes", false);
def reactNativeArchitectures() {
def value = project.getProperties().get("reactNativeArchitectures")
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
}
ext {
versionMajor = 2
versionMinor = 0
versionPatch = 0
}
android {
ndkVersion rootProject.ext.ndkVersion
compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
namespace "com.rajarsheechatterjee.LNReader"
defaultConfig {
applicationId 'com.rajarsheechatterjee.LNReader'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.1.12"
// Generated version code. Supports versions up to 1024.1024.2048
versionCode ((((versionMajor << 10) | versionMinor) << 11) | versionPatch)
versionName "$versionMajor.$versionMinor.$versionPatch"
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
include (*reactNativeArchitectures())
}
}
signingConfigs {
@@ -183,40 +153,43 @@ android {
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
implementation 'com.facebook.soloader:soloader:0.10.5+'
implementation 'com.github.bumptech.glide:glide:4.12.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
}
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
exclude group:'com.squareup.okhttp3', module:'okhttp'
}
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
}
addUnimodulesDependencies()
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
implementation project(':react-native-lottie-splash-screen')
implementation project(':react-native-fs')
def isGifEnabled = (findProperty('expo.gif.enabled') ?: "") == "true";
def isWebpEnabled = (findProperty('expo.webp.enabled') ?: "") == "true";
def isWebpAnimatedEnabled = (findProperty('expo.webp.animated') ?: "") == "true";
if (isGifEnabled || isWebpEnabled) {
implementation 'com.facebook.fresco:fresco:2.0.0'
implementation 'com.facebook.fresco:imagepipeline-okhttp3:2.0.0'
}
if(isGifEnabled){
// For animated gif support
implementation 'com.facebook.fresco:animated-gif:2.0.0'
}
if(isWebpEnabled){
// For webp support
implementation 'com.facebook.fresco:webpsupport:2.0.0'
if(isWebpAnimatedEnabled){
// Animated webp support
implementation 'com.facebook.fresco:animated-webp:2.0.0'
}
}
if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
implementation jscFlavor
}
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
-19
View File
@@ -1,19 +0,0 @@
"""Helper definitions to glob .aar and .jar targets"""
def create_aar_targets(aarfiles):
for aarfile in aarfiles:
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
lib_deps.append(":" + name)
android_prebuilt_aar(
name = name,
aar = aarfile,
)
def create_jar_targets(jarfiles):
for jarfile in jarfiles:
name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
lib_deps.append(":" + name)
prebuilt_jar(
name = name,
binary_jar = jarfile,
)
+47
View File
@@ -0,0 +1,47 @@
{
"project_info": {
"project_number": "1093792259511",
"project_id": "lnreader-test",
"storage_bucket": "lnreader-test.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:1093792259511:android:aab0078285720642369c32",
"android_client_info": {
"package_name": "com.rajarsheechatterjee.LNReader"
}
},
"oauth_client": [
{
"client_id": "1093792259511-9kftu28l4ku1k3cco7pn83jbrlsc4fr5.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.rajarsheechatterjee.LNReader",
"certificate_hash": "5e8f16062ea3cd2c4a0d547876baa6f38cabf625"
}
},
{
"client_id": "1093792259511-ml5ko1gmnvihqb2j9nnteehoeom2umnt.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDuumsGzm6iE4u7E8pkk8FcNH9wL5GzoI8"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "1093792259511-ml5ko1gmnvihqb2j9nnteehoeom2umnt.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
+2 -8
View File
@@ -8,13 +8,7 @@
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
-keep class com.swmansion.reanimated.** { *; }
-keep class com.facebook.react.turbomodule.** { *; }
-keep class com.facebook.hermes.unicode.** { *; }
-keep class com.facebook.jni.** { *; }
-keep public class com.dylanvann.fastimage.* {*;}
-keep public class com.dylanvann.fastimage.** {*;}
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public class * extends com.bumptech.glide.module.AppGlideModule
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
**[] $VALUES;
public *;
}
+6 -1
View File
@@ -3,5 +3,10 @@
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" />
<application
android:usesCleartextTraffic="true"
tools:targetApi="28"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false"/>
</application>
</manifest>
@@ -1,69 +0,0 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package com.lnreader;
import android.content.Context;
import com.facebook.flipper.android.AndroidFlipperClient;
import com.facebook.flipper.android.utils.FlipperUtils;
import com.facebook.flipper.core.FlipperClient;
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.modules.network.NetworkingModule;
import okhttp3.OkHttpClient;
public class ReactNativeFlipper {
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
if (FlipperUtils.shouldEnableFlipper(context)) {
final FlipperClient client = AndroidFlipperClient.getInstance(context);
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
client.addPlugin(new ReactFlipperPlugin());
client.addPlugin(new DatabasesFlipperPlugin(context));
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
client.addPlugin(CrashReporterPlugin.getInstance());
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
NetworkingModule.setCustomClientBuilder(
new NetworkingModule.CustomClientBuilder() {
@Override
public void apply(OkHttpClient.Builder builder) {
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
}
});
client.addPlugin(networkFlipperPlugin);
client.start();
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
// Hence we run if after all native modules have been initialized
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
if (reactContext == null) {
reactInstanceManager.addReactInstanceEventListener(
new ReactInstanceManager.ReactInstanceEventListener() {
@Override
public void onReactContextInitialized(ReactContext reactContext) {
reactInstanceManager.removeReactInstanceEventListener(this);
reactContext.runOnNativeModulesQueueThread(
new Runnable() {
@Override
public void run() {
client.addPlugin(new FrescoFlipperPlugin());
}
});
}
});
} else {
client.addPlugin(new FrescoFlipperPlugin());
}
}
}
}
+39 -40
View File
@@ -1,26 +1,25 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rajarsheechatterjee.LNReader">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.rajarsheechatterjee.LNReader">
<!-- Internet -->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
<!-- Storage -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<!-- For background jobs -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<queries>
<intent>
@@ -28,50 +27,50 @@
</intent>
</queries>
<application
android:name=".MainApplication"
<application
android:name=".MainApplication"
android:largeHeap="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="true"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true">
<meta-data
android:name="expo.modules.notifications.default_notification_icon"
android:resource="@drawable/notification_icon"/>
android:resource="@drawable/notification_icon" />
<meta-data
android:name="expo.modules.notifications.default_notification_color"
android:resource="@color/notification_icon_color"/>
android:resource="@color/notification_icon_color" />
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize"
android:exported="true"
android:theme="@style/Theme.App.SplashScreen"
android:screenOrientation="unspecified">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="lnreader"/>
<data android:scheme="com.rajarsheechatterjee.LNReader"/>
</intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="lnreader" />
<data android:scheme="com.rajarsheechatterjee.LNReader" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<service android:name="com.asterinet.react.bgactions.RNBackgroundActionsTask" />
</application>
</manifest>
</application>
</manifest>
+155
View File
@@ -0,0 +1,155 @@
html {
scroll-behavior: smooth;
overflow-x: hidden;
padding-top: var(--StatusBar-currentHeight);
word-wrap: break-word;
}
body {
padding-left: var(--readerSettings-padding);
padding-right: var(--readerSettings-padding);
padding-bottom: 40px;
font-size: var(--readerSettings-textSize);
color: var(--readerSettings-textColor);
text-align: var(--readerSettings-textAlign);
line-height: var(--readerSettings-lineHeight);
font-family: var(--readerSettings-fontFamily);
}
chapter {
display: block;
}
hr {
margin-top: 20px;
margin-bottom: 20px;
}
a {
color: var(--theme-primary);
}
img {
display: block;
width: auto;
height: auto;
max-width: 100%;
}
.nextButton,
.infoText {
width: 100%;
border-radius: 50px;
border-width: 1;
color: var(--theme-onPrimary);
background-color: var(--theme-primary);
font-family: var(--readerSettings-fontFamily);
font-size: 16px;
border-width: 0;
}
.nextButton {
min-height: 40px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
padding: 0 16px;
}
.infoText {
background-color: transparent;
text-align: center;
border: none;
margin: 0px;
color: inherit;
padding-top: 16px;
padding-bottom: 16px;
}
.chapterCtn {
min-height: var(--chapterCtn-height);
margin-bottom: auto;
}
.d-none {
display: none;
}
#ScrollBar {
position: fixed;
right: 5vw;
top: 27.5vh;
height: 45vh;
width: 2.4rem;
border-radius: 1.2rem;
background-color: var(--theme-surface-0-9);
touch-action: none;
}
.scrollbar-item {
display: flex;
justify-content: center;
align-items: center;
color: var(--theme-onSurface);
}
.scrollbar-item.scrollbar-text {
height: 12.5%;
}
.scrollbar-item#scrollbar-slider {
height: 75%;
align-items: unset;
}
#scrollbar-track {
width: 0.1rem;
height: 100%;
background-color: var(--theme-outline);
}
#scrollbar-progress {
width: 0.1rem;
height: 0;
background-color: var(--theme-primary);
transform: translateX(-0.1rem);
}
#scrollbar-thumb-wrapper {
position: relative;
top: 100%;
height: 2rem;
width: 2rem;
display: flex;
align-items: center;
justify-content: center;
transform: translate(-0.95rem, -1rem);
}
#scrollbar-thumb {
top: 100%;
height: 1rem;
width: 1rem;
border-radius: 100%;
background-color: var(--theme-primary);
}
#reader-percentage {
position: fixed;
padding-top: 0.5rem;
min-height: 2rem;
width: 100%;
background-color: var(--readerSettings-theme);
color: var(--readerSettings-textColor);
bottom: 0;
left: 0;
right: 0;
font-size: 1rem;
text-align: center;
}
t-t-s.tts-highlight {
color: var(--theme-onSecondary);
background-color: var(--theme-secondary);
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

File diff suppressed because one or more lines are too long
+181
View File
@@ -0,0 +1,181 @@
class Reader {
constructor() {
this.percentage =
showScrollPercentage && document.getElementById('reader-percentage');
this.paddingTop = parseInt(
getComputedStyle(document.querySelector('html')).getPropertyValue(
'padding-top',
),
);
this.chapter = document.querySelector('chapter');
this.chapterHeight = this.chapter.scrollHeight + this.paddingTop;
this.layoutHeight = window.innerHeight;
this.pluginId = this.chapter.getAttribute('data-plugin-id');
this.novelId = this.chapter.getAttribute('data-novel-id');
this.chapterId = this.chapter.getAttribute('data-chapter-id');
this.saveProgressInterval = setInterval(
() =>
this.post({
type: 'save',
data: {
offsetY: window.scrollY,
percentage: parseInt(
((window.scrollY + this.layoutHeight) / this.chapterHeight) * 100,
),
},
}),
autoSaveInterval,
);
}
refresh = () => {
this.chapterHeight = this.chapter.scrollHeight + this.paddingTop;
};
post = obj => window.ReactNativeWebView.postMessage(JSON.stringify(obj));
}
class ScrollHandler {
constructor(reader) {
this.reader = reader;
this.$ = document.getElementById('ScrollBar');
this.$.innerHTML = `
<div class="scrollbar-item scrollbar-text d-none" id="scrollbar-percentage">
0
</div>
<div class="scrollbar-item" id="scrollbar-slider">
<div id="scrollbar-track">
</div>
<div id="scrollbar-progress">
<div id="scrollbar-thumb-wrapper">
<div id="scrollbar-thumb"></div>
</div>
</div>
</div>
<div class="scrollbar-item scrollbar-text">
100
</div>
`;
this.percentage = this.$.querySelector('#scrollbar-percentage');
this.progress = this.$.querySelector('#scrollbar-progress');
this.thumb = this.$.querySelector('#scrollbar-thumb-wrapper');
this.slider = this.$.querySelector('#scrollbar-slider');
this.sliderHeight = this.slider.clientHeight;
this.sliderOffsetY = this.slider.offsetTop + this.$.offsetTop;
this.lock = false;
this.visible = false; // scrollbar
window.onscroll = () => !this.lock && this.update();
this.thumb.ontouchstart = () => (this.lock = true);
this.thumb.ontouchend = () => (this.lock = false);
this.thumb.ontouchmove = e => {
const ratio =
(e.changedTouches[0].clientY - this.sliderOffsetY) / this.sliderHeight;
this.update(ratio < 0 ? 0 : ratio);
};
}
update = ratio => {
if (ratio === undefined) {
ratio =
(window.scrollY + this.reader.layoutHeight) / this.reader.chapterHeight;
}
if (ratio > 1) {
ratio = 1;
}
const percentage = parseInt(ratio * 100);
if (this.visible) {
this.progress.style.height = percentage + '%';
this.percentage.innerText = percentage;
}
if (this.lock) {
window.scrollTo({
top: this.reader.chapterHeight * ratio - this.reader.layoutHeight,
behavior: 'instant',
});
}
if (this.reader.percentage) {
this.reader.percentage.innerText = percentage + '%';
}
};
refresh = () => {
this.sliderHeight = this.slider.clientHeight;
this.sliderOffsetY = this.slider.offsetTop + this.$.offsetTop;
};
hide = () => {
this.$.classList.add('d-none');
this.visible = false;
};
show = () => {
this.reader.refresh();
this.visible = true;
this.$.classList.remove('d-none');
this.refresh();
this.update();
};
}
class SwipeHandler {
constructor(reader) {
this.reader = reader;
this.initialX = null;
this.initialY = null;
if (swipeGestures) {
this.enable();
}
}
touchStartHandler = e => {
this.initialX = e.changedTouches[0].screenX;
this.initialY = e.changedTouches[0].screenY;
};
touchEndHandler = e => {
let diffX = e.changedTouches[0].screenX - this.initialX;
let diffY = e.changedTouches[0].screenY - this.initialY;
if (Math.abs(diffX) > Math.abs(diffY) && Math.abs(diffX) > 10) {
e.preventDefault();
this.reader.post({ type: diffX < 0 ? 'next' : 'prev' });
}
};
enable = () => {
document.addEventListener('touchstart', this.touchStartHandler);
document.addEventListener('touchend', this.touchEndHandler);
};
disable = () => {
document.removeEventListener('touchstart', this.touchStartHandler);
document.removeEventListener('touchend', this.touchEndHandler);
};
}
class TextToSpeech {
constructor(reader) {
this.reader = reader;
this.elements = this.reader.chapter.querySelectorAll('t-t-s');
this.previous = null;
}
play = index => {
if (index >= 0 && index < this.elements.length) {
if (this.previous !== null) {
this.unhighlight(this.previous);
}
this.highlight(index);
this.previous = index;
}
};
highlight = index => {
if (index >= 0 && index < this.elements.length) {
this.elements[index].classList.add('tts-highlight');
}
};
unhighlight = index => {
if (index >= 0 && index < this.elements.length) {
this.elements[index].classList.remove('tts-highlight');
}
};
}
const reader = new Reader();
const scrollHandler = new ScrollHandler(reader);
const swipeHandler = new SwipeHandler(reader);
const tts = new TextToSpeech(reader);
@@ -0,0 +1,174 @@
package com.rajarsheechatterjee.EpubParser;
import androidx.annotation.NonNull;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.WritableArray;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.bridge.WritableNativeArray;
import com.facebook.react.bridge.WritableNativeMap;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathFactory;
public class EpubParser extends ReactContextBaseJavaModule {
String rootPath;
String contentDirPath;
XPath xPath = XPathFactory.newInstance().newXPath();
DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
EpubParser(ReactApplicationContext context) throws Exception {
super(context);
}
@NonNull
@Override
public String getName() {
return "EpubParser";
}
@ReactMethod
public void parse(String epubFilePath, String epubDirPath, Promise promise) {
try{
this.rootPath = epubDirPath;
String novelCover = this.unzip(epubFilePath, epubDirPath);
File contentFile = this.parseContainer(epubDirPath);
this.contentDirPath = contentFile.getParent();
WritableMap novel = (WritableMap) this.parseContent(contentFile);
if(novelCover != null){
novel.putString("cover", new File(epubDirPath, novelCover).getAbsolutePath());
}
promise.resolve(novel);
} catch (Exception e) {
promise.reject(e.getCause());
}
}
public File parseContainer(String epubDir) throws Exception {
Document doc = this.parserDocument(new File(epubDir, "META-INF/container.xml"));
return new File(this.rootPath,
((Element) doc.getElementsByTagName("rootfile").item(0)).getAttribute("full-path"));
}
public ReadableMap parseContent(File contentFile) throws Exception {
Document content = this.parserDocument(contentFile);
WritableMap novel = new WritableNativeMap();
novel.putString("name", this.getFirstElementByTag(content, "dc:title").getTextContent().trim());
novel.putString("url", contentFile.getParent());
novel.putString("author", this.getFirstElementByTag(content, "dc:creator").getTextContent().trim());
novel.putArray("chapters", this.getChapters(content));
return novel;
}
public ReadableArray getChapters(Document doc) throws Exception {
WritableArray chapters = new WritableNativeArray();
Document toc = null;
if (this.getFirstElementByTag(doc, "spine").getAttribute("toc") != null) {
toc = this.parserDocument(new File(this.contentDirPath, "toc.ncx"));
}
NodeList itemrefs = this.getNodeListByTag(doc, "itemref");
for (int i = 0; i < itemrefs.getLength(); i++) {
WritableMap chapter = new WritableNativeMap();
Element itemref = (Element) itemrefs.item(i);
chapter.putString("name", itemref.getAttribute("idref"));
Element item = this.getElementById(doc, chapter.getString("name"));
chapter.putString("url", new File(this.contentDirPath, item.getAttribute("href")).getAbsolutePath());
if(toc != null){
chapter.putString("name", this.getChapterName(toc, item.getAttribute(("href"))));
if(chapter.getString("name") == null) continue;
}
chapters.pushMap(chapter);
}
return chapters;
}
public String getChapterName(Document doc, String href) throws Exception {
String path = String.format("//*[starts-with(@src,'%1$s')]", href);
Node node = ((NodeList) this.xPath.compile(path).evaluate(doc, XPathConstants.NODESET)).item(0);
if(node != null){
String text = node.getPreviousSibling().getTextContent().trim();
if(text.isEmpty()) text = node.getPreviousSibling().getPreviousSibling().getTextContent().trim();
return !text.isEmpty() ? text : null;
}
return null;
}
public Element getElementById(Document doc, String id) throws Exception {
return (Element) ((NodeList) this.xPath
.compile(String.format("//*[@id='%1$s']", id))
.evaluate(doc, XPathConstants.NODESET))
.item(0);
}
public NodeList getNodeListByTag(Document doc, String tag) throws Exception {
return (NodeList)
(
this.xPath.compile(String.format("//*[contains(name(), '%1$s')]", tag))
.evaluate(doc, XPathConstants.NODESET)
);
}
public Element getFirstElementByTag(Document doc, String tag) throws Exception {
return (Element) this.getNodeListByTag(doc, tag).item(0);
}
public Document parserDocument(File docFile) throws Exception {
Document doc = this.db.parse(docFile);
doc.getDocumentElement().normalize();
return doc;
}
public String escapeFilePath(String filePath){
return filePath.replaceAll(":", "\uA789");
}
public String unzip(String epubFilePath, String epubDirPath) throws Exception {
ZipInputStream zis = new ZipInputStream(new FileInputStream(epubFilePath));
ZipEntry zipEntry;
int len;
String novelCover = null;
byte[] buffer = new byte[4096];
while ((zipEntry = zis.getNextEntry()) != null) {
String escapedFilePath = escapeFilePath(zipEntry.getName());
if(Pattern.compile(".*cover.*\\.(png|jpeg|jpg)", Pattern.CASE_INSENSITIVE).matcher(escapedFilePath).matches()){
novelCover = escapedFilePath;
}
File newFile = new File(epubDirPath, escapedFilePath);
if(newFile.exists()) continue;
newFile.getParentFile().mkdirs();
FileOutputStream fos = new FileOutputStream(newFile);
int writeCount = 0;
while ((len = zis.read(buffer)) > 0) {
writeCount += 1;
fos.write(buffer, 0, len);
}
fos.close();
if(writeCount == 0){
newFile.delete();
}
}
zis.closeEntry();
zis.close();
return novelCover;
}
}
@@ -0,0 +1,32 @@
package com.rajarsheechatterjee.EpubParser;
import androidx.annotation.NonNull;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class EpubParserPackage implements ReactPackage {
@NonNull
@Override
public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactApplicationContext) {
List<NativeModule> modules = new ArrayList<>();
try {
modules.add(new EpubParser(reactApplicationContext));
} catch (Exception e) {
throw new RuntimeException(e);
}
return modules;
}
@NonNull
@Override
public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactApplicationContext) {
return Collections.emptyList();
}
}
@@ -1,41 +1,26 @@
package com.rajarsheechatterjee.LNReader;
import android.content.res.Configuration;
import android.content.Intent;
import android.os.Bundle;
import android.graphics.Color;
import android.view.KeyEvent;
import android.view.WindowManager;
import android.os.Build;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import expo.modules.ReactActivityDelegateWrapper;
import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
import com.facebook.react.defaults.DefaultReactActivityDelegate;
import com.rajarsheechatterjee.VolumeButtonListener.VolumeButtonListener;
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
import expo.modules.splashscreen.singletons.SplashScreen;
import expo.modules.splashscreen.SplashScreenImageResizeMode;
import org.devio.rn.splashscreen.SplashScreen;
public class MainActivity extends ReactActivity {
// Added automatically by Expo Config
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
Intent intent = new Intent("onConfigurationChanged");
intent.putExtra("newConfig", newConfig);
sendBroadcast(intent);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
// SplashScreen.show(...) has to be called after super.onCreate(...)
// Below line is handled by '@expo/configure-splash-screen' command and it's discouraged to modify it manually
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams();
layoutParams.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
@@ -46,10 +31,9 @@ public class MainActivity extends ReactActivity {
w.setStatusBarColor(Color.TRANSPARENT);
w.setNavigationBarColor(Color.TRANSPARENT);
w.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
super.onCreate(null);
SplashScreen.show(this, SplashScreenImageResizeMode.COVER, ReactRootView.class, false);
SplashScreen.show(this,R.style.SplashScreenTheme, R.id.lottie);
SplashScreen.setAnimationFinished(true);
}
@Override
@@ -69,7 +53,7 @@ public class MainActivity extends ReactActivity {
return true;
case KeyEvent.KEYCODE_VOLUME_DOWN:
if (action == KeyEvent.ACTION_DOWN) {
//voldown
// voldown
VolumeButtonListener.down();
if (!VolumeButtonListener.prevent)
return super.dispatchKeyEvent(event);
@@ -93,12 +77,13 @@ public class MainActivity extends ReactActivity {
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new ReactActivityDelegate(this, getMainComponentName()) {
@Override
protected ReactRootView createRootView() {
return new RNGestureHandlerEnabledRootView(MainActivity.this);
}
};
return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, new DefaultReactActivityDelegate(
this,
getMainComponentName(),
// If you opted-in for the New Architecture, we enable the Fabric Renderer.
DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled
// If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18).
DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled
));
}
}
@@ -1,98 +1,78 @@
package com.rajarsheechatterjee.LNReader;
import android.app.Application;
import android.content.Context;
import android.content.res.Configuration;
import androidx.annotation.NonNull;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
import com.facebook.react.defaults.DefaultReactNativeHost;
import com.facebook.soloader.SoLoader;
import com.rajarsheechatterjee.LNReader.generated.BasePackageList;
import com.rajarsheechatterjee.NavigationBarColor.NavigationBarColorPackage;
import com.rajarsheechatterjee.VolumeButtonListener.VolumeButtonListenerPackage;
import com.rajarsheechatterjee.EpubParser.EpubParserPackage;
import org.unimodules.adapters.react.ModuleRegistryAdapter;
import org.unimodules.adapters.react.ReactModuleRegistryProvider;
import expo.modules.ApplicationLifecycleDispatcher;
import expo.modules.ReactNativeHostWrapper;
import com.facebook.react.bridge.JSIModulePackage;
import com.swmansion.reanimated.ReanimatedJSIModulePackage;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactModuleRegistryProvider mModuleRegistryProvider = new ReactModuleRegistryProvider(
new BasePackageList().getPackageList()
);
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
private final ReactNativeHost mReactNativeHost =
new ReactNativeHostWrapper(this, new DefaultReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
List<ReactPackage> packages = new PackageList(this).getPackages();
packages.add(new ModuleRegistryAdapter(mModuleRegistryProvider));
packages.add(new com.rajarsheechatterjee.LNReader.NavigationBarColorPackage());
packages.add(new VolumeButtonListenerPackage());
return packages;
}
@Override
protected List<ReactPackage> getPackages() {
List<ReactPackage> packages = new PackageList(this).getPackages();
packages.add(new NavigationBarColorPackage());
packages.add(new VolumeButtonListenerPackage());
packages.add(new EpubParserPackage());
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
@Override
protected String getJSMainModuleName() {
return "index";
}
@Override
protected JSIModulePackage getJSIModulePackage() {
return new ReanimatedJSIModulePackage();
}
};
@Override
protected boolean isNewArchEnabled() {
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
}
@Override
protected Boolean isHermesEnabled() {
return BuildConfig.IS_HERMES_ENABLED;
}
});
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
DefaultNewArchitectureEntryPoint.load();
}
ApplicationLifecycleDispatcher.onApplicationCreate(this);
}
/**
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
*
* @param context
* @param reactInstanceManager
*/
private static void initializeFlipper(
Context context, ReactInstanceManager reactInstanceManager) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.rajarsheechatterjee.LNReader.ReactNativeFlipper");
aClass
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
.invoke(null, context, reactInstanceManager);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
@Override
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);
}
}
@@ -1,28 +0,0 @@
package com.rajarsheechatterjee.LNReader.generated;
import java.util.Arrays;
import java.util.List;
import org.unimodules.core.interfaces.Package;
public class BasePackageList {
public List<Package> getPackageList() {
return Arrays.<Package>asList(
new expo.modules.application.ApplicationPackage(),
new expo.modules.constants.ConstantsPackage(),
new expo.modules.documentpicker.DocumentPickerPackage(),
new expo.modules.errorrecovery.ErrorRecoveryPackage(),
new expo.modules.filesystem.FileSystemPackage(),
new expo.modules.font.FontLoaderPackage(),
new expo.modules.haptics.HapticsPackage(),
new expo.modules.imageloader.ImageLoaderPackage(),
new expo.modules.keepawake.KeepAwakePackage(),
new expo.modules.lineargradient.LinearGradientPackage(),
new expo.modules.localization.LocalizationPackage(),
new expo.modules.notifications.NotificationsPackage(),
new expo.modules.permissions.PermissionsPackage(),
new expo.modules.splashscreen.SplashScreenPackage(),
new expo.modules.sqlite.SQLitePackage(),
new expo.modules.webbrowser.WebBrowserPackage()
);
}
}
@@ -1,21 +1,18 @@
package com.rajarsheechatterjee.LNReader;
package com.rajarsheechatterjee.NavigationBarColor;
import android.animation.ArgbEvaluator;
import android.animation.ValueAnimator;
import android.annotation.TargetApi;
import android.graphics.Color;
import android.os.Build;
import android.app.Activity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import androidx.annotation.UiThread;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.UiThreadUtil;
import com.facebook.react.bridge.WritableMap;
import java.util.HashMap;
import java.util.Map;
@@ -1,4 +1,4 @@
package com.rajarsheechatterjee.LNReader;
package com.rajarsheechatterjee.NavigationBarColor;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material"
android:insetRight="@dimen/abc_edit_text_inset_horizontal_material"
android:insetTop="@dimen/abc_edit_text_inset_top_material"
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material">
<selector>
<!--
This file is a copy of abc_edit_text_material (https://bit.ly/3k8fX7I).
The item below with state_pressed="false" and state_focused="false" causes a NullPointerException.
NullPointerException:tempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)'
<item android:state_pressed="false" android:state_focused="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
For more info, see https://bit.ly/3CdLStv (react-native/pull/29452) and https://bit.ly/3nxOMoR.
-->
<item android:state_enabled="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
<item android:drawable="@drawable/abc_textfield_activated_mtrl_alpha"/>
</selector>
</inset>
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="@color/colorPrimaryDark"
android:gravity="center"
android:orientation="vertical"
android:scaleType="centerCrop"
android:navigationBarColor="#333333"
tools:context=".MainActivity">
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/lottie"
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_gravity="center_horizontal"
android:orientation="horizontal"
android:paddingLeft="25dp"
app:lottie_autoPlay="true"
app:lottie_loop="false"
app:lottie_rawRes="@raw/loading" />
</LinearLayout>
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/iconBackground"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
<background android:drawable="@mipmap/ic_launcher_background" />
<foreground android:drawable="@mipmap/ic_launcher_foreground" />
<monochrome android:drawable="@mipmap/ic_launcher_monochrome" />
</adaptive-icon>
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/iconBackground"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 858 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 876 B

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 876 B

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

File diff suppressed because one or more lines are too long
@@ -6,4 +6,5 @@
<color name="colorPrimaryDark">#202125</color>
<color name="navigationBarColor">#202125</color>
<color name="notification_icon_color">#00adb5</color>
<color name="ic_launcher_background">#222831</color>
</resources>
+13 -8
View File
@@ -5,19 +5,24 @@
?>
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:textColor">#000000</item>
<!-- Customize your theme here. -->
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="android:navigationBarColor">#202125</item>
<item name="android:statusBarColor">#202125</item>
<item name="android:navigationBarColor">@color/colorPrimaryDark</item>
<item name="android:statusBarColor">@color/colorPrimaryDark</item>
</style>
<style name="Theme.App.SplashScreen" parent="Theme.AppCompat.Light.NoActionBar">
<style name="SplashScreenTheme" parent="SplashScreen_SplashTheme">
<item name="android:statusBarColor">@color/colorPrimaryDark</item>
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
<item name="android:navigationBarColor">@color/colorPrimaryDark</item>
</style>
<style name="Theme.App.SplashScreen" parent="AppTheme">
<!-- Below line is handled by '@expo/configure-splash-screen' command and it's discouraged to modify it manually -->
<!-- Customize your splash screen theme here -->
<!-- <item name="icon">@drawable/no_icon</item> -->
<item name="android:windowBackground">@drawable/splashscreen</item>
<item name="android:navigationBarColor">#202125</item>
<item name="android:statusBarColor">#202125</item>
</style>
</resources>
@@ -0,0 +1,20 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package com.rajarsheechatterjee.LNReader;
import android.content.Context;
import com.facebook.react.ReactInstanceManager;
/**
* Class responsible of loading Flipper inside your React Native application. This is the release
* flavor of it so it's empty as we don't want to load Flipper.
*/
public class ReactNativeFlipper {
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
// Do nothing as we don't want to initialize Flipper on Release.
}
}
+11 -27
View File
@@ -1,39 +1,23 @@
import org.apache.tools.ant.taskdefs.condition.Os
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "29.0.3"
buildToolsVersion = "33.0.0"
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
ndkVersion = "21.1.6352462"
compileSdkVersion = 33
targetSdkVersion = 33
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"
}
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:4.1.0")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
google()
jcenter()
maven { url 'https://www.jitpack.io' }
classpath("com.android.tools.build:gradle:7.4.1")
classpath("com.facebook.react:react-native-gradle-plugin")
}
}
+26 -4
View File
@@ -9,8 +9,10 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
@@ -25,5 +27,25 @@ android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Version of flipper SDK to use with React Native
FLIPPER_VERSION=0.54.0
# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
# ./gradlew <task> -PreactNativeArchitectures=x86_64
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
# Use this property to enable support to the new architecture.
# This will allow you to use TurboModules and the Fabric render in
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=false
# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
hermesEnabled=true
# Enable GIF support in React Native images (~200 B increase)
expo.gif.enabled=false
# Enable webp support in React Native images (~85 KB increase)
expo.webp.enabled=false
# Enable animated webp support (~3.4 MB increase)
# Disabled by default because iOS doesn't support animated webp
expo.webp.animated=false
Binary file not shown.
+1 -1
View File
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
+160 -109
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env sh
#!/bin/sh
#
# Copyright 2015 the original author or authors.
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,78 +17,113 @@
#
##############################################################################
##
## Gradle start up script for UN*X
##
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
MAX_FD=maximum
warn () {
echo "$*"
}
} >&2
die () {
echo
echo "$*"
echo
exit 1
}
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -97,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
@@ -105,79 +140,95 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"
+4 -18
View File
@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -54,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -64,28 +64,14 @@ echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
+11 -5
View File
@@ -1,9 +1,15 @@
rootProject.name = 'LNReader'
apply from: '../node_modules/react-native-unimodules/gradle.groovy'
includeUnimodulesProjects()
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle");
applyNativeModulesSettingsGradle(settings)
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/react-native-gradle-plugin')
apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle")
useExpoModules()
include ':react-native-lottie-splash-screen'
project(':react-native-lottie-splash-screen').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-lottie-splash-screen/android')
include ':react-native-fs'
project(':react-native-fs').projectDir = new File(settingsDir, '../node_modules/react-native-fs/android')
+3 -4
View File
@@ -3,9 +3,8 @@
"name": "LNReader",
"slug": "LNReader",
"scheme": "lnreader",
"notification": {
"icon": "./assets/notification.png",
"color": "#00adb5"
}
"plugins": [
"expo-localization"
]
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

+14 -2
View File
@@ -1,7 +1,7 @@
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
presets: ['babel-preset-expo', 'module:metro-react-native-babel-preset'],
plugins: [
[
'module-resolver',
@@ -14,12 +14,24 @@ module.exports = function (api) {
'@strings': './strings',
'@redux': './src/redux',
'@services': './src/services',
'@sources': './src/sources',
'@plugins': './src/plugins',
'@utils': './src/utils',
'@theme': './src/theme',
'@navigators': './src/navigators',
'@native': './src/native',
'@api': './src/api',
},
},
],
'react-native-reanimated/plugin',
[
'module:react-native-dotenv',
{
envName: 'APP_ENV',
moduleName: '@env',
path: '.env',
},
],
],
};
};
+1 -1
View File
@@ -2,4 +2,4 @@ pull_request_title: 'chore: Update translations'
commit_message: '[ci skip]'
files:
- source: /strings/languages/en/strings.json
translation: /strings/languages/%two_letters_code%/strings.json
translation: /strings/languages/%locale_with_underscore%/strings.json
Vendored
+4
View File
@@ -0,0 +1,4 @@
declare module '@env' {
export const MYANIMELIST_CLIENT_ID: string;
export const ANILIST_CLIENT_ID: string;
}
-4
View File
@@ -1,4 +0,0 @@
module.exports = {
preset: 'react-native',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
};
+9410 -20855
View File
File diff suppressed because it is too large Load Diff
+55 -63
View File
@@ -1,98 +1,90 @@
{
"name": "lnreader",
"version": "1.1.12",
"version": "2.0.0",
"private": true,
"scripts": {
"android": "react-native run-android",
"android": "react-native run-android --active-arch-only",
"ios": "react-native run-ios",
"start": "react-native start",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"prettier": "prettier --write \"./src/**/*.{js,jsx,ts,tsx}\"",
"buildRelease": "cd android && gradlew clean && gradlew assembleRelease",
"sources:madara": "node scripts/generateMadaraSource.cjs",
"source:generator": "node scripts/generateSource.cjs",
"buildRelease": "cd android && ./gradlew clean && ./gradlew assembleRelease",
"open": "open ./android/app/build/outputs/apk/release/",
"strings": "node scripts/stringTypes.cjs",
"prepare": "husky install"
},
"dependencies": {
"@react-native-async-storage/async-storage": "^1.15.11",
"@react-native-community/clipboard": "^1.5.1",
"@react-native-community/masked-view": "^0.1.11",
"@react-native-community/slider": "^4.1.12",
"@react-native-picker/picker": "^2.4.1",
"@gorhom/bottom-sheet": "^4.4.5",
"@react-native-community/slider": "4.4.2",
"@react-native-google-signin/google-signin": "^11.0.0",
"@react-native-picker/picker": "2.4.8",
"@react-navigation/material-bottom-tabs": "^6.0.9",
"@react-navigation/native": "^6.0.6",
"@react-navigation/native": "^6.1.9",
"@react-navigation/stack": "^6.0.11",
"@reduxjs/toolkit": "^1.7.2",
"@shopify/flash-list": "^1.2.1",
"buffer": "^6.0.3",
"@shopify/flash-list": "1.4.0",
"cheerio": "^1.0.0-rc.10",
"color": "^4.2.3",
"dayjs": "^1.11.4",
"expo": "^41.0.1",
"expo-document-picker": "^9.2.4",
"expo-file-system": "~11.0.2",
"expo-haptics": "~10.0.0",
"expo-keep-awake": "~9.1.2",
"expo-linear-gradient": "~9.1.0",
"expo-linking": "~2.2.3",
"expo-localization": "~10.1.0",
"expo-notifications": "~0.11.6",
"expo-splash-screen": "^0.11.4",
"expo-sqlite": "~9.1.0",
"expo-web-browser": "~9.1.0",
"expo": "^48.0.21",
"expo-clipboard": "~4.1.2",
"expo-document-picker": "~11.2.2",
"expo-file-system": "~15.2.2",
"expo-haptics": "~12.2.1",
"expo-keep-awake": "~12.0.1",
"expo-linear-gradient": "~12.1.2",
"expo-linking": "~4.0.1",
"expo-localization": "~14.1.1",
"expo-notifications": "~0.18.1",
"expo-speech": "~11.1.1",
"expo-sqlite": "~11.1.1",
"expo-web-browser": "~12.1.1",
"i18n-js": "^3.8.0",
"lodash": "^4.17.21",
"prop-types": "^15.7.2",
"qs": "^6.10.1",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "^0.64.3",
"react-native-background-actions": "^2.6.5",
"lodash-es": "^4.17.21",
"qs": "^6.10.3",
"react": "18.2.0",
"react-native": "0.71.14",
"react-native-background-actions": "^3.0.1",
"react-native-device-info": "^8.4.7",
"react-native-easing-gradient": "^1.0.0",
"react-native-fast-image": "^8.5.11",
"react-native-gesture-handler": "~1.10.2",
"react-native-markdown-display": "^7.0.0-alpha.2",
"react-native-mmkv": "^2.4.3",
"react-native-pager-view": "^5.4.9",
"react-native-paper": "^5.0.0-rc.4",
"react-native-reanimated": "^2.2.4",
"react-native-render-html": "^6.3.4",
"react-native-safe-area-context": "^3.2.0",
"react-native-screens": "^3.9.0",
"react-native-swipe-gestures": "^1.0.5",
"react-native-tab-view": "^3.1.1",
"react-native-tts": "^4.1.0",
"react-native-unimodules": "^0.13.3",
"react-native-error-boundary": "^1.1.16",
"react-native-fs": "^2.20.0",
"react-native-gesture-handler": "~2.9.0",
"react-native-lottie-splash-screen": "^1.0.1",
"react-native-mmkv": "^2.11.0",
"react-native-pager-view": "6.1.2",
"react-native-paper": "^5.12.0",
"react-native-reanimated": "^2.17.0",
"react-native-safe-area-context": "4.5.0",
"react-native-screens": "~3.20.0",
"react-native-shimmer-placeholder": "^2.0.9",
"react-native-tab-view": "^3.5.2",
"react-native-vector-icons": "^9.0.0",
"react-native-webview": "^11.14.3",
"react-redux": "^7.2.6",
"redux": "^4.1.2",
"redux-persist": "^6.0.0",
"rn-fetch-blob": "^0.12.0",
"rn-sliding-up-panel": "^2.4.4",
"sanitize-html": "^2.7.0"
"react-native-webview": "11.26.0",
"sanitize-html": "^2.7.0",
"urlencode": "^2.0.0"
},
"devDependencies": {
"@babel/core": "^7.16.0",
"@react-native-community/eslint-config": "^3.0.1",
"@babel/core": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@react-native-community/eslint-config": "^3.2.0",
"@tsconfig/react-native": "^2.0.2",
"@types/color": "^3.0.3",
"@types/i18n-js": "^3.8.2",
"@types/jest": "^27.4.0",
"@types/lodash": "^4.14.179",
"@types/react-native": "^0.66.15",
"@types/lodash-es": "^4.17.6",
"@types/react": "^18.0.24",
"@types/react-native-vector-icons": "^6.4.10",
"@types/react-test-renderer": "^17.0.1",
"@types/sanitize-html": "^2.6.2",
"@typescript-eslint/eslint-plugin": "^5.10.2",
"@typescript-eslint/parser": "^5.10.2",
"babel-plugin-module-resolver": "^4.1.0",
"eslint": "^7.32.0",
"eslint-plugin-react-native": "^3.11.0",
"eslint": "^8.19.0",
"eslint-plugin-react-native": "^4.1.0",
"husky": "^7.0.4",
"lint-staged": "^12.3.7",
"typescript": "^4.5.5"
"metro-react-native-babel-preset": "^0.73.10",
"prettier": "^2.4.1",
"react-native-dotenv": "^3.4.9",
"typescript": "4.8.4"
},
"resolutions": {
"@types/react": "^17"
+410
View File
@@ -0,0 +1,410 @@
#!/usr/bin/python -u
'''
Copyright 2009, The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
'''
# Script to highlight adb logcat output for console
# Originally written by Jeff Sharkey, http://jsharkey.org/
# Piping detection and popen() added by other Android team members
# Package filtering and output improvements by Jake Wharton, http://jakewharton.com
import argparse
import sys
import re
import subprocess
from subprocess import PIPE
from ctypes import *
from platform import win32_ver
__version__ = '2.1.0+Win10'
win_ver = win32_ver()[0]
show_colors = (win_ver == '10' or win_ver == '') and sys.stdout.isatty()
LOG_LEVELS = 'VDIWEF'
LOG_LEVELS_MAP = dict([(LOG_LEVELS[i], i) for i in range(len(LOG_LEVELS))])
parser = argparse.ArgumentParser(description='Filter logcat by package name')
parser.add_argument('package', nargs='*', help='Application package name(s)')
parser.add_argument('-w', '--tag-width', metavar='N', dest='tag_width', type=int, default=23, help='Width of log tag')
parser.add_argument('-l', '--min-level', dest='min_level', type=str, choices=LOG_LEVELS+LOG_LEVELS.lower(), default='V', help='Minimum level to be displayed')
parser.add_argument('--color-gc', dest='color_gc', action='store_true', help='Color garbage collection')
parser.add_argument('--always-display-tags', dest='always_tags', action='store_true',help='Always display the tag name')
parser.add_argument('--current', dest='current_app', action='store_true',help='Filter logcat by current running app')
parser.add_argument('-s', '--serial', dest='device_serial', help='Device serial number (adb -s option)')
parser.add_argument('-d', '--device', dest='use_device', action='store_true', help='Use first device for log input (adb -d option)')
parser.add_argument('-e', '--emulator', dest='use_emulator', action='store_true', help='Use first emulator for log input (adb -e option)')
parser.add_argument('-c', '--clear', dest='clear_logcat', action='store_true', help='Clear the entire log before running')
parser.add_argument('-t', '--tag', dest='tag', action='append', help='Filter output by specified tag(s)')
parser.add_argument('-i', '--ignore-tag', dest='ignored_tag', action='append', help='Filter output by ignoring specified tag(s)')
parser.add_argument('-v', '--version', action='version', version='%(prog)s ' + __version__, help='Print the version number and exit')
parser.add_argument('-a', '--all', dest='all', action='store_true', default=False, help='Print all log messages')
parser.add_argument('-o', '--output', dest='output', type=str, default='', help='Output filename')
parser.add_argument('-n', '--no-color', dest='no_color', action='store_true', help='Disable colors')
parser.add_argument('-r', '--regex', dest='regex', type=str, help='Print only when matches REGEX and REGEX is regular expression logcat -e REGEX')
args = parser.parse_args()
min_level = LOG_LEVELS_MAP[args.min_level.upper()]
if (args.no_color):
show_colors = False
package = args.package
if len(package) == 0:
package.append('com.rajarsheechatterjee.LNReader')
# enabling Windows 10 VT100 support
def enableVT100():
STD_OUTPUT_HANDLE = -11
ENABLE_VIRTUAL_TERMINAL_PROCESSING = 4
stdout = windll.kernel32.GetStdHandle(STD_OUTPUT_HANDLE)
if stdout == -1:
raise WinError()
mode = c_uint()
if windll.kernel32.GetConsoleMode(stdout, byref(mode)) == 0:
raise WinError()
mode.value = mode.value | ENABLE_VIRTUAL_TERMINAL_PROCESSING
if windll.kernel32.SetConsoleMode(stdout, mode) == 0:
raise WinError()
if (show_colors):
enableVT100()
output_file = False
if (args.output):
output_file = open(args.output, 'a+')
base_adb_command = ['adb']
if args.device_serial:
base_adb_command.extend(['-s', args.device_serial])
if args.use_device:
base_adb_command.append('-d')
if args.use_emulator:
base_adb_command.append('-e')
if args.current_app:
system_dump_command = base_adb_command + ["shell", "dumpsys", "activity", "activities"]
system_dump = subprocess.Popen(system_dump_command, stdout=PIPE, stderr=PIPE).communicate()[0]
running_package_name = re.search(".*TaskRecord.*A[= ]([^ ^}]*)", system_dump).group(1)
package.append(running_package_name)
if len(package) == 0:
args.all = True
# Store the names of packages for which to match all processes.
catchall_package = list(filter(lambda package: package.find(":") == -1, package))
# Store the name of processes to match exactly.
named_processes = filter(lambda package: package.find(":") != -1, package)
# Convert default process names from <package>: (cli notation) to <package> (android notation) in the exact names match group.
named_processes = map(lambda package: package if package.find(":") != len(package) - 1 else package[:-1], named_processes)
header_size = args.tag_width + 1 + 3 + 1 # space, level, space
width = -1
try:
# Get the current terminal width
import fcntl, termios, struct
h, width = struct.unpack('hh', fcntl.ioctl(0, termios.TIOCGWINSZ, struct.pack('hh', 0, 0)))
except:
pass
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8)
RESET = '\033[0m'
def termcolor(fg=None, bg=None):
codes = []
if fg is not None: codes.append('3%d' % fg)
if bg is not None: codes.append('10%d' % bg)
return '\033[%sm' % ';'.join(codes) if codes else ''
def colorize(message, fg=None, bg=None):
return termcolor(fg, bg) + message + RESET
def indent_wrap(message):
if width == -1:
return message
message = message.replace('\t', ' ')
wrap_area = width - header_size
messagebuf = ''
current = 0
while current < len(message):
next = min(current + wrap_area, len(message))
messagebuf += message[current:next]
if next < len(message):
messagebuf += '\n'
messagebuf += ' ' * header_size
current = next
return messagebuf
LAST_USED = [RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN]
KNOWN_TAGS = {
'dalvikvm': WHITE,
'Process': WHITE,
'ActivityManager': WHITE,
'ActivityThread': WHITE,
'AndroidRuntime': CYAN,
'jdwp': WHITE,
'StrictMode': WHITE,
'DEBUG': YELLOW,
}
def allocate_color(tag):
# this will allocate a unique format for the given tag
# since we dont have very many colors, we always keep track of the LRU
if tag not in KNOWN_TAGS:
KNOWN_TAGS[tag] = LAST_USED[0]
color = KNOWN_TAGS[tag]
if color in LAST_USED:
LAST_USED.remove(color)
LAST_USED.append(color)
return color
NO_COLOR = re.compile(r'\033\[.*?m')
def output(line):
line_nocolor = '' if show_colors and not output_file else NO_COLOR.sub('', line)
print(line if show_colors else line_nocolor)
if (output_file):
output_file.write(line_nocolor + '\n')
RULES = {
# StrictMode policy violation; ~duration=319 ms: android.os.StrictMode$StrictModeDiskWriteViolation: policy=31 violation=1
re.compile(r'^(StrictMode policy violation)(; ~duration=)(\d+ ms)')
: r'%s\1%s\2%s\3%s' % (termcolor(RED), RESET, termcolor(YELLOW), RESET),
}
# Only enable GC coloring if the user opted-in
if args.color_gc:
# GC_CONCURRENT freed 3617K, 29% free 20525K/28648K, paused 4ms+5ms, total 85ms
key = re.compile(r'^(GC_(?:CONCURRENT|FOR_M?ALLOC|EXTERNAL_ALLOC|EXPLICIT) )(freed <?\d+.)(, \d+\% free \d+./\d+., )(paused \d+ms(?:\+\d+ms)?)')
val = r'\1%s\2%s\3%s\4%s' % (termcolor(GREEN), RESET, termcolor(YELLOW), RESET)
RULES[key] = val
TAGTYPES = {
'V': colorize(' V ', fg=WHITE, bg=BLACK),
'D': colorize(' D ', fg=BLACK, bg=BLUE),
'I': colorize(' I ', fg=BLACK, bg=GREEN),
'W': colorize(' W ', fg=BLACK, bg=YELLOW),
'E': colorize(' E ', fg=BLACK, bg=RED),
'F': colorize(' F ', fg=BLACK, bg=RED),
}
PID_LINE = re.compile(r'^\w+\s+(\w+)\s+\w+\s+\w+\s+\w+\s+\w+\s+\w+\s+\w\s([\w|\.|\/]+)$')
PID_START = re.compile(r'^.*: Start proc ([a-zA-Z0-9._:]+) for ([a-z]+ [^:]+): pid=(\d+) uid=(\d+) gids=(.*)$')
PID_START_5_1 = re.compile(r'^.*: Start proc (\d+):([a-zA-Z0-9._:]+)/[a-z0-9]+ for (.*)$')
PID_START_DALVIK = re.compile(r'^E/dalvikvm\(\s*(\d+)\): >>>>> ([a-zA-Z0-9._:]+) \[ userId:0 \| appId:(\d+) \]$')
PID_KILL = re.compile(r'^Killing (\d+):([a-zA-Z0-9._:]+)/[^:]+: (.*)$')
PID_LEAVE = re.compile(r'^No longer want ([a-zA-Z0-9._:]+) \(pid (\d+)\): .*$')
PID_DEATH = re.compile(r'^Process ([a-zA-Z0-9._:]+) \(pid (\d+)\) has died.?$')
LOG_LINE = re.compile(r'^([A-Z])/(.+?)\( *(\d+)\): (.*?)$')
BUG_LINE = re.compile(r'.*nativeGetEnabledTags.*')
BACKTRACE_LINE = re.compile(r'^#(.*?)pc\s(.*?)$')
adb_command = base_adb_command[:]
adb_command.append('logcat')
adb_command.extend(['-v', 'brief'])
if args.regex:
adb_command.extend(['-e',args.regex])
# Clear log before starting logcat
if args.clear_logcat:
adb_clear_command = list(adb_command)
adb_clear_command.append('-c')
adb_clear = subprocess.Popen(adb_clear_command)
while adb_clear.poll() is None:
pass
# This is a ducktype of the subprocess.Popen object
class FakeStdinProcess():
def __init__(self):
self.stdout = sys.stdin
def poll(self):
return None
if sys.stdin.isatty():
adb = subprocess.Popen(adb_command, stdin=PIPE, stdout=PIPE)
else:
adb = FakeStdinProcess()
pids = set()
last_tag = None
app_pid = None
def match_packages(token):
if len(package) == 0:
return True
if token in named_processes:
return True
index = token.find(':')
return (token in catchall_package) if index == -1 else (token[:index] in catchall_package)
def parse_death(tag, message):
if tag != 'ActivityManager':
return None, None
kill = PID_KILL.match(message)
if kill:
pid = kill.group(1)
package_line = kill.group(2)
if match_packages(package_line) and pid in pids:
return pid, package_line
leave = PID_LEAVE.match(message)
if leave:
pid = leave.group(2)
package_line = leave.group(1)
if match_packages(package_line) and pid in pids:
return pid, package_line
death = PID_DEATH.match(message)
if death:
pid = death.group(2)
package_line = death.group(1)
if match_packages(package_line) and pid in pids:
return pid, package_line
return None, None
def parse_start_proc(line):
start = PID_START_5_1.match(line)
if start is not None:
line_pid, line_package, target = start.groups()
return line_package, target, line_pid, '', ''
start = PID_START.match(line)
if start is not None:
line_package, target, line_pid, line_uid, line_gids = start.groups()
return line_package, target, line_pid, line_uid, line_gids
start = PID_START_DALVIK.match(line)
if start is not None:
line_pid, line_package, line_uid = start.groups()
return line_package, '', line_pid, line_uid, ''
return None
def tag_in_tags_regex(tag, tags):
return any(re.match(r'^' + t + r'$', tag) for t in map(str.strip, tags))
ps_command = base_adb_command + ['shell', 'ps']
ps_pid = subprocess.Popen(ps_command, stdin=PIPE, stdout=PIPE, stderr=PIPE)
while True:
try:
line = ps_pid.stdout.readline().decode('utf-8', 'replace').strip()
except KeyboardInterrupt:
break
if len(line) == 0:
break
pid_match = PID_LINE.match(line)
if pid_match is not None:
pid = pid_match.group(1)
proc = pid_match.group(2)
if proc in catchall_package:
seen_pids = True
pids.add(pid)
while adb.poll() is None:
try:
line = adb.stdout.readline().decode('utf-8', 'replace').strip()
except KeyboardInterrupt:
break
if len(line) == 0:
break
bug_line = BUG_LINE.match(line)
if bug_line is not None:
continue
log_line = LOG_LINE.match(line)
if log_line is None:
continue
level, tag, owner, message = log_line.groups()
tag = tag.strip()
start = parse_start_proc(line)
if start:
line_package, target, line_pid, line_uid, line_gids = start
if match_packages(line_package):
pids.add(line_pid)
app_pid = line_pid
linebuf = '\n'
linebuf += colorize(' ' * (header_size - 1), bg=WHITE)
linebuf += indent_wrap(' Process %s created for %s\n' % (line_package, target))
linebuf += colorize(' ' * (header_size - 1), bg=WHITE)
linebuf += ' PID: %s UID: %s GIDs: %s' % (line_pid, line_uid, line_gids)
linebuf += '\n'
output(linebuf)
last_tag = None # Ensure next log gets a tag printed
dead_pid, dead_pname = parse_death(tag, message)
if dead_pid:
pids.remove(dead_pid)
linebuf = '\n'
linebuf += colorize(' ' * (header_size - 1), bg=RED)
linebuf += ' Process %s (PID: %s) ended' % (dead_pname, dead_pid)
linebuf += '\n'
output(linebuf)
last_tag = None # Ensure next log gets a tag printed
# Make sure the backtrace is printed after a native crash
if tag == 'DEBUG':
bt_line = BACKTRACE_LINE.match(message.lstrip())
if bt_line is not None:
message = message.lstrip()
owner = app_pid
if not args.all and owner not in pids:
continue
if level in LOG_LEVELS_MAP and LOG_LEVELS_MAP[level] < min_level:
continue
if args.ignored_tag and tag_in_tags_regex(tag, args.ignored_tag):
continue
if args.tag and not tag_in_tags_regex(tag, args.tag):
continue
linebuf = ''
if args.tag_width > 0:
# right-align tag title and allocate color if needed
if tag != last_tag or args.always_tags:
last_tag = tag
color = allocate_color(tag)
tag = tag[-args.tag_width:].rjust(args.tag_width)
linebuf += colorize(tag, fg=color)
else:
linebuf += ' ' * args.tag_width
linebuf += ' '
# write out level colored edge
if level in TAGTYPES:
linebuf += TAGTYPES[level]
else:
linebuf += ' ' + level + ' '
linebuf += ' '
# format tag message using rules
for matcher in RULES:
replace = RULES[matcher]
message = matcher.sub(replace, message)
linebuf += indent_wrap(message)
output(linebuf)
if (output_file):
output_file.close()
-7
View File
@@ -1,7 +0,0 @@
module.exports = {
project: {
ios: {},
android: {},
},
assets: ['./assets/fonts/'],
};
+5
View File
@@ -0,0 +1,5 @@
1. Create `index.html` with [template](./template.index.html) content in this folder/
2. Replace `${hmtl}` by your chapter text.
3. Edit files in `/android/app/src/main/assets` folder.
4. Open index.html in browse for quick test.
5. rebuild the app to test in real reader.
+71
View File
@@ -0,0 +1,71 @@
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<style>
:root {
--StatusBar-currentHeight: 30px;
--readerSettings-theme: #292832;
--readerSettings-padding: 2%;
--readerSettings-textSize: 16px;
--readerSettings-textColor: #CCCCCC;
--readerSettings-textAlign: left;
--readerSettings-lineHeight: 1.5;
--readerSettings-fontFamily: ;
--theme-primary: rgb(0, 87, 206);
--theme-onPrimary: rgb(255, 255, 255);
--theme-secondary: rgb(88, 94, 113);
--theme-onSecondary: rgb(255, 255, 255);
--theme-surface: rgb(254, 251, 255);
--theme-surface-0-9: rgba(254, 251, 255, 0.9);
--theme-onSurface: rgb(27, 27, 31);
--theme-outline: rgb(117, 119, 128);
--chapterCtn-height: 700px;
}
body {
background-color: var(--readerSettings-theme);
}
@font-face {
font-family: 'Lora';
src: url("../android/app/src/main/assets/fonts/lora.ttf");
}
</style>
<script>
let hidden = true;
window.ReactNativeWebView = {};
window.ReactNativeWebView.postMessage = (data) => {
const event = JSON.parse(data);
switch (event.type) {
case 'hide':
if(!hidden) {
scrollHandler.hide()
}else{
scrollHandler.show();
}
break;
default:
console.log('unsupported event', event.type);
break;
}
};
</script>
<link rel="stylesheet" href="../android/app/src/main/assets/css/index.css">
<script async>
var showScrollPercentage = true;
var swipeGestures = false;
var autoSaveInterval = 2222;
</script>
<script defer src="../android/app/src/main/assets/js/index.js"></script>
</head>
<body>
<div class="chapterCtn" onclick="reader.post({type:'hide'})">
<chapter data-plugin-id='pluginId' data-novel-id='novelId' data-chapter-id='chapterId'>
${html}
</chapter>
<div class="d-none" id="ScrollBar"></div>
<div id="reader-percentage"></div>
</div>
</body>
</body>
</html>
-79
View File
@@ -1,79 +0,0 @@
const path = require('path');
const fs = require('fs');
const prettier = require('prettier');
const prettierConfig = require('../.prettierrc');
const MadaraSources = require('../src/sources/multisrc/madara/MadaraSources.json');
const AllSources = require('../src/sources/sources.json');
const getScraperName = scraperName => {
let name = scraperName
.replace(/\s+/g, '')
.replace(/-/g, 'Dash')
.replace(/\./g, 'Dot')
.replace('1st', 'First');
return name;
};
let content =
"/**\n * This file is auto-generated\n */\n\nimport MadaraScraper from './MadaraScraper';\n\n";
MadaraSources.forEach(source => {
content =
content +
`export const ${getScraperName(
source.sourceName,
)}Scraper = new MadaraScraper(${source.sourceId}, "${source.baseUrl}", "${
source.sourceName
}", ${source.options ? JSON.stringify(source.options) : ''});\n\n`;
});
content = prettier.format(content, {
parser: 'typescript',
...prettierConfig,
});
fs.writeFile(
path.resolve(process.cwd(), 'src/sources/multisrc/madara/MadaraGenerator.ts'),
content,
error => {
if (error) {
console.log(error);
}
},
);
MadaraSources.forEach(madaraSource => {
if (!AllSources.some(source => source.sourceId === madaraSource.sourceId)) {
let allSourcesContent = AllSources;
allSourcesContent.push({
sourceId: madaraSource.sourceId,
sourceName: madaraSource.sourceName,
icon: `https://github.com/LNReader/lnreader-sources/blob/main/multisrc/madara/icons/${madaraSource.sourceName
.replace(/\s+/g, '')
.toLowerCase()}.png?raw=true`,
url: madaraSource.baseUrl,
lang: madaraSource.options.lang || 'English',
});
allSourcesContent = JSON.stringify(allSourcesContent);
allSourcesContent = prettier.format(allSourcesContent, {
parser: 'json5',
quoteProps: 'preserve',
trailingComma: 'none',
});
fs.writeFile(
path.resolve(process.cwd(), 'src/sources/sources.json'),
allSourcesContent,
error => {
if (error) {
console.log(error);
}
},
);
}
});
-328
View File
@@ -1,328 +0,0 @@
/**
* This script can be used to generate sources
*/
const fs = require('fs');
const path = require('path');
const prettier = require('prettier');
const prettierConfig = require('../.prettierrc');
const AllSources = require('../src/sources/sources.json');
const getLanguageCode = language => {
const codes = {
English: 'en',
Arabic: 'ar',
French: 'fr',
Turkish: 'tr',
Chinese: 'cn',
Japanese: 'jp',
Vietnamese: 'vi',
};
return codes[language];
};
try {
if (process.argv[2]) {
const source = JSON.parse(
fs.readFileSync(path.resolve(process.cwd(), process.argv[2]), 'utf8'),
);
const isDuplicate = AllSources.some(
item => item.sourceId === source.sourceId,
);
const content = `
import * as cheerio from 'cheerio';
import { isUrlAbsolute } from '../../utils/isAbsoluteUrl';
${
source?.options?.imports?.toaster
? "import { showToast } from '../../hooks/showToast'"
: ''
};
import {
SourceChapter,
SourceChapterItem,
SourceNovel,
SourceNovelItem,
} from '../types';
const sourceId = ${source.sourceId};
const sourceName = "${source.sourceName}";
const baseUrl = "${source.baseUrl}";
${
!source.popularNovels.url.includes('${page}')
? '// eslint-disable-next-line @typescript-eslint/no-unused-vars'
: ''
}
const popularNovels = async (page: number) => {
const totalPages = ${source.popularNovels.totalPages};
const url = \`${source.popularNovels.url}\`;
const result = await fetch(url);
const body = await result.text();
const loadedCheerio = cheerio.load(body);
const novels: SourceNovelItem[] = [];
loadedCheerio('${
source.popularNovels.selectors.novelList
}').each(function () {
let novelUrl = loadedCheerio(this).find('${
source.popularNovels.selectors.novelUrl
}').attr('href');
if (novelUrl && !isUrlAbsolute(novelUrl)) {
novelUrl = baseUrl + novelUrl;
}
if (novelUrl) {
const novelName = loadedCheerio(this).find('${
source.popularNovels.selectors.novelName
}').text().trim();
let novelCover = loadedCheerio(this).find('${
source.popularNovels.selectors.novelCover
}').attr('src');
if (novelCover && !isUrlAbsolute(novelCover)) {
novelCover = baseUrl + novelCover;
}
const novel = {
sourceId,
novelUrl,
novelName,
novelCover,
};
novels.push(novel);
}
});
return { totalPages, novels };
};
const parseNovelAndChapters = async (novelUrl: string) => {
const url = novelUrl;
const result = await fetch(url);
const body = await result.text();
let loadedCheerio = cheerio.load(body);
const novel: SourceNovel = {
sourceId,
sourceName,
url: novelUrl,
novelUrl,
chapters: [],
};
novel.novelName = loadedCheerio('${
source.novelAndChapters.selectors.novelName
}').text();
let novelCover = loadedCheerio('${
source.novelAndChapters.selectors.novelCover
}').attr('src');
novel.novelCover = novelCover
? isUrlAbsolute(novelCover)
? novelCover
: baseUrl + novelCover
: undefined;
novel.summary = loadedCheerio('${
source.novelAndChapters.selectors.summary
}').text().trim();
novel.author = loadedCheerio('${
source.novelAndChapters.selectors.author
}').text().trim();
novel.genre = loadedCheerio('${
source.novelAndChapters.selectors.genre
}').text().trim()${source?.options?.status?.replace || ''};
novel.status = loadedCheerio('${
source.novelAndChapters.selectors.status
}').text().trim();
loadedCheerio('${
source.novelAndChapters.selectors.chapterList
}').each(function () {
let chapterUrl = loadedCheerio(this).find('a').attr('href');
if (chapterUrl && !isUrlAbsolute(chapterUrl)) {
chapterUrl = baseUrl + chapterUrl;
}
if (chapterUrl) {
const chapterName = loadedCheerio(this).find('${
source.novelAndChapters.selectors.chapterName
}').text().trim();
const releaseDate = ${
source.novelAndChapters.selectors.releaseDate
? `loadedCheerio(this).find('${source.novelAndChapters.selectors.releaseDate}').text();`
: null
}
const chapter: SourceChapterItem = {
chapterName,
releaseDate,
chapterUrl,
};
novel.chapters?.push(chapter);
}
});
return novel;
};
const parseChapter = async (novelUrl: string, chapterUrl: string) => {
const url = chapterUrl;
const result = await fetch(url);
const body = await result.text();
const loadedCheerio = cheerio.load(body);
const chapterName = loadedCheerio('${
source.chapter.selectors.chapterName
}').text();
const chapterText = loadedCheerio('${
source.chapter.selectors.chapterText
}').html() || '';
const chapter: SourceChapter = {
sourceId,
novelUrl,
chapterUrl,
chapterName,
chapterText,
};
return chapter;
};
${
!source.search.url.includes('${searchTerm}')
? '// eslint-disable-next-line @typescript-eslint/no-unused-vars'
: ''
}
const searchNovels = async (searchTerm: string) => {
${
source.search
? `
const url = \`${source.search.url}\`;
const result = await fetch(url);
const body = await result.text();
const loadedCheerio = cheerio.load(body);
const novels: SourceNovelItem[] = [];
loadedCheerio('${source.search.selectors.novelList}').each(function () {
let novelUrl = loadedCheerio(this).find('${source.search.selectors.novelUrl}').attr('href');
if (novelUrl && !isUrlAbsolute(novelUrl)) {
novelUrl = baseUrl + novelUrl;
}
if (novelUrl) {
const novelName = loadedCheerio(this).find('${source.search.selectors.novelName}').text();
let novelCover = loadedCheerio(this).find('${source.search.selectors.novelCover}').attr('src');
if (novelCover && !isUrlAbsolute(novelCover)) {
novelCover = baseUrl + novelCover;
}
novels.push({
sourceId,
novelUrl,
novelName,
novelCover,
});
}
});
return novels;`
: `
showToast('${source.sourceName}: Search is not available in this source')
return [];
`
}
};
const ${source.sourceName}Scraper = {
popularNovels,
parseNovelAndChapters,
parseChapter,
searchNovels,
};
export default ${source.sourceName}Scraper;
`;
const formatContent = prettier.format(content, {
parser: 'typescript',
...prettierConfig,
});
fs.writeFile(
path.resolve(
process.cwd(),
`src/sources/${getLanguageCode(source.lang)}/${source.sourceName}.ts`,
),
formatContent,
error => {
if (error) {
console.log(error);
}
},
);
if (!isDuplicate) {
let allSourcesContent = AllSources;
allSourcesContent.push({
sourceId: source.sourceId,
sourceName: source.sourceName,
icon: `https://github.com/LNReader/lnreader-sources/blob/main/src/${getLanguageCode(
source.lang,
)}/${source.sourceName.toLowerCase()}/icon.png?raw=true`,
url: source.baseUrl,
lang: source.lang || 'English',
});
allSourcesContent = prettier.format(JSON.stringify(allSourcesContent), {
parser: 'json',
...prettierConfig,
});
fs.writeFile(
path.resolve(process.cwd(), 'src/sources/sources.json'),
allSourcesContent,
error => {
if (error) {
console.log(error);
}
},
);
} else {
console.log('Source with same id already exists');
}
} else {
console.log('Template path not provided');
}
} catch (e) {
console.log(e);
}
+1
View File
@@ -0,0 +1 @@
export const PATH_SEPARATOR = '&&';
+111
View File
@@ -0,0 +1,111 @@
import { create, download, getJson, list } from './request';
import { DriveCreateRequestData, DriveFile } from './types';
const LNREADER_DRIVE_MARK = '(Do not change this!) LNReader-Drive';
export const exists = async (
fileName: string,
isFolder?: boolean,
parentId?: string,
marked?: boolean,
) => {
let q = `name = '${fileName}' and trashed = false `;
if (marked) {
q += ` and fullText contains '${LNREADER_DRIVE_MARK}' `;
}
if (isFolder) {
q += " and mimeType = 'application/vnd.google-apps.folder' ";
}
if (parentId) {
q += ` and '${parentId}' in parents `;
}
const res = await list({ q });
return res.files.find(file => file.name === fileName);
};
export const makeDir = async (fileName: string, parentId?: string) => {
const existedDir = await exists(fileName, true, parentId);
if (existedDir) {
return existedDir;
}
const data: DriveCreateRequestData = {
metadata: {
name: fileName,
mimeType: 'application/vnd.google-apps.folder',
description: LNREADER_DRIVE_MARK,
},
};
if (parentId) {
data.metadata.parents = [parentId];
}
return create(data);
};
export const createFile = async (
fileName: string,
mimeType: string,
content: string,
parentId?: string,
) => {
const existedFile = await exists(fileName, false, parentId);
if (existedFile) {
return existedFile;
}
const data: DriveCreateRequestData = {
metadata: {
name: fileName,
mimeType: mimeType,
description: LNREADER_DRIVE_MARK,
},
content: content,
};
if (parentId) {
data.metadata.parents = [parentId];
}
return create(data);
};
export const getBackups = async (parentId: string, marked?: boolean) => {
let q = `
name contains '.backup' and trashed = false
and mimeType = 'application/vnd.google-apps.folder' and '${parentId}' in parents
`;
if (marked) {
q += ` and fullText contains '${LNREADER_DRIVE_MARK}' `;
}
return list({
q,
}).then(res => res.files);
};
export const readDir = async (parentId: string, marked?: boolean) => {
let fileList: DriveFile[] = [];
let pageToken = '';
let q = `
trashed = false and mimeType != 'application/vnd.google-apps.folder'
and '${parentId}' in parents
`;
if (marked) {
q += ` and fullText contains '${LNREADER_DRIVE_MARK}' `;
}
let hasNextPage = true;
while (hasNextPage) {
const query = pageToken ? q + ` and pageToken = '${pageToken}'` : q;
const { nextPageToken, files } = await list({ q: query });
if (!nextPageToken) {
hasNextPage = false;
} else {
pageToken = nextPageToken;
}
fileList = fileList.concat(files);
}
return fileList;
};
export const readFile = async (file: DriveFile, type: 'json' | 'media') => {
if (type === 'json') {
return getJson(file.id);
} else {
return download(file);
}
};
+117
View File
@@ -0,0 +1,117 @@
import { GoogleSignin } from '@react-native-google-signin/google-signin';
import { downloadFile, mkdir, exists } from 'react-native-fs';
import {
DriveCreateRequestData,
DriveFile,
DriveReponse,
DriveRequestParams,
} from './types';
import { AppDownloadFolder } from '@utils/constants/download';
import { PATH_SEPARATOR } from '@api/constants';
const BASE_URL = 'https://www.googleapis.com/drive/v3/files';
const MEDIA_UPLOAD_URL = 'https://www.googleapis.com/upload/drive/v3/files';
const buildParams = (params: DriveRequestParams) => {
return Object.entries(params)
.map(pair => pair.map(encodeURIComponent).join('='))
.join('&');
};
export const list = async (
params: DriveRequestParams,
): Promise<DriveReponse> => {
const { accessToken } = await GoogleSignin.getTokens();
if (!params.fields) {
params.fields =
'nextPageToken, files(id, name, description, createdTime, parents)';
}
const url = BASE_URL + '?' + buildParams(params);
return fetch(url, {
headers: {
Authorization: `Bearer ${accessToken}`,
Accept: 'application/json',
},
}).then(res => res.json());
};
export const create = async (
data: DriveCreateRequestData,
): Promise<DriveFile> => {
const { accessToken } = await GoogleSignin.getTokens();
const params: DriveRequestParams = {
fields: 'id, name, description, createdTime, parents',
uploadType: 'multipart',
};
const url =
(data.content ? MEDIA_UPLOAD_URL : BASE_URL) + '?' + buildParams(params);
let body: any;
data.metadata.name = data.metadata.name.replace(/\//g, PATH_SEPARATOR);
if (data.content) {
body = new FormData();
body.append('metadata', {
string: JSON.stringify(data.metadata),
type: 'application/json',
});
if (data.metadata.mimeType === 'application/json') {
body.append('media', {
string: data.content,
type: data.metadata.mimeType,
});
} else {
body.append('media', {
name: data.metadata.name,
uri: data.content,
type: data.metadata.mimeType,
});
}
} else {
body = JSON.stringify(data.metadata);
}
return fetch(url, {
method: 'POST',
headers: {
Authorization: `Bearer ${accessToken}`,
Accept: 'application/json',
},
body,
}).then(res => res.json());
};
export const getJson = async (id: string) => {
const { accessToken } = await GoogleSignin.getTokens();
const url = BASE_URL + '/' + id + '?alt=media';
return fetch(url, {
headers: {
Authorization: `Bearer ${accessToken}`,
Accept: 'application/json',
},
}).then(res => res.json());
};
export const download = async (file: DriveFile) => {
const { accessToken } = await GoogleSignin.getTokens();
const url = BASE_URL + '/' + file.id + '?alt=media';
const regex = new RegExp(`${PATH_SEPARATOR}`, 'g');
const filePath = AppDownloadFolder + '/' + file.name.replace(regex, '/');
const dirPath = filePath.split('/').slice(0, -1).join('/');
return exists(filePath).then(existed => {
if (!existed) {
return mkdir(dirPath).then(() => {
return downloadFile({
fromUrl: url,
toFile: filePath,
headers: {
Authorization: `Bearer ${accessToken}`,
Accept: 'application/json',
},
});
});
}
});
};
+35
View File
@@ -0,0 +1,35 @@
export interface DriveFile {
kind: string;
mimeType?: string;
parents: string[];
id: string;
name: string;
description?: string;
createdTime?: string;
}
export interface DriveReponse {
nextPageToken?: string;
kind: string;
incompleteSearch: boolean;
files: DriveFile[];
}
export interface DriveRequestParams {
q?: string;
orderBy?: string;
pageSize?: number;
fields?: string;
pageToken?: string;
uploadType?: string; // only for upload
}
export interface DriveCreateRequestData {
metadata: {
name: string;
mimeType: string;
description?: string;
parents?: string[];
};
content?: string; // uri if upload file
}
+90
View File
@@ -0,0 +1,90 @@
import { PATH_SEPARATOR } from '@api/constants';
import { BackupPackage } from '@services/backup/types';
import { AppDownloadFolder } from '@utils/constants/download';
import { fetchTimeout } from '@utils/fetch/fetch';
import { downloadFile, mkdir } from 'react-native-fs';
const commonHeaders = {
'Connection': 'keep-alive',
'Accept':
'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
'Accept-Encoding': 'gzip, deflate, br',
};
export const upload = (host: string, data: BackupPackage) => {
const url = host + '/' + 'upload';
const body = new FormData();
data.name = data.name.replace(/\//g, PATH_SEPARATOR);
body.append('metadata', JSON.stringify(data));
if (data.mimeType === 'application/json') {
body.append('media', {
string: data.content,
type: data.mimeType,
});
} else {
body.append('media', {
name: data.name,
uri: data.content,
type: data.mimeType,
});
}
return fetchTimeout(url, {
method: 'POST',
headers: commonHeaders,
body,
});
};
export const list = (host: string, folderTree: string[]): Promise<string[]> => {
const url = host + '/' + 'list';
const body = new FormData();
body.append('metadata', JSON.stringify({ folderTree }));
return fetchTimeout(url, {
method: 'POST',
headers: commonHeaders,
body,
}).then(res => res.json());
};
export const getJson = (host: string, folderTree: string[], name: string) => {
const url = host + '/' + 'download' + '/' + folderTree.join('/') + '/' + name;
return fetchTimeout(url, {
headers: commonHeaders,
}).then(res => res.json());
};
export const download = async (
host: string,
folderTree: string[],
name: string,
) => {
const url = host + '/' + 'download' + '/' + folderTree.join('/') + '/' + name;
const regex = new RegExp(`${PATH_SEPARATOR}`, 'g');
const filePath = AppDownloadFolder + '/' + name.replace(regex, '/');
const dirPath = filePath.split('/').slice(0, -1).join('/');
await mkdir(dirPath).then(() => {
return downloadFile({
fromUrl: url,
toFile: filePath,
headers: commonHeaders,
}).promise;
});
};
export const exists = (
host: string,
folderTree: string[],
name: string,
): Promise<boolean> => {
const url = host + '/' + 'exists';
const body = new FormData();
body.append('metadata', JSON.stringify({ folderTree, name }));
return fetchTimeout(url, {
method: 'POST',
headers: commonHeaders,
body,
})
.then(res => res.json())
.then(data => data.exists);
};
+4 -9
View File
@@ -1,4 +1,4 @@
import { useTheme } from '@hooks/useTheme';
import { useTheme } from '@hooks/persisted';
import React from 'react';
import {
Dimensions,
@@ -8,11 +8,8 @@ import {
View,
ViewProps,
} from 'react-native';
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
import color from 'color';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { overlay } from 'react-native-paper';
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
type Action = {
icon: string;
@@ -40,9 +37,7 @@ export const Actionbar: React.FC<ActionbarProps> = ({
style={[
styles.actionbarContainer,
{
backgroundColor: theme.isDark
? overlay(2, theme.surface)
: theme.secondaryContainer,
backgroundColor: theme.surface2,
minHeight: 80 + bottom,
paddingBottom: bottom,
},
@@ -54,7 +49,7 @@ export const Actionbar: React.FC<ActionbarProps> = ({
key={id}
android_ripple={{
radius: 50,
color: color(theme.primary).alpha(0.12).string(),
color: theme.rippleColor,
borderless: true,
}}
onPress={onPress}
@@ -0,0 +1,96 @@
import React from 'react';
import { StyleSheet, View, Text, StatusBar } from 'react-native';
import ErrorBoundary from 'react-native-error-boundary';
import { Button, List } from '@components';
import { useTheme } from '@hooks/persisted';
interface ErrorFallbackProps {
error: Error;
resetError: () => void;
}
export const ErrorFallback: React.FC<ErrorFallbackProps> = ({
error,
resetError,
}) => {
const theme = useTheme();
return (
<View style={[styles.mainCtn, { backgroundColor: theme.background }]}>
<StatusBar translucent={true} backgroundColor="transparent" />
<View style={styles.errorInfoCtn}>
<Text style={[styles.errorTitle, { color: theme.onSurface }]}>
An Unexpected Error Ocurred
</Text>
<Text style={[styles.errorDesc, { color: theme.onSurface }]}>
The application ran into an unexpected error. We suggest you
screenshot this message and then share it in our support channel on
Discord.
</Text>
<Text
style={[
styles.errorCtn,
{
backgroundColor: theme.surfaceVariant,
color: theme.onSurfaceVariant,
},
]}
numberOfLines={20}
>
{`${error.message}\n\n${error.stack}`}
</Text>
</View>
<List.Divider theme={theme} />
<Button
onPress={resetError}
title={'Restart the application'}
style={styles.buttonCtn}
mode="contained"
/>
</View>
);
};
interface AppErrorBoundaryProps {
children: React.ReactNode | React.ReactElement;
}
const AppErrorBoundary: React.FC<AppErrorBoundaryProps> = ({ children }) => {
return (
<ErrorBoundary FallbackComponent={ErrorFallback}>{children}</ErrorBoundary>
);
};
export default AppErrorBoundary;
const styles = StyleSheet.create({
mainCtn: {
flex: 1,
},
errorInfoCtn: {
flex: 1,
justifyContent: 'center',
padding: 16,
},
buttonCtn: {
margin: 16,
marginBottom: 32,
},
errorTitle: {
marginBottom: 8,
textAlign: 'center',
fontSize: 20,
},
errorDesc: {
lineHeight: 20,
marginVertical: 8,
},
errorCtn: {
borderRadius: 8,
lineHeight: 20,
marginVertical: 16,
paddingVertical: 16,
paddingHorizontal: 8,
},
});
+6 -5
View File
@@ -2,13 +2,14 @@ import React from 'react';
import { StatusBar } from 'react-native';
import { Appbar as PaperAppbar } from 'react-native-paper';
import { MD3ThemeType } from '../../theme/types';
import { ThemeColors } from '../../theme/types';
interface AppbarProps {
title: string;
handleGoBack: () => void;
theme: MD3ThemeType;
handleGoBack?: () => void;
theme: ThemeColors;
mode?: 'small' | 'medium' | 'large' | 'center-aligned';
children?: React.ReactNode;
}
const Appbar: React.FC<AppbarProps> = ({
@@ -26,12 +27,12 @@ const Appbar: React.FC<AppbarProps> = ({
{handleGoBack && (
<PaperAppbar.BackAction
onPress={handleGoBack}
iconColor={theme.textColorPrimary}
iconColor={theme.onSurface}
/>
)}
<PaperAppbar.Content
title={title}
titleStyle={{ color: theme.textColorPrimary }}
titleStyle={{ color: theme.onSurface }}
/>
{children}
</PaperAppbar.Header>
@@ -0,0 +1,39 @@
import React, { Ref, useCallback } from 'react';
import {
BottomSheetBackdrop,
BottomSheetBackdropProps,
BottomSheetModal,
BottomSheetModalProps,
} from '@gorhom/bottom-sheet';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
interface BottomSheetProps extends Omit<BottomSheetModalProps, 'ref'> {
bottomSheetRef: Ref<BottomSheetModal> | null;
}
const BottomSheet: React.FC<BottomSheetProps> = props => {
const { bottom } = useSafeAreaInsets();
const renderBackdrop = useCallback(
(backdropProps: BottomSheetBackdropProps) => (
<BottomSheetBackdrop
{...backdropProps}
disappearsOnIndex={-1}
appearsOnIndex={0}
/>
),
[],
);
return (
<BottomSheetModal
ref={props.bottomSheetRef}
backdropComponent={renderBackdrop}
handleComponent={null}
containerStyle={{ paddingBottom: bottom }}
{...props}
>
{props.children}
</BottomSheetModal>
);
};
export default BottomSheet;
+12 -94
View File
@@ -1,105 +1,23 @@
import React from 'react';
import {
Pressable,
StyleProp,
StyleSheet,
Text,
TextStyle,
View,
ViewStyle,
} from 'react-native';
import React, { useMemo } from 'react';
import color from 'color';
Button as PaperButton,
ButtonProps as PaperButtonProps,
} from 'react-native-paper';
import { MD3ThemeType } from '../../theme/types';
import { useTheme } from '@hooks/persisted';
export enum ButtonVariation {
DEFAULT = 'default',
OUTLINED = 'outlined',
CLEAR = 'clear',
interface ButtonProps extends Partial<PaperButtonProps> {
title?: string;
}
interface Props {
variation?: ButtonVariation;
title: string;
textColor?: string;
onPress?: () => void;
theme: MD3ThemeType;
style?: ViewStyle;
labelStyle?: StyleProp<TextStyle>;
disabled?: boolean;
}
const Button: React.FC<Props> = ({
variation = ButtonVariation.DEFAULT,
title,
textColor,
onPress,
theme,
style,
disabled,
labelStyle,
}) => {
const textStyles: StyleProp<TextStyle> = useMemo(
() => ({
color: disabled
? theme.textColorHint
: textColor
? textColor
: variation === ButtonVariation.OUTLINED
? theme.primary
: variation === ButtonVariation.CLEAR
? theme.primary
: theme.onSecondary,
}),
[],
);
const Button: React.FC<ButtonProps> = props => {
const theme = useTheme();
return (
<View
style={[
styles.button,
variation === ButtonVariation.OUTLINED
? {
...styles.outlined,
borderColor: theme.textColorHint,
}
: variation !== ButtonVariation.CLEAR && {
backgroundColor: theme.secondary,
},
style,
]}
>
<Pressable
style={styles.pressable}
onPress={onPress}
android_ripple={{ color: color(theme.primary).alpha(0.12).string() }}
disabled={disabled}
>
<Text style={[textStyles, labelStyle]} numberOfLines={1}>
{title}
</Text>
</Pressable>
</View>
<PaperButton {...props} theme={{ colors: theme }}>
{props.title || props.children}
</PaperButton>
);
};
export default Button;
const styles = StyleSheet.create({
button: {
minHeight: 40,
justifyContent: 'center',
borderRadius: 50,
overflow: 'hidden',
},
pressable: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
paddingVertical: 8,
paddingHorizontal: 24,
},
outlined: {
borderWidth: 1,
},
});
+6 -7
View File
@@ -9,16 +9,15 @@ import {
} from 'react-native';
import { Checkbox as PaperCheckbox } from 'react-native-paper';
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
import color from 'color';
import { MD3ThemeType } from '../../theme/types';
import { ThemeColors } from '../../theme/types';
interface CheckboxProps {
label: string;
status: boolean | 'indeterminate';
onPress?: () => void;
disabled?: boolean;
theme: MD3ThemeType;
theme: ThemeColors;
viewStyle?: StyleProp<ViewStyle>;
labelStyle?: StyleProp<TextStyle>;
}
@@ -33,7 +32,7 @@ export const Checkbox: React.FC<CheckboxProps> = ({
labelStyle,
}) => (
<Pressable
android_ripple={{ color: color(theme.primary).alpha(0.12).string() }}
android_ripple={{ color: theme.rippleColor }}
style={[styles.pressable, viewStyle]}
onPress={onPress}
disabled={disabled}
@@ -49,9 +48,9 @@ export const Checkbox: React.FC<CheckboxProps> = ({
onPress={onPress}
color={theme.primary}
theme={{
colors: { disabled: theme.textColorSecondary },
colors: { disabled: theme.onSurfaceVariant },
}}
uncheckedColor={theme.textColorSecondary}
uncheckedColor={theme.onSurfaceVariant}
disabled={disabled}
/>
<Text style={[styles.defaultLabel, { color: theme.onSurface }, labelStyle]}>
@@ -62,7 +61,7 @@ export const Checkbox: React.FC<CheckboxProps> = ({
export const SortItem = ({ label, status, onPress, theme }) => (
<Pressable
android_ripple={{ color: color(theme.primary).alpha(0.12).string() }}
android_ripple={{ color: theme.rippleColor }}
style={[styles.pressable, { paddingVertical: 16, paddingLeft: 64 }]}
onPress={onPress}
>
+3 -4
View File
@@ -1,13 +1,12 @@
import React from 'react';
import { Pressable, StyleSheet, Text, View } from 'react-native';
import color from 'color';
import { MD3ThemeType } from '../../theme/types';
import { ThemeColors } from '../../theme/types';
import { overlay } from 'react-native-paper';
interface ChipProps {
label: string;
theme: MD3ThemeType;
theme: ThemeColors;
}
const Chip: React.FC<ChipProps> = ({ label, theme }) => (
@@ -22,7 +21,7 @@ const Chip: React.FC<ChipProps> = ({ label, theme }) => (
]}
>
<Pressable
android_ripple={{ color: color(theme.primary).alpha(0.12).string() }}
android_ripple={{ color: theme.rippleColor }}
style={styles.pressable}
>
<Text
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
import { FlatList, Pressable, StyleSheet, Text, View } from 'react-native';
import { Modal, overlay, Portal, TextInput } from 'react-native-paper';
import { MD3ThemeType } from '../../theme/types';
import { ThemeColors } from '../../theme/types';
interface ColorPickerModalProps {
visible: boolean;
@@ -10,7 +10,7 @@ interface ColorPickerModalProps {
color: string;
onSubmit: (val: string) => void;
closeModal: () => void;
theme: MD3ThemeType;
theme: ThemeColors;
showAccentColors?: boolean;
}
@@ -80,7 +80,7 @@ const ColorPickerModal: React.FC<ColorPickerModalProps> = ({
{ backgroundColor: overlay(2, theme.surface) },
]}
>
<Text style={[styles.modalTitle, { color: theme.textColorPrimary }]}>
<Text style={[styles.modalTitle, { color: theme.onSurface }]}>
{title}
</Text>
{showAccentColors ? (
@@ -123,7 +123,7 @@ const ColorPickerModal: React.FC<ColorPickerModalProps> = ({
onSubmitEditing={onSubmitEditing}
mode="outlined"
theme={{ colors: { ...theme } }}
underlineColor={theme.textColorHint}
underlineColor={theme.outline}
dense
error={Boolean(error)}
/>

Some files were not shown because too many files have changed in this diff Show More