Commit Graph

254 Commits

Author SHA1 Message Date
Igor Solomennikov
77d1f2b5ab
Fix regression caused OWSTableSheetViewController not use all available height.
OWSTableViewSheetViewController is inherited from InteractiveSheetViewController
and has additional size calculation logic that updates current sheet size based
on UITableView's contentSize. However, there's also a "max height" constraint
that also needs updating  - this commits adds that.
2022-07-21 09:43:30 -07:00
igor-signal
86e2c2c8e5
Add animations to controls in the in-app camera.
Also do some refactoring of controls to allow future changes.
2022-07-21 09:28:30 -07:00
igor-signal
3ad6c41a94
Fix "-0" could be displayed as current tilt (rotation) angle in Crop media view. (#4613) 2022-07-19 21:23:02 -07:00
Igor Solomennikov
75ef7d1482 Play haptic feedback when rotation control in Crop view crosses a mark. 2022-07-19 15:47:25 -07:00
Evan Hahn
c0c4a85d48 Fix InteractiveSheetViewController scrolling bug
Short story: we now properly decide whether the sheet is being resized
or scrolled, fixing the bug.

Long story:

Some users report that they can't scroll the forward message sheet
([example report 1][1], [example report 2][2]). This wasn't just a bug
with the forwarding sheet. It was a bug with all subclasses of
`InteractiveSheetViewController`.

When you gesture on the sheet, there are effectively two modes: "resize
the sheet mode", and "scroll the contents" mode. (See
`beginInteractiveTransitionIfNecessary` for a boolean that expresses
this.) The logic is effectively this:

    def getMode():
      if sheetHeight < maximumSheetHeight:
        # Note: there are some other ways to get this mode, e.g. by
        # grabbing the handle. But those aren't relevant for this bug.
        return "resize the sheet mode"
      else:
        return "scroll the contents mode"

Unfortunately, there was a bug in how we computed the max sheet height
if that height was larger than the height of the screen (e.g., in
landscape mode or on a shorter device). That bad height caused you to
get into "resize the sheet mode" incorrectly. This fixes that, and does
a few other cleanups.

[1]: https://github.com/signalapp/Signal-iOS/issues/5366
[2]: https://community.signalusers.org/t/beta-feedback-for-the-upcoming-ios-5-44-release/45401/3

Co-Authored-By: Igor Solomennikov <igor@signal.org>
2022-07-19 16:54:57 -05:00
Sasha Weiss
1687152665
Rename GroupManager+SignalMessaging to GroupManager+GroupInvites 2022-07-18 15:14:51 -07:00
Sasha Weiss
3f5a224916
Add fromViewController parameter to showActionSheet 2022-07-18 15:07:19 -07:00
Evan Hahn
e58c2c2455 Use new-style KVO in video player
This fixes one violation of [SwiftLint's `block_based_kvo` rule][0] in
our video player view.

I also removed a method (`playbackTimeDidChange`) for consistency.

[0]: https://realm.github.io/SwiftLint/block_based_kvo.html
2022-07-18 16:11:56 -05:00
Evan Hahn
486067130c Remove unused AttachmentCaptionViewController
It looks like this was removed in
7f4a5f3f7b.

`git grep -w AttachmentCaptionDelegate` and `git grep -w
AttachmentCaptionViewController` both return no results after removing
this file.
2022-07-15 17:15:53 -05:00
Nora Trapp
c2d9787cf7 PR Feedback 2022-07-15 15:05:03 -07:00
Nora Trapp
b67069e251 Add the editing of private stories 2022-07-15 15:05:03 -07:00
Nora Trapp
192c612bab Allow creation of private stories 2022-07-15 15:05:03 -07:00
Nora Trapp
d9c0a92ed4 Move dependencies needed for private story creation to SignalUI 2022-07-15 15:05:03 -07:00
Nora Trapp
b82cd6c654 Add ability to send to group stories 2022-07-15 15:05:03 -07:00
Nora Trapp
0dae510d07 Add '+ New Story' button to conversation picker 2022-07-15 15:05:03 -07:00
Igor Solomennikov
a71c59b9ad Fix issue making it impossible to activate popup menu in media editor's review screen.
Placeholder text view (the one that displays "Add Message") was stealing
focus and the fix is to disable user interaction for it.
2022-07-14 12:35:29 -07:00
igor-signal
e586969b57 Fix issue with rotation control in the media editor's crop tool.
Rotation control would show value outside of -45..45 range after leaving
crop tool and opening it again.
2022-07-14 12:12:04 -07:00
Igor Solomennikov
cb4a9bb9e5 Minor UI fix for the review screen in media editor.
Long recipient name in the top right corner would not be faded at the
end upon initial presentation.
This was happening because subviews did not have their final frames at
the end of `layoutSubviews`.
The fix is to call method that updates fading on next run loop run.
2022-07-14 12:09:35 -07:00
Evan Hahn
b12e3ae12e Explicitly invalidate observer in InputAccessoryViewPlaceholder
ARC should do this automatically, but I think it's better to be explicit
here.

See also: 16daabdd2e
2022-07-14 11:21:17 -05:00
Evan Hahn
d0fbb47c25 Fix input keyboard regression
I introduced a bug in 16daabdd2e.

In English: I accidentally added an observer to the _old_ superview
instead of the _new_ one.

In pseudocode: here's a diff of what went wrong:

     remove_observer_from(old_superview)
    -add_observer_to(new_superview)
    +add_observer_to(old_superview)
2022-07-14 11:21:07 -05:00
igor-signal
fc6bf2eca1
Increase max stroke width for drawing tools.
We want the default stroke width to be represented by a position
close to the center of the stroke width slider, with max value being
eight times the default value (four times for the blur tool) and min
value being 20% of the default value.

To do that slider value (which grows linearly) is raised
to power of 3 (2 for blur) when that value is > 1, and only then
that value becomes a multiplier for default stroke width.
2022-07-13 22:46:14 -07:00
Igor Solomennikov
50a54d0e73 Fix incorrect layout in review screen after rotating an image in Crop tool. 2022-07-13 17:55:28 -07:00
igor-signal
a02c18c972
Animate UI changes in the bottom toolbar in media review screen.
Animate UI changes in the bottom toolbar in media review screen.
2022-07-13 12:12:48 -07:00
Sasha Weiss (Signal)
7c61be5513
DRY out "message processing promise" 2022-07-13 10:02:17 -07:00
igor-signal
8b5ef88a88
Use "translucent dark" style for action sheets in media flow. (#4559) 2022-07-12 19:11:12 -07:00
Evan Hahn
16daabdd2e
Use new-style KVO input accessory view placeholder
_I recommend reviewing this with whitespace changes disabled._

This fixes one violation of [SwiftLint's `block_based_kvo` rule][0].

[0]: https://realm.github.io/SwiftLint/block_based_kvo.html
2022-07-12 19:25:59 -05:00
igor-signal
0c02bf9f29
[Media Editor] Fixes for text field in review screen.
• improvement: correct amount of padding between text field and keyboard.
• fix: text field isn't tall enough when there's a message draft and
  keyboard isn't up.
• fix: onscreen keyboard briefly changes style to 'light' upon dismissal.
2022-07-12 16:13:06 -07:00
Max Radermacher
d756a7c4d1 Avoid setters that don’t read newValue
This fixes our violations of [SwiftLint's `unused_setter_value`
rule][0].

[0]: https://realm.github.io/SwiftLint/unused_setter_value.html
2022-07-12 13:39:43 -07:00
igor-signal
c64320e75b
Improve crop view presentation.
Keep image center intact when transitioning to/from crop view to
eliminate unpleasant "jump".
2022-07-12 12:03:55 -07:00
Igor Solomennikov
f9e124145a [Media Editor] Don't slide buttons on the bottom when drawing and moving text.
Only slide buttons on-/off-screen when entering/leaving image editor.
2022-07-08 22:21:21 -07:00
Igor Solomennikov
70f4ab3fab [Media Editor] Do not wrap image editing tool VCs in a nav controller.
Two VCs: photo editor and crop view don't need a UINavigationController
and are fine presented as is.

Also remove unused `completion` parameter.
2022-07-07 15:38:25 -07:00
Igor Solomennikov
72d47eba28 Temporarily remove Sticker button from the media editor. 2022-07-07 13:13:53 -07:00
igor-signal
bf2ce630d9
Fix layout of mention picker in media editor's Review screen. 2022-07-07 11:42:05 -07:00
Max Radermacher
369118b045 Add support for replying to gift messages 2022-07-07 10:49:20 -07:00
Igor Solomennikov
ef1a56a299 Media Editor: Improved layout in for tall images (eg screenshots).
Fixes an issue where image would be displayed under bottom toolbar.
2022-07-07 08:37:34 -07:00
Igor Solomennikov
44b8cacce9 Disable insetsLayoutMarginsFromSafeArea in RoundMediaButton.
This is done to prevent incorrect layout when moving buttons off-screen
in ImageEditorBottomBar.

All instances of RoundMediaButton always have a fixed size and there are
no cases when it would be necessary for button's layoutMargins to include
safe area (which is inherited from the superview).
2022-07-07 08:37:34 -07:00
Igor Solomennikov
2fd17eda12 Animate controls on the crop screens in and out.
This change also fixes a bug when bottom buttons in the crop screen
were not visible. That happened because ImageEditorBottomBar by default
had its controls hidden (with the intent that they are animated in once
view controller's view is visible). That was a poor design choice on my
end and is fixed in this commit.
2022-07-07 08:37:34 -07:00
Igor Solomennikov
7f4a5f3f7b Merge branch igor/media-editor-updates. 2022-07-06 14:54:26 -07:00
Evan Hahn
d0c7de494a Computed accessors shold always be in the same order
`get`, then `set`. This fixes violations of [SwiftLint's
`computed_accessors_order` rule][0].

A very mechanical change.

[0]: https://realm.github.io/SwiftLint/computed_accessors_order.html
2022-06-24 09:35:07 -07:00
Evan Hahn
576d854c6f Remove unnecessary break statements
This fixes all of our violations of [SwiftLint's
`unneeded_break_in_switch` rule][0].

[0]: https://realm.github.io/SwiftLint/unneeded_break_in_switch.html
2022-06-24 09:32:34 -07:00
Evan Hahn
76c8d66702 Use "done" button on gift badge message keyboard
Goodbye "return", hello "done".

Clicking "done" will dismiss the keyboard.
2022-06-23 17:09:57 +00:00
Evan Hahn
5696c50d7d Make some outgoing message params optional
We frequently send outgoing messages with some parameters, like "link
preview" or "quoted reply", empty.

This change lets those parameters be omitted (instead of explicitly
empty) for brevity.

This is a stylistic change and should have no user impact.

Tested this by sending a regular message, a message with a link preview,
and two messages with photos.
2022-06-23 12:53:05 +00:00
Evan Hahn
b5b560a0fe Shorten message send expiry timer lookup
Similar to e79f37cc01.
2022-06-22 14:35:48 -07:00
Sasha Weiss (Signal)
5695809776
Prevent non-temporary-file attachments from being deleted when shared 2022-06-22 13:15:04 -07:00
Evan Hahn
7e0fa84c6d Only add necessary completion callbacks to message send transaction
You can add callbacks to be executed when a transaction completes. We
usually do this when sending messages, but not always.

Previously, the logic was "add a callback that runs the completion
function, if it exists." Now, the logic is "if the completion function
exists, add a callback that runs it."

I think this slightly better reflects our intent, and helps reduce
memory usage (and potential capturing?) slightly.
2022-06-21 16:46:59 +00:00
Sasha Weiss (Signal)
2f4ded9d03
Fix reentrant DB read on mentions processing 2022-06-20 13:21:22 -07:00
Nora Trapp
7bd167f815
Initial story sending support
* Little fix for context menu

* Add 'My Stories' section to stories tab

* Add new story thread types

* Show stories in conversation picker

* Support for sending stories

* Update story list when sending stories

* Add basic 'My Stories' view controller

* Initial stories settings screens

* Consolidate TSPrivateStoryThread and TSMyStoryThread into one class

* Require an explicit read transaction to initialize an outgoing message

* Fix linting

* Allow enabling group story from internal settings

* Fix tests

* PR Feedback
2022-06-10 22:28:03 -04:00
Max Radermacher
66a2638edd Don’t attach canceled link previews 2022-06-09 15:10:50 -07:00
Nora Trapp
a106ecdfdd Fix RTL layout of video playback progress bar 2022-06-08 16:58:56 -04:00
Evan Hahn
41c4be6b71 Remove useless override
This override stopped being relevant in
c4f967ef46, as far as I can tell.
2022-06-06 14:45:54 +00:00