Commit Graph

79 Commits

Author SHA1 Message Date
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
Konrad Pozniak 9dcb1b666c
show push migration snackbar above floating action button (#2598) 2022-06-30 20:49:27 +02:00
Konrad Pozniak f419e83c16
improve logout (#2579)
* improve logout

* fix tests

* add db migration

* delete wrongly committed file again

* improve LogoutUsecase
2022-06-20 16:45:54 +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
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
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 b8e3b6b884
fix currently logged in profiles not being visible in main drawer when offline (#2516) 2022-05-12 18:21:33 +02:00
kyori19 95a1f5632b
Merge remote-tracking branch 'tuskyapp/develop' 2022-05-01 19:54:22 +09:00
Constantin A 3a11b9900e
EmojiCompat fix (#2468)
* Add back the emojiInitCallback and move EmojiCompat init

* Small adjustments

* Make sure that we don't hit the IllegalStateException when EmojiCompat-ing the display names

* Add a TODO for when Material Drawer 9 can be used

* Remove EmojiCompat.process and initcallback
2022-04-28 18:55:10 +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
kyori19 6c630e08dd Merge remote-tracking branch 'tuskyapp/develop' 2022-04-24 16:42:54 +09:00
Konrad Pozniak d2bfceae7b
refactor compose & announcements to coroutines (#2446)
* refactor compose & announcements to coroutines

* fix code formatting

* add javadoc to InstanceInfoRepository

* fix comments in ImageDownsizer

* remove unused Either extensions

* add explicit return type for InstanceInfoRepository.getEmojis

* make ComposeViewModel.pickMedia return Result

* cleanup code in ImageDownsizer
2022-04-21 18:46:21 +02:00
Konrad Pozniak 3e8c6a318a
introduce KotlinResultCallAdapter for nice suspending network calls (#2415)
* introduce KotlinResultCallAdapter for nice suspending network calls

* fix tests
2022-04-14 19:49:49 +02:00
Konrad Pozniak b4a913b2d5
fix black theme on Android 12 (#2424)
* fix black theme on Android 12

* Revert "fix black theme on Android 12"

This reverts commit 2286706fdb239e15be72ac8943405ffeb2258219.

* bring back SplashActivity
2022-04-13 19:22:01 +02:00
kyori19 1228f645a6 Merge remote-tracking branch 'tuskyapp/develop' 2022-04-13 00:59:06 +09: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
Konrad Pozniak 55513e8e2b
Android 12 support, update AndroidX libraries (#2367)
* Android 12 support, update AndroidX libraries

* fix ktlint

* add Android 12 splash screen support

* fix comments in MainActivity

* remove deprecated Intent.ACTION_CLOSE_SYSTEM_DIALOGS

* delete TimelineViewModelTest

* fix notifications on Android 12

* improve splash screen

* handle pending intent flags in a dedicated function
2022-03-09 20:50:23 +01:00
Ivan Kupalov 4d8289b245
Implement Login via WebView (#2371)
* Improve login process with newer APIs

* Implement login with WebView instead of browser tab or external browser

Oauth process requires us to open login prompt for correct instance and
we need to receive the result back. Usually it is done with redirect
parameter.

Previously we've been using BrowserTabs API and have been falling back
to just opening browser. This mostly worked but is very clumsy:

 - It relies on few system mechanisms for opening URLs in both
directions
 - Browsers do weird things and tend to break quite a bit
 - There's a good chance that the app can die in the process and we need
to recover our state.

So instead we are now using WebView. It has disadvantages (users have
to trust us to show correct page, logins are not shared w/ browser) but
it should be more reliable.

* Changes to login after review

* Move login classes to their own package

* Fix linting issues
2022-03-08 21:22:19 +01:00
kyori19 ba005c769b Merge remote-tracking branch 'tuskyapp/develop' 2022-03-04 17:51:25 +09:00
kyori19 4a8fa74f79 Merge commit '224161caf111a15887cbc8a419763e87fe69931d' 2022-03-04 00:37:23 +09:00
Levi Bard f822234995
Add "open as" to profiles (#2340)
* Extract "open as" utilities to BaseActivity

* Add "open as" to profiles.
Fixes #2329

* Rename STATUS_URL intent extra key

* Add nullability notations for new java code

* Pacify ktlint
2022-02-25 18:55:58 +01:00
kyori19 e78cdad22f Refactor streaming feature 2022-01-25 03:32:57 +09:00
Konrad Pozniak fe350ccf36
move AccountActivity and related classes to a new package (#2216)
* move AccountActivity and related classes to a new package

* fix ktlint

* fix ktlint

* fix imports
2022-01-11 19:55:17 +01:00
Konrad Pozniak 6b7d3ef613
fix loading Gif avatars into the main appbar (#2268)
* fix loading Gif avatars into the main appbar

and respect the animateAvatars setting

closes #2259

* fix formatting
2021-12-05 19:12:52 +01:00
kyori19 76cd8f6c06 Fix tab resetting behaviour 2021-07-26 00:10:48 +09:00
kyori19 2005b32dfa Merge remote-tracking branch 'tuskyapp/develop' 2021-07-03 23:59:57 +09:00
Konrad Pozniak 2cc53d6772 fix codestyle 2021-06-28 22:04:34 +02:00
Konrad Pozniak f6dd131b95
migrate drafts to paging 3 (#2206)
* migrate drafts to paging 3

* migrate DraftHelper to coroutines
2021-06-24 21:23:29 +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 3301643c1d
update to SDK 30 and fix deprecations (#2173)
* update to SDk 30 and fix deprecations

* remove unnecessary .run

* revert ViewMediaActivity change
2021-06-01 19:46:07 +02:00
Konrad Pozniak d5e539fd64
cleanup MainActivity / last remnants of SavedToots (#2174) 2021-05-22 19:24:40 +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
kyori19 609dcf46cb Merge remote-tracking branch 'tuskyapp/develop' 2021-04-28 11:54:29 +09: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 2d0862cfc5
fix MainActivity switching to notification tab when opened from recents (#2099) 2021-03-07 19:29:45 +01:00
Konrad Pozniak ff69a2ad0d
migrating to ViewBinding part 2: Activities (#2093) 2021-03-07 19:05:51 +01:00
kyori19 a746009f74 Merge remote-tracking branch 'tuskyapp/develop' 2021-03-04 15:08:48 +09:00
David 2fea6011fd
NavIcon Avatar fix (#2080)
* NavIcon Avatar fix

* Added in all three methods
2021-02-16 18:45:45 +01:00
Konrad Pozniak 4d856365f9
cleanup drafts when user logs out (#2067)
* cleanup drafts when user logs out

* delete unused method

* remove unneeded sorting from loadDraftsSingle
2021-02-07 16:40:09 +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
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 5fbd459aed
Make tapping the main toolbar scroll to the top of the timeline. #1899 (#2045) 2021-01-15 21:23:02 +01:00
kyori19 b3c825339f Fix broken preferences 2021-01-03 14:42:50 +09:00
kyori19 ea822004dd Merge remote-tracking branch 'tuskyapp/develop' 2020-12-16 23:47:26 +09:00
Konrad Pozniak a19411c947
cleanup accountManager.activeAccount usages in MainActivity (#2021) 2020-12-13 16:32:04 +01:00
Levi Bard b8268538fd
Fix negative count on the unread announcements badge. (#2010)
Fixes #1994
2020-12-04 17:37:52 +01:00
Konrad Pozniak 227e219241
load drawer avatar earlier to avoid flicker on app start (#1993)
* load drawer avatar earlier to avoid flicker on app start

* use placeholder when loading drawer avatar for the first time
2020-11-25 19:41:57 +01:00
Ivan Kupalov ef1ae581b4
Fix some of the StrictMode violations (#1931)
Mostly it's disk reads/writes.

Conscrypt reads own version on startup which reads from disk multiple
times. There's no solution for it right now.

SharedPreferences which are used in BaseActivity also read from disk
and pretty early but it shouldn't be a problem.
2020-11-23 20:05:48 +01:00
Konrad Pozniak 9ea2557148
fix crash when clearing glide requests (#1989) 2020-11-22 19:03:11 +01:00