Commit Graph

79 Commits

Author SHA1 Message Date
Nik Clayton cdbd0efe11
refactor: Extract operation counter to a class (#977) 2024-10-03 22:21:27 +02:00
Nik Clayton 0d5d118267
refactor: Move AccountManager to core.data.repository (#976) 2024-10-03 21:28:01 +02:00
Nik Clayton 8b498c0a56
chore(deps): Update AGP to 8.7.0, lint to 31.7.0 (#970)
Quiet one lint error.

There's a false positive MissingSuperCall, see
https://issuetracker.google.com/issues/371019875
2024-10-03 14:44:05 +02:00
Nik Clayton c30a2ea137
refactor: Implement AppTheme with PreferenceEnum (#951)
Provde an `appTheme` property in `SharedPreferenceRepository` to manage
read access, simplifying calling code.

Update `PreferenceEnum.from` to check the `value` property of the enum
first.

Fixes #950
2024-09-26 22:54:42 +02:00
Weblate (bot) 5505180868
fix(l10n): Translations update from Hosted Weblate (#933)
Translations update from [Hosted Weblate](https://hosted.weblate.org)
for [Pachli/Fastlane
Metadata](https://hosted.weblate.org/projects/pachli/fastlane-metadata/).


It also includes following components:

* [Pachli/Core/Activity :
Main](https://hosted.weblate.org/projects/pachli/coreactivity-main/)

* [Pachli/App :
Google](https://hosted.weblate.org/projects/pachli/app-google/)

* [Pachli/Feature/Suggestions :
Main](https://hosted.weblate.org/projects/pachli/featuresuggestions-main/)

* [Pachli/Core/Designsystem :
Main](https://hosted.weblate.org/projects/pachli/coredesignsystem-main/)

* [Pachli/Core/Network :
Main](https://hosted.weblate.org/projects/pachli/corenetwork-main/)

*
[Pachli/Feature/Login](https://hosted.weblate.org/projects/pachli/featurelogin/)

* [Pachli/Core/Ui :
Main](https://hosted.weblate.org/projects/pachli/coreui-main/)

* [Pachli/Core/Activity :
Orange](https://hosted.weblate.org/projects/pachli/coreactivity-orange/)

* [Pachli/Feature/About :
Main](https://hosted.weblate.org/projects/pachli/featureabout-main/)

* [Pachli/Core/Data :
Main](https://hosted.weblate.org/projects/pachli/coredata-main/)

* [Pachli/App :
Main](https://hosted.weblate.org/projects/pachli/app-main/)

* [Pachli/App :
Fdroid](https://hosted.weblate.org/projects/pachli/app-fdroid/)

* [Pachli/Feature/Lists :
Main](https://hosted.weblate.org/projects/pachli/featurelists-main/)



Current translation status:

![Weblate translation
status](https://hosted.weblate.org/widget/pachli/fastlane-metadata/horizontal-auto.svg)

---------

Co-authored-by: sunniva <schildkroteskoldpadda@gmail.com>
Co-authored-by: LibreTranslate <noreply-mt-libretranslate@weblate.org>
Co-authored-by: ButterflyOfFire <boffire@users.noreply.hosted.weblate.org>
2024-09-20 15:53:28 +02:00
Nik Clayton 9e1f5b426d fix(l10n): Update Galician translations
Currently translated at 100.0% (17 of 17 strings)

Translation: Pachli/Feature/Login
Translate-URL: https://hosted.weblate.org/projects/pachli/featurelogin/gl/
2024-09-09 10:06:19 +02:00
Nik Clayton fb7cc6f22f fix(l10n): Update Gaelic translations
Currently translated at 100.0% (17 of 17 strings)

Translation: Pachli/Feature/Login
Translate-URL: https://hosted.weblate.org/projects/pachli/featurelogin/gd/
2024-09-09 10:06:19 +02:00
josé m e5b87a0421 fix(l10n): Update Galician translations
Currently translated at 100.0% (62 of 62 strings)

Translation: Pachli/Feature/About : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/featureabout-main/gl/
2024-09-09 10:06:19 +02:00
josé m 95c9ba7f96 fix(l10n): Update Galician translations
Currently translated at 100.0% (17 of 17 strings)

Translation: Pachli/Feature/Login
Translate-URL: https://hosted.weblate.org/projects/pachli/featurelogin/gl/
2024-09-09 10:06:19 +02:00
Aindriú Mac Giolla Eoin bc896d1ee8 fix(l10n): Update Irish translations
Currently translated at 100.0% (17 of 17 strings)

Translation: Pachli/Feature/Login
Translate-URL: https://hosted.weblate.org/projects/pachli/featurelogin/ga/
2024-09-09 10:06:19 +02:00
Weblate (bot) 1473561e6d
fix(l10n): Translations update from Hosted Weblate (#929)
Translations update from [Hosted Weblate](https://hosted.weblate.org)
for [Pachli/Fastlane
Metadata](https://hosted.weblate.org/projects/pachli/fastlane-metadata/).


It also includes following components:

* [Pachli/App :
Fdroid](https://hosted.weblate.org/projects/pachli/app-fdroid/)

* [Pachli/Feature/About :
Main](https://hosted.weblate.org/projects/pachli/featureabout-main/)

* [Pachli/App :
Google](https://hosted.weblate.org/projects/pachli/app-google/)

* [Pachli/Feature/Suggestions :
Main](https://hosted.weblate.org/projects/pachli/featuresuggestions-main/)

* [Pachli/Core/Data :
Main](https://hosted.weblate.org/projects/pachli/coredata-main/)

* [Pachli/Core/Activity :
Orange](https://hosted.weblate.org/projects/pachli/coreactivity-orange/)

* [Pachli/Feature/Lists :
Main](https://hosted.weblate.org/projects/pachli/featurelists-main/)

* [Pachli/Core/Activity :
Main](https://hosted.weblate.org/projects/pachli/coreactivity-main/)

* [Pachli/Core/Ui :
Main](https://hosted.weblate.org/projects/pachli/coreui-main/)

* [Pachli/Core/Designsystem :
Main](https://hosted.weblate.org/projects/pachli/coredesignsystem-main/)

* [Pachli/App :
Main](https://hosted.weblate.org/projects/pachli/app-main/)

* [Pachli/Core/Network :
Main](https://hosted.weblate.org/projects/pachli/corenetwork-main/)

*
[Pachli/Feature/Login](https://hosted.weblate.org/projects/pachli/featurelogin/)



Current translation status:

![Weblate translation
status](https://hosted.weblate.org/widget/pachli/fastlane-metadata/horizontal-auto.svg)
2024-09-04 15:15:46 +02:00
Weblate (bot) b40e2c5f98
fix(l10n): Translations update from Hosted Weblate (#919)
Translations update from [Hosted Weblate](https://hosted.weblate.org)
for [Pachli/Fastlane
Metadata](https://hosted.weblate.org/projects/pachli/fastlane-metadata/).


It also includes following components:

* [Pachli/App :
Google](https://hosted.weblate.org/projects/pachli/app-google/)

* [Pachli/Core/Activity :
Main](https://hosted.weblate.org/projects/pachli/coreactivity-main/)

* [Pachli/Feature/Suggestions :
Main](https://hosted.weblate.org/projects/pachli/featuresuggestions-main/)

* [Pachli/Core/Data :
Main](https://hosted.weblate.org/projects/pachli/coredata-main/)

* [Pachli/App :
Fdroid](https://hosted.weblate.org/projects/pachli/app-fdroid/)

* [Pachli/Core/Activity :
Orange](https://hosted.weblate.org/projects/pachli/coreactivity-orange/)

* [Pachli/Feature/Lists :
Main](https://hosted.weblate.org/projects/pachli/featurelists-main/)

* [Pachli/App :
Main](https://hosted.weblate.org/projects/pachli/app-main/)

* [Pachli/Core/Network :
Main](https://hosted.weblate.org/projects/pachli/corenetwork-main/)

* [Pachli/Feature/About :
Main](https://hosted.weblate.org/projects/pachli/featureabout-main/)

* [Pachli/Core/Ui :
Main](https://hosted.weblate.org/projects/pachli/coreui-main/)

*
[Pachli/Feature/Login](https://hosted.weblate.org/projects/pachli/featurelogin/)

* [Pachli/Core/Designsystem :
Main](https://hosted.weblate.org/projects/pachli/coredesignsystem-main/)



Current translation status:

![Weblate translation
status](https://hosted.weblate.org/widget/pachli/fastlane-metadata/horizontal-auto.svg)

---------

Co-authored-by: LibreTranslate <noreply-mt-libretranslate@weblate.org>
Co-authored-by: Aindriú Mac Giolla Eoin <aindriu80@gmail.com>
Co-authored-by: Yuri <trans.late@onionmail.org>
Co-authored-by: Juan M Sevilla <jumase@disroot.org>
Co-authored-by: josé m <correoxm@disroot.org>
Co-authored-by: Nik Clayton <nik@ngo.org.uk>
2024-09-03 16:35:54 +02:00
Nik Clayton c9cf078939
change: Drop any mention of account creation (#907)
The help text used to mention that an account could be created at the
user's server. This was not done in Pachli, but could confuse reviewers
into thinking it was.

Drop the reference to prevent this confusion.
2024-08-28 17:45:52 +02:00
josé m 3138df3374 fix(l10n): Update Galician translations
Currently translated at 27.4% (17 of 62 strings)

Translation: Pachli/Feature/About : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/featureabout-main/gl/
2024-08-28 14:47:27 +02:00
josé m 9ed7ef9cac fix(l10n): Update Galician translations
Currently translated at 100.0% (18 of 18 strings)

Translation: Pachli/Feature/Suggestions : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/featuresuggestions-main/gl/
2024-08-26 14:28:42 +02:00
josé m 9e42d29ba9 fix(l10n): Update Galician translations
Currently translated at 100.0% (21 of 21 strings)

Translation: Pachli/Feature/Lists : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/featurelists-main/gl/
2024-08-26 14:28:42 +02:00
Juan M Sevilla 8c6a985920 fix(l10n): Update Spanish translations
Currently translated at 100.0% (18 of 18 strings)

Translation: Pachli/Feature/Suggestions : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/featuresuggestions-main/es/
2024-08-11 16:20:31 +02:00
Ricky From Hong Kong e8e2b0d99b fix(l10n): Update Chinese (Traditional) translations
Currently translated at 14.5% (9 of 62 strings)

Translation: Pachli/Feature/About : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/featureabout-main/zh_Hant/
2024-07-28 15:57:29 +02:00
Ricky From Hong Kong c25d80a14f fix(l10n): Update Chinese (Simplified) (zh_MO) translations
Currently translated at 11.2% (7 of 62 strings)

Translation: Pachli/Feature/About : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/featureabout-main/zh_MO/
2024-07-28 15:57:29 +02:00
Ricky From Hong Kong ad7058f4ad fix(l10n): Update Chinese (Traditional, Hong Kong) translations
Currently translated at 14.5% (9 of 62 strings)

Translation: Pachli/Feature/About : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/featureabout-main/zh_Hant_HK/
2024-07-28 15:57:29 +02:00
Ricky From Hong Kong 1f90fc9157 fix(l10n): Update Chinese (Simplified) translations
Currently translated at 24.1% (15 of 62 strings)

Translation: Pachli/Feature/About : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/featureabout-main/zh_Hans/
2024-07-28 15:57:29 +02:00
Ricky From Hong Kong d81fdcd24f fix(l10n): Update English (United Kingdom) translations
Currently translated at 3.2% (2 of 62 strings)

Translation: Pachli/Feature/About : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/featureabout-main/en_GB/
2024-07-28 15:57:29 +02:00
Ricky From Hong Kong b041f9f787 fix(l10n): Update Chinese (Traditional) translations
Currently translated at 94.1% (16 of 17 strings)

Translation: Pachli/Feature/Login
Translate-URL: https://hosted.weblate.org/projects/pachli/featurelogin/zh_Hant/
2024-07-28 15:57:29 +02:00
Ricky From Hong Kong 2858882787 fix(l10n): Update Chinese (Simplified) (zh_MO) translations
Currently translated at 64.7% (11 of 17 strings)

Translation: Pachli/Feature/Login
Translate-URL: https://hosted.weblate.org/projects/pachli/featurelogin/zh_MO/
2024-07-28 15:57:29 +02:00
Ricky From Hong Kong f0dd53e533 fix(l10n): Update Chinese (Traditional, Hong Kong) translations
Currently translated at 64.7% (11 of 17 strings)

Translation: Pachli/Feature/Login
Translate-URL: https://hosted.weblate.org/projects/pachli/featurelogin/zh_Hant_HK/
2024-07-28 15:57:29 +02:00
Ricky From Hong Kong 5e16d10dd0 fix(l10n): Update Chinese (Simplified) translations
Currently translated at 100.0% (17 of 17 strings)

Translation: Pachli/Feature/Login
Translate-URL: https://hosted.weblate.org/projects/pachli/featurelogin/zh_Hans/
2024-07-28 15:57:29 +02:00
Ricky From Hong Kong f1f0999ead fix(l10n): Update English (United Kingdom) translations
Currently translated at 47.0% (8 of 17 strings)

Translation: Pachli/Feature/Login
Translate-URL: https://hosted.weblate.org/projects/pachli/featurelogin/en_GB/
2024-07-28 15:57:29 +02:00
Nik Clayton 63809b5868 fix(l10n): Update Latvian translations
Currently translated at 12.9% (8 of 62 strings)

Translation: Pachli/Feature/About : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/featureabout-main/lv/
2024-07-27 19:17:30 +02:00
Nik Clayton 00a2cd32d3
change: Implement more of FiltersRepository (#816)
The previous code had a number of problems, including:

- Calls to the filters API were scattered through UI and viewmodel code.
- Repeated places where the differences between the v1 and v2 Mastodon
filters API had to be handled.
- UI and viewmodel code using the network filter classes, which tied
them to the API implementation.
- Error handling was inconsistent.

Fix this.

## FiltersRepository

- All filter management now goes through `FiltersRepository`.
- `FiltersRepository` exposes the current set of filters as a
`StateFlow`, and automatically updates it when the current server
changes or any changes to filters are made. This makes
`FilterChangeEvent` obsolete.
- Other operations on filters are exposed through `FiltersRepository` as
functions for viewmodels to call.
- Within the bulk of the app a new `Filter` class is used to represent a
filter; handling the differences between the v1 and v2 APIs is
encapsulated in `FiltersRepository`.
- Represent errors when handling filters as subclasses of `PachliError`,
and use `Result<V, E>` throughout, including using `ApiResult` for all
filter API results.
- Provide different types to distinguish between new-and-unsaved
filters, new-and-unsaved keywords, and in-progress edits to filters.

## Editing filters

- Accept an optional complete filter, or filter ID, as parameters in the
intent that launches `EditFilterActivity`. Pass those to the viewmodel
using assisted injection so the viewmodel has the info immediately.
- In the viewmodel use a new `FilterViewData` type to model the data
used to display and edit the filter.
- Start using the UiSuccess/UiError model. Refrain from cutting over to
full the action implementation as that would be a much larger change.
- Use `FiltersRepository` instead of making any API calls directly.

## Listing filters

- Use `FiltersRepository` instead of making any API calls directly.

## EventHub

- Remove `FilterChangedEvent`. Update everywhere that used it to use the
flow from `FiltersRepository`.
2024-07-14 15:36:52 +02:00
Aindriú Mac Giolla Eoin 4642031ddd fix(l10n): Update Irish translations
Currently translated at 100.0% (18 of 18 strings)

Translation: Pachli/Feature/Suggestions : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/featuresuggestions-main/ga/
2024-07-13 09:43:18 +02:00
Aindriú Mac Giolla Eoin a66e905692 fix(l10n): Update Irish translations
Currently translated at 100.0% (21 of 21 strings)

Translation: Pachli/Feature/Lists : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/featurelists-main/ga/
2024-07-13 09:43:18 +02:00
Aindriú Mac Giolla Eoin e0ce148a88 fix(l10n): Update Irish translations
Currently translated at 100.0% (17 of 17 strings)

Translation: Pachli/Feature/Login
Translate-URL: https://hosted.weblate.org/projects/pachli/featurelogin/ga/
2024-07-13 09:43:18 +02:00
Aindriú Mac Giolla Eoin f9434b04d4 fix(l10n): Update Irish translations
Currently translated at 100.0% (62 of 62 strings)

Translation: Pachli/Feature/About : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/featureabout-main/ga/
2024-07-13 09:43:18 +02:00
sunniva c8e35f89ed fix(l10n): Update Norwegian Bokmål translations
Currently translated at 100.0% (18 of 18 strings)

Translation: Pachli/Feature/Suggestions : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/featuresuggestions-main/nb_NO/
2024-07-08 00:11:01 +02:00
sunniva 2ff67bf799 fix(l10n): Update Norwegian Bokmål translations
Currently translated at 98.3% (61 of 62 strings)

Translation: Pachli/Feature/About : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/featureabout-main/nb_NO/
2024-07-08 00:11:01 +02:00
sunniva df232ebd4c fix(l10n): Update Norwegian Bokmål translations
Currently translated at 82.2% (51 of 62 strings)

Translation: Pachli/Feature/About : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/featureabout-main/nb_NO/
2024-07-06 14:13:42 +02:00
Kalle Kniivilä e2bdf41f09 fix(l10n): Update Finnish translations
Currently translated at 100.0% (18 of 18 strings)

Translation: Pachli/Feature/Suggestions : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/featuresuggestions-main/fi/
2024-07-03 10:36:25 +02:00
Kalle Kniivilä 511107a36f fix(l10n): Update Finnish translations
Currently translated at 100.0% (18 of 18 strings)

Translation: Pachli/Feature/Suggestions : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/featuresuggestions-main/fi/
2024-07-02 09:02:10 +02:00
Juan M Sevilla 7d1c23f434 fix(l10n): Update Spanish translations
Currently translated at 100.0% (18 of 18 strings)

Translation: Pachli/Feature/Suggestions : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/featuresuggestions-main/es/
2024-07-02 09:02:10 +02:00
Kalle Kniivilä 05b20e4b17 fix(l10n): Update Finnish translations
Currently translated at 100.0% (21 of 21 strings)

Translation: Pachli/Feature/Lists : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/featurelists-main/fi/
2024-07-02 09:02:10 +02:00
Juan M Sevilla 2c76a28642 fix(l10n): Update Spanish translations
Currently translated at 100.0% (62 of 62 strings)

Translation: Pachli/Feature/About : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/featureabout-main/es/
2024-07-02 09:02:10 +02:00
Weblate (bot) b88a2739fd
fix(l10n): Translations update from Hosted Weblate (#788)
Translations update from [Hosted Weblate](https://hosted.weblate.org)
for [Pachli/Fastlane
Metadata](https://hosted.weblate.org/projects/pachli/fastlane-metadata/).


It also includes following components:

* [Pachli/Core/Network :
Main](https://hosted.weblate.org/projects/pachli/corenetwork-main/)

* [Pachli/Feature/Suggestions :
Main](https://hosted.weblate.org/projects/pachli/featuresuggestions-main/)

* [Pachli/App :
Main](https://hosted.weblate.org/projects/pachli/app-main/)

* [Pachli/Core/Data :
Main](https://hosted.weblate.org/projects/pachli/coredata-main/)

* [Pachli/App :
Google](https://hosted.weblate.org/projects/pachli/app-google/)

*
[Pachli/Feature/Login](https://hosted.weblate.org/projects/pachli/featurelogin/)

* [Pachli/Core/Activity :
Orange](https://hosted.weblate.org/projects/pachli/coreactivity-orange/)

* [Pachli/Core/Activity :
Main](https://hosted.weblate.org/projects/pachli/coreactivity-main/)

* [Pachli/App :
Fdroid](https://hosted.weblate.org/projects/pachli/app-fdroid/)

* [Pachli/Feature/About :
Main](https://hosted.weblate.org/projects/pachli/featureabout-main/)

* [Pachli/Feature/Lists :
Main](https://hosted.weblate.org/projects/pachli/featurelists-main/)

* [Pachli/Core/Designsystem :
Main](https://hosted.weblate.org/projects/pachli/coredesignsystem-main/)

* [Pachli/Core/Ui :
Main](https://hosted.weblate.org/projects/pachli/coreui-main/)



Current translation status:

![Weblate translation
status](https://hosted.weblate.org/widget/pachli/fastlane-metadata/horizontal-auto.svg)

---------

Co-authored-by: Languages add-on <noreply-addon-languages@weblate.org>
2024-06-27 10:51:02 +02:00
Nik Clayton 6f1aaaa884
change: Refer to Pachli as a Nivenly project in AboutFragment (#785) 2024-06-26 23:40:10 +02:00
Nik Clayton cf1f776ef3
change: Trigger Weblate component creation with empty string resource (#782) 2024-06-26 17:48:41 +02:00
Nik Clayton 1468936970
chore(deps): update agp to v8.5.0, lint to 31.5.0 (#756)
New lint checks mean:

- Some trivial uses of String.format() are replaced with templates
- Use a string resource for the scheduled date and time

Some reported SetTextI18n warnings have been ignored, as they relate to
e.g., clearing a view's text by setting it to "".
2024-06-18 13:58:37 +02:00
Nik Clayton 3d5c2dd32f
feat: Show "Suggested accounts" (#734)
Implement suggestions as a new `feature:suggestions` module, with
associated activity, fragment, etc.

Suggested accounts are shown with their normal information, as well as
information about the number of follows / followers, and a guide to
posting frequency, so the user can make a more informed decision about
whether to follow or not.
2024-06-17 21:43:12 +02:00
Nik Clayton d8d15ab5b0
change: Simplify mapBoth operations to mapEither and map (#746) 2024-06-13 22:55:16 +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 7bf8c382e1
fix: Show/hide the list of lists appropriately when showing errors (#740)
Previous code didn't hide the list-of-lists if an error occurred after
the list was displayed (e.g., load the list, turn on airplane mode,
reload the list).

Hide the list when errors are shown, and show it when there is content.
2024-06-11 22:18:51 +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