Commit Graph

63 Commits

Author SHA1 Message Date
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
Nik Clayton b0fccb0aa7 change: Remove unnecessary null check 2024-04-30 16:23:34 +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 2a38f8e926 fix(l10n): Update Spanish translations
Currently translated at 100.0% (17 of 17 strings)

Translation: Pachli/Feature/Login
Translate-URL: https://hosted.weblate.org/projects/pachli/featurelogin/es/
2024-04-27 02:08:54 +02:00
Nik Clayton 93e6b38d43
feat: Update activity transitions, prepare for predictive-back (#650)
Previous code used a single animation type (slide) when transitioning,
the transition was quite slow, and didn't behave appropriately if the
device was set to a RTL writing system.

In addition, handling the back affordance didn't work well with the new
"Predictive Back" feature in Android 14

(https://developer.android.com/guide/navigation/custom-back/predictive-back-gesture).

Fix this.

## Transitions

To update the transitions the `startActivityWithSlideInAnimation()`
implementation (and associated `finishWithoutSlideOutAnimation()`) have
been replaced.

There are three transitions; `default`, `slide`, and `explode`,
represented as an enum passed to the activity intent.

The `default` transition is the activity transition from Android 14,
from the Android open source project

(https://cs.android.com/android/platform/superproject/+/android-14.0.0_r18:frameworks/base/core/res/res/anim/;bpv=1).
This is used for most transitions.

The `slide` transition is the pre-existing slide transition, with a
shorter transition time so it feels more responsive, and an RTL
implementation. This is used when there is a strong spatial component to
the navigation, for example, when going from:

- a status to its thread
- a preference menu item to its subscreen
- a filter in a list to the "edit filter" screen
- viewing your profile to editing your profile

The `explode` transition is used when the state of the app changes
significantly, such as when switching accounts.

Activities are now started with `startActivityWithTransition()` which
sets the intent and prepares the transition. `BaseActivity` checks the
intent for the transition type and makes further changes to the
transition as necessary.

## Predictive back

"Predictive back" needs to know what the back button would do before the
user interacts with it with an `onBackPressedCallback` that is either
enabled or disabled. This required refactoring some code (particularly
in `ComposeActivity`) to gather data ahead of time and enable/disable
the callback appropriately.

## Fixed bugs

- Back button wasn't stepping back through the tabs in AccountActivity
- Modifying a filter and pressing back without saving wasn't prompting
the user to save the changes
- Writing a content warning and then hiding it would still count the
text of the content warning toward's the post's length

## Other cleanups

- Use `ViewCompat.setTransitionName()` instead of setting the
`transitionName` property
- Delete the unused `fade_in` and `fade_out` animations.
- Use androidx-activity 1.9.0 to get the latest predictive back support
library code
- Show validation errors when creating / editing filters
2024-04-26 23:18:30 +02:00
Nik Clayton 3e1d94ded2
feat: Use Let's Encrypt certificates on API 23 devices (#640)
Android 7 devices no longer trust certificates issued by Let's Encrypt
(see https://letsencrypt.org/2020/11/06/own-two-feet and
https://letsencrypt.org/2023/07/10/cross-sign-expiration.html for
details).

To work around that provide the Let's Encrypt root certs as resources.

On API 24+ devices add those via network_security_config.xml.

On API 23 devices they need to be installed manually for OkHttp SSL
connections, and checked when there is an SSL error in
LoginWebViewActivity.

The root certificates were downloaded from
https://letsencrypt.org/certificates/:

- https://letsencrypt.org/certs/isrgrootx1.der (self-signed)
- https://letsencrypt.org/certs/isrg-root-x1-cross-signed.der
(cross-signed)
- https://letsencrypt.org/certs/isrg-root-x2.der (self-signed)
- https://letsencrypt.org/certs/isrg-root-x2-cross-signed.der
(cross-signed)

Fixes #638
2024-04-24 10:32:50 +02:00
Miles Krell f6bcded976 fix(l10n): Update Spanish 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/es/
2024-04-23 22:25:56 +02:00
Nik Clayton 7752cf9210
fix: Set correct text direction for localised error messages (#601)
Use `unicodeWrap` when inserting placeholders in error messages so they
set the correct text direction.

Update some strings with formatting directives to (a) include `_fmt`
in the name, and (b) use `%1$s` instead of `%s`.
2024-04-09 14:26:15 +02:00
Nik Clayton c89f91d058
feat: Show any errors when registering the app during login (#594)
Should make it easier for users to figure out what's gone wrong and
either fix it on their end, or provide more detailed bug reports.
2024-04-05 12:27:12 +02:00
Nik Clayton 64fae0ceb6
refactor: Rename `StatusListActivity` to `TimelineActivity` (#577)
More accurately reflects what it does, and simplies the diffs for
upcoming work.
2024-03-30 23:48:04 +01:00
ButterflyOfFire 76984763af fix(l10n): Update Kabyle translations
Currently translated at 9.8% (6 of 61 strings)

Translation: Pachli/Feature/About : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/featureabout-main/kab/
2024-03-18 19:31:42 +01:00
ButterflyOfFire fd6b6d0c07 fix(l10n): Update Kabyle translations
Currently translated at 41.1% (7 of 17 strings)

Translation: Pachli/Feature/Login
Translate-URL: https://hosted.weblate.org/projects/pachli/featurelogin/kab/
2024-03-18 19:31:42 +01:00
Weblate (bot) f64f9f03ae
fix(l10n): Translations update from Hosted Weblate (#541)
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/App :
Main](https://hosted.weblate.org/projects/pachli/app-main/)

* [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/Ui :
Main](https://hosted.weblate.org/projects/pachli/coreui-main/)

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

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

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

* [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/)



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-03-17 00:24:12 +01:00
Nik Clayton 9e0a1f4015
refactor: Simplify use of BackgroundMessageView (#539)
Previous code expected callers to typically provide the drawable and the
error message string resource, resulting in duplicate code at many
callsites.

Replace with three canned messages for empty containers, generic errors,
and network errors respectively. The images for these are fixed, the
caller may choose a different string resource for the error if there is
a more specific option.

Update and simplify the call sites.
2024-03-16 22:12:54 +01:00
Nik Clayton e41722e16f
refactor: Extract user list functionality to `feature:lists` (#537)
Move `ListsActivity`, along with fragments and viewmodels, to a new
`feature:lists` module.

Previous code used the `item_follow_request` layout, which was not
ideal, so update it to use a dedicated layout, `item_account_in_list`.

The UI uses strings and views originally defined in the main app, so
move them elsewhere so they can be re-used.

- `BackgroundMessageView` moves to `core.ui`.

- `Lazy` moves to `core.common`.

- `ThrowableExtensions` split; the extensions specific to throwables
from network activity move to `core.network`, others move to `core.ui`.

- `BindingHolder` moves to `core.ui`

- Shared drawables and strings move to `core.ui`.
2024-03-16 18:42:11 +01:00
Juan M Sevilla a8dc83a63c fix(l10n): Update Spanish translations
Currently translated at 100.0% (61 of 61 strings)

Translation: Pachli/Feature/About : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/featureabout-main/es/
2024-03-04 20:33:08 +01:00
Nik Clayton af58de5a8f
refactor: Enable core library desugaring as build convention logic (#480)
Once desugaring is enabled it needs to be enabled for up/down the
dependency chain, so enable it in the shared configuration defined by
the build convention code.

Highlighted a failing test that wasn't being run, so fix that too.
2024-02-29 09:43:44 +01:00