Commit Graph

4137 Commits

Author SHA1 Message Date
Goooler e4d1543bda Bump jvmTarget to 17 2023-01-19 22:03:23 +08:00
Goooler 9b1cf708aa Declare compileOptions & kotlinOptions 2023-01-19 22:03:03 +08:00
Goooler 2e2ca51087 Merge instance-build.gradle into app's build.gradle 2023-01-19 22:00:52 +08:00
Goooler e9bb518ca7 Migrate `flavorDimensions` 2023-01-19 21:57:00 +08:00
Goooler 0de4f7f024 Defer clean task 2023-01-19 21:56:32 +08:00
Goooler c2679438a8 Merge remote-tracking branch 'origin/develop' into modernize 2023-01-19 21:56:03 +08:00
Konrad Pozniak db91b4db0e
Merge pull request #3184 from nailyk-weblate/weblate-tusky-tusky
Translations update from Weblate
2023-01-17 20:05:18 +01:00
Mikalai 066c7428f9 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
2023-01-17 12:35:55 +00:00
Sveinn í Felli 100fbe796a 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
2023-01-17 12:35:55 +00:00
TAKAHASHI Shuuji ec5fa814c4 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
2023-01-17 12:35:55 +00:00
xzFantom 2872253cb6 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
2023-01-17 12:35:55 +00:00
Mikalai db433e6f59 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
2023-01-17 12:35:55 +00:00
Andrej Zabavin 023033243c 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
2023-01-17 12:35:55 +00:00
Mikalai a76e6dff1e 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
2023-01-17 12:35:54 +00:00
Hồ Nhất Duy 1dc0f8d78e 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
2023-01-17 12:35:54 +00:00
Ihor Hordiichuk cb7e4c76b6 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
2023-01-17 12:35:54 +00:00
Eric e09efd48ad 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
2023-01-17 12:35:54 +00:00
Gera, Zoltan 4b02ba0816 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
2023-01-17 12:35:54 +00:00
Konrad Pozniak acb0e38b88
fix crash in AccountListFragment when network calls are cancelled (#3175) 2023-01-15 15:21:42 +01:00
Konrad Pozniak 8058c4bc79
fix crash when user clicks url on in partially loaded thread (#3174) 2023-01-15 15:18:07 +01:00
Artsiom 2df6a83e42
Add Belarusian language to the in-app language picker (#3170)
* Add Belarusian language to the in-app language picker

* added Belarusian to locales_config.xml
2023-01-15 15:03:46 +01:00
Konrad Pozniak 01b329c8e3
Merge pull request #3176 from nailyk-weblate/weblate-tusky-tusky-app
Translations update from Weblate
2023-01-14 20:02:02 +01:00
Konrad Pozniak fe30b6cc85
Merge pull request #3173 from nailyk-weblate/weblate-tusky-tusky
Translations update from Weblate
2023-01-14 19:59:06 +01:00
xzFantom c5980217f1 Translated using Weblate (Belarusian)
Currently translated at 15.7% (3 of 19 strings)

Translation: Tusky/Tusky description
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky-app/be/
2023-01-14 18:55:05 +00:00
Goooler f0fd1303f4 Add .editorconfig 2023-01-14 09:24:39 +08:00
Goooler 46c0fc9a9c Cleanups 2023-01-14 09:21:39 +08:00
Goooler b7252055f2 Cleanups 2023-01-14 03:50:44 +08:00
Goooler 04cf93e2cd Enable room incremental build 2023-01-14 03:48:29 +08:00
Goooler 6806c6374f Enable Gradle cache 2023-01-14 03:32:04 +08:00
Goooler 10aa548081 Remove com.android.library 2023-01-14 03:25:36 +08:00
Goooler f3be6d01a2 Revert "Enable build scan"
This reverts commit 1568e5e84f.
2023-01-14 03:23:22 +08:00
Goooler f84c5b980e Revert "Bump deps"
This reverts commit bc0d5b69d5.
2023-01-14 03:23:07 +08:00
Nik Clayton 7d444d1f8c
Fix incorrect log message, s/favourite/bookmark/ (#3172) 2023-01-13 20:03:47 +01:00
Mārtiņš Bruņenieks e68f45058a Translated using Weblate (Latvian)
Currently translated at 80.4% (439 of 546 strings)

Co-authored-by: Mārtiņš Bruņenieks <martinsb@gmail.com>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/lv/
Translation: Tusky/Tusky
2023-01-13 18:59:52 +00:00
xzFantom 1e04973c6a Translated using Weblate (Belarusian)
Currently translated at 100.0% (546 of 546 strings)

Co-authored-by: xzFantom <xzfantom@gmail.com>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/be/
Translation: Tusky/Tusky
2023-01-13 18:59:52 +00:00
Motasem Jouda ce522489af Translated using Weblate (Arabic)
Currently translated at 100.0% (546 of 546 strings)

Co-authored-by: Motasem Jouda <matsm123@gmail.com>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/ar/
Translation: Tusky/Tusky
2023-01-13 18:59:52 +00:00
Nik Clayton f28252bfd5
Keep all subclasses of PreferenceFragmentCompat (#3162)
* Mark *PreferencesFragment as @Keep

PreferenceFragment references them by string name, which doesn't work after
ProGuard has obfuscated the code in release mode. The name is no longer
valid and the app crashes.

Fixes https://github.com/tuskyapp/Tusky/issues/3161

* Prefer to keep Preference classes with a Proguard rule

Ensures that all PreferenceFragmentCompat are kept, to prevent the risk
that this could break in a new fragment where `@Keep` is accidentally
omitted.
2023-01-13 19:51:42 +01:00
Nik Clayton d6e7905e01
Reduce horizontal swipe sensitivity in timelines (#3148)
* Reduce horizontal swipe sensitivity in timelines

Fixes https://github.com/tuskyapp/Tusky/issues/2725, fixes https://github.com/tuskyapp/Tusky/issues/2112, fixes https://github.com/tuskyapp/Tusky/issues/2530, fixes https://github.com/tuskyapp/Tusky/issues/2200, fixes https://github.com/tuskyapp/Tusky/issues/2176, fixes https://github.com/tuskyapp/Tusky/issues/2112, fixes https://github.com/tuskyapp/Tusky/issues/1912, fixes https://github.com/tuskyapp/Tusky/issues/1718, fixes https://github.com/tuskyapp/Tusky/issues/1336

* Set scale factor to 4

* Catch exceptions, just in case
2023-01-13 19:51:09 +01:00
Nik Clayton e5e076b0d3
Convert BezelImageView, EndlessOnScrollListener, ComposeScheduleView, ProgressImageView to Kotlin (#3147)
* Convert BezelImageView to Kotlin

* Convert EndlessOnScrollListener to Kotlin

* Convert ComposeScheduleView to use view binding

* Convert ComposeScheduleView to Kotlin

* Convert ProgressImageView to Kotlin

* Apply reviewer feedback
2023-01-13 19:49:56 +01:00
Nik Clayton aa96d02923
Implement HTTP proxy summary as a SummaryProvider (#3091)
* Handle preference fragments using the framework

The previous code started new preference "screens" as activities, even though
each one hosted a single fragment.

Modify this to use the framework's support for swapping in/out different
preference fragments.

PreferencesActivity:
- Remove the code for launching tab and proxy preferences
- Remove the code for setting titles, each fragment is responsible for that
- Implement OnPreferenceStartFragmentCallback to swap fragments in/out with
  the correct animation

PreferencesFragment:
- Use `fragment` property instead of `setOnPreferenceClickListener`
- Set the activity title when resuming

Everything else:
- Set the activity title when resuming

* Implement HTTP proxy summary as a SummaryProvider

Uses the frameworks's support for setting summaries instead of rolling our
own.

Also fix a tiny bug -- the minimum port number to connect to should be 1,
not 0.

* Lint
2023-01-13 19:28:46 +01:00
Nik Clayton 9cf4882f41
Keep scroll position when loading missing statuses (#3000)
* Change "Load more" to load oldest statuses first in home timeline

Previous behaviour loaded missing statuses by using "since_id" and "max_id".
This loads the most recent N statuses, looking backwards from "max_id".

Change to load the oldest statuses first, assuming the user is scrolling
up through the timeline and will want to load statuses in reverse
chronological order.

* Scroll to the bottom of new entries added by "Load more"

- Remember the position of the "Load more" placeholder
- Check the position of inserted entries
- If they match, scroll to the bottom

* Change "Load more" to load oldest statuses first in home timeline

Previous behaviour loaded missing statuses by using "since_id" and "max_id".
This loads the most recent N statuses, looking backwards from "max_id".

Change to load the oldest statuses first, assuming the user is scrolling
up through the timeline and will want to load statuses in reverse
chronological order.

* Scroll to the bottom of new entries added by "Load more"

- Remember the position of the "Load more" placeholder
- Check the position of inserted entries
- If they match, scroll to the bottom

* Ensure the user can't have two simultaneous "Load more" coroutines

Having two simultanous coroutines would break the calculation used to figure
out which item in the list to scroll to after a "Load more" in the timeline.

Do this by:

- Creating a TimelineUiState and associated flow that tracks the "Load more"
  state
- Updating this in the (Cached|Network)TimelineViewModel
- Listening for changes to it in TimelineFragment, and notifying the adapter
- The adapter will disable any placeholder views while "Load more" is active

* Revert changes that loaded the oldest statuses instead of the newest

* Be more robust about locating the status to scroll to

Weirdness with the PagingData library meant that positionStart could still be
wrong after "Load more" was clicked.

Instead, remember the position of the "Load more" item and the ID of the
status immediately after it.

When new items are added, search for the remembered status at the position of
the "Load more" item. This is quick, testing at most LOAD_AT_ONCE items in
the adapter.

If the remembered status is not visible on screen then scroll to it.

* Lint

* Add a preference to specify the reading order

Default behaviour (oldest first) is for "load more" to load statuses and
stay at the oldest of the new statuses.

Alternative behaviour (if the user is reading from top to bottom) is to
stay at the newest of the new statuses.

* Move ReadingOrder enum construction logic in to the enum

* Jump to top if swipe/refresh while preferring newest-first order

* Show a circular progress spinner during "Load more" operations

Remove a dedicated view, and use an icon on the button instead.

Adjust the placeholder attributes and styles accordingly.

* Remove the "loadMoreActive" property

Complicates the code and doesn't really achieve the desired effect. If the
user wants to tap multiple "Load more" buttons they can.

* Update comments in TimelineFragment

* Respect the user's reading order preference if it changes

* Add developer tools

This is for functionality that makes it easier for developers to interact
with the app, or get it in to a known-state.

These features are for use by users, so are only visible in debug builds.

* Adjust how content is loaded based on preferred reading order

- Add the readingOrder to TimelineViewModel so derived classes can use it.
- Update the homeTimeline API to support the `minId` parameter and update
  calls in NetworkTimelineViewModel

In CachedTimelineViewModel:
- Set the bounds of the load to be the status IDs on either side of the
  placeholder ID (update TimelineDao with a new query for this)
- Load statuses using either minId or sinceId depending on the reading order
- Is there was no overlap then insert the new placeholder at the start/end
  of the list depending on reading order

* Lint

* Rename unused dialog parameter to _

* Update API arguments in tests

* Simplify ReadingOrder preference handling

* Fix bug with Placeholder and the "expanded" property

If a status is a Placeholder the "expanded" propery is used to indicate
whether or not it is loading.

replaceStatusRange() set this property based on the old value, and the user's
alwaysOpenSpoiler preference setting.

This shouldn't have been used if the status is a Placeholder, as it can lead
to incorrect loading states.

Fix this.

While I'm here, introduce an explicit computed property for whether a
TimelineStatusEntity is a placeholder, and use that for code clarity.

* Set the "Load more" button background to transparent

* Fix typo.

* Inline spec, update comment

* Revert 1480c6aa3a

Turns out the behaviour is not desired.

* Remove unnecessary Log call

* Extract function

* Change default to newest first
2023-01-13 19:26:24 +01:00
Goooler 394d098de7 Add an icon for IDEA to display 2023-01-13 15:48:06 +08:00
Goooler 5afd5f00a3 Run `ktlintFormat` 2023-01-13 15:34:16 +08:00
Goooler bc0d5b69d5 Bump deps 2023-01-13 15:32:19 +08:00
Goooler 0000991c82 Bump AGP to 7.4.0 2023-01-13 15:30:11 +08:00
Goooler f16323d473 Tweak flags 2023-01-13 15:29:37 +08:00
Goooler e2b8e2f190 Migrate to nonTransitive R class 2023-01-13 15:28:34 +08:00
Goooler 83e9f09e50 Disable buildFeatures flags by default 2023-01-13 15:28:34 +08:00
Goooler 1568e5e84f Enable build scan 2023-01-13 15:25:32 +08:00
Goooler 3d5ca84367 Ignore all build folders 2023-01-13 15:23:54 +08:00