Commit Graph

47 Commits

Author SHA1 Message Date
Igor Solomennikov
de8c24d345
Media viewer improvements.
Change appearance of controls in media viewer:
 • use dark chrome background for top and bottom panels.
 • move "Delete" into (•••) submenu at the top.

Appearance tweaks for media album strip at the bottom of media viewer. 
 • update design to latest spec.
 • make media strip view configurable (border color and width, size, corner rounding).
2023-03-15 11:55:04 -07:00
Harry
003cc19e62
Update SignalCoreKit. Use explicit DispatchQueue instead of relying on the implicit type on promise 'on' params
* Use explicit DispatchQueue instead of relying on the implicit type on promise 'on' params

* Update SignalCoreKit
2023-02-07 16:14:39 -08:00
Igor Solomennikov
f264b4b70d
Improvements for "Media Review" screen.
* Enable zooming for photos and videos.
* Shrink media when keyboard is up.
* Fix minor animation issues on iPad.
* Fix "Add Message" placeholder not fading out properly.
2023-01-11 16:22:40 -08:00
Igor Solomennikov
6ac2646306
Clean up and consolidate logic for setting textContainerInset in MentionTextView.
Also fix logic for calculation of top and bottom text container insets for
smaller fonts.
2022-12-16 15:48:28 -08:00
Igor Solomennikov
8dfe095571
Animate input box height changes in the media flow. 2022-12-06 15:44:36 -08:00
Igor Solomennikov
d57e0d35b8
Update "Send" button icon to up arrow in all places. 2022-11-16 16:32:34 -08:00
Harry
520faa95df
Refactor OWSNavigationController
* make shouldCancelNavigationBack a var

* rename OWSNavigationView->OWSNavigationChildController

* forward delegate calls to OWSNavigationController

* apply theme and style to OWSNavigationBar consistently

fix themeing on gif picker controller

* Use topPinned navbar position. Size the blur effect view using the background view

* Use fade animation when hiding the navigation bar

* fix issues with reduced transparency setting

* pr feedback
2022-11-03 16:40:47 -07:00
Evan Hahn
b72449490c Use contains instead of filter(...).count > 0
This small change should speed up the attachment approval process.
2022-10-31 17:15:31 -07:00
Max Radermacher
ab55cf3929 Import SignalMessaging where it’s needed
The next commit removes a file that, through assorted Swift/Obj-C bridge
magic, resulted in SignalMessaging being available to all these files.
2022-10-24 10:19:06 -07:00
Evan Hahn
370ff654e7
Change license to AGPL
Change license to AGPL

This commit:

- Updates the `LICENSE` file

- Start every file with something like:

      // Copyright YEAR_FIRST_PUBLISHED Signal Messenger, LLC
      // SPDX-License-Identifier: AGPL-3.0-only

---

First, I removed existing license headers with this Ruby 3.1.2 script:

    require 'set'

    EXTENSIONS_TO_CHECK = Set['.h', '.hpp', '.cpp', '.m', '.mm', '.pch', '.swift']

    same = 0
    different = 0

    all_files = `git ls-files`.lines.map { |line| line.strip }
    all_files.each do |relative_path|
      if relative_path == 'Pods'
        next
      end

      unless EXTENSIONS_TO_CHECK.include? File.extname(relative_path)
        next
      end

      path = File.expand_path(relative_path)

      contents = File.read(path)
      new_contents = contents.sub(/\/\/\n\/\/  Copyright .*\n\/\/\n\n/, '')

      if contents == new_contents
        same += 1
      else
        different += 1
      end

      File.write(path, new_contents)
    end

    puts "updated #{different} file(s), left #{same} untouched"

I'm sure this script could be improved, but it worked well enough.

Then, I created `Scripts/lint/lint-license-headers` and ran it to auto-
fix a lot of files. This changed the mode of some files, but I think
that's actually desirable. For example,
`SignalServiceKit/src/Util/AppContext.m` previously had a mode of
`0755/-rwxr-xr-x`, and it's now `0644/-rw-r--r--`.

Then I fixed some stragglers and updated the precommit script.

See [a similar change in the Desktop app][0].

[0]: 8bfaf598af
2022-10-13 08:25:37 -05:00
Harry
3f0fe34089
Disable view once media in stories send flow
* Disable view once media in stories send flow

* Remove stories from picker if sending a view once media

* dont show view once button if sending to stories from sharesheet
2022-10-11 13:11:48 -07:00
Harry
c544e46ee1
Story fix bargain bin
* fix conflict between story viewer context menu drag and navigational pan gestures

* Fix RTL chevrons on story list

* swipe only between hidden stories OR visible stories, never both

* Add table row swipe actions for hiding/unhiding stories & update icons to sharp corners instead of rounded

* make story viewer context menu always dark theme to match design mocks

* dont fail dev builds when harmlessly double dismissing a context menu, which happens if backgrounding the app while the context menu is open

* update my story row icons to 16pt

* swipe to delete on my story rows

* Use themed icons. Get filled versions of various context menu icons from design
2022-09-26 17:10:10 -07:00
Nora Trapp
ae6b55b1bf Hide some extraneous back button labels 2022-09-12 15:35:02 -07:00
Jordan Rose
0f694d318c Allow ToastController to present from the top as well 2022-08-17 17:59:19 -07:00
Igor Solomennikov
915f3bd4f9
Redo media quality picker sheet in media editor.
• provide visual feedback when user selects media quality.
• add VoiceOver support.
• fix retain cycle caused leak of ActionSheetController objects.
• correct bottom margin on non-notch devices.
2022-08-05 11:03:35 -07:00
Jordan Rose
4f06a6d8a5 Fix incorrect uses of NotificationCenter block-based API
The block-based API returns a token that needs to be explicitly
unregistered, *and* the block should not capture 'self' strongly.
The fixes in this PR come in three flavors:

1. Switch to the selector-based API, sometimes taking advantage of
   the fact that extra arguments to an Objective-C method can be
   safely discarded (because they are passed at +0).

2. Save the observer token and unregister in deinit.

3. Comment why it's safe to leave the observer registered forever
   in this particular case.
2022-08-02 17:43:52 -07:00
Igor Solomennikov
32fffd4308 Media Editor: fix an issue when Pen and Crop button might not be visible.
Repro steps:
* have an album of three media: the first two are static, the last one is a video.
* go to the video and tap into message text input to pop the keyboard.
* dismiss keyboard and swipe to the static image.

Expected:
Static image tools buttons to be visible.

Result:
Static image tools buttons not visible.

Issue is a very weird one and likely is caused by some obscure bug with UIKit / UIStackView.
2022-07-25 17:00:56 -07: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
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 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
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
igor-signal
8b5ef88a88
Use "translucent dark" style for action sheets in media flow. (#4559) 2022-07-12 19:11:12 -07: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
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
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-signal
bf2ce630d9
Fix layout of mention picker in media editor's Review screen. 2022-07-07 11:42:05 -07:00
Igor Solomennikov
7f4a5f3f7b Merge branch igor/media-editor-updates. 2022-07-06 14:54:26 -07:00
Sasha Weiss (Signal)
2f4ded9d03
Fix reentrant DB read on mentions processing 2022-06-20 13:21:22 -07:00
Evan Hahn
c2e7f0ca93 Prefer implicit getters
_I recommend reviewing this with whitespace changes disabled._

This fixes violations of [SwiftLint's `implicit_getter` rule][0] by
removing explicit getters when an implicit one would do.

[0]: https://realm.github.io/SwiftLint/implicit_getter.html
2022-06-06 14:00:15 +00:00
Igor Solomennikov
db0c4e7c73 Fix crash when opening media flow with message pre-populated.
Steps to reproduce:
• open group chat and type a message containing "@" but don't send it.
• tap on + and select last photo/video from the strip.
• observe app crashing.

Cause of crash:
Attempting to access a child view controller of UIPageViewController
while using force unwrap when UIPageViewController's view is not yet loaded.

The fix:
• Remove force unwrapping (linter was complaining about that too).
• Add "isViewLoaded" check to the method that was causing the crash.
2022-05-25 11:42:04 -07:00
Evan Hahn
29c0ddf60e Fix violations of SwiftLint's attributes rule
_I recommend reviewing this with whitespace changes disabled._

Most of these were `@objc` being on the same line, which I fixed with [a
silly script][1]—probably could've used `sed` if I were wiser. The rest
were manual fixes.

See [the SwiftLint documentation for this rule][0].

[0]: https://realm.github.io/SwiftLint/attributes.html
[1]: https://gist.github.com/EvanHahn-Signal/d353c93fa269c82b96baca0a1086521f
2022-05-14 09:07:42 -05:00
Igor Solomennikov
8fe9963f16 Address PR feedback. 2022-04-22 11:15:21 -07:00
Igor Solomennikov
9349af7fa5 Fix incorrect (old) media editor layout in landscape on non-plus size devices. 2022-04-22 11:15:21 -07:00
Michelle Linington
37fe097812 Lint 2022-04-13 20:23:22 -07:00
Michelle Linington
d54d654cfc PR Feedback: Remove notImplemented altogether 2022-04-13 20:21:47 -07:00
Michelle Linington
6b2f8d31d6 Lint 2022-04-13 20:21:46 -07:00
Michelle Linington
cca09295e6 Adopt notImplemented() where it's unadopted
notImplemented() ends up forwarding to fatalError() anyway, but before
it does so it flushes our logs. That's probably good to have. I think
most of these come from the default implementations Xcode provides for
you with a fix-it.
2022-04-13 20:21:46 -07:00
Igor Solomennikov
d9acd69963 [MediaEditor] Fix typo that caused broken layout when in landscape mode. 2022-03-22 14:24:13 -07:00
Dimitris Apostolou
62724cf0be Fix typos 2022-03-18 11:31:06 -07:00
Martin Böttcher
8f9be31ba3 replaced NSLocalizedStringFromAppBundle with OWSLocalizedString 2022-03-08 10:17:25 +01:00
Martin Böttcher
c0adfbfb32 NSLocalizedString is replaced by NSLocalizedStringFromAppBundle (reading strings from the bundle of the main app) for all source files called by an app extension and the localizable files are removed for the app extension targets. 2022-03-07 13:29:06 +01:00
Igor Solomennikov
96c7b802de Slightly tweak position of photos/videos in media editor.
In order to minimize amount of moving elements when transitioning from
in-app camera to media editor.
2022-03-02 17:58:40 -08:00
Igor Solomennikov
d1a726f467 Do not use UIVC.automaticallyAdjustsScrollViewInsets - deprecated.
Use UIScrollView.contentInsetAdjustmentBehavior instead.
2022-01-31 15:41:18 -08:00
Matthew Chen
7d0485661d Move window manager to Signal target. 2021-10-19 17:59:13 -03:00
Matthew Chen
25f015d8bc Add SignalUI framework target. 2021-10-19 09:39:53 -03:00
Matthew Chen
21a8175795 Add SignalUI framework target. 2021-10-19 09:39:53 -03:00
Matthew Chen
c416609108 Add SignalUI framework target. 2021-10-19 09:39:53 -03:00