Commit Graph

4106 Commits

Author SHA1 Message Date
Nik Clayton 892663cab3
refactor: Move ReselectableFragment to core.activity (#743) 2024-06-13 21:16:10 +02:00
Nik Clayton efd1c8e556
refactor: Use the PachliError type for ApiError (#739)
In the previous code `PachliError` could correctly chain errors and
generate error messages, `ApiError` didn't, which is why there was the
temporary `ApiError.fmt()` extension function.

Rewrite `ApiError` to implement `PachliError` so it gets these benefits
and to reduce the number of different error-handling mechanisms in the
code.

Main changes:

- `PachliError` is now an interface so it can be extended by other
  error interfaces.
- All the `ApiError` subclasses implement `PachliError`, and can
  specify the error string and interpolated variables at the point of
  declaration.
- Update `ListsRepository` and `ServerRepository` to return
  `PachliError` subclasses.
2024-06-12 10:22:27 +02:00
Nik Clayton d0432dbd24
refactor: Move string post_username_format to core.designsystem (#736) 2024-06-10 21:06:31 +02:00
Nik Clayton 9f4652c6cf
refactor: Move LinkHelper and AsciiFolding to core.ui (#735) 2024-06-10 20:38:16 +02:00
Nik Clayton 7cf7476c49
refactor: Move throttleFirst to core.common (#733) 2024-06-10 19:57:47 +02:00
Nik Clayton 46c7307c0d
refactor: Move LinkListener to core.ui (#732) 2024-06-10 17:40:23 +02:00
Nik Clayton a68e1bf63b
refactor: Move StatusDisplayOptions and Repository to core.data (#731) 2024-06-10 17:29:09 +02:00
Nik Clayton dc61030b98
refactor: Move AccountPreferenceDataStore to core.data (#730) 2024-06-10 16:54:14 +02:00
Nik Clayton 5dd1b9a2f9
refactor: Move CardViewMode to core.preferences (#729) 2024-06-10 16:28:55 +02:00
Nik Clayton e4a065ca9f
refactor: Move ServerRepository to core.data (#728) 2024-06-10 16:08:48 +02:00
Nik Clayton a2fa9f60fb
change: Use getErrorString for UploadServerError types (#726) 2024-06-05 18:21:20 +02:00
Miles Krell 368f9a8f70 fix(l10n): Update Spanish translations
Currently translated at 100.0% (607 of 607 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/es/
2024-06-02 15:15:10 +02:00
Nik Clayton 7f094b1781
chore: Prepare release 2.5.2 (versionCode 16) (#723) 2024-05-31 12:27:27 +02:00
Miles Krell 5610cd23fa
fix: Prevent crash on "hidden domains" page (#703)
The crash was caused by an uncaught exception when calling
`MastodonApi#domainBlocks`.

Update the `BackgroundMessageView` for the error message so it fills the
screen like on other pages.

Fixes #696
2024-05-30 19:35:39 +02:00
Miles Krell ab08974fc9 fix(l10n): Update Spanish translations
Currently translated at 100.0% (607 of 607 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/es/
2024-05-30 19:26:07 +02:00
Miles Krell fe4813283b fix(l10n): Update Spanish translations
Currently translated at 100.0% (607 of 607 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/es/
2024-05-30 19:26:07 +02:00
Black_Eyes 4944e6fde1 fix(l10n): Update French translations
Currently translated at 100.0% (2 of 2 strings)

Translation: Pachli/App : Fdroid
Translate-URL: https://hosted.weblate.org/projects/pachli/app-fdroid/fr/
2024-05-30 19:26:07 +02:00
Kalle Kniivilä 071af59ad7 fix(l10n): Update Finnish translations
Currently translated at 100.0% (607 of 607 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/fi/
2024-05-30 19:26:07 +02:00
Nik Clayton 4520a29c74
fix: Generate useful error messages for all errors (#719)
Previous code was inconsistent about using getServerErrorMessage() and
whether or not the case where getServerErrorMessage() returns null was
handled.

Switch to using getErrorString() which does handle the null case and
always returns a usable string.

Some string resources are rendered temporarily unused by this change.
They will be used again soon, so configure lint to ignore them at the
moment.
2024-05-30 19:14:43 +02:00
Nik Clayton 84fdf4abb7
fix: Only include transitionKind in intents for Pachli activities (#716)
Previous code always included the transitionKind enum as an extra, and
could cause a crash if the activity launched by the intent was not a
Pachli activity.

Fixes #700.
2024-05-30 14:05:42 +02:00
Nik Clayton 61afde882c
fix: Only suggest upgrading to a version F-Droid has built (#717)
The F-Droid API can return a `suggestedVersionCode` that F-Droid has not
successfully built (e.g., there was a network issue preventing F-Droid
from fetching the source code at the time of the last build).

This meant users were being prompted to update when there was not a
built package to update to.

Fix this by verifying that `suggestedVersionCode` appears in the list of
packages. If it doesn't then fall back to the highest version code in
the list of packages.

Fixes #684
2024-05-30 13:49:42 +02:00
Nik Clayton de7e5a9df9
fix: Re-enable accessiblity actions in all timelines (#715)
22729df1 broke accessiblity actions in non-notification timelines by
returning too early if the status was not a NotificationViewData.
2024-05-29 22:07:08 +02:00
Nik Clayton a12d03b2b7
fix: Prompt user to save/discard changes after editing bio (#678)
Previous code didn't get the viewmodel to check if the content had
changed, so `onBackPressedCallback` wasn't enabled, and the user could
edit the bio and press "back" without being prompted to save their
changes.
2024-05-01 22:42:53 +02:00
Nik Clayton 1c7e4747f0
chore: Update lint, mark item_status_filtered text non-selectable (#677) 2024-04-30 17:18:18 +02:00
Miles Krell ee8f2b69b8
remove: remove janky animation warning (#658)
This warning (added in #274) includes a comment saying that we can
remove it after 2024-03-01, so the time has come :)
2024-04-30 16:25:05 +02:00
Nik Clayton 8ee5463bba change: Add anonymous parameter to `forEach` lambda 2024-04-30 16:23:34 +02:00
Nik Clayton 02da503721 change: Use `tools:text` for design-time text 2024-04-30 16:23:34 +02:00
Nik Clayton e97d9c30fe change: Set the visiblity explicitly 2024-04-30 16:23:34 +02:00
Nik Clayton 5cd0083807 change: Remove unnecessary `Companion` qualifier 2024-04-30 16:23:34 +02:00
Nik Clayton b0fccb0aa7 change: Remove unnecessary null check 2024-04-30 16:23:34 +02:00
Nik Clayton d87a6718cc change: Use "…" instead of "..." in Korean localisation 2024-04-30 16:23:34 +02:00
Nik Clayton 86d79276c6 change: Correct some package references in KDoc 2024-04-30 16:23:34 +02:00
Nik Clayton 1f50a9cbe7 change: Remove unnecessary types 2024-04-30 16:23:34 +02:00
Nik Clayton 4ddd23dda6 change: Correct constructor parameter visibility 2024-04-30 16:23:34 +02:00
Nik Clayton c8532c9fb4 change: Remove dead code 2024-04-30 16:23:34 +02:00
Nik Clayton 6fd993acf6 change: Use supportFragmentManager.commit 2024-04-30 16:23:34 +02:00
Nik Clayton 286a152fde change: Move MediaUploadApi to the correct package 2024-04-30 16:23:34 +02:00
Nik Clayton 2d0cf6c17e change: Mark some properties private 2024-04-30 16:23:34 +02:00
Nik Clayton bf474a5eef
fix(deps): update dependency androidx.core:core-ktx to v1.13.0 (#673)
Use `GestureDetector` as this release deprecates
`GestureDetectorCompat`.
2024-04-30 16:14:11 +02:00
Nik Clayton 2236f53838
fix: Show edit history for status' with polls (#672)
Edited polls only include the list of options with titles; no other
metadata (poll ID, single/multiple choice, vote counts, etc). Since the
data shape didn't match Moshi wasn't decoding the data.

Provide dedicated data classes to model the response, and add a fourth
poll display option to represent viewing an edit history snapshot.
2024-04-30 14:38:36 +02:00
Nik Clayton c7783b65f9
refactor: Use AppCompatResources.getDrawable() (#671)
Replace `ContextCompat.getDrawable()`, as the app-compat version has
platform fixes and backports.

appcompat-lint warns about bare `context.getDrawable()`, but does not
cover `ContextCompat` (https://issuetracker.google.com/issues/337905331)
2024-04-30 13:30:19 +02:00
Nik Clayton c6d6f0f810
chore: Prepare release 2.5.1 (versionCode 15) (#670) 2024-04-29 18:52:34 +02:00
Nik Clayton 22729df1b7
fix: Only enable accessible actions on notifications attached to a status
Fixes #669
2024-04-29 18:43:39 +02:00
Nik Clayton fc5061f777
chore: Prepare release 2.5.0 (versionCode 14) (#668) 2024-04-29 12:44:59 +02:00
Miles Krell 6fed74099a fix(l10n): Update Spanish translations
Currently translated at 100.0% (609 of 609 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/es/
2024-04-29 08:58:44 +02:00
Nik Clayton e65bc13184
fix: Mark tab drag icon as unimportant for accessiblity (#663)
Talkback was speaking it as "Unlabeled". It's not necessary for
Talkback, as the tab name describes it in the list.
2024-04-28 23:53:38 +02:00
Nik Clayton f771dd7026
fix: Enable talkback actions in notifications and conversations (#661)
`ListStatusAccessiblityDelegate` was ignoring notifications because it
was checking the status against the concrete `StatusViewData` and not
the interface `IStatusViewData`.

Fix that and now notifications have accessibility actions.

`ConversationsFragment` didn't set the accessibility delegate, so no
actions appeared. Fix that so they do.
2024-04-28 23:46:11 +02:00
Nik Clayton 362cdfeb27
fix: Prevent crash when Pachli is a share target (#659)
Crash was occuring because the instance info hadn't been fetched, trying
to take the last item of an empty list.

To fix:

- Expose the instance info as a state flow, with a default. New instance
info is fetched whenever the active account changes.

- Do the same for the emojis supported by the server.

- Update call sites as appropriate.

- Mark `InstanceInfoRepository` as `@Singleton` so it isn't repeatedly
created causing fresh content fetches.

The tests needed updating to get this to work.

- Extract the network fake modules in to a network-test module so
multiple other modules can use them.

- Rewrite `InstanceInfoRepositoryTest` to use Hilt and use Turbine to
test the new flows.

Checking this showed cosmetic bugs in the About layout when instance
info is missing, clean those up.
2024-04-28 18:19:13 +02:00
Miles Krell 1f4930ff79 fix(l10n): Update Spanish translations
Currently translated at 100.0% (606 of 606 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/es/
2024-04-27 02:08:54 +02:00
Nik Clayton 78cda01ec8
change: Adjust SwipeRefreshLayout offset in AccountActivity (#652)
The change in 5959d23d resulted in a stuck margin when scrolling up in
the account view.

Fix the `SwipeRefreshLayout` offset in a different way that doesn't have
that problem; move the spinner's start position to the top of the screen
(instead of the negative offset it normally has) and keep the same
relative offset from the end position.

Have it scale in on the drag to complete the effect.
2024-04-27 00:15:21 +02:00