Commit Graph

65 Commits

Author SHA1 Message Date
kyori19 762b2225ca Merge remote-tracking branch 'tuskyapp/develop' 2019-11-19 21:52:13 +09:00
Konrad Pozniak 78b5aa8baf
Upgrade api level to Android 10, implement new sharing api (#1537)
* upgrade api level to Android 10, resolve compile errors

* use androidx.preference.PreferenceManager instead of deprecated platform class

* add hyphenation to important TextViews

*  setBottomSheetCallback -> addBottomSheetCallback

* implement new sharing api

* improve TuskyTileService so it shows account picker when multiple accounts are present

* delete unused AccountChooserService

* fix test

* improve ShareShortcutHelper

* remove debug log statement

* improve image loading fallback behavior in ShareShortcutHelper

* improve behavior on foldable devices
2019-10-22 21:18:20 +02:00
kyori19 aa48555902 Merge remote-tracking branch 'tuskyapp/master' 2019-10-03 21:09:01 +09:00
Konrad Pozniak a9440ea2ab
filter polls (#1496) 2019-09-24 20:33:29 +02:00
kyori19 964c14af3f Merge remote-tracking branch 'tuskyapp/master' 2019-09-16 14:16:00 +09:00
Ivan Kupalov 60383e112a Notify thread adapter when sensitive media is shown (#1472) 2019-09-08 10:30:59 +02:00
kyori19 573be935a7 [quote] Implement quote feature 2019-09-03 23:08:13 +09:00
Konrad Pozniak 8834c22120
add option to always expand content warnings (#1422) 2019-07-28 19:59:52 +02:00
Konrad Pozniak f975522e63
fix shouldTrimStatus and add tests (#1404) 2019-07-25 12:15:54 +02:00
HellPie 87285ae5bf Transfer SmartLengthInputFilter license to Tusky (#1384)
* Transfer SmartLengthInputFilter in-header license

Transfer license for file "SmartLengthInputFilter.java" from me (Diego Rossi) to Tusky and therefore also change it from the original Apache 2.0 to currently GPLv3. This was a mistake that has been sitting around for way too long.

* Rewrite SmartLengthInputFilter from Java to Kotlin

This has been done by hand, without the custom copy-paste tool.

* Fix bad references in Java files using SmartLengthInputFilter features

* Shorten code in Java classes referencing SmartLengthInputFilter instance

* Refactor SmartLengthInputFilter from class to singleton Kotlin object

* Move hasBadRatio to become a toplevel function

* Patch up all the files affected by SmartLengthInputFilter changes

* Length in SmartLengthInputFilter is const 500, simplify code accordingly

* More meaningful name for toplevel function for checking trimming ability

* Add missing license header
2019-07-19 20:47:30 +02:00
Levi Bard d4ec0bb101 Apply conversation filters to threads. Addresses #1349 (#1351)
* Apply conversation filters to threads. Addresses #1349

* Cache filters for app lifetime, unless filters are modified locally

* Flush cached filters when changing accounts
2019-07-08 12:57:53 +02:00
Levi Bard c3cae4a603 Fix respecting bot overlay preference in detailed status view. (#1368)
Closes #1364
2019-07-07 14:41:07 +02:00
Konrad Pozniak e6d91c1cf3
remove boosted status when the original author was blocked or muted (#1335) 2019-06-22 08:05:24 +02:00
Konrad Pozniak 2b2212e951
cleanup entity classes and ViewThreadFragment (#1302)
* cleanup entity classes and ViewThreadFragment

* fix tests
2019-06-02 21:23:18 +02:00
Konrad Pozniak fd7471f2ab
Polls part 1 - displaying in timelines and voting (#1200)
* add entity classes

* change data models and add database migration

* add polls to StatusViewData

* show poll results

* add methods for vote handling

* add voting interface

* enable voting in TimelineFragment

* update polls immediately

* enable custom emojis for poll options

* enable voting from search fragment

* add voting layout to detailed statuses

* fix tests

* enable voting in ViewThreadFragment

* enable voting in ConversationsFragment

* small refactor for StatusBaseViewHolder
2019-04-22 10:11:00 +02:00
Konrad Pozniak dd02af9911
fix IndexOutOfBoundException caused by ListStatusAccessibilityDelegate (#1178) 2019-04-07 16:32:58 +02:00
Konrad Pozniak 5f390b378b
Improve Dependency Injection (#1120)
* inject TimelineCases directly into SFragment

* inject ThemeUtils
2019-03-11 17:25:11 +01:00
Ivan Kupalov 479d210e64 Timeline a11y (#1059)
* Improve timeline accessibility

* Improve a11y description and actions in timeline

* Refactor timeline accessibility handling, add more actions

* Update app/src/main/java/com/keylesspalace/tusky/adapter/StatusViewHolder.java

Co-Authored-By: charlag <charlag@tutanota.com>

* Add a11y actions for links, hashtags and mentions, enable for detailed.

* A11y delegate: Add open reblogger action, cleanup

* a11y delegate: add reblogs/boosts, improve interrupts

* a11y delegate: add reblogs/boosts, improve interrupts

* a11y delegate: add to notifications fragment
2019-03-04 19:24:27 +01:00
Konrad Pozniak 5ee78e68ba
remove unnecessary divider styling (#1057) 2019-02-26 18:28:20 +01:00
Conny Duck 88ce1a1d79 fix boost/fav count resetting after boosting a detailed status 2019-02-16 15:53:56 +01:00
Konrad Pozniak d371074d2a
fix statuses collapsing when faving/boosting in ViewThreadFragment (#1047) 2019-02-16 14:35:06 +01:00
Konrad Pozniak e371fa0e24
Tab customization & direct messages tab (#1012)
* custom tabs

* custom tabs interface

* implement custom tab functionality

* add database migration

* fix bugs, improve ThemeUtils nullability handling

* implement conversationsfragment

* setup ConversationViewHolder

* implement favs

* add button functionality

* revert 10.json

* revert item_status_notification.xml

* implement more menu, replying, fix stuff, clean up

* fix tests

* fix bug with expanding statuses

* min and max number of tabs

* settings support, fix bugs

* database migration

* fix scrolling to top after refresh

* fix                                 bugs

* fix warning in item_conversation
2019-02-12 19:22:37 +01:00
Ivan Kupalov 3ab78a19bc Caching toots (#809)
* Initial timeline cache implementation

* Fix build/DI errors for caching

* Rename timeline entities tables. Add migration. Add DB scheme file.

* Fix uniqueness problem, change offline strategy, improve mapping

* Try to merge in new statuses, fix bottom loading, fix saving spans.

* Fix reblogs IDs, fix inserting elements from top

* Send one more request to get latest timeline statuses

* Give Timeline placeholders string id. Rewrite Either in Kotlin

* Initial placeholder implementation for caching

* Fix crash on removing overlap statuses

* Migrate counters to long

* Remove unused counters. Add minimal TimelineDAOTest

* Fix bug with placeholder ID

* Update cache in response to events. Refactor TimelineCases

* Fix crash, reduce number of placeholders

* Fix crash, fix filtering, improve placeholder handling

* Fix migration, add 8-9 migration test

* Fix initial timeline update, remove more placeholders

* Add cleanup for old statuses

* Fix cleanup

* Delete ExampleInstrumentedTest

* Improve timeline UX regarding caching

* Fix typos

* Fix initial timeline update

* Cleanup/fix initial timeline update

* Workaround for weird behavior of first post on initial tl update.

* Change counter types back to int

* Clear timeline cache on logout

* Fix loading when timeline is completely empty

* Fix androidx migration issues

* Fix tests

* Apply caching feedback

* Save account emojis to cache

* Fix warnings and bugs
2019-01-14 22:05:08 +01:00
Konrad Pozniak c869886c19
add the ability to see who faved or boosted a toot (#962)
* move reblog/fav count up in detailed status view and make them clickable

* use status object returned by api when reblogging/faving

* Reblogs -> Boosts

* add support for viewing who faved/reblogged a status

* add onShowReblogs/onShowFavs to listener, fix display bug

* remove unneeded icon from previous revision

* small code improvements

* fix liking/boosting toot with card
2018-12-27 09:48:24 +01:00
Konrad Pozniak a445c12094
Upgrade to AndroidX, move to MaterialComponents theme (#953)
* upgrade to AndroidX, upgrade libraries

* move to MaterialComponents theme

* make sure the compose button looks good everywhere

* fix tollbar title/button alignment on tablet

* move to new material color theming, consolidate colors and themes

* fix build, fix imports

* set error on TextInputLayout instead of EditText

* fix imports, TootButton when

* improve snackbar style

* fix task description color
2018-12-17 15:25:35 +01:00
Konrad Pozniak 348c20c792
New settings (#891)
* change drawer items

* rename SettingsActivity

* introduce AccountSettings activity

* improve account settings, move notification settings

* sync settings with server

* rename settings back to preferences

* add functionality for settings

* move mediaPreviewEnabled preference to AccountPreferences

* replace shared prefs with accountmanager

* move PreferencesFragment to support library

* split preferences fragment into smaller fragments,
merge AccountPreferencesActivity into PreferencesFragment

* adjust icon size, add icons to general preferences

* change mediaPreviewEnabled and alwaysShowSensitiveMedia pref position

* add database migration

* remove pullNotificationCheckInterval option

* fix  preference in TimelineFragment

* Update Chinese translations. (#915)

* Update zh-CN translations.

* Update zh-SG translations.

* Update zh-TW translations.

* Update zh-MO translations.

* Update zh-HK translations.

* Fix errors in zh-CN translations.

* Fix errors in zh-SG translations.

* Fix errors in zh-TW translations.

* Fix errors in zh-MO translations.

* Fix errors in zh-HK translations.
2018-11-12 21:09:39 +01:00
HellPie 4759783d10 Add support for collapsible statuses when they exceed 500 characters (#825)
* Update Gradle plugin to work with Android Studio 3.3 Canary

Android Studio 3.1.4 Stable doesn't render layout previews in this project
for whatever reason. Switching to the latest 3.3 Canary release fixes the
issue without affecting Gradle scripts but requires the new Android Gradle
plugin to match the new Android Studio release.

This commit will be reverted once development on the feature is done.

* Update gradle build script to allow installing debug builds alongside store version

This will allow developers, testers, etc to work on Tusky will not having to worry
about overwriting, uninstalling, fiddling with a preinstalled application which would
mean having to login again every time the development cycle starts/finishes and
manually reinstalling the app.

* Add UI changes to support collapsing statuses

The button uses subtle styling to not be distracting like the CW button on the timeline
The button is toggleable, full width to match the status textbox hitbox width and also
is shorter to not be too intrusive between the status text and images, or the post below

* Update status data model to store whether the message has been collapsed

* Update status action listener to notify of collapsed state changing

Provide stubs in all implementing classes and mark as TODO the stubs that
require a proper implementation for the feature to work.

* Add implementation code to handle status collapse/expand in timeline

Code has not been added elsewhere to simplify testing.
Once the code will be considered stable it will be also included in other
status action listener implementers.

* Add preferences so that users can toggle the collapsing of long posts

This is currently limited to a simple toggle, it would be nice to implement
a more advanced UI to offer the user more control over the feature.

* Update Gradle plugin to work with latest Android Studio 3.3 Canary 8

Just like the other commit, this will be reverted once the feature is working.
I simply don't want to deal with what changes in my installation of Android
Studio 3.1.4 Stable which breaks the layout preview rendering.

* Update data models and utils for statuses to better handle collapsing

I forgot that data isn't available from the API and can't really be built
from scratch using existing data due to preferences.
A new, extra boolean should fix the issue.

* Fix search breaking due to newly introduced variables in utils classes

* Fix timeline breaking due to newly introduced variables in utils classes

* Fix item status text for collapsed toggle being shown in the wrong state

* Update timeline fragment to refresh the list when collapsed settings change

* Add support for status content collapse in timeline viewholder

* Fix view holder truncating posts using temporary debug settings at 50 chars

* Add toggle support to notification layout as well

* Add support for collapsed statuses to search results

* Add support for expandable content to notifications too

* Update codebase with some suggested changes by @charlang

* Update more code with more suggestions and move null-safety into view data

* Update even more code with even more suggested code changes

* Revert a0a41ca and 0ee004d (Android Studio 3.1 to Android Studio 3.3 updates)

* Add an input filter utility class to reuse code for trimming statuses

* Update UI of statuses to show a taller collapsible button

* Update notification fragment logging to simplify null checks

* Add smartness to SmartLengthInputFilter such as word trimming and runway

* Fix posts with show more button even if bad ratio didn't collapse

* Fix thread view showing button but not collapsing by implementing the feature

* Fix spannable losing spans when collapsed and restore length to 500 characters

* Remove debug build suffix as per request

* Fix all the merging happened in f66d689, 623cad2 and 7056ba5

* Fix notification button spanning full width rather than content width

* Add a way to access a singleton to smart filter and use clearer code

* Update view holders using smart input filters to use more singletons

* Fix code style lacking spaces before boolean checks in ifs and others

* Remove all code related to collapsibility preferences, strings included

* Update style to match content warning toggle button

* Update strings to give cleaner differentiation between CW and collapse

* Update smart filter code to use fully qualified names to avoid confusion
2018-09-19 19:51:20 +02:00
kyori 219eafe6fc Prevent query SharedPreference in adapters. 2018-08-17 14:42:15 +09:00
Conny Duck 6f179fccaa fix crash in TimelineFragment 2018-07-12 21:21:53 +02:00
Conny Duck b7da5f7a29 fix another crash in ViewThreadFragment 2018-07-08 19:21:19 +02:00
Conny Duck b2c0ed69f6 fix crash in ViewThreadFragment 2018-07-07 12:09:15 +02:00
Ivan Kupalov 3756a1fd20
Add EventHub, add fav, reblog events, improve timelines (#562)
* Add AppStore, add fav, reblog events

* Add events, add handling to Timeline

* Add event handling to Notifications

* Mostly finish events

* Fix unsubscribing

* Cleanup timeline

* Fix newStatusEvent in thread, fix deleteEvent

* Insert new toots only in specific timelines

* Add missing else

* Rename AppStore to EventHub

* Fix tests

* Use DiffUtils for timeline

* Fix empty timeline bug. Improve loading placeholder

* Fix AsyncListDiff, loading indicator, "load more"

* Timeline fixes & improvements.

Fix infinite loading. Remove spinner correctly.
Don't refresh timeline without need.
2018-05-27 11:22:12 +03:00
Ivan Kupalov 23d84dfa66 Show image descriptions in gallery (#630)
* Add circleci

* Commit to maybe fix ci

* Suppress false positives in lint

* Disable linting for tests in ci

* Add image descriptions to gallery

* Fix test

* [CI] Attempt to fix OOM error

* [CI] Attempt to fix OOM error, 2

* Add option to open status from media

* fix theme issue

* increase linespacing on media description
2018-05-10 20:13:25 +02:00
Konrad Pozniak 27b4cf8739
1.8 fixes (#637)
* fix lint warnings

* upgrade dependencies

* auto cancel notifications

* improve dependency injection

* fix tests

* remove old comment from BaseActivity

* fix missing injectors
2018-05-08 19:15:10 +02:00
Konrad Pozniak 89f93eab85
Fix SparkButtons (#608)
* fix the SparkButtons

* dont notify adapter after boost/fav
2018-04-28 22:59:46 +02:00
Ivan Kupalov f3c6abdd4d Add expand/collapse button for threads (#609) 2018-04-28 16:17:01 +02:00
Levi Bard 76eae44324 View links to statuses inside Tusky (#568)
* View links to statuses inside Tusky

* Only attempt to open links that look like mastodon statuses

* Add support for pleroma statuses

* Move "smells like mastodon" url check to click handler

* Add bottom sheet to notify users of post query status

* Improve architecture for managing search status

* Push everything into SFragment

* Add external lookup for non-locally-resolved account links

* Clean up copypasta from LinkHelper.setClickableText

* Apply PR feedback

* Migrate bottom sheet wrappers to CoordinatorLayout
2018-04-25 20:04:55 +02:00
Ivan Kupalov a5cffe0fea Add Dagger (#554)
* Add Dagger DI

* Preemptively fix tests

* Add missing licenses

* DI fixes

* ci fixes
2018-03-27 19:47:00 +02:00
Conny Duck 4e617dccc7 change the color of all SwipeRefreshLayouts to match the Tusky theme 2018-03-09 20:39:08 +01:00
Conny Duck 44b79e31d4 fail silently when status card cannot be loaded for compatibility with Pleroma 2018-03-09 18:56:05 +01:00
Konrad Pozniak 71954a277e
convert entity classes to Kotlin data classes (#526)
* convert entity classes to Kotlin data classes

* more data classes, code style
2018-03-03 13:24:03 +01:00
Conny Duck b33740d74e fix IndexOutOfBoundsException in ViewThreadFragment 2017-11-30 21:04:47 +01:00
Konrad Pozniak 41233a837b
UI Improvements (#445)
UI Improvements
2017-11-30 20:12:09 +01:00
Ivan Kupalov 2575b16dad Save reply info in draft, refactor (#449)
* Save reply info in draft, refactor

* Handle replying to deleted status
2017-11-16 19:18:11 +01:00
charlag 74d6736afc Make status placeholder abstraction cleaner 2017-11-07 12:44:19 +01:00
Conny Duck 80a10c1ac1 implement "load more" placeholder 2017-11-04 21:57:30 +01:00
Konrad Pozniak 5cbc7217ff Link previews for detail statuses (#424)
* implement link preview cards on detail statuses

* cleanup code
2017-10-27 13:20:17 +02:00
Conny Duck 00c5a975d6 close ViewThreadActivity if the main status got removed to avoid crashes on subsequent refreshes 2017-10-24 23:33:05 +02:00
Conny Duck f2f3be37b3 cleanup code, remove some unneeded files 2017-10-18 00:20:50 +02:00
Vavassor 309c89eefc Makes the main status of a thread appear as a more detailed view. 2017-08-03 00:29:31 -04:00