Commit Graph

119 Commits

Author SHA1 Message Date
kyori19 96162ab544 Add pinned status tab (#994)
* Add pinned status tab

* Make TabLayout scrollable.
2019-01-21 08:37:25 +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 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
kyori19 1556a88d05 Prevent multiple registrations to eventHub on same TimelineFragment (#879) 2018-10-15 19:47:50 +02: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
Conny Duck 51d231834c Merge branch 'AbsoluteTime' of https://github.com/kyori19/Tusky into kyori19-AbsoluteTime
# Conflicts:
#	app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java
2018-09-09 21:48:01 +02:00
Conny Duck 5131c44e93 fix empty message view showing/hiding at the wrong times 2018-09-02 13:23:36 +02:00
Konrad Pozniak 791a87e7a1
fix repeating toots in timelines (#789) 2018-08-22 21:19:56 +02:00
kyori 219eafe6fc Prevent query SharedPreference in adapters. 2018-08-17 14:42:15 +09:00
Konrad Pozniak 8930d277e6
add new elephant friends (#757)
* add new elephant friends

* add art license

* fix typo
2018-08-15 20:51:35 +02:00
Konrad Pozniak dbdc597207
fix bug where home timeline was never showing "load more" button (#729) 2018-07-25 21:50:09 +02:00
Conny Duck 6f179fccaa fix crash in TimelineFragment 2018-07-12 21:21:53 +02:00
Conny Duck 67f90d050c fix crash in TimelineFragment 2018-07-08 10:16:19 +02:00
Conny Duck ef9e931428 fix regex filter not affecting spoilertext 2018-07-05 21:59:38 +02:00
Conny Duck c452b8f281 Merge branch 'master' of https://github.com/Vavassor/Tusky 2018-07-05 21:36:16 +02:00
Conny Duck d900e1d8cd fix crash in TimelineFragment 2018-07-05 21:32:49 +02:00
Ivan Kupalov 8c20d5dd93 Fix crash on receiving event in timeline (#704) 2018-07-02 22:12:27 +02:00
Conny Duck 77617ba9bf fix crash on timeline reloading 2018-06-25 18:20:45 +02:00
Conny Duck b655985997 only reload timeline on pref change when necessary 2018-06-25 17:20:41 +02:00
Conny Duck 50b0d1fb8d cleanup code 2018-06-25 14:49:00 +02:00
Ivan Kupalov 570d7e3597 Do not scroll to top on timeline refresh (#681)
* Do not scroll to top on timeline refresh

* Use dp for shifting timeline
2018-06-24 10:53:19 +02:00
Konrad Pozniak 63f9d99390
Account activity redesign (#662)
* Refactor-all-the-things version of the fix for issue #573

* Migrate SpanUtils to kotlin because why not

* Minimal fix for issue #573

* Add tests for compose spanning

* Clean up code suggestions

* Make FakeSpannable.getSpans implementation less awkward

* Add secondary validation pass for urls

* Address code review feedback

* Fixup type filtering in FakeSpannable again

* Make all mentions in compose activity use the default link color

* new layout for AccountActivity

* fix the light theme

* convert AccountActivity to Kotlin

* introduce AccountViewModel

* Merge branch 'master' into account-activity-redesign

# Conflicts:
#	app/src/main/java/com/keylesspalace/tusky/AccountActivity.java

* add Bot badge to profile

* parse custom emojis in usernames

* add possibility to cancel follow request

* add third tab on profiles

* add account fields to profile

* add support for moved accounts

* set click listener on account moved view

* fix tests

* use 24dp as statusbar size

* add ability to hide reblogs from followed accounts

* add button to edit own account to AccountActivity

* set toolbar top margin programmatically

* fix crash

* add shadow behind statusbar

* introduce ViewExtensions to clean up code

* move code out of offsetChangedListener for perf reasons

* clean up stuff

* add error handling

* improve type safety

* fix ConstraintLayout warning

* remove unneeded ressources

* fix event dispatching

* fix crash in event handling

* set correct emoji on title

* improve some things

* wrap follower/foillowing/status views
2018-06-18 13:26:18 +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
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
Gareth Murphy 6d6c9575c4 Add regular expression feed filtering (#557)
* Initial implementation of regex feed filtering

Mimics Mastodon web's functionality, but in a simpler form; a single
regular expression is shared across the home, local and federated feeds.

Strings are currently only provided in English and will need to be
translated.

* Fix buggy behaviour on filter regex update

* Validate regex filter input

Fixes buggy behaviour on inputting a regular expression feed filter by
testing the expression continuously as the user types, displaying an
error and disabling the 'OK' button of the dialog at any time it's not a
valid regular expression. Disables spelling suggestions in the input to
make the experience less frustrating and error prone.

Also fixes some generally buggy behaviour upon preference change,
specifically in cases where no Matcher was set prior to a new pattern
being set, which would cause the app to crash.

* Apply regex filter to spoiler text

* Get rid of empty catch block in regex filter code

* Make regex filter error string translatable
2018-04-05 22:58:44 +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 720f7c6a0c fix issue where scrolling wont stop after jumping to top 2018-03-17 19:46:01 +01:00
Conny Duck 4e617dccc7 change the color of all SwipeRefreshLayouts to match the Tusky theme 2018-03-09 20:39:08 +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 5dbe3c927e fix timeline filtering not working after app restart 2018-02-08 19:12:02 +01:00
Ivan Kupalov 6152043df3 Add basic lists support (#501) 2018-01-06 19:01:37 +01:00
Conny Duck 7abd8c8d70 fix some lint warnings 2017-12-01 22:31:34 +01:00
Conny Duck 7cc1ed9844 fix problem with spark buttons behaving weirdly 2017-12-01 22:13:47 +01:00
Konrad Pozniak 41233a837b
UI Improvements (#445)
UI Improvements
2017-11-30 20:12:09 +01:00
Conny Duck 59bcb6f0bf fix bug where account timeline showed only media toots 2017-11-07 23:06:06 +01:00
Conny Duck 3053e097a7 upgrade room library to 1 (fix merge problem) 2017-11-07 13:12:57 +01:00
Konrad Pozniak 21de60f739
Merge branch 'master' into timeline-improvement 2017-11-07 13:03:49 +01:00
Conny Duck 52dd9559d6 fix placeholder not resetting itself after a load failed 2017-11-07 12:59:46 +01:00
charlag 74d6736afc Make status placeholder abstraction cleaner 2017-11-07 12:44:19 +01:00
Ivan Kupalov dc1a60cc12 Implement media tab (#430) 2017-11-05 22:32:36 +01:00
Conny Duck 80a10c1ac1 implement "load more" placeholder 2017-11-04 21:57:30 +01:00
Conny Duck f2f3be37b3 cleanup code, remove some unneeded files 2017-10-18 00:20:50 +02:00
Len Chan c0a5e55f47 add option: always show all sensitive content without warning 2017-09-19 23:19:18 +08:00
Conny Duck f696b6e8d3 bugfix, layout improvements 2017-08-05 12:04:40 +02:00
Conny Duck 099d76d919 make FAB hide on scroll in AccountActivity as well 2017-08-04 11:44:10 +02:00
Vavassor 3f8378ae3a Fixes a crash when a timeline or thread is backgrounded and brought back with an uninitialized notification or status list. 2017-07-20 21:17:36 -04:00
Ivan Kupalov 08f928a2b2 Improve media browser and video viewer
* show/hide status bar by tapping a photo
* dim and color status bar in video/media viewers
* show/hide status bar in video viewer
* use shared element transition when opening a photo is possible
* center video in VideoView
2017-07-15 18:37:53 +03:00
Vavassor 87600b016f Removes unused icons and does bits of cleanup. 2017-07-14 23:23:14 -04:00
Vavassor 96cba0cc2b Fixes timelines and notifications tabs fetching progressively further down when they are restarted. 2017-07-14 17:09:44 -04:00
Vavassor a23cca7047 Re-does commit 5754a3a177 because those changes were stomped by merging in commit fc1a24be11. 2017-07-13 21:39:17 -04:00
Vavassor fc1a24be11 Resolves merge conflicts and makes NotificationAdapter no longer implement AdapterItemRemover 2017-07-13 21:31:31 -04:00
Ivan Kupalov 90c1a83ba4 Preserve status states on updates. UI layer refactoring.
Some things were pulled out of adapters to fragments. New classes were introduced - StatusViewData and NotificationViewData. They not only have view state in them but also help decoupling.
Because introducing parallel model list requires a lot of synchronisation PairedList was added.
Also synchronisation between fragments and adapters is quiet tedious and error-prone and should be replaces with better solution.
Oh, I also couldn’t resist and fixed bug with buttons animation in the same commit.
2017-07-13 22:18:08 +03:00
Ivan Kupalov 0f15509345 Add boost click handling 2017-07-02 09:55:20 +03:00
Vavassor afa21f5a5c Makes end of list footers have zero height. 2017-07-01 23:23:42 -04:00
Vavassor 275cd51a6d Adds correct footer behaviour to account lists and unifies it with how timelines use them. 2017-06-30 18:30:25 -04:00
Vavassor 3955649b9c Moves loading of accounts, notifications, and statuses to use link headers. Also remedies an issue where duplicate calls for the same chunk of items in a list can occur. 2017-06-30 02:31:58 -04:00
Vavassor 3f54ead962 Adds option to hide media previews if reduced data usage is desired Closes #56. 2017-06-26 05:15:47 -04:00
Vavassor e3745ebd6b Adds ability to page between multiple images in a status by swiping from left to right. Closes #66 2017-06-25 01:07:41 -04:00
Vavassor a4ee128e26 Broadcasts now cause a refresh on timelines after a post is composed instead of listeners.
As a side effect, pagers don't have to keep track of "registered fragments", which was a bad idea and caused crashes.
2017-06-06 18:20:55 -04:00
Vavassor 9c56f0e7bc Broadcasts now used everywhere for signalling to remove accounts' posts instead of listeners. 2017-06-06 17:15:29 -04:00
torrentcome 2b9f19805f Merge branch 'master' into #136 2017-06-02 23:15:21 +02:00
Conny Duck 1a39e58d3c remove unnecessary Log utility class, replace Exception.printStackTrace with logging 2017-05-23 21:34:31 +02:00
torrentcome ed5564d4d5 (receiver) create package for receiver 2017-05-15 12:05:10 +02:00
Vavassor 66bac21236 fixes merge conflicts 2017-05-11 18:58:38 -04:00
Pangoraw 72ac4e5581 Allow broadcasting event across activities. 2017-05-11 09:11:15 +00:00
Vavassor 3c20f7a0c4 Adds a splash screen replacement. 2017-05-09 22:36:05 -04:00
Vavassor aa2394748c Reorganizes the whole codebase. 2017-05-04 18:55:35 -04:00