Commit Graph

281 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
Abrar Wiryawan c0a06f7188
migrate `IOUtils` to Kotlin (#2763)
* migrate `IOUtils` to Kotlin

* Fix ktlint

* change functions inside IOUtils to extension function
2022-11-07 20:10:06 +01:00
Konrad Pozniak d17a0c43ab
Api 33 support (#2719)
* update to Api 33, fix some deprecations

* fix deprecated serializable/parcelable methods

* ask for notification permission

* fix code formatting

* add back comment in PreferencesActivity
2022-11-04 19:22:38 +01:00
Levi Bard 58e8f75287
Don't markup urls where the display text is exactly the domain (#2732)
* Don't markup urls where the display text is exactly the domain (or www.thedomain)

* Remove unused arguments
2022-11-01 16:41:55 +01:00
Levi Bard 5d09a67b52
Fix the tag span generation for tags with nonascii characters (#2700)
* Update mention and tag regexes from mastodon

* Normalize nonascii tag names the same way that mastodon does
2022-09-17 19:06:45 +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
Konrad Pozniak c8fc2418b8
AccountMediaFragment improvements (#2684)
* initial setup

* add spacing between images

* use blurhash

* handle hidden state and show video indicator

* handle item clicks

* small cleanup

* move SquareImageView into account.media package

* fix build

* improve AccountMediaGridAdapter

* handle loadstate, errors and refreshing

* remove commented out code

* log error

* show audio attachments with icon

* fix glitchy transition animation

* set image Description on imageview

* show toast with media description on long press
2022-09-02 16:52:47 +02:00
Konrad Pozniak 741461acde
rewrite threads with Kotlin & coroutines (#2617)
* initial class setup

* handle events and filters

* handle status state changes

* code formatting

* fix status filtering

* cleanup code a bit

* implement removeAllByAccountId

* move toolbar into fragment, implement menu

* error and load state handling

* fix pull to refresh

* implement reveal button

* use requireContext() instead of context!!

* jump to detailed status

* add ViewThreadViewModelTest

* fix ktlint

* small code improvements (thx charlag)

* add testcase for toggleRevealButton

* add more state change testcases to ViewThreadViewModel
2022-08-15 11:00:18 +02:00
Konrad Pozniak 4f0f9a7a12
update Kotlin to 1.7.10 and fix some (new?) warnings (#2647)
* update Kotlin to 1.7.10 and fix some (new?) warnings

* remove unused import
2022-08-07 19:36:09 +02:00
Konrad Pozniak 55796c9a30
update minSdkVersion to 23 (#2638)
closes #2606
2022-08-04 16:48:26 +02:00
Konrad Pozniak 1b6a0908f6
Handle even more instance defaults (#2612)
* handle media size instance limits

* remove unused attributes from Instance entity

* support max_media_attachments

* support pleroma field limits, remove max_bio_chars support

* improve field input margin

* fix tests

* MAX_ACCOUNT_FIELDS -> DEFAULT_MAX_ACCOUNT_FIELDS

* improve "add field" button behavior

* fix copy paste mistake in AccountFieldEditAdapter

* refactor sendStatus to be a suspending function
2022-07-26 20:24:50 +02:00
Konrad Pozniak 62c4cfde89
improve media upload error messages (#2602) 2022-06-30 20:51:05 +02:00
Konrad Pozniak e1c8461423
replace kotlin-result-calladapter with networkresult-calladapter (#2569)
* replace kotlin-result-calladapter with networkresult-calladapter

* fix tests
2022-05-30 20:03:40 +02:00
Konrad Pozniak cec8f6dd65
modernize autocomplete (#2510)
* modernize autocomplete

* use @WorkerThread annotation
2022-05-17 19:55:37 +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
Guntbert Reiter 9a8dfaa744
Remove code to check the server version (#2469)
solves #2439
2022-04-29 18:35:25 +02: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
Mélanie Chauvel e0abcbfada
Improve time format of posts when using absolute time (#2413)
* Improve time format of posts when using absolute time

* fix AbsoluteTimeFormatter, add tests

* fix tests

Co-authored-by: Conny Duck <k.pozniak@gmx.at>
2022-04-18 21:41:18 +02:00
Konrad Pozniak 027b659d1c
fix notifications showing unparsed html (#2436) 2022-04-16 09:44:05 +02:00
Konrad Pozniak 3e849244f9
move Html parsing to ViewData (#2414)
* move Html parsing to ViewData

* refactor reports to use viewdata

* cleanup code

* refactor conversations

* fix getEditableText

* rename StatusParsingHelper

* fix tests

* commit db schema file

* add file header

* rename helper function to parseAsMastodonHtml

* order imports correctly

* move mapping off main thread to default dispatcher

* fix ktlint
2022-04-15 13:20:27 +02:00
Constantin A 4011242257
Update emoji font versions to 14 (#2411) 2022-03-31 19:02:42 +02:00
Levi Bard ad001d044d
Revert unintentional behavior change for mention spans to use remote usernames (#2408) 2022-03-30 19:33:31 +02:00
Konrad Pozniak f2529a8e61
Fix Timeline not loading (#2398)
* fix cached timeline

* fix network timeline

* delete unused inc / dec extensions

* fix tests and bug in network timeline

* add db migration

* remove unused import

* commit 31.json

* improve placeholder inserting logic, add comment

* fix tests

* improve tests
2022-03-28 18:39:16 +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
kyori19 72bb34bf27
Fix some network timeline bugs (#2373)
* Fix network timeline gap loading

* Fix fullReload keeps nextKey

* Fix reload after clearing timeline

* Improve logic to handle overlapped statuses
2022-03-12 09:38:48 +01:00
Konrad Pozniak b145fc9d50
fix String.inc() and String.dec() not being inverse operations (#2355) 2022-03-01 21:29:05 +01:00
Levi Bard cdefcc441f
Fix relinkifying tags in posts from remote servers (#2359)
* Fix relinkifying tags in posts from remote servers

* Completely ignore urls, and (case-insensitively) match tag names instead
2022-02-28 16:54:25 +01:00
Levi Bard addce87eb6
Use tags from status when adding handlers to hashtag spans in status content (#2344)
* Migrate LinkHelper to kotlin

* Support tags field on statuses

* Use embedded tags list in status instead of text scraping to embed tag click handler.
Fixes #2283

* Make mentions and tags lists nonnullable

* Make LinkHelper.openLink a Context extension method

* Use builtin extension for uri conversion

* More cleanup in LinkHelper

* Add tests for LinkHelper.getDomain

* Unbreak tags in places that don't have a tag list (e.g. profiles)

* Fixup javadoc
2022-02-25 18:56:21 +01:00
Konrad Pozniak c20effe6c9
fix some mentions not being opened in Tusky (#2339)
* fix some mentions not being opened in Tusky

* link PR in code
2022-02-15 17:04:00 +01:00
Konrad Pozniak 329bc51f90
fix apng emojis not rendered when animation is turned off (#2312) 2022-02-05 08:56:24 +01:00
Konrad Pozniak 6c5c628b90
delete unused class NetworkState (#2301) 2022-01-23 20:25:06 +01:00
Konrad Pozniak 643e012b11
Timeline paging (#2238)
* first setup

* network timeline paging / improvements

* rename classes / move to correct package

* remove unused class TimelineAdapter

* some code cleanup

* remove TimelineRepository, put mapper functions in TimelineTypeMappers.kt

* add db migration

* cleanup unused code

* bugfix

* make default timeline settings work again

* fix pinning statuses from timeline

* fix network timeline

* respect account settings in NetworkTimelineRemoteMediator

* respect account settings in NetworkTimelineRemoteMediator

* update license headers

* show error view when an error occurs

* cleanup some todos

* fix db migration

* fix changing mediaPreviewEnabled setting

* fix "load more" button appearing on top of timeline

* fix filtering and other bugs

* cleanup cache after 14 days

* fix TimelineDAOTest

* fix code formatting

* add NetworkTimeline unit tests

* add CachedTimeline unit tests

* fix code formatting

* move TimelineDaoTest to unit tests

* implement removeAllByInstance for CachedTimelineViewModel

* fix code formatting

* fix bug in TimelineDao.deleteAllFromInstance

* improve loading more statuses in NetworkTimelineViewModel

* improve loading more statuses in NetworkTimelineViewModel

* fix bug where empty state was shown too soon

* reload top of cached timeline on app start

* improve CachedTimelineRemoteMediator and Tests

* improve cached timeline tests

* fix some more todos

* implement TimelineFragment.removeItem

* fix ListStatusAccessibilityDelegate

* fix crash in NetworkTimelineViewModel.loadMore

* fix default state of collapsible statuses

* fix default state of collapsible statuses -tests

* fix showing/hiding media in the timeline

* get rid of some not-null assertion operators in TimelineTypeMappers

* fix tests

* error handling in CachedTimelineViewModel.loadMore

* keep local status state when refreshing cached statuses

* keep local status state when refreshing network timeline statuses

* show placeholder loading state in cached timeline

* better comments, some code cleanup

* add TimelineViewModelTest, improve code, fix bug

* fix ktlint

* fix voting in boosted polls

* code improvement
2022-01-11 19:00:29 +01:00
Konrad Pozniak d1d564a7e2
support animated PNGs and WEBPs (#2244) 2021-10-09 10:45:41 +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
Levi Bard d07c1b098e
Highlight your own votes when displaying poll results (#2242)
* Highlight your own votes when displaying poll results

* Unbreak tests

* Add a checkmark to the description of self-voted options
2021-09-17 22:12:17 +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 554820de5f
migrate reporting to paging 3 (#2205)
* migrate reporting to paging 3

* apply PR feedback
2021-06-20 10:58:19 +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 31da851f28
correctly serialize custom spans to html (#2199) 2021-06-14 11:00:35 +02:00
Ivan Kupalov 44a5b42cac
Timeline refactor (#2175)
* Move Timeline files into their own package

* Introduce TimelineViewModel, add coroutines

* Simplify StatusViewData

* Handle timeilne fetch errors

* Rework filters, fix ViewThreadFragment

* Fix NotificationsFragment

* Simplify Notifications and Thread, handle pin

* Redo loading in TimelineViewModel

* Improve error handling in TimelineViewModel

* Rewrite actions in TimelineViewModel

* Apply feedback after timeline factoring review

* Handle initial failure in timeline correctly
2021-06-11 20:15:40 +02:00
Konrad Pozniak ca5c455881
update AndroidX, use ActivityResultContracts (#2170)
* update AndroidX, use ActivityResultContracts

* make allowMultiple setable in PickMediaFiles

* add license headers to PickMediaFiles
2021-05-22 17:50:08 +02:00
Konrad Pozniak 751109ac39
upgrade kotlin to 1.5.0 (#2162)
* upgrade kotlin to 1.5.0

* don't explicitly set kotlin jvmtarget
2021-05-21 17:51:35 +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 6c37cc770c
remove SavedToots (#2141)
* remove SavedToots

* fix tests
2021-05-16 19:17:56 +02:00
Konrad Pozniak bf6d7a6b97
Convert TimelineFragment to Kotlin & ViewBinding (#2131)
* convert TimelineFragment to Kotlin

* cleanup some code

* migrate to viewbinding

* cleanup even more code

* address review feedback

* improve findStatusOrReblogPositionById
2021-04-22 18:48:16 +02:00
Konrad Pozniak bea5098cc1
migrating to ViewBinding part 4: Fragments (#2108)
* migrating to ViewBinding part 4: Fragment

* fix imports

* don't use viewBinding extension in ViewImage and ViewVideoFragment

* don't use viewBinding extension in ViewImage and ViewVideoFragment
2021-03-13 21:27:20 +01:00
Konrad Pozniak fc4b47aee4
migrating to ViewBinding part 4: Adapters (#2095) 2021-03-07 19:24:01 +01:00
Konrad Pozniak 22bed19d90
migrating to ViewBinding part 3: EmojiPreference (#2094) 2021-03-07 19:06:05 +01:00
Konrad Pozniak ff69a2ad0d
migrating to ViewBinding part 2: Activities (#2093) 2021-03-07 19:05:51 +01:00
kyori19 cf642d9eb0
Avoid using displayName for displaying purpose (#2101) 2021-03-05 16:26:51 +01:00