Commit Graph

38 Commits

Author SHA1 Message Date
Nik Clayton 5c048311b2
refactor: Ensure copying text experience is consistent (#1115)
Previous code was inconsistent about whether or not a notification toast
was shown after copying text (contrary to platform guidelines), and
there was some code duplication.

Fix this with a new `ClipboardUseCase` with a `copyTextTo` method that
handles copying text to the clipboard and showing a message afterwards
(depending on platform level).
2024-11-20 14:51:24 +01:00
Nik Clayton f2ed6a0dab
fix: Ensure items in accessibility dialogs are clickable (#1112)
The copy button meant that some dialogs did not return the item click.

Fix this by having the adapter listen for clicks and forward them on.
Pre-emptively move the adapter to core.ui, as it's going to be useful
for the other accessiblity delegates.

Fixes #1108
2024-11-19 15:04:22 +01:00
Languages add-on df15422a6a feat(l10n): Added Norwegian Nynorsk translation 2024-11-15 08:54:53 +01:00
Weblate (bot) 04d98ae616
fix(l10n): Translations update from Hosted Weblate (#1056)
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 :
Main](https://hosted.weblate.org/projects/pachli/app-main/)

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

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

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

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

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

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

* [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: Vaclovas Intas <Gateway_31@protonmail.com>
2024-10-29 15:43:23 +01:00
Weblate (bot) 0cf50524f2
fix(l10n): Translations update from Hosted Weblate (#995)
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 :
Main](https://hosted.weblate.org/projects/pachli/app-main/)

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

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

* [Pachli/Feature/Suggestions :
Main](https://hosted.weblate.org/projects/pachli/featuresuggestions-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/Core/Designsystem :
Main](https://hosted.weblate.org/projects/pachli/coredesignsystem-main/)

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

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

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

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

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

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



Current translation status:

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

---------

Co-authored-by: Vaclovas Intas <vaclovas1999@gmail.com>
Co-authored-by: Languages add-on <noreply-addon-languages@weblate.org>
Co-authored-by: Weblate Translation Memory <noreply-mt-weblate-translation-memory@weblate.org>
Co-authored-by: LibreTranslate <noreply-mt-libretranslate@weblate.org>
2024-10-10 21:42:59 +02:00
Nik Clayton 59a0e3087c
refactor: Pass the active account ID to activities, fragments, etc (#982)
Previous code assumed the active account could always be determined from
the account manager.

This causes a few problems.

1. The account manager has to handle the case where there is no active
account (e.g., the user is logging out of the last account). This meant
the `activeAccount` property had to be nullable, so every consumer of
that property either used it with a `let` or `!!` expression.

2. The active account can change over the life of the UI component, for
example, when the user is switching accounts. There's a theoretical race
condition where the UI component has started an operation for one
account, then the account changes and the network authentication code
uses the new account.

3. All operations assume they operate on whatever the active account is,
making it difficult to provide any features that allow the user to
temporarily operate as another account ("Boost as...", etc).

This "ambient account" was effectively global mutable state, with all
the problems that can cause.

Start to fix this. The changes in this commit do not fix the problem
completely, but they are some progress.

Each activity (except LoginActivity) is expected to be launched with an
intent that includes the ID of the Pachli account it defaults to
operating with. This is `pachliAccountId`, and is the *database ID*
(not the server ID) of the account. This is non-null, which removes one
class of bugs.

This account is passed to each fragment and any piece of code that has
to perform an operation on behalf of this account. It's not used in
most of those places yet, that will be done over a number of followup
PRs as part of modernising each module.
2024-10-07 15:56:37 +02:00
Languages add-on 414d0cb04d feat(l10n): Added Burmese translation 2024-10-06 19:08:25 +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
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
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
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
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
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
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 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
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
Nik Clayton 6f1aaaa884
change: Refer to Pachli as a Nivenly project in AboutFragment (#785) 2024-06-26 23:40:10 +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
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
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
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
Kalle Kniivilä db628f5dd6 fix(l10n): Update Finnish translations
Currently translated at 52.4% (32 of 61 strings)

Translation: Pachli/Feature/About : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/featureabout-main/fi/
2024-02-27 10:37:41 +01:00
Martijn de Boer 486acecfe7 fix(l10n): Update Dutch 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/nl/
2024-02-25 15:53:32 +01:00
Nik Clayton 23e3cf1035
feat: Show information about notification fetches on "About" screen (#454)
Some users report that Pachli is not retrieving/displaying notifications
in a timely fashion.

To assist in diagnosing these errors, provide an additional set of tabs
on the "About" screen that contain information about how Pachli is
fetching notifications, and if not, why not.

Allow the user to save notification related logs and other details to a
file that can be attached to an e-mail or bug report.

Recording data:

- Provide a `NotificationConfig` singleton with properties to record
different aspects of the notification configuration. Update these
properties as different notification actions occur.

- Store logs in a `LogEntryEntity` table. Log events of interest with a
new `Timber` `LogEntryTree` that is planted in all cases.

- Add `PruneLogEntryEntityWorker` to trim saved logs to the last 48
hours.

Display:

- Add a `NotificationFragment` to `AboutActivity`. It hosts two other
fragments in tabs to show details from `NotificationConfig` and the
relevant logs, as well as controls for interacting with them.

Bug fixes:

- Filter out notifications with a null tag when processing active
notifications, prevents an NPE crash

Other changes:

- Log more details when errors occur so the bug reports are more helpful
2024-02-17 15:57:32 +01:00
Nik Clayton d01c72b7d7
change: Disable SyntheticAccessor lint rule (#424)
Does not appear to be adding value, and R8 optimises the code to remove
the generated accessors.
2024-02-06 19:51:37 +01:00
Nik Clayton 75f75a7fc6
fix: Use string resource instead of hardcoded "About" (#421) 2024-02-06 12:57:50 +01:00
Nik Clayton 41c702fc1b
change: Display "About" information in tabs (#420)
Previously, `AboutActivity` had buttons and links to show the privacy
policy and licenses of dependencies.

Change this to a selection of fragments in tabs, one tab each for:

- General "About" information
- Licenses
- Privacy Policy

The information shown hasn't changed, but this lays the groundwork for
including additional tabs in the future for information like server
rules, detected capabilities, or troubleshooting information.
2024-02-06 00:43:26 +01:00
Languages add-on d7edeec3ee feat(l10n): Added Hebrew translation 2024-02-03 15:26:43 +01:00
Languages add-on 53d983743b feat(l10n): Added Odia translation 2024-02-03 15:26:43 +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