Commit Graph

14 Commits

Author SHA1 Message Date
UlrichKu b4d10c9613
3204: Add an account based preference store (#3205)
* 3204: Add an account based preference store

* 3204: (related) reformat a bit, add todo

* 3204: Use the preference data store for all three account settings

* 3204: Move event handling to account settings handler

* 3204: Correct includes

* 3204: Appease linter

* 3204: Appease linter again

* 3204: Add an account based preference store

* 3204: Use the preference data store for all three account settings

* 3204: Move event handling to account settings handler

* 3204: Correct includes

* 3204: Add general "preference upgrade loop stepper"; use it for removing obsolete account settings (in shared)

* 3204: Add missing spaces

* 3204: Key is non-nullable

* 3204: Upgrade to new settings migration code

* 3204: Remove (commented) DI code
2023-02-27 14:07:28 +01:00
Nik Clayton fda8c80949
Use an explicit SCHEMA_VERSION instead of BuildConfig.VERSION_CODE (#3324)
* Use an explicit SCHEMA_VERSION instead of BuildConfig.VERSION_CODE

Every nightly release has a new BuildConfig.VERSION_CODE, so the previous
code would not do the right thing.

Require the schema version to be explicitly set. While I'm here, provide
a clear set of guidelines as to what has to happen when the schema changes.

* Improve documentation links
2023-02-25 21:22:49 +01:00
Nik Clayton a1494ecc68
Perform preference schema upgrades at startup (#3186)
* Perform preference schema upgrades at startup

Over time it can be desirable to change how preferences are interpreted.

Preferences might be removed, or renamed. Or the default value for a
preference might be changed.

When this happens it's important that users upgrading from one version to
the next (or jumping from one version to several versions ahead) get a
consistent experience. In particular:

- Preferences that no longer exist should be deleted
- Preferences that have been renamed should have the old preference values
  copied over
- If the user used the default value for the preference, and the default has
  changed, the previous default value should be explicitly set as their
  value for the preference

To support this, store a SCHEMA_VERSION as a preference. This is not exposed
to the user, and corresponds to the app's VERSION_CODE.

If the version code does not match the schema version then this is a newer
version of the app with older preferences that may need to be changed.

Those changes will be implemented in `upgradeSharedPreferences`.

* Translated using Weblate (Hungarian)

Currently translated at 100.0% (552 of 552 strings)

Co-authored-by: Gera, Zoltan <gerazo@manioka.hu>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/hu/
Translation: Tusky/Tusky

* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (552 of 552 strings)

Co-authored-by: Eric <alchemillatruth@purelymail.com>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/zh_Hans/
Translation: Tusky/Tusky

* Translated using Weblate (Ukrainian)

Currently translated at 100.0% (552 of 552 strings)

Co-authored-by: Ihor Hordiichuk <igor_ck@outlook.com>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/uk/
Translation: Tusky/Tusky

* Translated using Weblate (Vietnamese)

Currently translated at 100.0% (552 of 552 strings)

Co-authored-by: Hồ Nhất Duy <mastoduy@gmail.com>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/vi/
Translation: Tusky/Tusky

* Translated using Weblate (Belarusian)

Currently translated at 100.0% (552 of 552 strings)

Co-authored-by: Mikalai <mikalai.hryb@gmail.com>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/be/
Translation: Tusky/Tusky

* Translated using Weblate (Belarusian)

Currently translated at 100.0% (552 of 552 strings)

Co-authored-by: Andrej Zabavin <andre.zabavin@gmail.com>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/be/
Translation: Tusky/Tusky

* Translated using Weblate (Belarusian)

Currently translated at 100.0% (552 of 552 strings)

Co-authored-by: Mikalai <mikalai.hryb@gmail.com>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/be/
Translation: Tusky/Tusky

* Translated using Weblate (Belarusian)

Currently translated at 100.0% (552 of 552 strings)

Translated using Weblate (Belarusian)

Currently translated at 100.0% (552 of 552 strings)

Co-authored-by: xzFantom <xzfantom@gmail.com>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/be/
Translation: Tusky/Tusky

* Translated using Weblate (Japanese)

Currently translated at 91.3% (504 of 552 strings)

Co-authored-by: TAKAHASHI Shuuji <shuuji3@gmail.com>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/ja/
Translation: Tusky/Tusky

* Translated using Weblate (Icelandic)

Currently translated at 100.0% (552 of 552 strings)

Co-authored-by: Sveinn í Felli <sv1@fellsnet.is>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/is/
Translation: Tusky/Tusky

* Translated using Weblate (Belarusian)

Currently translated at 100.0% (552 of 552 strings)

Co-authored-by: Mikalai <mikalai.hryb@gmail.com>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/be/
Translation: Tusky/Tusky

* Lint

---------

Co-authored-by: Gera, Zoltan <gerazo@manioka.hu>
Co-authored-by: Eric <alchemillatruth@purelymail.com>
Co-authored-by: Ihor Hordiichuk <igor_ck@outlook.com>
Co-authored-by: Hồ Nhất Duy <mastoduy@gmail.com>
Co-authored-by: Mikalai <mikalai.hryb@gmail.com>
Co-authored-by: Andrej Zabavin <andre.zabavin@gmail.com>
Co-authored-by: xzFantom <xzfantom@gmail.com>
Co-authored-by: TAKAHASHI Shuuji <shuuji3@gmail.com>
Co-authored-by: Sveinn í Felli <sv1@fellsnet.is>
2023-02-04 20:19:01 +01:00
Nik Clayton 22834431ca
Convert util/{HttpHeaderLink,PairedList,TimestampUtils,ThemeUtils} to Kotlin (#3046)
* Fix off-by-one error in HttpHeaderLink

Link headers with multiple URLs with multiple parameters were being parsed
incorrectly.

Detected by adding unit tests ahead of converting to Kotlin.

* Convert util/HttpHeaderLink from Java to Kotlin

* Convert util/ThemeUtils from Java to Kotlin

* Convert util/TimestampUtils from Java to Kotlin

* Add tests for PairedList

* Convert util/PairedList from Java to Kotlin

* Implement feedback from PR

* Relicense as GPL
2022-12-31 13:01:35 +01:00
Konrad Pozniak c96a81571c
support Android 13 per-app languages (#2829)
* support Android 13 per-app languages

* fix tests

* fix language ids in locales_config.xml

* fix language setting default in ComposeActivity
2022-11-16 19:45:18 +01:00
Constantin A f15b3e61bb
New emoji picker (#2395)
* Update to Emoji2

* Hopefully fix the emoji picker preference

* Switch to released Filemojicompat version

* Filemojicompat version as an own var

* Remove an unused import

* Small cleanup

* Correct onDisplayPreferenceDialog; test TuskyApplication

* Use TextViews instead of EmojiTextViews

* Recreate the Main Activity if the emoji pack is updated

* Enable coreLibraryDesugaring (for Java Streams); update Filemojicompat, downgrade Emoji2

* Update emoji font versions to 14

* Use FilemojiCompat 3.2.0-beta01

* Make ktLint happy again

* Remove coreLibraryDesugaring and a FIXME

* Use EmojiPickerPreference.get()

* Disable emoji pack import

* Update FilemojiCompat to Beta 2

* Update FilemojiCompat to Beta 3

* Update FilemojiCompat to Beta 3.2.0 final

* Update FilemojiCompat to 3.2.1
2022-04-26 18:50:58 +02:00
Konrad Pozniak 16ffcca748
add ktlint plugin to project and apply default code style (#2209)
* add ktlint plugin to project and apply default code style

* some manual adjustments, fix wildcard imports

* update CONTRIBUTING.md

* fix formatting
2021-06-28 21:13:24 +02:00
Konrad Pozniak 40b24cd242
migrate to RxJava3 (#2146)
* migrate to RxJava3

* remove unused import
2021-05-16 19:53:27 +02:00
Konrad Pozniak a9337bcb78
fix workmanager crashing because of async initialization (#2003) 2020-12-01 07:39:30 +01:00
Ivan Kupalov ef1ae581b4
Fix some of the StrictMode violations (#1931)
Mostly it's disk reads/writes.

Conscrypt reads own version on startup which reads from disk multiple
times. There's no solution for it right now.

SharedPreferences which are used in BaseActivity also read from disk
and pretty early but it shouldn't be a problem.
2020-11-23 20:05:48 +01:00
Konrad Pozniak 1d309850b0
convert EmojiPreference and EmojiCompatFont to Kotlin (#1922)
* convert EmojiPreference and EmojiCompatFont to Kotlin

* move preference related to to dedicated preference package

* update proguard-rules.pro

* reformat & add comment

* maintain disposable information in EmojiPreference instead of EmojiCompatFont
2020-09-02 12:27:51 +02:00
Konrad Pozniak b280e25727
use AndroidX WorkManager instead of Evernote Android Job (#1783)
* use AndroidX WorkManager instead of Evernote Android Job

* move notification related classes to their own package

* fix missing import
2020-05-12 18:46:49 +02:00
Konrad Pozniak 83c06f44e7
Fix RxJava UndeliverableException crashes (#1778) 2020-05-08 16:53:38 +02:00
Konrad Pozniak 398ee66084
simplify DI & test setup, convert TuskyApplication to Kotlin (#1675)
* simplify DI & test setup, convert TuskyApplication to Kotlin

* try to fix tests on bitrise

* remove conscrypt-openjdk-uber test dependency again
2020-02-25 19:49:15 +01:00