Commit Graph

28 Commits

Author SHA1 Message Date
sanao ff39f9b3c2
feat: Hide self-boosts (#3534) (#4101)
# Overview
Some Mastodon posters have a annoying habit of boosting their own posts
some time after they've posted them.
 No need to see the same toot over and over again.

# Changes made
- Add an additional option to the "Filters > Tabs" preference to show
these self-boosts (default: on)
- If "Show boosts" is turned off, self-boosts are automatically hidden.
    
# Screenshot
***screen of "Filters > Tabs" preference***
before | after
:--: | :--:
| <image
src="https://github.com/tuskyapp/Tusky/assets/62137820/16ed2f4a-0776-4f60-afe6-29827acf5bbd"
width="300"> |<image
src="https://github.com/tuskyapp/Tusky/assets/62137820/9d4e1457-f71d-440c-959f-b91f7433b29a"
width="300" />

***screen of Home Timeline***
***switch-on(self-boosts are displayed)*** | ***swith-off(self-boosts
are not displayed)***
:--: | :--:
| <image
src="https://github.com/tuskyapp/Tusky/assets/62137820/3bb80791-a81f-4cbc-98ad-8a14602e53a4"
width="300" />|<image
src="https://github.com/tuskyapp/Tusky/assets/62137820/a7964da8-d106-4209-b911-460ef8988831"
width="300" />

# Related issue
 Fixes #3534
2023-11-13 10:04:39 +01:00
Konrad Pozniak ff1c4a4b27
fix theme preference defaults (#4061)
closes #4060 

Also I noticed that we had the theme defaults twice in the code so I
refactored a bit so only one are still in there.
2023-10-14 14:20:20 +02:00
Mylloon bb1868fd67
Add system black theme (#3957)
Close #1222
2023-09-13 11:14:20 +02:00
Conny Duck af5ec068e8 use PrefKeys everywhere 2023-09-11 19:12:33 +02:00
SpaceFox 85888ac238
Uses the system theme as default theme (#3813)
Set the "System Design" as the default theme.

This ensures that the app's initial behaviour respect's the user's system-wide theme choice, while still allowing the user to adjust it later.

This is only done for new installs of Tusky. If the user is upgrading from a previous release and they did not have an explicit theme set then the dark theme is used, and the UX does not change.
2023-08-23 15:04:24 +02:00
Nik Clayton 059352f471
Display notification filter/clear actions as menu items (#3877)
Previously the notification filter and clear actions were shown as
buttons in the UI, with a preference that determined whether they were
displayed.

Remove this preference, and display them as menu items.

- "Filter notifications" is shown as an icon, if possible
- "Clear notifications" is only ever shown as a menu item, to reduce the
chance the user inadvertently selects it

To ensure that the options menu appears correctly, remove the code that
creates a "fake" action bar, and adjust the layouts so that there are
three toolbars;

- mainToolbar -- displays the icons, and the current "location" (Home,
Notifications, etc)
- topNav -- displays the row of tabs at the top
- bottomNav -- displays the row of tabs at the bottom

Only one of them is set as the support action bar (depending on the
user's preferences). This provides the "show a logo" and "show the
options menu" functionality as standard, without needing to re-implement
as the previous code did.
2023-08-19 14:41:10 +02:00
Nik Clayton fe7b1529df
Provide a preference to scale all UI text (#3248)
Font scaling is applied in addition to any scaling set in Android system preferences. So if the user set the Android font size to largest (a 1.3x increase) and then sets the preference to 120%, the total change is 1.56x.

Create SliderPreference to adjust the preference.

- Use Slider, which supports float values and step sizes > 1
- Display the selected value in the preference's summary
- Provide buttons to increment / decrement the value

Restart the activity if the preference changes so that the user sees the impact of the change immediately. Fix a bug in PreferencesActivity where the "EXTRA_RESTART_ON_BACK" intent was never processed. Fix this to ensure that other activities are restarted so the new font scale takes effect.

Implement the scaling in BaseActivity by overriding onAttachBaseContext, and providing a wrapped context with the font scaling applied.

Fixes https://github.com/tuskyapp/Tusky/issues/2982, https://github.com/tuskyapp/Tusky/issues/2461
2023-06-29 18:34:56 +02:00
Grigorii Ioffe 75e7b9f1a5
Show toot stat inline (#3413)
* Show toot stat inline

* Correct elements position

* Format stats and show it according to setting

* inline toot statistics setting

* Code formatting

* Use kotlin functions

* Change the statistics setting description

* Use capital letters for all variants

* increase the statistics margin

* Merge fixes

* Code review fixes

* move setReblogsCount and setFavouritedCount to StatusViewHolder

* code cleaning

* code cleaning

* import lexicographical order

---------

Co-authored-by: Grigorii Ioffe <zikasaks@gmail.com>
Co-authored-by: grigoriiioffe <zikasaks@icloud.com>
2023-03-18 08:57:26 +01:00
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 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 1480c6aa3ac5c0c2d362fb271f47ea2259ab14e2

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
Levi Bard 588307f7a1
Enable setting the default posting language from Tusky (#2946)
* Extract locale utils

* Extract makeIcon

* Allow setting the (server-synchronized) default posting language from Tusky.
Closes #2902

* Add copyright headers

* Address review feedback
2022-12-02 19:19:17 +01:00
Levi Bard 6b95790457
Add support for moderation report notifications (#2887)
* Add support for moderation report notifications

* Translate report categories

* Apply tint inside flag drawable

* Remove unused imports

Co-authored-by: Konrad Pozniak <connyduck@users.noreply.github.com>
2022-12-01 20:11:55 +01:00
mcclure 85a6b2d96b
Preference to disable multiple-login usernames (#2718)
* Preference to disable multiple-login usernames (with problems)

* Fix problem where 'show self username disambiguation' does not take effect immediately because MainActivity needed to be restarted

* Make 'show username in toolbars' a 3-option selector, default when multiple accounts logged in

* Move SHOW_SELF_USERNAME higher in preference fragment
2022-10-18 19:38:17 +02:00
mcclure 06e32f703a
Fix unintended [mismatched] show-replies preference (with key force-reset) (#2568)
* Fix unintended [mismatched] show-replies preference and add a comment to prevent confusion.

* Change the key on TAB_FILTER_HOME_REPLIES to reset everyone's value here once.
2022-05-29 19:21:33 +02:00
Levi Bard dff039e123
Add support for post edit notifications (#2431)
* Add support for post edit notifications

* Update notification icon
2022-04-19 11:10:13 +02:00
kyori19 d21d045eda
Support new signup notifications (#2357) 2022-04-14 19:39:30 +02:00
Colin Kinloch c37ccbb6e8
Add confirmation for favourite and bookmark actions (#2245)
* Add confirmation for favourite and bookmark actions

* Favourite confirmation american spelling and default values

* Remove bookmarking confirmation

* Update app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java

Co-authored-by: Konrad Pozniak <connyduck@users.noreply.github.com>

Co-authored-by: Konrad Pozniak <connyduck@users.noreply.github.com>
2021-10-04 07:48:44 +02:00
Alibek Omarov 9580870445
Animated emoji support (#2064)
* Animated emoji support

* Try to query preference only once

* Revert to using SpannableStringBuilder
2021-02-06 08:14:51 +01:00
Garrit Franke 0fbb4e9713
Wellbeing mode (#1992)
* Add wellbeing mode settings toggle

* Translate wellbeing mode string to german

* Disable fav/boost count on toots if wellbeing is enabled

* Hide follow/post stats on profiles

* Reload notifications when wellbeing mode is toggled

* Add wellbeing mode explainer dialog

* Move wellbeing filter timeline into own category

* Add toggles for quantitative stats

* Hide announcement badge counts if wellbeing is enabled

* Move fetching of wellbeing setting to activity

* Add wellbeing option to statusDisplayOptions

* Update post filters for all accounts

* Remove local translations

* Revert "Remove local translations"

This reverts commit e92e636a5c759b09649174ab68ec91bc13680287.

* Remove german translations
2020-12-23 19:13:37 +01:00
Alibek Omarov b91a0aceeb
Notification bell (#2012)
* Add notification bell button, API endpoints and new relationship field

* Add notification type for subscriptions

* Add subscriptions to legacy notification filtering

* Update schemas

* Fix build

* Make rewrite static method into method of Notification class, fix getNotificationText

* Mastodon wording for subscriptions
2020-12-23 12:52:39 +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
Karol Kosek a010687709
SettingsConstants: fix home tab filters (#1906)
Showing repeats was swapped with showing replies.
2020-08-21 09:15:53 +02:00
Konrad Pozniak dd3d372b80 add setting to hide top toolbar 2020-08-16 10:01:51 +02:00
Konrad Pozniak e2f3c74774
Fix cards in timelines/confirm boost preferences (#1878) 2020-08-08 10:03:07 +02:00
Konrad Pozniak 74bd493878
add possibility to move the main navigation to the bottom (#1808)
* add possibility to move the main navigation to the bottom

* add top toolbar with drawer toggle, title and search button
2020-06-18 11:04:53 +02:00
Ivan Kupalov c64df0fd1d
Settings refactor (#1615)
* Refactor main preferences to use DSL

* Refactor account preferences to use DSL

* Use DSL in rest of the preference screens

* Preferences cleanup

* Fix preference dependencies
2020-06-08 09:21:12 +02:00