Commit Graph

102 Commits

Author SHA1 Message Date
kyori19 1228f645a6 Merge remote-tracking branch 'tuskyapp/develop' 2022-04-13 00:59:06 +09: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 a746009f74 Merge remote-tracking branch 'tuskyapp/develop' 2021-03-04 15:08:48 +09:00
Alibek Omarov 2d2b79aa47
layout: move media preview to standalone xml and include it in containers (#2063) 2021-01-31 19:22:06 +01:00
kyori19 ea822004dd Merge remote-tracking branch 'tuskyapp/develop' 2020-12-16 23:47:26 +09:00
Konrad Pozniak 9cdf486ceb
remove ThemeUtils.getTintedDrawable (#2015) 2020-12-09 19:08:16 +01:00
kyori19 171f69a35d Merge remote-tracking branch 'tuskyapp/develop' 2020-11-20 13:21:21 +09:00
Karol Kosek b8892044f6
Use status text size for poll descriptions (#1942) 2020-09-25 13:27:09 +02:00
kyori19 31c9debd5d Merge remote-tracking branch 'tuskyapp/develop' 2020-06-19 14:40:57 +09:00
Konrad Pozniak df5490b5b9
upgrade gradle, AGP and dependencies (#1818)
* upgrade gradle, AGP and dependencies

* fix new layout related warnings
2020-06-04 20:16:48 +02:00
Levi Bard 84ad1807c8
One more layout fix for length-collapsed posts with preview cards (#1805) 2020-05-26 16:58:33 +02:00
kyori19 3ae4dc5397 Merge remote-tracking branch 'tuskyapp/develop' 2020-05-22 23:39:08 +09:00
Levi Bard 1c09441c32
Fix showing/hiding of preview cards in timeline posts that are collapsed for length. (#1796)
Also properly places the preview card after the "collapse for length" button.
2020-05-21 18:32:22 +02:00
kyori19 1370eedc10 Merge remote-tracking branch 'tuskyapp/develop' 2020-04-09 00:34:31 +09:00
Levi Bard 3edc47aa4a
Add option to show link previews in timelines (#1681)
* Add option to show link previews in timelines.
Addresses #1075

* Indent cards in non-selected statuses when viewing threads

* Indent cards in timelines

* Fix clipping of right side of preview in timelines
2020-03-02 19:34:31 +01:00
kyori19 fbb1c5aee6 Merge remote-tracking branch 'tuskyapp/develop' 2020-02-12 12:16:30 +09:00
Konrad Pozniak 8767d2ed3d
Theme refactoring (#1656)
* Theme refactoring

* disable the automatic tinting of surfaces with elevation in dark mode

* make the media warning visible again with the dark theme

* fix nav bar on api 27+

* use correct color for all media warnings
2020-01-30 21:37:28 +01:00
kyori19 b2739828dc Merge remote-tracking branch 'tuskyapp/develop' 2020-01-11 22:46:31 +09:00
Konrad Pozniak e5b78f65cf
use material buttons in timeline (#1627)
* use material buttons in timeline

* remove wrong switch option
2020-01-07 19:40:52 +01:00
kyori19 9efc4a4bc9 Merge remote-tracking branch 'tuskyapp/develop' 2020-01-05 01:02:28 +09:00
Konrad Pozniak 352ff3a2d1
give media previews a rounded outline (#1617)
* give media previews a rounded outline

* give media previews a rounded outline in ReportActivity
2020-01-03 20:22:16 +01:00
Ivan Kupalov 7623962a0d Use blurhash as image preview and as sensitive media cover, close #1571 (#1581)
* Use blurhash as image preview and as sensitive media cover, close #1571

* Fix focal point for blurhashes

* Fix video indicator overlapping sensitive media indicator

* Add a preference for blurhash

* Add blurhash to report UI.

* Introduce StatusDisplayOptions
2019-12-30 21:37:20 +01:00
kyori19 fb3263b76d Merge remote-tracking branch 'tuskyapp/develop' 2019-11-19 23:42:22 +09:00
kyori19 762b2225ca Merge remote-tracking branch 'tuskyapp/develop' 2019-11-19 21:52:13 +09: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 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
Konrad Pozniak 9a3b92ecbc
change active boost icon (#1513) 2019-10-03 18:55:32 +02:00
Billy Brawner 0b1c3d6c40 [visibility-icon] Add visibility icons to statuses 2019-09-05 21:29:45 +09:00
kyori19 573be935a7 [quote] Implement quote feature 2019-09-03 23:08:13 +09:00
Konrad Pozniak 588775ff9b
cleanup code in StatusViewHolders (#1418)
* cleanup code in status ViewHolder

* add check for reblogButton back in
2019-07-27 21:53:28 +02:00
Konrad Pozniak 578b816a8e
fix eye menu icon in thread view (#1372) 2019-07-07 17:57:41 +02:00
Konrad Pozniak b95ff10a3c
Unlimited number of poll options (#1340)
* implement unlimited number of poll options

* fixes

* extract percent calculation into function so it can be used anywhere

* add license header
2019-06-22 21:55:03 +02:00
Ivan Kupalov d827bd120f Show media descriptions in timeline when previews are disabled. (#1284) 2019-06-22 20:38:53 +02:00
Konrad Pozniak 83696b5c7f
Animate gif avatars (#1279)
* animate gif avatars

* add setting to enable avatar animation

* cleanup code
2019-05-26 08:46:08 +02:00
Konrad Pozniak 561d4cc284
support custom emoji fonts in poll options (#1250) 2019-05-10 20:08:22 +02:00
Konrad Pozniak b8c32a96de
Poll fixes (#1238)
* update cache when voting on a poll

* fix poll controls color

* don't allow voting on old poll from cache

* check for RecyclerView.NO_POSITION in click listener

* fix crash when voting in a boosted poll
2019-05-05 08:26:17 +02:00
Konrad Pozniak e735e4843e
Poll notifications (#1229)
* show poll notifications in the app

* show poll notifications in the app

* allow filtering poll notifications in the poll fragment

* show poll notifications in system notifications
2019-05-02 19:44:35 +02:00
Konrad Pozniak 8d01e54caf
add support for multiple choice polls (#1212) 2019-04-28 09:58:17 +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
Levi Bard 391cd12974 Add bot indicator overlay to avatars (#1173)
* Add bot indicator overlay to avatars

* Add bot overlay to account list in search view

* Add preference for bot avatar overlay
2019-04-09 20:13:25 +02:00
Konrad Pozniak 0506bfa7d6
remove todos from status layouts (#1112)
* remove todos from status layouts

* remove todo from account autocomplete layout
2019-03-08 20:27:30 +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
Conny Duck 683b06a35d upgrade deps, fix some lint warnings 2019-02-11 16:59:01 +01:00
Ivan Kupalov 20f257c35b Fix layout issue with narrow timelines (#982) 2019-01-11 07:36:14 +01:00
Ivan Kupalov 0300a11d1e Fix layout issue with long CWs (#978) 2019-01-10 20:41:39 +01:00
Ivan Kupalov 38c7c8c71a Rework status layouts with ConstraintLayout (#967)
* Migrate item_status_detailed layout, minimum

* Migrate item_status_detailed layout, buttons

* Migrate item_status layout, minimum + buttons

* Migrate status layouts, fix RTL, cleanup

* Fix item_status layout

* Fix item_status name layout, fix CW button

* Simplify item_status, item_status_detailed layouts with chains

* Apply statuses layout feedback
2019-01-06 10:39:42 +01:00
jchmrt 30df1cf403 Set image previews correctly according to their focal points (#899)
* Add serialization of the meta-data and focus objects

These objects are added in some attachments. This commit adds data
classes which are able to serialize these (partially) in preparation
for the ability to honour the focal point information in image
previews.

* Implement correctly honouring the focal point meta-data in previews

This commit adds code which ensures that the image previews of media
attachments to toots are correctly cropped to always show the focal
point of the image (if it is specified). It should not in any way
influence how previews of media without a focal point are shown.

To achieve the correct crop on the image a few components were
needed:

First of all we needed a way to influence how the image is cropped
into the ImageView. It turns out that the preferred way to do this is
by setting the ScaleType to MATRIX and adjusting the matrix of the
image as needed. This matrix allows us to scale and transform the
image in the way we need to make sure that the focal point is visible
within the view. For this purpose we have the FocalPointEnforcer which
can calculate and set the appropriate matrix on an ImageView as soon
as the image is loaded.

However a second problem is that we need to make sure that this matrix
is updated whenever the size of the ImageView changes. The size might
change for example because the orientation of the device changed from
portrait to landscape or vice versas, or for a number of other reasons
such as the screen being split vertically or something like that.

To be able to hook onto this event we need to create a new extended
version of the ImageView class, which we call
MediaPreviewImageView. This class behaves exactly the same as a normal
ImageView, however if the focalPointEnforcer of this view is set, then
it will call this enforcer to update the image matrix any time the
size is changed.

So this commit changes all media previews in the item_status.xml and
item_status_detailled.xml layout files to the new
MediaPreviewImageView class. Additionally in the code for loading the
images into the previews a new case is added which tests if there is a
focus attribute in the meta-data. If so it makes sure to create and
set the FocalPointEnforcer.

* Fix typos in documentation comment

"to" -> "too"

* Use static imports to remove clutter in FocalPointEnforcerTest

Instead of duplication Assert. in front of every assertEquals, simply
statically import it.

* Move the MetaData and Focus classes into the Attachment class

Since they are very strongly linked to the attachment class and are
themselves very small.

* Refactor the focal point handling code

- All the code modifying the actual members of the
  MediaPreviewImageView is now in this class itself. This class still
  uses the FocalPointUtil to calculate the new Matrix, but it now
  handles setting this new Matrix itself.

- The FocalPointEnforcer has been renamed to the FocalPointUtil to
  reflect that it only calculates the correct matrix, but doesn't set
  anything on the MediaPreviewImageView.

- The Matrix used to control the cropping of the
  MediaPreviewImageViews is now only allocated a single time per view
  instead of each time the view is resized. This is done by caching
  the Matrix and passing it to the FocalPointUtil to update on each
  resize.

* Only reallocate focalMatrix if it is not yet initialized

This helps prevent unnecessary allocations in the case where
setFocalPoint is called multiple times.

* Change checking of availability of objects to use != null

As pointed out, the 'is' keyword is meant for checking types, not for
checking non-nullness.

* Make updateFocalPointMatrix() return nothing

This makes it clearer that it actually mutates the matrix it is
given.

* Fix bug with transitions crashing the PhotoView

Due to the android transitions for some reason copying the scaletype
from the MediaPreviewImageView to the PhotoView during the transition,
the PhotoView would crash on pictures with a focal point, since
PhotoView doesn't support ScaleType.MATRIX.

This is solved by the workaround of overriding both the getScaleType
and setScaleType methods to ensure that we use the MATRIX type in the
preview and the center_crop type in the PhotoView.

Additionally this commit also makes sure to remove the focal point
when the MediaPreviewImageView is recycled.

* Fix bug in overriden getScaleType

Instead of simply returning the scaleType we need to return the
super.getScaleType() method, to avoid crashing.

* Merge changes from master

Mainly the migration to androidx.
2018-12-28 16:32:07 +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
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
Konrad Pozniak 4402f3d337
update minSdkVersion to 21 (#843)
* set minSdkVersion to 21

* use elevation instead of additional views for shadow

* clean up code occurrences

* remove drawable compat code

* remove no longer needed resources

* remove unneeded android:clipChildren="false"

* Revert "remove no longer needed resources"

This reverts commit 67a4d6f8d87b3f116b95d90dfb48f350d342f503.

* remove no longer needed resources (this time the right ones)
2018-09-16 18:54:12 +02:00