Commit Graph

6 Commits

Author SHA1 Message Date
Nik Clayton dda9dde1b9
feat: Periodically check for updates and alert user (#236)
Users can inadvertently get stuck on older versions of the app; e.g., by
installing from one F-Droid repository that stops hosting the app at
some later time.

Analytics from the Play Store also shows a long tail of users who are,
for some reason, on an older version.

On resuming `MainActivity`, and approximately once per day, check and
see if a newer version of Pachli is available, and prompt the user to
update by going to the relevant install location (Google Play, F-Droid,
or GitHub).

The dialog prompt allows them to ignore this specific version, or
disable all future update notifications. This is also exposed through
the preferences, so the user can adjust it there too.

A different update check method is used for each installation location.

- F-Droid: Use the F-Droid API to query for the newest released version
- GitHub: Use the GitHub API to query for the newest release, and check
the APK filename attached to that release
- Google Play: Use the Play in-app-updates library
(https://developer.android.com/guide/playcore/in-app-updates) to query
for the newest released version

These are kept in different build flavours (source sets), so that e.g.,
the build for the F-Droid store can only query the F-Droid API, the UI
strings are specific to F-Droid, etc. This also ensures that the update
service libraries are specific to that build and do not
"cross-contaminate".

Note that this *does not* update the app, it takes the user to either
the relevant store page (F-Droid, Play) or GitHub release page. The user
must still start the update from that page.

CI configuration is updated to build the different flavours.
2023-11-08 08:42:39 +01:00
Nik Clayton e5a54061aa
build: Use `updateLintBaseline` task (#209)
There's a well-hidden `updateLintBaseline` task that does what the
custom `newLintBaseline` task does. Prefer the `update...` task to
reduce the amount of custom machinery in this build.
2023-10-30 19:03:45 +01:00
Nik Clayton 3a274b0594
refactor: Replace .to... with .from() in most cases (#82)
The previous code generally converted between a higher and a lower type
by putting the type conversion functions on the lower type.

This introduced cycles in the code dependency graph, and made it more
difficult to follow the code flow.

Refactor the code so that types generally have a `from(...)` static
factory method that can create an instance from a lower type, and if
appropriate a `to...()` method that can also create an instance of that
lower type.

Add `docs/code-style.md` which explains the rationale for this change
in more detail so that future contributors can write code in the same
style.
2023-09-22 15:17:38 +02:00
Nik Clayton e0e4235354
change: Deprecate the "develop" branch (#70)
The separation between the `develop` and `main` branches was inherited
from Tusky and isn't helpful, complicating the release process and
causing CI to repeatedly run the same actions on the same code.

Deprecate the `develop` branch by removing references to it in the
documentation and updating the CI configuration as necessary.

Separately, the GitHub settings will be changed to set `main` as the
default branch, and the `develop` branch will be deleted.
2023-09-19 16:40:07 +02:00
Nik Clayton 38266fbdfa
docs: Expand translate/code guides for new contributors (#11)
Instead of a single `CONTRIBUTING.md`, create an initial set of more
detailed documentation for the different types of contribution.

Start with `code.md` and `translate.md`, the processes for submitting
code and translations respectively.

Commit to documenting how to contribute documentation, project
management, user support, and social presence in the next week.
2023-09-08 21:54:34 +02:00
Nik Clayton ea3c9c1b8e
docs: Start formally documenting decisions as ADRs (#10)
Ensure that project decisions are clear and transparent to potential
contributors by documenting them in `docs/decisions`, starting with
the decision to use conventional commits.

Use the MADR format (https://adr.github.io/madr/).
2023-09-08 21:40:44 +02:00