New lint checks mean:
- Some trivial uses of String.format() are replaced with templates
- Use a string resource for the scheduled date and time
Some reported SetTextI18n warnings have been ignored, as they relate to
e.g., clearing a view's text by setting it to "".
Implement suggestions as a new `feature:suggestions` module, with
associated activity, fragment, etc.
Suggested accounts are shown with their normal information, as well as
information about the number of follows / followers, and a guide to
posting frequency, so the user can make a more informed decision about
whether to follow or not.
In the previous code `PachliError` could correctly chain errors and
generate error messages, `ApiError` didn't, which is why there was the
temporary `ApiError.fmt()` extension function.
Rewrite `ApiError` to implement `PachliError` so it gets these benefits
and to reduce the number of different error-handling mechanisms in the
code.
Main changes:
- `PachliError` is now an interface so it can be extended by other
error interfaces.
- All the `ApiError` subclasses implement `PachliError`, and can
specify the error string and interpolated variables at the point of
declaration.
- Update `ListsRepository` and `ServerRepository` to return
`PachliError` subclasses.
The crash was caused by an uncaught exception when calling
`MastodonApi#domainBlocks`.
Update the `BackgroundMessageView` for the error message so it fills the
screen like on other pages.
Fixes#696
Previous code was inconsistent about using getServerErrorMessage() and
whether or not the case where getServerErrorMessage() returns null was
handled.
Switch to using getErrorString() which does handle the null case and
always returns a usable string.
Some string resources are rendered temporarily unused by this change.
They will be used again soon, so configure lint to ignore them at the
moment.
Previous code always included the transitionKind enum as an extra, and
could cause a crash if the activity launched by the intent was not a
Pachli activity.
Fixes#700.
The F-Droid API can return a `suggestedVersionCode` that F-Droid has not
successfully built (e.g., there was a network issue preventing F-Droid
from fetching the source code at the time of the last build).
This meant users were being prompted to update when there was not a
built package to update to.
Fix this by verifying that `suggestedVersionCode` appears in the list of
packages. If it doesn't then fall back to the highest version code in
the list of packages.
Fixes#684
Previous code didn't get the viewmodel to check if the content had
changed, so `onBackPressedCallback` wasn't enabled, and the user could
edit the bio and press "back" without being prompted to save their
changes.
Edited polls only include the list of options with titles; no other
metadata (poll ID, single/multiple choice, vote counts, etc). Since the
data shape didn't match Moshi wasn't decoding the data.
Provide dedicated data classes to model the response, and add a fourth
poll display option to represent viewing an edit history snapshot.
Replace `ContextCompat.getDrawable()`, as the app-compat version has
platform fixes and backports.
appcompat-lint warns about bare `context.getDrawable()`, but does not
cover `ContextCompat` (https://issuetracker.google.com/issues/337905331)