Commit Graph

4295 Commits

Author SHA1 Message Date
Nik Clayton a43ebab69b
feat: Add "Don't ask again" option when confirming the posting language (#1027)
For some users this feature has too many false positives, particularly
when emojis are used.

Provide a preference that enables/disables the feature, default to
"enable".

When the user is prompted the dialog has a third "Don't ask again"
option. If chosen the preference is set to prevent future prompts and
the status is sent as-is.

Fixes #893
2024-10-18 17:26:50 +02:00
Nik Clayton c8aa4fd374
fix: Disable "Scheduled post" support on GoToSocial accounts (#1025)
GoToSocial servers don't support scheduled posts; they return the wrong
type, and this can cause a loop of posting.

The GoToSocial bug to implement scheduled posts is
https://github.com/superseriousbusiness/gotosocial/issues/1006.

Fix this by adding a new server capability for scheduled post support,
using it for most servers, and disabling it for GoToSocial.

If scheduled post support is not available for an account:

- The "Scheduled posts" menu option is not shown.
- The scheduling button (clock) when composing a post is hidden, so the
user cannot set scheduling parameters.

Fixes #963
2024-10-18 15:37:10 +02:00
Nik Clayton 8fac5c3d4d
fix: Don't clip buttons when choosing scheduled post time (#1024)
The MaterialTimePicker library has a bug that results in the "Cancel"
and "Ok" buttons on the dialog being cut off.

See
https://github.com/material-components/material-components-android/issues/3584

Work around this by updating their layout params and explicitly setting
the "bottomToBottom" constraint to their parent.
2024-10-18 15:13:17 +02:00
Nik Clayton a5c8bf5e7e
fix: Remove the "Liimt timeline notifications" preference (#1009)
This wasn't acting as a preference.

It presented as a switch. If the user toggled it some notification
settings were changed for all accounts.

It wasn't clear what was changed, and if the user changed some of those
settings back the switch position did not change (it couldn't, you
couldn't meaningfully represent a partial change using a single switch).

Since the user has full control over the notification filters on a
per-account basis remove this "preference" to reduce confusion.

Fixes #935
2024-10-17 22:09:22 +02:00
Nik Clayton 1b3b78a9dd
refactor: Pass pachliAccountId to more functions (#1008)
While this isn't used in many places yet, it pushes the places where the
active account is referenced further up the call stack.
2024-10-17 21:19:17 +02:00
Nik Clayton fd9cc2ea96
refactor: Improve saveVisibleId log message (#1003) 2024-10-14 17:21:04 +02:00
Nik Clayton f7c87dfe73
refactor: Use pachliAccountId in EditProfileActivity (#1002)
Pass the value to EditProfileViewModel. It's not used yet, but this
minimises diffs an upcoming large refactor.
2024-10-14 16:39:45 +02:00
mondstern 2c75be8936 fix(l10n): Update Ukrainian translations
Currently translated at 100.0% (2 of 2 strings)

Translation: Pachli/App : Fdroid
Translate-URL: https://hosted.weblate.org/projects/pachli/app-fdroid/uk/
2024-10-12 20:49:52 +02: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 a4e9c563e9
fix: Prevent crash when ModuleInstall.API is unavailable (#997)
Seen the following crash in user reports:

```
com.google.android.gms.common.api.ApiException: 17:
  API: ModuleInstall.API is not available on this device.
  Connection failed with:
  ConnectionResult{statusCode=SERVICE_INVALID, resolution=null, message=null}
```

Doesn't appear to be properly documented anywhere I can find. To work
around this catch exceptions when checking for MLKit modules or
installing them and return defaults.
2024-10-10 20:44:06 +02:00
Nik Clayton 23121459ab
refactor: Implement SharedPreferencesRepository.showSelfUsername property (#996) 2024-10-10 20:15:46 +02:00
Nik Clayton fd0957d829
fix: Parse and restore poll when editing scheduled statuses (#994)
Previous code didn't deserialise the "poll" attribute so it was never
passed to the composer when editing scheduled statuses.

Fixes #991
2024-10-10 19:43:48 +02:00
Nik Clayton f3b11d0e81
refactor: Lazy load preferences to prevent crash (#993)
Without this the values are loaded from sharedPreferencesRepository
before the variable is initialised.
2024-10-10 15:14:51 +02:00
Nik Clayton e307796251
refactor: Provide properties for more shared preferences (#992)
Continues the work of providing properties with accessors for specific
shared preferences.
2024-10-10 13:12:56 +02:00
Nik Clayton 8587fafaa8
refactor: Expose main navigation preference as an enum (#988) 2024-10-08 15:30:56 +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
Nik Clayton 668c073822
refactor: Assorted code inspection cleanups (#985)
Code inspection found some mechanical code cleanups.
2024-10-07 12:38:35 +02:00
Nik Clayton ea635d654e
refactor: Rename ListActivityIntent to ListsActivityIntent (#984)
Since the activity it launches is called `ListsActivity`.
2024-10-07 12:33:42 +02:00
Kalle Kniivilä aaf88b4ac3 fix(l10n): Update Finnish translations
Currently translated at 100.0% (728 of 728 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/fi/
2024-10-06 19:08:25 +02:00
--//-- 268b042a95 fix(l10n): Update Burmese translations
Currently translated at 14.1% (103 of 728 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/my/
2024-10-06 19:08:25 +02:00
--//-- f6370d6385 fix(l10n): Update Burmese translations
Currently translated at 0.4% (3 of 728 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/my/
2024-10-06 19:08:25 +02:00
--//-- 8d41a03668 fix(l10n): Update Burmese translations
Currently translated at 0.4% (3 of 728 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/my/
2024-10-06 19:08:25 +02:00
--//-- 4c59a5bace fix(l10n): Update Burmese translations
Currently translated at 0.1% (1 of 728 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/my/
2024-10-06 19:08:25 +02:00
Languages add-on c966fbd83a feat(l10n): Added Burmese translation 2024-10-06 19:08:25 +02:00
Languages add-on f52fe63272 feat(l10n): Added Burmese translation 2024-10-06 19:08:25 +02:00
--//-- 34db06d980 feat(l10n): Added Burmese translation 2024-10-06 19:08:25 +02:00
Juan M Sevilla 23ac1c04d2 fix(l10n): Update Spanish translations
Currently translated at 100.0% (728 of 728 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/es/
2024-10-06 19:08:25 +02:00
Nik Clayton 1c861ee906
chore(i18n): Add Burmese ("my") language code (#981) 2024-10-06 18:47:57 +02:00
Nik Clayton 65c73625f6
refactor: Create V2 filters with one API call (#979)
Previous code didn't encode v2 filter keywords, so created v2 filters by
first creating the filter with no keywords (one API call) then making
1-N API calls to add each keyword to the filter.

Fix this by adding a dedicated converter for the `NewContentFilter` type
that encodes it correctly so the filter can be created with a single API
call.

This necessitates moving some types around,
2024-10-05 14:53:23 +02:00
Nik Clayton ec27aa2435
fix: Don't crash if a conversation has no participants (#978)
It's possible for some servers to return a conversation that has an
empty (or possibly missing) `accounts` property. In the previous code
this would crash trying to access an item in an empty list.

Fix this by handling the "no participants" case.

Fixes #971
2024-10-04 11:28:20 +02:00
Nik Clayton 0d5d118267
refactor: Move AccountManager to core.data.repository (#976) 2024-10-03 21:28:01 +02:00
Kalle Kniivilä 0c2cda1a14 fix(l10n): Update Finnish translations
Currently translated at 100.0% (727 of 727 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/fi/
2024-10-03 15:07:42 +02:00
Nik Clayton fe1c586dae
refactor: Move ServerOperation and related types to core.model (#969) 2024-10-03 13:41:46 +02:00
Nik Clayton ea53b68b3f
refactor: Rename LogoutUseCase, call with invoke. (#968) 2024-10-03 12:53:57 +02:00
Nik Clayton 03cb6c313e
refactor: Start splitting Notification helpers in to use cases (#967)
Move enableNotifications and androidNotificationsAreEnabled to usecases.
2024-10-03 12:11:20 +02:00
Nik Clayton 4b3b275c97
refactor: Rename variables and functions in MainActivity (#966)
Rename some variables and functions in MainActivity to more accurately
or consistently reflect what they do.
2024-10-02 23:48:20 +02:00
Weblate (bot) 33726431e8
fix(l10n): Translations update from Hosted Weblate (#962)
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/Feature/About :
Main](https://hosted.weblate.org/projects/pachli/featureabout-main/)

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

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

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

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

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

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

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

* [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/Feature/Lists :
Main](https://hosted.weblate.org/projects/pachli/featurelists-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: LibreTranslate <noreply-mt-libretranslate@weblate.org>
Co-authored-by: nichu42 <nroediger@nic-site.de>
Co-authored-by: Nik Clayton <nik@ngo.org.uk>
2024-10-02 23:19:34 +02:00
Nik Clayton 510717d46a
refactor: Rename "Filters" to "Content filters" (#927)
The new anti-harassment features will add several different types of
filtering options through the UI.

To ensure there is no confusion, rename the existing "Filters" UI and
code to "Content filters" to accurately describe what they operate on,
distinct from new filters which will act on account metadata.

Fixes #926.
2024-10-02 22:57:00 +02:00
Nik Clayton f9ca3cd700
chore: Prepare release 2.8.2 (versionCode 22) (#960) 2024-09-30 15:21:52 +02:00
Nik Clayton fd29987cd1
refactor: Move tab-tap preference to labs (#958)
Allows user feedback on this before promoting to a main feature.
2024-09-30 14:57:17 +02:00
Nik Clayton 97558667c8
feat: Allow the user to chose behaviour when tapping a tab (#955)
Previously, tapping a tab would jump to the top of the loaded content,
which might trigger a load of a fresh page.

Provide a preference to control this; the default is the current
behaviour, the user can also choose to discard the current content and
load the newest content.

Fixes #939
2024-09-27 17:38:15 +02:00
Nik Clayton 90537da122
feat: Add option to download media to per-sender directories (#954)
Update `DownloadUrlUseCase` with a parameter to specify the account that
"owns" the media. This is either the account that posted the status, or
the account being viewed (e.g., if downloading an account's header
image).

Add a new `DownloadLocation` enum constant to download to directories
named after that account.

Pass this information through at the call sites.

Fixes #938
2024-09-27 11:29:34 +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
Nik Clayton 85ab714ec1
feat: Add option to save attachments to per-account folders (#945)
The existing code downloaded any attachments to the user's "Downloads"
folder. If the user is logged in with several accounts these downloads
will be mixed up together.

Fix this by adding a new preference that allows the user to specify the
downloads should be placed in a sub-folder per account, named after the
account.

To do this:

- Add an interface for enums that can be used as preferences, with
properties for the string resource to display and the value to store.
- Add `EnumListPreference`, a `ListPreference` that allows the user to
choose between different enum values.
- Add a `DownloadLocation` enum and preference key so the user can
choose the location.
- Add a `core.domain` module, with a use case for downloading URLs that
respect's the user's download preference. Use this use-case everywhere
that files are currently downloaded.

Fixes #938
2024-09-26 13:51:30 +02:00
Nik Clayton 3f9ee1d9c8
fix: Show notification fetch errors instead of JSON (#942)
Previous code showed any JSON-wrapped errors from notification fetches
as the JSON string, instead of the error message.

Fix this by switching to `ApiResult` and using the formatted error
message.

Fixes 937
2024-09-25 13:49:43 +02:00
Nik Clayton 561c26ad4d
fix: Save the reading position if no post is fully visible (#941)
Previous code saved the reading position of a fully visible status. But
there are situations where no status is fully visible.

1. The user is in the middle of viewing a status longer than the screen
height, and the top/bottom of the status are off the top/bottom of the
screen.

2. The user has scrolled between two statuses. Collectively they are
longer than the screen height, and the top of one status is off the top
of the screen and the bottom of the other status is off the bottom of
the screen.

In both cases the user's reading position was not saved.

In these situations use the ID of the status closest to the bottom of
the screen, even if not fully visible. This should ensure the user never
missing anything.

Fixes #936
2024-09-25 11:45:33 +02:00
renovate[bot] 494246097d
fix(deps): update dependency com.github.unifiedpush:android-connector to v2.5.0 (#915)
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[com.github.UnifiedPush:android-connector](https://unifiedpush.org/developers/android/)
([source](https://codeberg.org/UnifiedPush/android-connector)) | `2.4.0`
-> `2.5.0` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/com.github.UnifiedPush:android-connector/2.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.github.UnifiedPush:android-connector/2.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.github.UnifiedPush:android-connector/2.4.0/2.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.github.UnifiedPush:android-connector/2.4.0/2.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>UnifiedPush/android-connector
(com.github.UnifiedPush:android-connector)</summary>

###
[`v2.5.0`](https://codeberg.org/UnifiedPush/android-connector/releases/tag/2.5.0)

[Compare
Source](https://codeberg.org/UnifiedPush/android-connector/compare/2.4.0...2.5.0)

- Avoid possible desynchronization that let the app use the token of a
removed instance
- Deprecate `registerAppWithDialog` in favor of the new lib
`org.unifiedpush.android:connector-ui`
- Drop toolchains in favor of compatibility API, removing requirement of
Java version to build project
-   Bump dependencies

</details>

---

### 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 was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/pachli/pachli-android).

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

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nik Clayton <nik@ngo.org.uk>
2024-09-25 11:20:58 +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 aec657d49a
refactor: Use ApiResult for requests that return lists of accounts (#932)
Previous code used `Response`. Convert to `ApiResult` as part of the
work to implement anti-harassment controls, which will need to query the
user's list of accounts they are following.

Converting just `accountFollowing` wasn't practical, as all the methods
are called by a single function in `AccountListFragment` which expects
the return type to be the same.
2024-09-09 13:12:26 +02:00
josé m 95e924a5ef fix(l10n): Update Galician translations
Currently translated at 100.0% (731 of 731 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/gl/
2024-09-09 10:06:19 +02:00
Nik Clayton 70529ffd8a
chore: Prepare release 2.8.1 (versionCode 21) (#930) 2024-09-04 15:30:28 +02:00
Nik Clayton 3c1818a5d5
fix: Stop preview card text overlapping images (#924)
In rare occasions the preview card text could overlap the image if the
image had a portrait aspect ratio.

This seems to be due to the use of the `with(...) {}` scope function and
Kotlin's interoperability with Java setters.

Replace this with code that explicitly gets and sets the layout params
to ensure they are set correctly.
2024-09-03 22:17:52 +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 b83ecf56d6
fix: Restore video transitions on androidx.media3 1.4.0 and 1.4.1 (#922)
androidx.media3 1.4.0-rc01 and above (at the time of writing) has a bug
that breaks shared element transitions with a `PlayerView` (see
https://github.com/androidx/media/issues/1594).

This can be worked around by setting `app:surface_type="texture_view"`.
This uses more power, but for the typical length of social media videos
this shouldn't be a problem at the moment.

Fixes #920.
2024-09-03 13:05:52 +02:00
Nik Clayton 69b87a3c44
fix: Prevent crash when sending a post while media is uploading (#923)
Previous code used `filterIsInstance<Ok<UploadEvent.FinishedEvent>>()`.

This can fail at runtime with class cast exception because the type in
`Ok<...>` is erased so `filterIsInstance` was accepting any `Ok`
`Result`. Later attempts to operate on it as a `.FinishedEvent`
generated the run time error.

Fix that by explicitly checking the type of the `Ok` result in `first`
instead.
2024-09-03 13:05:33 +02:00
Nik Clayton c90445364b
chore: Prepare release 2.8.0 (versionCode 20) (#918) 2024-08-30 12:45:19 +02:00
Nik Clayton 874cb554a4
fix: Write correct description when battery optimisation is disabled (#917) 2024-08-30 12:30:58 +02:00
Nik Clayton 8d87005669
fix: Show posting app name if app link is missing (#912)
Previous code had a bug/typo, which meant the app the user was posting
from was not shown if the app did not have an associated website. But
the bullet separating the parts of the text was still shown, resulting
in a spurious dangling bullet.
2024-08-29 13:10:08 +02:00
Nik Clayton 7a04ec86b2
fix: Remove anyRTL from status root view (#910)
It's overly eager to switch, and renders incorrectly with content like:

> I like the letter י because it's so small
2024-08-29 11:51:35 +02:00
Nik Clayton 766dc1f907
fix: Render hashtags, mentions, and initial paras correctly in RTL (#906)
Previous code didn't set the textDirection for the status content, so
the first para of RTL text might be rendered incorrectly.

In addition, mentions and tags weren't BIDI wrapped, so would appear as
"foo@" and "foo#" in RTL statuses, instead of "@foo" and "#foo".

Fix both of these issues.

Fixes #870
2024-08-28 17:46:39 +02:00
josé m a73770e073 fix(l10n): Update Galician translations
Currently translated at 100.0% (711 of 711 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/gl/
2024-08-28 14:47:27 +02:00
Kalle Kniivilä 228414c3a2 fix(l10n): Update Finnish translations
Currently translated at 100.0% (731 of 731 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/fi/
2024-08-28 14:47:27 +02:00
josé m 3d826aecc7 fix(l10n): Update Galician translations
Currently translated at 82.1% (588 of 716 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/gl/
2024-08-26 14:28:42 +02:00
josé m 43fb5f6d12 fix(l10n): Update Galician translations
Currently translated at 78.6% (563 of 716 strings)

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

Translation: Pachli/App : Fdroid
Translate-URL: https://hosted.weblate.org/projects/pachli/app-fdroid/gl/
2024-08-26 14:28:42 +02:00
josé m 330a3e31b2 fix(l10n): Update Galician translations
Currently translated at 100.0% (2 of 2 strings)

Translation: Pachli/App : Google
Translate-URL: https://hosted.weblate.org/projects/pachli/app-google/gl/
2024-08-26 14:28:42 +02:00
renovate[bot] 8bc8be8cc3
chore(deps): update agp to v8.5.2 (#845)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

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

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### 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 these
updates again.

---

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

---

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

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

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nik Clayton <nik@ngo.org.uk>
2024-08-20 20:15:15 +02:00
Nik Clayton 8b099aba64
fix: Search filters use correct colours in dark and black mode (#881)
Two problems with the previous code when search filters were visible:

1. The link icon overrode the tint, so didn't appear correctly in dark
and black mode.

2. The horizontal scroll view had the wrong background colour in black
mode.

Fix both, by updating the icon and adding a new style for the scroll
view.

While I'm here remove an obsolete comment and tighten up visibility.

Fixes #875
2024-08-19 17:23:39 +02:00
Nik Clayton 8b9fe6d5ae
fix: Improve push and pull notification reliability (#880)
Clean up the notification handling code and fix a lot of bugs, hopefully
without introducing new ones in the process.

Specific bugs discovered and fixed:

- The code that tried to sync notification filtering state between the
server and Pachli could fail, leaving things in an inconsistent state,
resulting in dropped notifications. Remove that code, do filtering
client-side.

- Logging out of an account would disable push notifications for all
accounts.

- If any account did not support push notifications then push
notifications were disabled for all accounts.

- If any account did not support push notifications the user was
prompted to log out of all accounts. Drop that entirely.

- The UnifiedPush library could get to a state where configuring the
notification mechanism would silently fail,

The preferences UI now has a section for notifications, showing:

- The Unified Push distributor in use (if any)
- A mechanism to change the distributor
- Per-account configuration and notification fetch details
- Battery optimisation state

General changes:

- Update to UnifiedPush library 2.4.0.

- NotificationFetcher.fetchAndShow() can now fetch a single account's
notifications, or all accounts, depending on data passed to the worker.

- Use ApiResult for `push/subscription` responses.

- Drop the "needs migration" terminology for the more specific "has push
scope", to make it clear what the issue with the account is.
2024-08-18 15:17:57 +02:00
sunniva fcbcb4073e fix(l10n): Update Norwegian Bokmål translations
Currently translated at 83.9% (601 of 716 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/nb_NO/
2024-08-14 17:18:09 +02:00
Juan M Sevilla 93895fd78e fix(l10n): Update Spanish translations
Currently translated at 100.0% (716 of 716 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/es/
2024-08-11 16:20:31 +02:00
Kalle Kniivilä e6b7b306f8 fix(l10n): Update Finnish translations
Currently translated at 100.0% (716 of 716 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/fi/
2024-08-06 19:38:02 +02:00
Kalle Kniivilä b1545272ac fix(l10n): Update Finnish translations
Currently translated at 100.0% (711 of 711 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/fi/
2024-08-06 19:38:02 +02:00
Nik Clayton c919f867b2
feat: Experimental preference to reverse home timeline (#867)
Add a new set of preferences, "Lab experiments", to control features
that are under investigation and may never make it into the mainstream.

Add the first experimental feature, which reverses the order of the home
timeline, so posts are shown oldest first instead of newest first.
2024-08-05 15:48:14 +02:00
Juan M Sevilla 75a8152739 fix(l10n): Update Spanish translations
Currently translated at 100.0% (711 of 711 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/es/
2024-08-05 13:47:29 +02:00
Miles Krell 0720e6c462 fix(l10n): Update Spanish translations
Currently translated at 88.7% (631 of 711 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/es/
2024-08-04 01:52:05 +02:00
Nik Clayton c0ff447415
chore: Prepare release 2.7.1 (versionCode 19) (#861) 2024-07-31 15:10:18 +02:00
Nik Clayton ff8b71a2d8
fix: Correctly position preview card images, show card description (#860)
Byline changes inadvertently changed how the preview image is laid out,
breaking the "Image at start, info at end" variant.

Previous code did not always show the card description if the text was
present, fix that.
2024-07-31 12:32:14 +02:00
Nik Clayton a0b3b1ffac
chore: Prepare release 2.7.0 (versionCode 18) (#841) 2024-07-29 16:25:24 +02:00
Nik Clayton e61de1c5f2
fix: Reduce preview cards to minimum height required (#840)
Previous code set a min-height, which is no longer necessary after the
other layout changes. But it meant that a preview card with a one-line
title, no synopsis, and a URL, was taking up too much vertical space.
2024-07-29 14:48:35 +02:00
Nik Clayton 6b5f816b28
feat: Remove preview card placeholder icon (#839)
Previous code displayed a large placeholder icon if there was no preview
image for a preview card.

This reduces the amount of space available for the actual preview text
(i.e., title and description) and did not convey additional information
in the limited space available on the timeline.

So remove it.

While I'm here simplify the PreviewCard layout and migrate to
ConstraintLayout.
2024-07-28 16:24:20 +02:00
Ricky From Hong Kong 8457d92581 fix(l10n): Update Chinese (Traditional) translations
Currently translated at 61.7% (435 of 704 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/zh_Hant/
2024-07-28 15:57:29 +02:00
Ricky From Hong Kong 05aed67e1e fix(l10n): Update Chinese (Simplified) (zh_MO) translations
Currently translated at 41.7% (294 of 704 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/zh_MO/
2024-07-28 15:57:29 +02:00
Ricky From Hong Kong f594749c5f fix(l10n): Update Chinese (Traditional, Hong Kong) translations
Currently translated at 53.4% (376 of 704 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/zh_Hant_HK/
2024-07-28 15:57:29 +02:00
Kalle Kniivilä 22ce5c08f2 fix(l10n): Update Finnish translations
Currently translated at 100.0% (704 of 704 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/fi/
2024-07-27 19:17:30 +02:00
Kalle Kniivilä 0dfb949207 fix(l10n): Update Finnish translations
Currently translated at 100.0% (611 of 611 strings)

Translation: Pachli/App : Main
Translate-URL: https://hosted.weblate.org/projects/pachli/app-main/fi/
2024-07-27 19:17:30 +02:00
Nik Clayton b1d5cb548f
fix: Don't crash due to Filters/ServerRepository race condition (#837)
The `canFilter()` implementation could crash if `server` (marked
`lateinit`) hadn't been initialised at the point of use.

Fix this by removing it and adjusting the two callers to use the
`filters` flow and take appropriate action on error.
2024-07-25 18:43:34 +02:00
Nik Clayton 01831474dc
feat: Toggle display of search operators with toolbar action (#836)
Default to hiding the search operators, and provide a new toolbar icon
(always visible) to show them.

The toolbar icon is displayed with a badge if any operators are present.

Adjust the operator display to three horizontal scrolling rows, to
further limit the maximum amount of vertical space the operators use.
2024-07-24 18:51:00 +02:00
Nik Clayton 5d574d4d76
feat: Include pre-set date search options (#835)
When selecting a search date range show the user a dialog with some
pre-set options, and a button that allows them to pick a custom date
range.
2024-07-24 17:57:19 +02:00
Nik Clayton bad502e6c3
fix: Use show()/hide() to ensure animation is delayed (#834) 2024-07-24 17:20:44 +02:00
Nik Clayton e4a305f608
refactor: Shorten search operator chip label strings (#833)
Improves the information density when selecting search operators.
2024-07-23 15:48:08 +02:00
Nik Clayton 11444bd27d
feat: Search whenever one of the search operators changes (#832) 2024-07-23 15:02:54 +02:00
Nik Clayton ae8584422c
fix: Ensure trending tag name is fully visible (#831)
Previously re-binding the tag's text wouldn't re-measure the layout when
the text changed. So scrolling down a longer tag could be placed in a
textview that previously held a shorter tag.

Then it was cut off and the user couldn't see what the tag was. Use
`wrap_content` so size is measured when the content changes.
2024-07-22 17:27:52 +02:00
Nik Clayton 71e006b0d2
feat: Provide a UI to edit different search operators (#829)
Mastodon supports in-query search operators, such as `has:image`,
`language:en`, or `in:library`. Previously the user had to enter them in
to the query directly.

This provides a chip-based UI that allows the user to set values for
these operators.

## Server

- Add new search capabilities to record the faceted search features the
server reports.
- Update definitions for Mastodon, Friendica, and GoToSocial to specify
which versions of the operations they support.

## SearchOperator / SearchOperatorViewData

- Represents each supported operator and associated viewdata.

## SearchActivity / activity_search.xml

- Conditionally display a chip for each facet depending on the server's
level of support.
- Implement the UI for each chip. They display dialogs of varying levels
of complexity depending on the underlying operation.

## FragmentSearch

- Display the progress as a LinearProgressIndicator instead of an
indeterminate ProgressBar. This makes it more visible under the search
facets.
2024-07-22 17:11:08 +02:00
Nik Clayton c4bc7f81da
refactor: Use withStyledAttributes in FontFamilyDialogFragment (#827)
Ensures it is not possible to forget to recycle the attribute array.
2024-07-22 16:29:53 +02:00
Nik Clayton 6b55d107c1
feat: Edit a matching filter directly from the timeline (#819)
Previously, if a status was filtered with "WARN" and was shown in the
timeline with the name of the filter, and the user then decided to
change
that filter, they had to:

1. Open the left navigation menu
2. Navigate to "Account preferences"
3. Open "Filters"
4. Find the filter they want to edit, tap it
5. Make the change, and save
6. "Back" to the list of filters
7. "Back" to "Account preferences"
8. "Back" to the timeline

That's a lot of clicks for a simple action.

Change this. Now the filtered status includes an "Edit filter" button
that takes the user directly to step 5, and when they press "Back" they
return directly to the timeline.

To do this create a new filter action, `onEditFilterById`. Update the
listeners to launch `EditFilterActivity` if appropriate.

Modify `item_status_filtered.xml` to show the new button.

Update the accessibility delegate to show just the "Show anyway" and
"Edit filter" actions. Modify `FilterableStatusViewHolder` to expose
the information it needs to do this.
2024-07-19 13:45:24 +02:00
Nik Clayton 7ef692c2c8
fix: Don't focus search query when returning to the results list (#824)
Previous code always focused the search query. This meant that if the
user:

1. Searched for something
2. Opened a result (post, hashtag, account)
3. Navigated back to the search results

then because the query was focused the soft-keyboard would open,
obscuring the list of results. The user had to press "Back" again to
dismiss the keyboard.

New code only focuses the search query view if it is empty. This allows
the user to come back to the list of results and immediately open a new
result.
2024-07-15 09:02:07 +02:00
Nik Clayton b757765383
change: Remove copyWithCollapsed helper (#823)
Holdover from when Java interoperability was required.
2024-07-15 00:00:36 +02:00
Nik Clayton e560868749
feat: Animate filter keywords when added or removed (#817)
This makes it a little easier to see what's been changed.
2024-07-14 23:43:20 +02:00
Nik Clayton af11e3d3a1
refactor: Replace `getOrElse { null }` with get() (#820)
`getOrElse { null }` is synonymous with `get()` when using
kotlin-result.
2024-07-14 23:42:59 +02:00