Commit Graph

57 Commits

Author SHA1 Message Date
kyori19 9b5f176008
Merge remote-tracking branch 'tuskyapp/develop' 2023-12-08 02:14:28 +09:00
UlrichKu b286255630
3532: Show badge on conversations tab on new conversations (#3890)
Fixes #3532

(Old PR, now closed: https://github.com/tuskyapp/Tusky/pull/3533)

Listens on new notifications and if a "direct mention" is detected a
badge (red dot) is shown on the conversations tab if present.

I am missing things like this a lot and also big accounts are unhappy
with the usability so far:
https://mastodon.social/@pallenberg/110129889996182814
2023-10-15 21:39:38 +02:00
Nik Clayton b6102a755a
Rename "Trending" to "TrendingTags" or similar where necessary (#3906)
The "trending" functionality will expand to include trending links and
posts. But at the moment the "Trending" references in the code are
exclusively to hashtags.

Rename "Trending" to "TrendingTags" or similar everywhere necessary in
order to prepare for this.

This includes a database migration, as the identifier for the "Trending
tags" tab in the account preferences was changed from "Trending" to
"TrendingTags". The migration updates the stored value if necessary.
2023-08-19 12:54:35 +02:00
Konrad Pozniak ee711598c7
Cache locked state of connected accounts (#3790)
Small improvement to the behavior on bad/disconnected networks

Fixes https://github.com/tuskyapp/Tusky/issues/3773
2023-07-27 00:09:26 +02:00
kyori19 4b9fb2f0bb
Merge remote-tracking branch 'tuskyapp/develop'
# Conflicts:
#	.gitignore
#	README.md
#	app/build.gradle
#	app/src/green/res/mipmap-hdpi/ic_launcher.png
#	app/src/green/res/mipmap-mdpi/ic_launcher.png
#	app/src/green/res/mipmap-xhdpi/ic_launcher.png
#	app/src/green/res/mipmap-xxhdpi/ic_launcher.png
#	app/src/green/res/mipmap-xxxhdpi/ic_launcher.png
#	app/src/main/java/com/keylesspalace/tusky/EditProfileActivity.kt
#	app/src/main/java/com/keylesspalace/tusky/MainActivity.kt
#	app/src/main/java/com/keylesspalace/tusky/StatusListActivity.kt
#	app/src/main/java/com/keylesspalace/tusky/TabData.kt
#	app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java
#	app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java
#	app/src/main/java/com/keylesspalace/tusky/appstore/Events.kt
#	app/src/main/java/com/keylesspalace/tusky/components/account/AccountActivity.kt
#	app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeActivity.kt
#	app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeViewModel.kt
#	app/src/main/java/com/keylesspalace/tusky/components/conversation/ConversationEntity.kt
#	app/src/main/java/com/keylesspalace/tusky/components/conversation/ConversationsFragment.kt
#	app/src/main/java/com/keylesspalace/tusky/components/preference/PreferencesActivity.kt
#	app/src/main/java/com/keylesspalace/tusky/components/preference/PreferencesFragment.kt
#	app/src/main/java/com/keylesspalace/tusky/components/report/fragments/ReportStatusesFragment.kt
#	app/src/main/java/com/keylesspalace/tusky/components/search/SearchViewModel.kt
#	app/src/main/java/com/keylesspalace/tusky/components/search/fragments/SearchStatusesFragment.kt
#	app/src/main/java/com/keylesspalace/tusky/components/timeline/TimelineFragment.kt
#	app/src/main/java/com/keylesspalace/tusky/components/timeline/TimelineTypeMappers.kt
#	app/src/main/java/com/keylesspalace/tusky/components/timeline/viewmodel/TimelineViewModel.kt
#	app/src/main/java/com/keylesspalace/tusky/components/viewthread/ViewThreadFragment.kt
#	app/src/main/java/com/keylesspalace/tusky/db/TimelineDao.kt
#	app/src/main/java/com/keylesspalace/tusky/db/TimelineStatusEntity.kt
#	app/src/main/java/com/keylesspalace/tusky/di/ActivitiesModule.kt
#	app/src/main/java/com/keylesspalace/tusky/di/FragmentBuildersModule.kt
#	app/src/main/java/com/keylesspalace/tusky/di/ViewModelFactory.kt
#	app/src/main/java/com/keylesspalace/tusky/entity/NewStatus.kt
#	app/src/main/java/com/keylesspalace/tusky/entity/Status.kt
#	app/src/main/java/com/keylesspalace/tusky/entity/TimelineAccount.kt
#	app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java
#	app/src/main/java/com/keylesspalace/tusky/service/SendStatusService.kt
#	app/src/main/java/com/keylesspalace/tusky/settings/SettingsConstants.kt
#	app/src/main/java/com/keylesspalace/tusky/util/StatusDisplayOptions.kt
#	app/src/main/java/com/keylesspalace/tusky/util/StatusParsingHelper.kt
#	app/src/main/res/layout/activity_about.xml
#	app/src/main/res/layout/activity_main.xml
#	app/src/main/res/layout/item_status.xml
#	app/src/main/res/layout/item_status_notification.xml
#	app/src/main/res/values-ar/strings.xml
#	app/src/main/res/values-be/strings.xml
#	app/src/main/res/values-bn-rBD/strings.xml
#	app/src/main/res/values-ca/strings.xml
#	app/src/main/res/values-cy/strings.xml
#	app/src/main/res/values-de/strings.xml
#	app/src/main/res/values-es/strings.xml
#	app/src/main/res/values-eu/strings.xml
#	app/src/main/res/values-fa/strings.xml
#	app/src/main/res/values-fr/strings.xml
#	app/src/main/res/values-gd/strings.xml
#	app/src/main/res/values-gl/strings.xml
#	app/src/main/res/values-hu/strings.xml
#	app/src/main/res/values-in/strings.xml
#	app/src/main/res/values-is/strings.xml
#	app/src/main/res/values-it/strings.xml
#	app/src/main/res/values-ja/strings.xml
#	app/src/main/res/values-lv/strings.xml
#	app/src/main/res/values-nb-rNO/strings.xml
#	app/src/main/res/values-night/theme_colors.xml
#	app/src/main/res/values-oc/strings.xml
#	app/src/main/res/values-pl/strings.xml
#	app/src/main/res/values-pt-rBR/strings.xml
#	app/src/main/res/values-ru/strings.xml
#	app/src/main/res/values-sa/strings.xml
#	app/src/main/res/values-sv/strings.xml
#	app/src/main/res/values-tr/strings.xml
#	app/src/main/res/values-uk/strings.xml
#	app/src/main/res/values-vi/strings.xml
#	app/src/main/res/values-zh-rCN/strings.xml
#	app/src/main/res/values/attrs.xml
#	app/src/main/res/values/styles.xml
#	app/src/main/res/values/theme_colors.xml
#	app/src/test/java/com/keylesspalace/tusky/BottomSheetActivityTest.kt
#	app/src/test/java/com/keylesspalace/tusky/FilterV1Test.kt
#	app/src/test/java/com/keylesspalace/tusky/components/timeline/StatusMocker.kt
#	app/src/test/java/com/keylesspalace/tusky/db/TimelineDaoTest.kt
#	app/src/test/java/com/keylesspalace/tusky/usecase/TimelineCasesTest.kt
#	app/src/test/java/com/keylesspalace/tusky/util/RickRollTest.kt
#	assets/tusky_banner.xcf
#	fastlane/metadata/android/ca/changelogs/58.txt
#	fastlane/metadata/android/ca/full_description.txt
#	fastlane/metadata/android/de/changelogs/58.txt
#	fastlane/metadata/android/de/changelogs/61.txt
#	fastlane/metadata/android/de/changelogs/67.txt
#	fastlane/metadata/android/de/changelogs/68.txt
#	fastlane/metadata/android/de/changelogs/70.txt
#	fastlane/metadata/android/de/changelogs/72.txt
#	fastlane/metadata/android/de/changelogs/74.txt
#	fastlane/metadata/android/de/changelogs/77.txt
#	fastlane/metadata/android/de/changelogs/80.txt
#	fastlane/metadata/android/de/changelogs/82.txt
#	fastlane/metadata/android/de/changelogs/83.txt
#	fastlane/metadata/android/de/changelogs/87.txt
#	fastlane/metadata/android/de/changelogs/89.txt
#	fastlane/metadata/android/de/changelogs/94.txt
#	fastlane/metadata/android/de/full_description.txt
#	fastlane/metadata/android/de/short_description.txt
#	fastlane/metadata/android/fa/changelogs/58.txt
#	fastlane/metadata/android/it/changelogs/58.txt
#	gradle.properties
#	gradle/libs.versions.toml
#	instance-build.gradle
2023-06-02 00:54:05 +09:00
Nik Clayton d644f6e6f3
Save the a copy of the notification marker ID locally (#3672)
Not all servers support the marker API. If they don't the user will
potentially get duplicate Android notifications.

To resolve this, store a copy of the notification marker ID locally as
well. Defer to the remote marker if it exists (and is newer than the
local marker).

Fixes https://github.com/tuskyapp/Tusky/issues/3671
2023-05-18 23:23:42 +02:00
Nik Clayton 81b15e72f3
Only fetch and display a given notification once (#3626)
When fetching:

- Maintain a marker with the position of the newest fetched notification
- Use the marker to determine which notifications to fetch
- Fetch notifications with min_id to ensure that none are lost
- Update the marker as necessary
- Perform a one-time immediate fetch of notifications on startup

When creating notifications:

- Identify each notification with tag=${MastodonNotificationId}, id=${account.id}
- Remove activeNotifications field, it's no longer necessary
- Use the tag/id tuple to reliably identify existing notifications and avoid creating duplicates
- Cancelling notifications for an account must iterate over all the notifications, and individually remove the notifications that exist for that account.
- Limit notifications to a maximum of 40 (excluding summary notifications)
- Remove notifications (oldest first) to get under this limit
- Rate limit notification creation to 1 per second, so the OS won't drop them

Adjust the summary notification:

- Ensure the summary notification and the child notifications have the same group key
- Dismiss the summary notification if there is only one child notification

NotificationClearBroadcastReceiver is no longer needed, so remove it, and the need for deletePendingIntent.

Fixes #3625, #3539
2023-05-13 16:00:28 +02:00
Nik Clayton 367240a612
Save the user's reading position in the home timeline (#3614)
- Add a field to AccountEntity to hold the reading position
- Provide a method to save in the viewmodel to save the position
- Save the position when TimelineFragment pauses

Does not restore the position yet.
2023-05-08 13:57:17 +02:00
Levi Bard ff8dd37855
Support the mastodon 4 filter api (#3188)
* Replace "warn"-filtered posts in timelines and thread view with placeholders

* Adapt hashtag muting interface

* Rework filter UI

* Add icon for account preferences

* Clean up UI

* WIP: Use chips instead of a list. Adjust padding

* Scroll the filter edit activity

Nested scrolling views (e.g., an activity that scrolls with an embedded list
that also scrolls) can be difficult UI.

Since the list of contexts is fixed, replace it with a fixed collection of
switches, so there's no need to scroll the list.

Since the list of actions is only two (warn, hide), and are mutually
exclusive, replace the spinner with two radio buttons.

Use the accent colour and title styles on the different heading titles in
the layout, to match the presentation in Preferences.

Add an explicit "Cancel" button.

The layout is a straightforward LinearLayout, so use that instead of
ConstraintLayout, and remove some unncessary IDs.

Update EditFilterActivity to handle the new layout.

* Cleanup

* Add more information to the filter list view

* First pass on code review comments

* Add view model to filters activity

* Add view model to edit filters activity

* Only use the status wrapper for filtered statuses

* Relint

---------

Co-authored-by: Nik Clayton <nik@ngo.org.uk>
2023-03-11 13:12:50 +01:00
kyori19 52a757e572
Merge remote-tracking branch 'tuskyapp/develop'
# Conflicts:
#	app/build.gradle
#	app/src/main/java/com/keylesspalace/tusky/MainActivity.kt
#	app/src/main/java/com/keylesspalace/tusky/components/account/AccountActivity.kt
#	app/src/main/java/com/keylesspalace/tusky/components/login/LoginActivity.kt
#	app/src/main/res/values-cy/strings.xml
#	app/src/main/res/values-eu/strings.xml
#	app/src/main/res/values-ja/strings.xml
#	app/src/main/res/values-oc/strings.xml
#	app/src/main/res/values-pt-rBR/strings.xml
#	app/src/main/res/values-zh-rCN/strings.xml
#	app/src/main/res/values-zh-rSG/strings.xml
#	app/src/test/java/com/keylesspalace/tusky/MainActivityTest.kt
#	fastlane/metadata/android/en-US/images/phoneScreenshots/00_login.png
2023-01-29 04:50:36 +09:00
kyori19 eeb6c3c96b
Merge remote-tracking branch 'tuskyapp/develop'
# Conflicts:
#	app/build.gradle
#	app/src/main/java/com/keylesspalace/tusky/MainActivity.kt
#	app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java
#	app/src/main/java/com/keylesspalace/tusky/adapter/StatusDetailedViewHolder.java
#	app/src/main/java/com/keylesspalace/tusky/components/account/AccountActivity.kt
#	app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeActivity.kt
#	app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeViewModel.kt
#	app/src/main/java/com/keylesspalace/tusky/components/compose/MediaUploader.kt
#	app/src/main/java/com/keylesspalace/tusky/components/search/SearchViewModel.kt
#	app/src/main/java/com/keylesspalace/tusky/components/timeline/TimelineFragment.kt
#	app/src/main/java/com/keylesspalace/tusky/components/timeline/viewmodel/TimelineViewModel.kt
#	app/src/main/java/com/keylesspalace/tusky/components/viewthread/ViewThreadFragment.kt
#	app/src/main/java/com/keylesspalace/tusky/db/TimelineStatusEntity.kt
#	app/src/main/java/com/keylesspalace/tusky/di/NetworkModule.kt
#	app/src/main/java/com/keylesspalace/tusky/fragment/SFragment.java
#	app/src/main/java/com/keylesspalace/tusky/service/SendStatusService.kt
#	app/src/main/java/com/keylesspalace/tusky/util/ThemeUtils.java
#	app/src/main/res/layout/item_status_detailed.xml
#	app/src/main/res/values-cy/strings.xml
#	app/src/main/res/values-de/strings.xml
#	app/src/main/res/values-es/strings.xml
#	app/src/main/res/values-fa/strings.xml
#	app/src/main/res/values-hu/strings.xml
#	app/src/main/res/values-it/strings.xml
#	app/src/main/res/values-ja/strings.xml
#	app/src/main/res/values-nb-rNO/strings.xml
#	app/src/main/res/values-oc/strings.xml
#	app/src/main/res/values-tr/strings.xml
#	app/src/main/res/values-zh-rCN/strings.xml
#	app/src/main/res/values/strings.xml
#	fastlane/metadata/android/sv/changelogs/74.txt
#	fastlane/metadata/android/tr/changelogs/58.txt
#	gradle/libs.versions.toml
2023-01-29 04:44:17 +09:00
mcclure b2511d782d
Dialog notifying user of failure when media upload fails (#3135)
* First attempt at user notifications of failure when media upload fails

* Drafts alert displays alert

* ktLint

* Fix defaced 46.json, add 47.json

* Mock draftsNeedUserAlert in MainActivityTest to prevent spurious failure

* Friendlier posts-failed message

* Create DraftsAlert object

* DraftsAlert works

* Not the cleanest, but DraftsAlert works with multiple accounts

* Use plural strings

* KtLint

* Clean up debug prints

* Simplify DraftsAlert per Conny suggestions

* Text change suggested by Conny

* ktLint again

* Back out test changes

* Fix MainActivityTest for new approach

* Tweak debug log

* Do not use GlobalScope for coroutines
2023-01-27 20:50:45 +01:00
Konrad Pozniak 9cf949fc2e
add 46.json (#3116) 2022-12-29 19:29:33 +01:00
kyori19 5be9a90333
Merge remote-tracking branch 'tuskyapp/develop' 2022-12-29 22:53:20 +09:00
fruyek d823052862
Status: Display indicators of edited posts (#2935)
* Add editedAt field to Status

* Status: Display indicators of edited posts

* Annotate edited posts in the Status description

* Cache info that post has been edited
2022-12-03 12:15:54 +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
Levi Bard 0126ee9500
Language selection fixes (#2917)
* Fix duplicated language entries from system and app language sets.
Closes #2900

* Prefer modern language codes.
Closes #2903

* Synchronize per-account default posting language with server.
Closes #2902

* Allow users to post in languages android doesn't know about yet (e.g. toki pona)

* Always put the preselected language at the top of the list
2022-11-24 15:45:19 +01:00
kyori19 004a9b4921
Merge remote-tracking branch 'tuskyapp/develop' 2022-11-12 04:35:49 +09: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
Martin Marconcini 8b026991e0
2616: Save Scheduled Time for Drafts. (#2624)
* 2616: Save Scheduled Time for Drafts.

Signed-off-by: Martin Marconcini <martin.marconcini.rodriguez@nl.abnamro.com>

* Revert 39.json schema to the original state before my changes.
2022-07-27 21:06:51 +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
kyori19 57aab71b0e
Merge remote-tracking branch 'tuskyapp/develop'
# Conflicts:
#	app/build.gradle
#	app/src/main/java/com/keylesspalace/tusky/SplashActivity.kt
#	app/src/main/java/com/keylesspalace/tusky/adapter/StatusDetailedViewHolder.java
#	app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeViewModel.kt
#	app/src/main/java/com/keylesspalace/tusky/components/compose/MediaUploader.kt
#	app/src/main/java/com/keylesspalace/tusky/components/conversation/ConversationViewHolder.java
#	app/src/main/java/com/keylesspalace/tusky/components/search/SearchViewModel.kt
#	app/src/main/java/com/keylesspalace/tusky/components/timeline/TimelineTypeMappers.kt
#	app/src/main/java/com/keylesspalace/tusky/components/timeline/viewmodel/CachedTimelineViewModel.kt
#	app/src/main/res/layout/activity_main.xml
#	app/src/main/res/values-cs/strings.xml
#	app/src/main/res/values-de/strings.xml
#	app/src/main/res/values-fa/strings.xml
#	app/src/main/res/values-fr/strings.xml
#	app/src/main/res/values-hu/strings.xml
#	app/src/main/res/values-it/strings.xml
#	app/src/main/res/values-no-rNB/strings.xml
#	app/src/main/res/values-zh-rCN/strings.xml
2022-07-16 02:51:51 +09:00
Conny Duck 18506f7092 add 39.json 2022-06-20 16:52:01 +02:00
Konrad Pozniak 131309e99c
Fix conversations (#2556)
* fix conversations

* cleanup ConversationsRemoteMediator

* update conversation timestamps regularly

* improve loadStateListener

* add db migration

* make deleting from conversation db suspending

* reorganize code in ConversationsFragment

* delete NetworkStateViewHolder

* cleanup imports

* add 38.json

* honor fabHide setting in ConversationsFragment

* set page size to 30
2022-05-30 19:06:14 +02:00
Konrad Pozniak 2983c3f48e
Add UtcDateTypeAdapter for Gson (#2549)
* Add UtcDateTypeAdapter for Gson

* add 38.json
2022-05-30 18:15:17 +02:00
Levi Bard 4188670b42
Implement reply count indicator to track web UI (#2467)
Addresses #882
2022-05-20 16:47:45 +02:00
kyori19 25bee533f1
Merge remote-tracking branch 'tuskyapp/develop'
# Conflicts:
#	app/build.gradle
#	app/src/main/java/com/keylesspalace/tusky/MainActivity.kt
#	app/src/main/java/com/keylesspalace/tusky/entity/Account.kt
#	app/src/main/res/values-zh-rCN/strings.xml
#	app/src/main/res/values-zh-rTW/strings.xml
#	app/src/main/res/values/strings.xml
2022-05-19 02:42:27 +09:00
kyori19 0ef03e2bec
Merge commit '0f1e95d0ca81d0254f8d1ae6b60a3130d51b15cf' 2022-05-19 00:15:17 +09: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 0f1e95d0ca add 35.json 2022-05-11 07:43:30 +02:00
kyori19 d43f01920b Support displaying quote status in streamed home timeline 2022-05-02 10:29:00 +09: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
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
kyori19 d21d045eda
Support new signup notifications (#2357) 2022-04-14 19:39:30 +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
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
Konrad Pozniak 2c91b1148c
fix database migration to v29 (#2354) 2022-02-27 20:16:41 +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 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 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 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
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
Levi Bard 8cb83050ac
Add support for muting conversations (#1732)
* Add support for muting conversations
Implements #1731

* Fix CI

* Apply code review feedback
2020-03-24 21:06:04 +01:00
Levi Bard 4a4dd4f30f
Add notifications for follow requests (#1729)
* Add notifications for follow requests
Issue #1719

* Revert item_follow_request layout, create new layout for follow request notifications

* Migrate follow request interaction from notification to observable pattern

* Filter follow request notifications by default

* Add missing cases for system notification generation

* Format code
2020-03-19 22:02:10 +01:00
Ivan Kupalov 8770fbe986 ComposeActivity refactor (#1541)
* Convert ComposeActivity to Kotlin

* More ComposeActivity cleanups

* Move ComposeActivity to it's own package

* Remove ComposeActivity.IntentBuilder

* Re-do part of the media downsizing/uploading

* Add sending of status to ViewModel, draft media descriptions

* Allow uploading video, update description after uploading

* Enable camera, enable upload cancelling

* Cleanup of ComposeActivity

* Extract CaptionDialog, extract ComposeActivity methods

* Fix handling of redrafted media

* Add initial state and media uploading out of Activity

* Change ComposeOptions.mentionedUsernames to be Set rather than List

We probably don't want repeated usernames when we are writing a post
and Set provides such guarantee for free plus it tells it to the
callers. The only disadvantage is lack of order but it shouldn't be a
problem.

* Add combineOptionalLiveData. Add docs.

It it useful for nullable LiveData's. I think we cannot differentiate
between value not being set and value being null so I just added the
variant without null check.

* Add poll support to Compose.

* cleanup code

* move more classes into compose package

* cleanup code

* fix button behavior

* add error handling for media upload

* add caching for instance data again

* merge develop

* fix scheduled toots

* delete unused string

* cleanup ComposeActivity

* fix restoring media from drafts

* make media upload code a little bit clearer

* cleanup autocomplete search code

* avoid duplicate object creation in SavedTootActivity

* perf: avoid unnecessary work when initializing ComposeActivity

* add license header to new files

* use small toot button on bigger displays

* fix ComposeActivityTest

* fix bad merge

* use Singles.zip instead of Single.zip
2019-12-19 19:09:40 +01:00
Konrad Pozniak d9694df0c2
Bookmarks (#1560)
* add bookmarks to timelines

* add Bookmarks to main menu

* cleanup

* handle BookmarkEvent

* fix tests

* fix bookmark handling in NotificationsFragment

* add bookmark accessibility actions
2019-11-19 10:15:32 +01:00
Konrad Pozniak 51c6852492
Create polls (#1452)
* add AddPollDialog

* add support for pleroma poll options

* add PollPreviewView

* add Poll support to drafts

* add license header, cleanup

* rename drawable files to correct size

* fix tests

* fix bug with Poll having wrong duration after delete&redraft

* add input validation

* grey out poll button when its disabled

* code cleanup & small improvements
2019-08-22 20:30:08 +02:00
Konrad Pozniak 8834c22120
add option to always expand content warnings (#1422) 2019-07-28 19:59:52 +02:00
Konrad Pozniak 0419417346 add missing db schema 17 file 2019-05-30 21:02:59 +02:00