(cherry picked from commit 0e0b6d92833f8e4f3aebdcc1f7c8c175084175d6)
Fix extra padding appearing in reader after user interactions (mihonapp/mihon#2669)
(cherry picked from commit aa300cb53ea3a02b63c3b3f3fca60d5e7533a8f1)
- Removes `BoxIgnoreLayoutDirection` wrapper and related `CompositionLocalProvider` logic.
- Integrates vertical `ChapterNavigator` directly into the main `Column` layout using `Modifier.weight(1f)`.
- Replaces separate `AnimatedVisibility` blocks for vertical navigation with a single `when` branch inside the main UI structure.
- Refines positioning for `NavBarType.VerticalLeft` and `NavBarType.VerticalRight`.
Co-authored-by: Cuong-Tran <16017808+cuong-tran@users.noreply.github.com>
(cherry picked from commit 3e6afee13b9fd5716f7f2d547b3edcd3e17915db)
This reverts part of commit 3ab83f1270.
Previously, the app made one request for the search, and then fired
off 1 request per search result to obtain additional data, such as
each title's synopsis, etc.
However, MAL's search allows field selection during the initial query,
which will return all the data in that first response, avoiding the
massive bunch of requests (and alleviating some pressure on MAL from
our userbase).
By combining the selected fields into one constant, I was able to also
get rid of the MALUserListSearch entirely because it was redundant.
This allows for a unified MALManga->TrackSearch helper, further
reducing complexity.
I got to my "11x" improvement because on page of search results has 10
elements, and this change turns 11 (1+10 for results) requests into 1.
(cherry picked from commit 9bf2d78a421213b1885456f5b54c3286edc539e1)
Due to a `Float->Double->Float` conversion somewhere inside Mihon, the
tracker sees 2.1 as 2.0999999046325684, which means this filter ignores
the 2.1 chapter (which we just tried to mark as read). This small
epsilon is small enough to never bother any serious usage, but large
enough to ignore any such conversion errors.
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
(cherry picked from commit bd5c4d48f980d2d3dcc1112fe499dba17ef8e507)
A user in mihonapp/mihon#2777 was using the ComicInfo.xml Year/Month/Day fields to
indicate date of publication for some American comics, which often
predate the UNIX Epoch of 1970.
They were seeing "N/A" displays because this line of code discarded
date information for any time before Jan 1st, 1970.
The `toRelativeString` extension function used in the other
`relativeDateText` function already accounts for very distant dates
(anything >7 days away turns into full date, not relative, regardless
of setting, though disabling the relative timestamp setting
circumvents this with the same result). Removing this line should not
cause any issues as it is purely a display difference and the use case
of backdating comics to pre-1970 is worth it in my opinion.
(cherry picked from commit 7a1c8a1b61e07d2e1a402b5daf0e7c04c232f655)
- Navigation history for lower windows is preserved when a popup is opened
- Back gesture will close a popup window rather than the entire WebView activity when there is no previous page
- The leftmost close button closes the entire activity as before
- When a popup window is shown, a new button appears to close just that window
(cherry picked from commit 855eea2ada8c09404dee99a965325913b246618f)
Also auto update extension list whenever a repository is added or removed
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
(cherry picked from commit 87c6f34a558b009be4d316e396ec3eeb4cfbbbf8)
Configure Coil-cache to no longer leak memory, causing the app to slow down and eventually crash
This configures the memory caching in the way presented by the official documentation at
https://coil-kt.github.io/coil/image_loaders/
* chore(library): Optimize library grouping
(cherry picked from commit 2f89d98cf9f0568401b39c09fdffe9fb3ece1fda)
* refactor(library): Avoiding a redundant iteration when grouping by Track Status
* fix(strings): Remove unnecessary period from search/filtering string
* feat(library): Improve category tab selection when searching/filtering library or adding/removing categories
* Improve active category index handling in LibraryScreenModel
* fix(webtoon): improve webtoon scale type handling and listener invocation
* fix(webtoon): streamline webtoon scale type handling and improve listener invocation
* add retry
* qualifier
* remove listener on destroy to avoid memory leaks
* using an object expression for the listener
* ensure listener is removed only if viewTreeObserver is alive
* refactor layout listener to improve retry logic and ensure proper removal
* using doOnLayout
* use doOnLayout for scaling logic to ensure proper execution after view is laid out
* remove filtered_scanlators (old field not used anymore)
* Improve coding
* Revert "remove filtered_scanlators (old field not used anymore)"
This reverts commit 24042c17a432ff4c5012010155476aedbed3825f.
* consistent text style
* add comment
* feat: Add webtoon scale type option
This commit introduces a new setting for webtoon reading mode that allows users to select a scale type for webtoon images.
The available scale types are:
- Fit Screen
- 16:9
- 20:9
- 4:3
- 3:2
This setting can be found in both the reader settings sheet and the global reader settings.
* mutable
* add to Reader's settings page & fix size calculation
* option for long strip gap preference
* fix: ensure recycler scales to default when screen ratio is less than desired
* hide smart scale for long strip gap preference
* Avoid zero division
* using forEach
* improve readability
* better viewer size calculation & optimize list
* feat: Add option to disable pinch to zoom in webtoon viewer
* Change default settings & also include settings for Paged mode
* refactor webtoon
---------
Co-authored-by: Cuong-Tran <cuongtran.tm@gmail.com>
* Add RPC [Barebone, barely works]
Co-Authored-By: Cuong-Tran <16017808+cuong-tran@users.noreply.github.com>
* refactor connections
* RPC (#223)
* Add error handling and refactor DiscordRPCService methods
* Add Discord RPC customization options and preferences
* Update Discord RPC button labels and clean up comments
* Refactor DiscordRPCService to improve readability by adding braces for null checks
* Refactor ConnectionsPreferences to improve code clarity and organization
* Refactor ConnectionsPreferences to improve code clarity and organization
(cherry picked from commit df42d196368d28c3c9dcee3692f3f9140da7f2a1)
* Feat: implement Discord account management enhancements and RPC restart functionality (#245)
* fix: correct indentation in CastManager for better readability
* feat: implement Discord account management enhancements and RPC restart functionality
(cherry picked from commit b7c50f1f0184dd717c5cc4dee0310053bfb8d613)
* Notification color & icon for DiscordRPC
Co-Authored-By: Cuong-Tran <16017808+cuong-tran@users.noreply.github.com>
* Change foss variant application id suffix to '.foss' and more (mihonapp/mihon#1831)
- Remove `BuildConfig.PREVIEW`
- Rename `BuildConfig.INCLUDE_ANALYTICS` -> `BuildConfig.ANALYTICS_INCLUDED`
- Rename `BuildConfig.INCLUDE_UPDATER` -> `BuildConfig.UPDATER_ENABLED`
- Rename build property `with-analytics` -> `include-analytics`
- Rename build property `with-updater` -> `enable-updater`
- Add build property to disable code shrink
- Add build property to include dependency info in apk/app bundle
(cherry picked from commit 0893609ad2c4791dc404d72a5e69a2e0373517ae)
* feat(discord): update App/icon & fully works with all screens
* update Discord Rich Presence application ID and icon URLs
* Fix updateDiscordRPC for all screens (also reuse code)
* integrate Discord Rich Presence for WebViewScreen
* feat: ghibli style images for Discord RPC
* optimize code
* further optimize
* supprest useless warning
* refactor: simplify setScreen calls related to lastUsedScreen
* optimize whole file
* a
Co-Authored-By: Cuong-Tran <16017808+cuong-tran@users.noreply.github.com>
* fix(discord): update download button URL to point to the official website
* feat(discord): allow stop Discord RPC from notification
also improve error handling
* fix(i18n): Torrent server "stop" multi-lang
* Start DiscordRPCService as foreground service on Android O+
This commit modifies the `DiscordRPCService` to start as a foreground service on Android O (API level 26) and above. This change ensures the service continues to run in the background, especially when the app is not in the foreground.
- Added a conditional check using `Build.VERSION.SDK_INT` to detect if the device is running Android O or later.
- If the device is running Android O or later, `startForegroundService` is called instead of `startService` to ensure it runs as foreground service.
- If the device is running a version prior to Android O, `startService` is called.
(cherry picked from commit 869617d8cac3aa8461158f1f9a34b9e29147e8f0)
* fix(discord): episode/chapter formating
* fix(discord): Fix & improve Discord login/accounts
* New webview with DiscordLoginScreen
* Add appbar
* Using Webview directly instead of AndroidView and add clearCookies, browsing navigation
* Using coroutine instead of thread
* Revert service
* use response block
* save preference in coroutine too
* no web navigator
* address comments for DiscordLoginScreen
* Refactor Settings screen & dialog
* Using serialization to parse JSON to avoid blocking API
* Don't clear all cookies and web storage aggressively
* Extract constant
* Fix login
Co-Authored-By: Cuong-Tran <16017808+cuong-tran@users.noreply.github.com>
* fix(discord): Fix screen crash & token retrievement
* Update images to my liking
* spotless
* small fixes
* Update strings.xml
* Revert "Update images to my liking"
This reverts commit 4ad3b9f84fdada45ee480ae7dc242b6e1b4bc18a.
* small fixes
* hopeful fix + chapter progress
* Update ReaderActivity.kt
* Update ReaderActivity.kt
* remove timestamps
* Remove isNSFW check
because 95% of tachi extensions are rated as +18, even when there is sfw content
* Clean up
* Fix ReaderActivity
* Cleanup Settings
* Fix login
* Fix lag when getting categories
* Fix jump to pages
* Remove old SDK check
* Fix status when back from reading
* Remove pages progress
* Only set necessary action in ReaderActivity
* Using IO coroutine instead
* Add back timestamps
* Fix strings & settings
* Fix crash
* ActivityType
* Adjust description
* refactor Discord settings menu
* Using its own scope
* Optimize the connection waiting
* remove source.isNSFW
* Using screenModelScope
* Fix state access
* add modifier
* sharing OkHttpClient instance for better resource management
* Restart RPC directly via service intent instead of toggling
* remove lint suppression
* add back showProgress
* Fix set Discord status
* Fix Discord login no avatar
* Handle API rate limits and errors in getDiscordUri
* Token-based isLogged checking
* Make Discord token sensitive data and not in backup
* Minor fix
* remove debug message
---------
Co-authored-by: Cuong-Tran <16017808+cuong-tran@users.noreply.github.com>
Co-authored-by: Cuong-Tran <cuongtran.tm@gmail.com>
Co-authored-by: Dark25 <nadiecaca2000@gmail.com>
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
Co-authored-by: Jery <jery99961@gmail.com>