Commit Graph

3999 Commits

Author SHA1 Message Date
Kalle Kniivilä 7c5181d5c2 fix(l10n): Update Finnish translations
Currently translated at 100.0% (619 of 619 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/fi/
2024-02-05 14:18:34 +01:00
Kalle Kniivilä ab01bbfed8 fix(l10n): Update Finnish translations
Currently translated at 100.0% (2 of 2 strings)

Translation: Pachli/App : Fdroid
Translate-URL: https://hosted.weblate.org/projects/pachli/app-fdroid/fi/
2024-02-05 14:18:34 +01:00
Nik Clayton 54d7888316
feat: Include extra logs in error reports from orange release builds (#414)
Release builds normally strip out all logging to reduce the number of
disk writes and reduce UI jank.

These logs would still be useful in user error reports from orange
builds. To preseve them:

- Implement a simple `RingBuffer`.

- Create `TreeRing`, a `Timber` `Tree` logger that logs to a
`RingBuffer` instance in orange release builds.

- Create `TreeRingCollector`, called when ACRA reports are generated,
which includes the contents of the ring buffer in the report.

- Enable desugaring to allow the use of java.time libraries on older
Android versions.

- Disable ProGuard obfuscation of class names as the obfuscation adds
additional de-obfuscation steps when handling error reports from users.
2024-02-04 15:17:46 +01:00
Reza Almanda dcf781aa21 fix(l10n): Update Indonesian translations
Currently translated at 45.8% (284 of 619 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/id/
2024-02-03 15:26:43 +01:00
ButterflyOfFire 7cb48a6673 fix(l10n): Update French translations
Currently translated at 97.4% (603 of 619 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/fr/
2024-02-03 15:26:43 +01:00
ButterflyOfFire 409db3019f fix(l10n): Update French translations
Currently translated at 92.7% (574 of 619 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/fr/
2024-02-03 15:26:43 +01:00
bittin1ddc447d824349b2 e5bbb71661 fix(l10n): Update Swedish translations
Currently translated at 100.0% (2 of 2 strings)

Translation: Pachli/App : Google
Translate-URL: https://hosted.weblate.org/projects/pachli/app-google/sv/
2024-02-03 15:26:43 +01:00
bittin1ddc447d824349b2 53ce9d90e6 fix(l10n): Update Swedish translations
Currently translated at 100.0% (2 of 2 strings)

Translation: Pachli/App : Fdroid
Translate-URL: https://hosted.weblate.org/projects/pachli/app-fdroid/sv/
2024-02-03 15:26:43 +01:00
Nik Clayton 1488c13c42
feat: Allow the user to send an error report without a crash (#406)
Getting error reports with logs of strange behaviour is useful even if
the app doesn't crash.

Move crash reporting in to `core.activity`, and provide a menu option
(in orange builds) to trigger a non-fatal crash report that is handled
the same way (i.e., sent by e-mail) as a regular crash report.

`BaseActivity` has to be able to create and handle menus, so adjust
subclasses to call the superclass when necessary.

Update `tools/mvstring` to be able to move strings between different
flavour directories, not just `main`.
2024-02-02 15:34:31 +01:00
Nik Clayton 86d800b1c8
refactor: Modularise "about" activities (#405)
Continue modularisation by moving activities in the "About" feature to a
new `feature.about` module.

Implement `feature.about:
- Move `AboutActivity`, `LicenseActivity`, and `PrivacyPolicyActivity`
here.
- Update `markdown2resource` plugin to work with libraries

Implement `core.data`:
- Types and repositories used through the app
- Move `InstanceInfo` and `InstanceInfoRepository` here so they are
available to `feature.about`.

Implement `core.ui`:
- App-specific views, spans, and other UI content
- Move `ClickableSpanTextView` and `NoUnderlineURLSpan` here so they are
available to `feature.about`.
2024-02-02 15:14:31 +01:00
Nik Clayton 7116c8e0c3
test: Mock searchSync to prevent crash in ComposeActivityTest (#404)
Without the mock the code-under-test was getting a null value where none
should have been possible, and crashing.
2024-02-01 15:50:40 +01:00
ButterflyOfFire ce21b3b9f8 fix(l10n): Update Arabic translations
Currently translated at 94.8% (604 of 637 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/ar/
2024-01-31 20:19:19 +01:00
Weblate (bot) 1925860731
fix(l10n): Translations update from Hosted Weblate (#397)
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](https://hosted.weblate.org/projects/pachli/ui-strings/)

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

* [Pachli/F-Droid](https://hosted.weblate.org/projects/pachli/f-droid/)

* [Pachli/Core -
Network](https://hosted.weblate.org/projects/pachli/core-network/)

* [Pachli/Core - Design
System](https://hosted.weblate.org/projects/pachli/core-design-system/)

* [Pachli/Core -
Activity](https://hosted.weblate.org/projects/pachli/core-activity/)

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

* [Pachli/GitHub](https://hosted.weblate.org/projects/pachli/github/)



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-01-30 16:39:45 +01:00
Nik Clayton 358af13dfb
chore: Remove obsolete LicenseCard code (#399)
Unnecessary since the use of `aboutlibraries`
2024-01-30 16:39:19 +01:00
Nik Clayton f0fc0fd530
refactor: Modularise core activity classes, (#393)
Continue modularisation by moving core activity classes that almost all
activities depende on to a `core.activity` module. This includes
core "helper" classes as well.

Implement core.activity:
- Contains BaseActivity, BottomSheetActivity
- Contains LinkHelper and other utility classes used by activities

Implement core.common.extensions:
- Move ViewBindingExtensions and ViewExtensions here

Implement core.common.util:
- Move BlurHashDecoder and VersionName here

Implement core.designsystem:
- Holds common resources (animations, colours, drawables, etc) used
  through the app
- Import "core.designsystem.R as DR" through the app to distinguish
  from the module's own resources

Implement feature.login:
- Move the LoginActivity and related code/resources to its own module

Implement tools/mvstring
- Moves string resources (and all translations) from one module to
  another
2024-01-30 11:37:00 +01:00
Nik Clayton 741bf56f38
chore: Prepare release 2.2.0 (versionCode 11) (#392) 2024-01-29 10:09:57 +01:00
Nik Clayton b454fdceb9
fix: Allow users to retry errors when fetching server info (#391)
Previous code would show errors when fetching server info but with no
mechanism to retry the operation, so it would "stick" until the user
restarted the app.

Fix this with a retry action.

While I'm here use styles to ensure that all snackbars are 5 lines max
length and remove code that sets the length.
2024-01-28 20:13:39 +01:00
Nik Clayton 355244a8e2
refactor: Destructure maps for more idiomatic code (#388) 2024-01-26 12:32:45 +01:00
Nik Clayton fc81e8bad7
fix: Ensure actions happen against the correct status (#373)
Previously when the user interacted with a status the operation (reblog,
favourite, etc) travels through multiple layers of code, carrying with
it the position of the item in the list that the user operated on.

At some point the status is retrieved from the list using its position
so that the correct status ID can be used in the network operation.

If this happens while the list is also refreshing there's a possible
race condition, and the original status' position may have changed in
the list. Looking up the status by position to determine which status to
perform the action on may cause the action to happen on the wrong
status.

Fix this by passing the status' viewdata to any actions instead of its
position. This includes all the information necessary to make the API
call, so there is no chance of a race.

This is quite an involved change because there are three types of
viewdata:

- `StatusViewData`, used for regular timelines
- `NotificationViewData`, used for notifications, may wrap a status that
can be operated on
- `ConversationViewData`, used for conversations, does wrap a status

The previous code treated them all differently, which is probably why it
operated by position instead of type.

The high level fix is to:

1. Create an interface, `IStatusViewData`, that contains the data
exposed by any viewdata that contains a status.

2. Implement the interface in `StatusViewData`, `NotificationViewData`,
and `ConversationViewData`.

3. Change the code that operates on viewdata (`SFragment`,
`StatusActionListener`, etc) to be generic over anything that implements
`IStatusViewData`.

4. Change the code that handles actions to pass the viewdata instead of
the position.

Fixes #370
2024-01-26 12:15:27 +01:00
Nik Clayton c48b8bf545
fix: Don't leak MainActivity in DrawerImageLoader (#382)
Previous code created the drawer image loader as an anonymous inner
class that kept a reference to `glide`, which had a reference to `this`
and could leak.

Fix that by create a separate class that takes these as constructor
parameters.
2024-01-25 17:45:20 +01:00
bittin1ddc447d824349b2 928955e886 fix(l10n): Update Swedish translations
Currently translated at 100.0% (658 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/sv/
2024-01-25 11:28:08 +01:00
bittin1ddc447d824349b2 8dc56be8b6 fix(l10n): Update Swedish translations
Currently translated at 100.0% (658 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/sv/
2024-01-25 11:28:08 +01:00
Reza Almanda 1fc306d890 fix(l10n): Update Indonesian translations
Currently translated at 44.2% (291 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/id/
2024-01-25 11:28:08 +01:00
Anonymous 092a91312a fix(l10n): Update Chinese (Simplified) (zh_MO) translations
Currently translated at 51.5% (339 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/zh_MO/
2024-01-25 11:28:08 +01:00
Anonymous 1e638af89e fix(l10n): Update Chinese (Simplified) translations
Currently translated at 92.0% (606 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/zh_Hans/
2024-01-25 11:28:08 +01:00
Anonymous 28b34aee64 fix(l10n): Update Vietnamese translations
Currently translated at 92.0% (606 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/vi/
2024-01-25 11:28:08 +01:00
Anonymous ec8666edc5 fix(l10n): Update Ukrainian translations
Currently translated at 91.6% (603 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/uk/
2024-01-25 11:28:08 +01:00
Anonymous 0857f3d61d fix(l10n): Update Turkish translations
Currently translated at 91.7% (604 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/tr/
2024-01-25 11:28:08 +01:00
Anonymous 7fb2cd9af1 fix(l10n): Update Thai translations
Currently translated at 66.4% (437 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/th/
2024-01-25 11:28:08 +01:00
Anonymous 6ef6ac15df fix(l10n): Update Slovenian translations
Currently translated at 58.0% (382 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/sl/
2024-01-25 11:28:08 +01:00
Anonymous 92c94ae2b9 fix(l10n): Update Sinhala translations
Currently translated at 36.4% (240 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/si/
2024-01-25 11:28:08 +01:00
Anonymous 9a17096f8d fix(l10n): Update Sanskrit translations
Currently translated at 78.1% (514 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/sa/
2024-01-25 11:28:08 +01:00
Anonymous 11a8429327 fix(l10n): Update Portuguese (Portugal) translations
Currently translated at 78.5% (517 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/pt_PT/
2024-01-25 11:28:08 +01:00
Anonymous b36eba9092 fix(l10n): Update Occitan translations
Currently translated at 91.1% (600 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/oc/
2024-01-25 11:28:08 +01:00
Anonymous b3427f823e fix(l10n): Update Norwegian Bokmål translations
Currently translated at 90.5% (596 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/nb_NO/
2024-01-25 11:28:08 +01:00
Anonymous 73c80825f1 fix(l10n): Update Latvian translations
Currently translated at 83.2% (548 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/lv/
2024-01-25 11:28:08 +01:00
Anonymous 3829e8bd31 fix(l10n): Update Korean translations
Currently translated at 57.2% (377 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/ko/
2024-01-25 11:28:08 +01:00
Anonymous 9a68df58f6 fix(l10n): Update Kabyle translations
Currently translated at 37.3% (246 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/kab/
2024-01-25 11:28:08 +01:00
Anonymous 978f1fccee fix(l10n): Update Icelandic translations
Currently translated at 90.5% (596 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/is/
2024-01-25 11:28:08 +01:00
Anonymous 612043d3fe fix(l10n): Update Hungarian translations
Currently translated at 90.5% (596 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/hu/
2024-01-25 11:28:08 +01:00
Anonymous 4d8e8fa020 fix(l10n): Update Hindi translations
Currently translated at 55.9% (368 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/hi/
2024-01-25 11:28:08 +01:00
Anonymous 9e1b6f9d02 fix(l10n): Update Galician translations
Currently translated at 91.9% (605 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/gl/
2024-01-25 11:28:08 +01:00
Anonymous c1c99db75b fix(l10n): Update Gaelic translations
Currently translated at 91.6% (603 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/gd/
2024-01-25 11:28:08 +01:00
Anonymous 79648170d1 fix(l10n): Update Irish translations
Currently translated at 64.5% (425 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/ga/
2024-01-25 11:28:08 +01:00
Anonymous 53c1485dbf fix(l10n): Update French translations
Currently translated at 89.3% (588 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/fr/
2024-01-25 11:28:08 +01:00
Anonymous ab7003efc4 fix(l10n): Update Persian translations
Currently translated at 92.0% (606 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/fa/
2024-01-25 11:28:08 +01:00
Anonymous 9ddb965d6b fix(l10n): Update Basque translations
Currently translated at 71.5% (471 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/eu/
2024-01-25 11:28:08 +01:00
Anonymous 4b4a736db0 fix(l10n): Update Esperanto translations
Currently translated at 74.0% (487 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/eo/
2024-01-25 11:28:08 +01:00
Anonymous 181b8198be fix(l10n): Update German translations
Currently translated at 97.7% (643 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/de/
2024-01-25 11:28:08 +01:00
Anonymous 2fd6f96706 fix(l10n): Update Welsh translations
Currently translated at 92.0% (606 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/cy/
2024-01-25 11:28:08 +01:00
Anonymous b36cf1dbc0 fix(l10n): Update Czech translations
Currently translated at 74.9% (493 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/cs/
2024-01-25 11:28:08 +01:00
Anonymous 2979959e87 fix(l10n): Update Kurdish (Central) translations
Currently translated at 63.3% (417 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/ckb/
2024-01-25 11:28:08 +01:00
Anonymous d0e77b4a5c fix(l10n): Update Catalan translations
Currently translated at 84.8% (558 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/ca/
2024-01-25 11:28:08 +01:00
Anonymous cc5a535730 fix(l10n): Update Bengali (India) translations
Currently translated at 62.4% (411 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/bn_IN/
2024-01-25 11:28:08 +01:00
Anonymous 8919650cc7 fix(l10n): Update Bengali (Bangladesh) translations
Currently translated at 66.7% (439 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/bn_BD/
2024-01-25 11:28:08 +01:00
Anonymous 50f4df1693 fix(l10n): Update Belarusian translations
Currently translated at 88.1% (580 of 658 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/be/
2024-01-25 11:28:08 +01:00
Reza Almanda d501d7d35d fix(l10n): Update Indonesian translations
Currently translated at 42.6% (277 of 650 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/id/
2024-01-25 11:28:08 +01:00
Reza Almanda 1e13a040b4 fix(l10n): Update Indonesian translations
Currently translated at 40.3% (262 of 650 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/id/
2024-01-25 11:28:08 +01:00
Nik Clayton dcc2954148
fix: Show correct trending tag values at the end of the chart lines (#380)
The previous code incorrectly showed the trending tag usage data twice
next to the end of the trending tag lines, instead of one entry for the
usage data and one entry for the account data.

Fix that.

As part of this fix change how the data is displayed. Instead of using
two distinct `TextView`, fixed to the bottom end of the chart, draw the
text directly on the chart. The text is accurately position so that it
is next to the end of the relevant line. If both lines overlap the label
positions are adjusted appropriately.

The chart now uses Pachli blue and orange for the line colours.

While doing this I discovered that the mechanism used to fall back to
particular chart colours if none were specified was incorrect, so fix
that too.
2024-01-25 00:50:50 +01:00
Nik Clayton bdb3a61523
feat: Disable tag mute feature if server can't filter (#378)
If the server doesn't support filtering then it's impossible to mute a
hashtag (which works by creating a filter). In this case hide the UI.
2024-01-23 23:29:10 +01:00
Nik Clayton 88066302ab
build: Disable lint warnings about old versions of AGP (#379)
They're caught via GH Actions, and block builds unnecessarily.
2024-01-23 23:18:27 +01:00
Nik Clayton 5cfe6d055b
fix: Improve parsing of Friendica (and other server) version formats (#376)
Previous code could return an error on Friendica version strings like
`2024.03-dev-1547`.

Fix this:

- Extend the list of explicitly supported servers to include Fedibird,
Friendica, Glitch, Hometown, Iceshrimp, Pixelfed, and Sharkey.

- Add version parsing routines for these servers.

- Test the version parsing routines fetching every server and version
seen by Fediverse Observer (~ 2,000 servers) and ensuring that the
server and version information can be parsed.

Improve the error message:

- Show the hostname with a `ServerRepository` error

Clean up the code:

- Remove the custom `resultOf` and `mapResult` functions, they have
equivalents in newer versions of the library (like `runSuspendCatching`)

Fixes #372
2024-01-23 20:27:25 +01:00
Nik Clayton 7e3cde4c65
refactor: Remove unused logging tags (#374) 2024-01-23 16:59:56 +01:00
Nik Clayton a588c702fb
fix: Prevent crash by keeping network.model.** classes (#369)
Previous rule didn't consider a deeper package hierarchy, so the new
NodeInfo classes were being removed by ProGuard.
2024-01-19 09:39:44 +01:00
Martijn de Boer 875bb9c2a5 fix(l10n): Update Dutch translations
Currently translated at 100.0% (650 of 650 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/nl/
2024-01-18 22:02:47 +01:00
Jener Gomes ee0fdf86b3 fix(l10n): Update Portuguese (Brazil) translations
Currently translated at 100.0% (650 of 650 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/pt_BR/
2024-01-18 22:02:47 +01:00
Kalle Kniivilä 1bbe32d6c0 fix(l10n): Update Finnish translations
Currently translated at 100.0% (650 of 650 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/fi/
2024-01-18 22:02:47 +01:00
Kalle Kniivilä 37a6826df7 fix(l10n): Update Finnish translations
Currently translated at 86.6% (563 of 650 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/fi/
2024-01-18 22:02:47 +01:00
Martijn de Boer c50bbf86ca fix(l10n): Update Dutch translations
Currently translated at 99.6% (648 of 650 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/nl/
2024-01-18 22:02:47 +01:00
ButterflyOfFire 970a7574a7 fix(l10n): Update Arabic translations
Currently translated at 94.6% (615 of 650 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/ar/
2024-01-18 22:02:47 +01:00
Nik Clayton 42219875e9
fix: Disable filter functionality if unsupported by the server (#366)
The previous code unilaterally enabled filter functionality. Some
Mastodon-like servers -- like GoToSocial -- do not support filters, and
this resulted in user visible error messages when connecting to those
servers.

To fix this:

- Extend the set of supported server capabilities to include client and
server side filtering.

- Disable the filter preferences if the server does not support filters
and show a message explaining why it's disabled.

Extend the capabilities model to support this:

- Fetch server software name and version from the nodeinfo endpoints
(implementing the nodeinfo API and schema)

- Extend the use of kotlin-result to provide hierarchies of Error
classes and demonstrate how to chain errors and display more informative
messages without using exceptions.

Fixes #343
2024-01-18 21:44:30 +01:00
Nik Clayton aaf8cf57f3
refactor: Provide TestScope as ApplicationScope in tests (#364)
Previously some tests had to manually create dependencies (instead of
injecting them) because the dependency required the `TestScope`
`CoroutineScope` as one of its dependencies.

Resolve this with a `FakeCoroutineScopeModule` that provides `TestScope`
as `@ApplicationScope`. The tests can now inject their dependencies,
which will use `TestScope`.

To inject `AccountPreferenceDataStore` it has been updated to use the
current active account when reading or writing preferences.
2024-01-17 16:41:41 +01:00
Nik Clayton 993b74691a
chore(deps): update plugin ktlint to v12.1.0 (#358) 2024-01-09 17:50:20 +01:00
Nik Clayton d8be70a465
chore(deps): update plugin ktlint to v12 (#357) 2024-01-08 23:26:46 +01:00
Nik Clayton 51c2ef0607
chore: Prepare release 2.1.1 (versionCode 10) (#331) 2023-12-17 07:15:46 +01:00
Nik Clayton 88466373b3
chore: Prepare release 2.1.0 (versionCode 9) (#327) 2023-12-15 15:50:20 +01:00
bittin1ddc447d824349b2 49a31dd80b fix(l10n): Update Swedish translations
Currently translated at 100.0% (650 of 650 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/sv/
2023-12-15 11:38:09 +01:00
Kalle Kniivilä 4db3b35023 fix(l10n): Update Finnish translations
Currently translated at 72.3% (470 of 650 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/fi/
2023-12-15 11:38:09 +01:00
Nik Clayton b294a3bace
fix: Correctly show if an account is a bot or not (#322)
e35fa1db inadvertently contained some left over debug code that treats
non-bot accounts as bots (for displaying the bot badge) and vice versa.

Fixes #321
2023-12-14 11:27:49 +01:00
Nik Clayton 29f9273c01
fix: Show translated content when viewing a thread (#320)
If a status was part of a thread, and it was not the "detailed" status,
and it had been translated, then the view data was marked as "show the
translation". But the translation was not loaded, so the status content
appeared as empty.

Fix that by loading the translated content of all statuses in the thead
and ensure that the translated content is rendered.

Throw an `IllegalStateException` in debug builds to catch any future
occurrences of this.

Fixes #281
2023-12-13 17:18:07 +01:00
Nik Clayton bf36837b04
feat: Allow the user to report crashes in orange builds (#317)
Add a dependency on ACRA (in orange builds only), and catch crashes.

The user is given the option to e-mail the crash report data to the
support address, and can view and edit/redact the data before doing so.
2023-12-12 23:25:09 +01:00
Nik Clayton 098983f401
fix: Calculate length of posts and polls with emojis correctly (#315)
Mastodon counts post lengths by considering emojis to be single
characters, no matter how many unicode code points they are composed of.
So "😜" has length 1.

Pachli was using `String.length`, which considers "😜" as length 2.

Correct the calculation by using a BreakIterator to count the characters
in the string, which treats multi-character emojis as a length 1.

Poll options had a similar problem, exacerbated by the Mastodon web UI
also having the same problem, see
https://github.com/mastodon/mastodon/issues/28336.

Fix that by creating `MastodonLengthFilter`, an `InputFilter` that does
the right thing for regular text that may contain emojis.

See also https://github.com/tuskyapp/Tusky/pull/4152, which has the fix
for status length but not polls.

---------

Co-authored-by: Konrad Pozniak <opensource@connyduck.at>
2023-12-12 16:53:09 +01:00
Kalle Kniivilä 07e1d4c760 fix(l10n): Update Finnish translations
Currently translated at 60.2% (390 of 647 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/fi/
2023-12-12 14:09:35 +01:00
Nik Clayton cbecfa3117
feat: Show roles on profiles (#312)
Roles for the logged in user appeared in Mastodon 4.0.0 and can be
displayed on the user's profile screen.

Show them as chips, adjusting the display of the existing "Follows you"
and "Bot" indicators to make allowances for this.

Roles can have a custom colour assigned by the server admin. This is
blended with the app colour so it is not too jarring in the display.

See also https://github.com/tuskyapp/Tusky/pull/4029

Co-authored-by: Konrad Pozniak <opensource@connyduck.at>
2023-12-11 20:57:11 +01:00
Nik Clayton 60cfa99f17
refactor: Use AppTheme enum exclusively (#311)
Previous code treated the app theme as a mix of strings and enums.
Convert to exclusively use the `AppTheme` enum to improve type safety.
2023-12-11 14:41:36 +01:00
Nik Clayton 2a7eda667b fix: Prevent crash if a preview card does not have an author 2023-12-09 22:49:21 +01:00
Nik Clayton 4f65321a9d fix: Prevent crash if an error is shown in a timeline without a FAB 2023-12-09 22:49:21 +01:00
Nik Clayton df45c0cd96 fix: Prevent crash showing profile if account has null `createdAt` field 2023-12-09 22:49:21 +01:00
Nik Clayton d4eed2fbf8
fix: Prevent memory leak in CompositeWithOpaqueBackground (#309)
Quoting @connyduck in https://github.com/tuskyapp/Tusky/pull/4150:

"""
The transformation ends up in Glide's memory cache and leaks whole
Activities through the view -> context reference.

This fixes the problem by removing the background detection logic (so
the view reference is no longer needed) and setting the background
directly instead. Looks exactly as before.
"""

Co-authored-by: Konrad Pozniak <opensource@connyduck.at>
2023-12-09 18:36:49 +01:00
Nik Clayton 6ee41177cd
build: Install LeakCanary in debug builds (#308) 2023-12-09 18:06:01 +01:00
Kalle Kniivilä 0251801d7e fix(l10n): Update Finnish translations
Currently translated at 60.1% (389 of 647 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/fi/
2023-12-09 17:49:16 +01:00
Nik Clayton 1214cf7c8a
refactor: Break navigation dependency cycles with :core:navigation (#305)
The previous code generally started an activity by having the activity
provide a method in a companion object that returns the relevant intent,
possibly taking additional parameters that will be included in the
intent as extras.

E.g., if A wants to start B, B provides the method that returns the
intent that starts B.

This introduces a dependency between A and B.

This is worse if B also wants to start A.

For example, if A is `StatusListActivity` and B is`ViewThreadActivity`.
The user might click a status in `StatusListActivity` to view the
thread, starting `ViewThreadActivity`. But from the thread they might
click a hashtag to view the list of statuses with that hashtag. Now
`StatusListActivity` and `ViewThreadActivity` have a circular
dependency.

Even if that doesn't happen the dependency means that any changes to B
will trigger a rebuild of A, even if the changes to B are not relevant.

Break this dependency by adding a `:core:navigation` module with an
`app.pachli.core.navigation` package that contains `Intent` subclasses
that should be used instead. The `quadrant` plugin is used to generate
constants that can be used to launch activities by name instead of by
class, breaking the dependency chain.

The plugin uses the `Activity` names from the manifest, so when an
activity is moved in the future the constant will automatically update
to reflect the new package name.

If the activity's intent requires specific extras those are passed via
the constructor, with companion object methods to extract them from the
intent.

Using the intent classes from this package is enforced by a lint
`IntentDetector` which will warn if any intents are created using a
class literal.

See #291
2023-12-07 18:36:00 +01:00
Nik Clayton 2ce80c6a32
refactor: Use the correct package for TimelineKind (#303)
The package wasn't renamed when it was moved, so was still
`app.pachli.components.timeline`, instead of the new location,
`app.pachli.core.network.model`.
2023-12-06 12:20:36 +01:00
Nik Clayton e749b362ca
refactor: Start creating core modules (#286)
The existing code base is a single monolithic module. This is relatively
simple to configure, but many of the tasks to compile the module and
produce the final app have to run in series.

This is unnecessarily slow.

This change starts to split the code in to multiple modules, which are:

- :core:account - AccountManager, to break a dependency cycle
- :core:common - low level types or utilities used in many other modules
- :core:database - database types, DAOs, and DI infrastructure
- :core:network - network types, API definitions, and DI infrastructure
- :core:preferences - shared preferences definitions and DI
infrastructure
- :core:testing - fakes and rules used across different modules

Benchmarking with gradle-profiler shows a ~ 17% reduction in incremental
build times after an ABI change. That will improve further as more code
is moved to modules.

The rough mechanics of the changes are:

- Create the modules, and move existing files in to them. This causes a
  lot of churn in import arguments.

- Convert build.gradle files to build.gradle.kts

- Separate out the data required to display a tab (`TabViewData`) from
  the data required to configure a tab (`TabData`) to avoid circular
  dependencies.

- Abstract the repeated build logic shared between the modules in to
  a set of plugins under `build-logic/`, to simplify configuration of
  the application and library builds.

- Be explicit that some nullable types are non-null at time of use.
  Nullable properties in types imported from modules generally can't be
  smart cast to non-null. There's a detailed discussion of why this
restriction exists at
https://discuss.kotlinlang.org/t/what-is-the-reason-behind-smart-cast-being-impossible-to-perform-when-referenced-class-is-in-another-module/2201.

The changes highlight design problems with the current code, including:

- The main application code is too tightly coupled to the network types
- Too many values are declared unnecessarily nullable
- Dependency cycles between code that make modularisation difficult

Future changes will add more modules.

See #291.
2023-12-04 16:58:36 +01:00
sanao a7533b3f08
feat: Display compose button when viewing lists (#279)
Fixes #231
2023-12-04 16:42:32 +01:00
sanao fbbb6249cc
feat: Display compose button when viewing bookmarks list (#278)
Fixes #230
2023-12-04 16:29:14 +01:00
renovate[bot] 02b17f4144
fix(deps): update dependency com.android.tools.build:gradle to v8.2.0 (#257)
[![Mend Renovate logo
banner](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[com.android.tools.build:gradle](https://developer.android.com/studio/build)
([source](https://android.googlesource.com/platform/tools/base)) |
`8.1.2` -> `8.2.0` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/com.android.tools.build:gradle/8.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.android.tools.build:gradle/8.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.android.tools.build:gradle/8.1.2/8.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.android.tools.build:gradle/8.1.2/8.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [com.android.tools.lint:lint-tests](http://tools.android.com/) |
`31.1.3` -> `31.2.0` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/com.android.tools.lint:lint-tests/31.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.android.tools.lint:lint-tests/31.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.android.tools.lint:lint-tests/31.1.3/31.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.android.tools.lint:lint-tests/31.1.3/31.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [com.android.tools.lint:lint](http://tools.android.com/) | `31.1.3` ->
`31.2.0` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/com.android.tools.lint:lint/31.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.android.tools.lint:lint/31.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.android.tools.lint:lint/31.1.3/31.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.android.tools.lint:lint/31.1.3/31.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [com.android.tools.lint:lint-checks](http://tools.android.com/) |
`31.1.3` -> `31.2.0` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/com.android.tools.lint:lint-checks/31.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.android.tools.lint:lint-checks/31.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.android.tools.lint:lint-checks/31.1.3/31.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.android.tools.lint:lint-checks/31.1.3/31.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [com.android.tools.lint:lint-api](http://tools.android.com/) |
`31.1.3` -> `31.2.0` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/com.android.tools.lint:lint-api/31.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.android.tools.lint:lint-api/31.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.android.tools.lint:lint-api/31.1.3/31.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.android.tools.lint:lint-api/31.1.3/31.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/pachli/pachli-android).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy41OS44IiwidXBkYXRlZEluVmVyIjoiMzcuNTkuOCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nik Clayton <nik@ngo.org.uk>
2023-12-02 14:34:34 +01:00
Nik Clayton f9fb0e87b4
fix: Prevent UnsupportedOperationException in PachliTileService (#288)
Previous code always called `startActivityAndCollapse()` with a regular
intent, which triggers an `UnsupportedOperationException` at API 34.

Use the non-deprecated variant that uses pending intents when
appropriate.

While looking at this I noticed the icon for the tile was incorrect, so
replaced that with the notification icon.
2023-12-02 14:24:29 +01:00
Jener Gomes d2ef0b0713 fix(l10n): Update English (United Kingdom) translations
Currently translated at 12.3% (80 of 647 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/en_GB/
2023-12-01 17:00:58 +01:00
sköldpadda 96d6c3bed3 fix(l10n): Update Swedish translations
Currently translated at 99.8% (646 of 647 strings)

Translation: Pachli/UI strings
Translate-URL: https://hosted.weblate.org/projects/pachli/ui-strings/sv/
2023-12-01 17:00:58 +01:00