Commit Graph

288 Commits

Author SHA1 Message Date
Josh Soref 98092e6ff7
Spelling (#2771)
* spelling: activity

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: animation

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: detailed

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: hierarchy

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: javascript

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: memory

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: notification

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: opened

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: preferable

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: repetitive

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: spoiler

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: thumbnail

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: visibility

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: whitespace

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-11-09 19:32:39 +01:00
Eva Tatarka be96aa576e
Show toast if pin fails (#2755)
* Show toast if pin fails

Fixes #2229

* Swtich to snackbar

* Show generic error message if no server error is available

* Fix pin error logging
2022-11-09 19:30:50 +01:00
Konrad Pozniak 8e9b356074
show rules on the login screen (#2746)
* show rules on the login screen

* fix code formatting

* fix code formatting

* fix tests
2022-11-05 17:37:20 +01:00
Konrad Pozniak 532afaad2b
warn before deleting a scheduled post (#2721) 2022-10-28 16:46:38 +02: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 0e892be48e
Add a description to the focus dialog (#2711)
* Show explanation atop focus set dialog

* Update app/src/main/res/layout/dialog_focus.xml

Per Connyduck suggestion

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

Co-authored-by: Konrad Pozniak <connyduck@users.noreply.github.com>
2022-10-15 19:04:27 +02:00
mcclure 7684f06938
Add UI for image-attachment "focus" (#2620)
* Attempt-zero implementation of a "focus" feature for image attachments. Choose "Set focus" in the attachment menu, tap once to select focus point (no visual feedback currently), tap "OK". Works in tests.

* Remove code duplication between 'update description' and 'update focus'

* Fix ktlint/bitrise failures

* Make updateMediaItem private

* When focus is set on a post attachment the preview focuses correctly. ProgressImageView now inherits from MediaPreviewImageView.

* Replace use of PointF for Focus where focus is represented, fix ktlint

* Substitute 'focus' for 'focus point' in strings

* First attempt draw focus point. Only updates on initial load. Modeled on code from RoundedCorners builtin from Glide

* Redraw focus after each tap

* Dark curtain where focus isn't (now looks like mastosoc)

* Correct ktlint for FocusDialog

* draft: switch to overlay for focus indicator

* Draw focus circle, but ImageView and FocusIndicatorView seem to share a single canvas

* Switch focus circle to path approach

* Correctly scale, save and load focuses. Clamp to visible area. Focus editor looks and feels right

* ktlint fixes and comments

* Focus indicator drawing should use device-independent pixels

* Shrink focus window when it gets unattractively tall (no linting, misbehaves on wide aspect ratio screens)

* Correct max-height behavior for screens in landscape mode

* Focus attachment result is are flipped on x axis; fix this

* Correctly thread focus through on scheduled posts, redrafted posts, and drafts (but draft focus is lost on post)

* More focus ktlint fixes

* Fix specific case where a draft is given a focus, then deleted, then posted in that order

* Fix accidental file change in focus PR

* ktLint fix

* Fix property style warnings in focus

* Fix remaining style warnings from focus PR

Co-authored-by: Conny Duck <k.pozniak@gmx.at>
2022-09-21 20:28:06 +02:00
Levi Bard 687cffd540
Show target domains for non-mention/non-hashtag links where the target domain is not provided or differs from the domain in the text (#2698)
* Show target domains for non-mention/non-hashtag links where the target domain is not provided or differs from the domain in the text.
Addresses #2694

* Add link signifier to the marked-up domain

* Back down on validating hashtags and mentions, don't markup _any_ urls where the text starts with #/@
2022-09-17 19:06:07 +02:00
Vivianne c908ebb3f1
Add display of handle when using multiple accounts (#2697)
- Shown on the main toolbar (subtitle)
- Shown just above the "replying to" message (even if not replying)
2022-09-17 19:05:56 +02:00
Levi Bard 0041acf2d4
Add language dropdown to compose view (#2651)
* Add UI for selecting post language

* Apply selected language when sending status

* Save/restore post language with drafts

* Fall back to english if the configured language isn't found in the locale list (no-NB)

* Remove comment about no_NB

* Move language dropdown to top of compose view

* Preserve language when redrafting

* Set default language to target post's language when replying

* Add Tusky license header to new source file

* Tweak language dropdown button width
2022-08-31 18:53:57 +02:00
Levi Bard c47d9ef6ac
Support setting filter expirations (#2667)
* Show filter expiration in list

* Add support for setting and updating the duration of a filter

* Add tests for duration conversion math

* Refactor network wrapper code

* Mark updated mastodon api functions as suspend

* Avoid creating unnecessary Date objects

* Apply suggestions to filter dialog layout
2022-08-17 17:50:34 +02:00
Levi Bard 042176e523
Add support for following hashtags (#2642)
* Add support for following hashtags. Addresses #2637

* Update rxjava to coroutines

* Update new tag api to use suspend functions

* Update hashtag unfollow icon

* Set correct tint on hashtag follow/unfollow icons

* Translate hashtag follow/unfollow error messages

* Toast => Snackbar

* Remove unnecessary view lookup
2022-08-07 19:09:26 +02:00
QuirkyPony 17fb93626c
adapt file size error messages to show real instance upload limit (#2630)
* remove megabyte counts from file size error messages

The file size limits depend on the server; change strings to reflect that.

* show real file size limits instead of assuming Mastodon defaults

* correct previous commit

* correct previous commit (again)

* remove megabyte counts from file size error messages

The file size limits depend on the server; change strings to reflect that.

* Translated using Weblate (Galician)

Currently translated at 100.0% (489 of 489 strings)

Co-authored-by: XoseM <xosem@disroot.org>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/gl/
Translation: Tusky/Tusky

* Translated using Weblate (Finnish)

Currently translated at 5.5% (1 of 18 strings)

Translation: Tusky/Tusky description
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky-app/fi/

* correct previous commit

correct previous commit (again)

fixed type error caused by previous commits

* fix lint error...

* Update strings.xml

* improve code, calculate correct max size and format it

Co-authored-by: Laura <the-ceo-of-antifa@protonmail.com>
Co-authored-by: XoseM <xosem@disroot.org>
Co-authored-by: Konrad Pozniak <k.pozniak@gmx.at>
2022-08-05 18:55:13 +02:00
Konrad Pozniak 8a0848d252
fix data loss when re-adding existing account (#2601) 2022-06-30 20:49:48 +02:00
mcclure 3ca8a0b549
Use specific term "image" in error UI, not "attachment" (#2592)
The new message for the crop feature, "The attachment could not be edited.", turned out to be awkward in some languages (French) where according to the translator it would be better to more specifically say "The image could not be edited." (as currently we can only edit images). Patch replaces error_media_edit_failed with a error_image_edit_failed and deletes the existing error_media_edit_failed-s.
2022-06-21 22:14:11 +02:00
mcclure 00c139190e
Ability to crop images attached to posts (#2531)
* First attachment crop attempt: Can crop in place, but does not delete/replace on server so has no effect

* Attachment crop feature works

* ktlint fixes on attachment crop patch

* Upgrade Android-Image-Cropper to 4.2.1

* An error message should be displayed if attachment cropping fails and it is not because the user intentionally cancelled.

* Remove 2 of the 3 "state passing" variables by using MediaUtils

* Cropper should use content uri (MIME type bearing) and setOutputCompressFormat so that PNGs reach the server safely.

* Change to crop requested by Conny: Store inflight cropImageItemOld in view model

* Change to crop requested by Conny: Sort cropImage with the other contracts

* ktlint fixes on attachment crop patch (again)
2022-05-22 21:01:14 +02:00
Levi Bard 4188670b42
Implement reply count indicator to track web UI (#2467)
Addresses #882
2022-05-20 16:47:45 +02:00
Konrad Pozniak 4c9cd4084b
show list title when viewing list timeline (#2503) 2022-05-17 19:55:26 +02:00
Martin Marconcini d97493d312
Issue 2477: Show account's creation date in Profile. (#2480)
* Show account's creation date in Profile.

* Fix broken test.

* Store account creation date in the Database.

* Reformat and reposition Joined Date according to PR Feedback.

* Revert "Store account creation date in the Database."

This reverts commit d9761f53 as it's not needed.

* Change Account's Creation Date to a java.util.Date.
Update Test.

* Fix wildcard import.

* Show full month instead of an abbreviation.

* Remove `lazy` usage in favor of local instantiation.

Co-authored-by: Martin Marconcini <martin.marconcini.rodriguez@nl.abnamro.com>
Co-authored-by: Konrad Pozniak <connyduck@users.noreply.github.com>
2022-05-17 19:49:42 +02:00
Peter Cai 9ec5d6e3b0
Push notifications support via UnifiedPush (#2303)
Fixes #793.

This is an implementation for push notifications based on UnifiedPush
for Tusky. No push gateway (other than UP itself) is needed, since
UnifiedPush is simple enough such that it can act as a catch-all
endpoint for WebPush messages. When a UnifiedPush distributor is present
on-device, we will by default register Tusky as a receiver; if no
UnifiedPush distributor is available, then pull notifications are used
as a fallback mechanism.

Because WebPush messages are encrypted, and Mastodon does not send the
keys and IV needed for decryption in the request body, for now the push
handler simply acts as a trigger for the pre-existing NotificationWorker
which is also used for pull notifications. Nevertheless, I have
implemented proper key generation and storage, just in case we would
like to implement full decryption support in the future when Mastodon
upgrades to the latest WebPush encryption scheme that includes all
information in the request body.

For users with existing accounts, push notifications will not be enabled
until all of the accounts have been re-logged in to grant the new push
OAuth scope. A small prompt will be shown (until dismissed) as a
Snackbar to explain to the user about this, and an option is added in
Account Preferences to facilitate re-login without deleting local drafts
and cache.
2022-05-17 19:32:09 +02:00
Konrad Pozniak beaed6b875
Fix crash when saving redrafted media to drafts (#2502)
* fix crash when saving draft from redraft

* fix crash when saving draft from redraft

* replace ... with …
2022-05-09 19:39:43 +02:00
Ivan Kupalov f3d7923803
Improve UX when Login WebView fails to load the page (#2492)
Previously we simply closed the screen with the login WebView which
could cause confusion. Now we specify that page could not be loaded.

As a side effect it will also show the error message which the server
returns (if any).
2022-05-03 19:14:55 +02:00
Martin Marconcini 260e25a0a4
Issue 2379: Make it possible to select text in posts. (#2472)
* Set TextIsSelectable on the corresponding view holders and remove a longpress listener to let Android select text.

* Revert changes, and make selectable text only in detailed status.

Remove long press listener to copy to clipboard (as it interferes with natural text selection on Android).

* Remove unused string (copy_to_clipboard_success) from all translations.

Co-authored-by: Martin Marconcini <martin.marconcini.rodriguez@nl.abnamro.com>
2022-04-30 19:05:44 +02:00
Konrad Pozniak e5b58770ce
improve LoginWebViewActivityUX (#2465) 2022-04-28 20:38:51 +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
Mélanie Chauvel 2fc3ba3cee
Replace “status” by “post” in strings name and source values (#2405) 2022-03-27 12:23:25 +02:00
Konrad Pozniak d9931e3d2c
Rename Toots to Posts (#2396)
* rename toots -> posts in strings

* extract tusky_compose_post_quicksetting_label string

* rename toot -> status in code
2022-03-20 20:21:42 +01:00
Levi Bard 7114575497
Instance configuration: the easy parts (#2341)
* Add data model for instance configuration

* Support instance.configuration.statuses.max_characters

* Support instance.configuration.statuses.characters_reserved_per_url

* Support instance.configuration.polls.max_options and max_characters_per_option

* Pacify ktlint

* Support instance-configured poll durations

* Fixup versions for migration after rebase
2022-03-01 19:43:36 +01: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
Konrad Pozniak 6d4f5ad027
migrate to paging 3 (#2182)
* migrate conversations and search to paging 3

* delete SearchRepository

* remove unneeded executor from search

* fix bugs in conversations

* update license headers

* fix conversations refreshing

* fix search refresh indicators

* show fullscreen loading while conversations are empty

* search bugfixes

* error handling

* error handling

* remove mastodon bug workaround

* update ConversationsFragment

* fix conversations more menu and deleting conversations

* delete unused class

* catch exceptions in ConversationsViewModel

* fix bug where items are not diffed correctly / cleanup code

* fix search progressbar display conditions
2021-06-17 18:54:56 +02:00
Konrad Pozniak 6c37cc770c
remove SavedToots (#2141)
* remove SavedToots

* fix tests
2021-05-16 19:17:56 +02:00
Konrad Pozniak dee6a3a160
always show follow requests in main menu (#1809)
* always show follow requests in main menu

* update recyclerview to v1.2.0

* fix bug that shows follow requests info to wrong users
2021-04-10 20:30:44 +02:00
Konrad Pozniak 0b86f58139
convert some regular strings to plural strings (#2100)
* convert some regular strings to plural strings

* convert hint_describe_for_visually_impaired from string to plurals

* fix ukrainian strings
2021-03-07 19:43:25 +01:00
Konrad Pozniak d2a8254d4f
add content description to account subscription button (#2076) 2021-02-18 19:26:25 +01: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
lenchan139 0275504a05
Move compose content's EditText cursor to first when shared content parsed in ComposeActivity (#2030)
* multiple media upload support

* multiple media upload support

* multiple media upload support

* remove  typing

* Update app/src/main/res/values/strings.xml

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

* remove magic number on string.xml and add to activity.

* move edittext cursor to first when shareBody parsed in ComposeActivity

Co-authored-by: Konrad Pozniak <connyduck@users.noreply.github.com>
2021-01-26 16:38:03 +01:00
Konrad Pozniak 940d6d395a
Drafts v2 (#2032)
* cleanup warnings, reorganize some code

* move ComposeAutoCompleteAdapter to compose package

* composeOptions doesn't need to be a class member

* add DraftsActivity and DraftsViewModel

* drafts

* remove unnecessary Unit in ComposeViewModel

* add schema/25.json

* fix db migration

* drafts

* cleanup code

* fix compose activity rotation bug

* fix media descriptions getting lost when restoring a draft

* improve deleting drafts

* fix ComposeActivityTest

* improve draft layout for almost empty drafts

* reformat code

* show toast when opening reply to deleted toot

* improve item_draft layout
2021-01-21 18:57:09 +01:00
Levi Bard baa915a0a3
Support opening unknown attachment types via `openLink` (#2044)
* Support opening unknown attachment types via openLink. #1970

* Fix label text for unknown attachment types
2021-01-18 13:53:13 +01:00
Levi Bard cb2296f248
Prompt before deleting lists (#2043)
* Prompt before deleting lists. #1998

* Address pull request feedback
2021-01-18 11:40:13 +01:00
Levi Bard be60155de5
Implement timed mutes. (#2035)
Fixes #2033
2021-01-15 21:05:36 +01:00
lenchan139 f7a630c1d8
multiple media upload support (#2029)
* multiple media upload support

* multiple media upload support

* multiple media upload support

* remove  typing

* Update app/src/main/res/values/strings.xml

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

* remove magic number on string.xml and add to activity.

Co-authored-by: Konrad Pozniak <connyduck@users.noreply.github.com>
2020-12-30 17:36:00 +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 e92e636a5c.

* 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
kyori19 fef4b8b07f
[needs help] Support announcements (#1977)
* Implement announcements activity

* Update reactions without api access

* Add badge style

* Use emptyList() as default parameter

* Simplify newIntent

* Use List instead of Array

* Remove unneeded ConstraintLayout

* Add lineSpacingMultiplier

* Fix wording

* Apply material design's default chip style

* Dismiss announcements automatically
2020-11-18 21:12:27 +01:00
Konrad Pozniak ce973ea7e7
Personal account notes (#1978)
* add personal notes to AccountActivity

* use RxJava instead of plain okhttp calls

* make AccountViewModel rx aware

* hide note input until data is loaded
2020-11-17 20:10:54 +01:00
Konrad Pozniak 26a051220b
improve relative poll timestamp string format (#1939) 2020-10-02 17:11:48 +02:00
Konrad Pozniak dd3d372b80 add setting to hide top toolbar 2020-08-16 10:01:51 +02:00
Mélanie Chauvel b3b4794a2b
Implement optional notifications muting for account muting (#1856) 2020-07-27 10:28:59 +02:00
Konrad Pozniak dfd30ec52a
correctly update the menu when muting domains (#1848) 2020-06-23 19:59:49 +02:00