Commit Graph

239 Commits

Author SHA1 Message Date
Evan Hahn
eff8c4c2a3 Support attributed strings in action sheet messages
This change should have no user impact, but makes a future change
easier.

`ActionSheetController` supports string messages, but now it also
supports `NSAttributedString` messages. That lets us include styling
(like bold) and links.
2023-03-21 10:55:46 -05:00
Evan Hahn
6083ddd456 Clean up OWSActionSheets
This change should have no user impact.

This makes a few changes to `OWSActionSheets`:

- `OWSActionSheets` is now an enum (with an Objective-C bridge)
- Some unnecessary methods were removed
- Fixed some long lines

It also removes the payment-specific
`OWSActionSheets.showPaymentsOutdatedClientSheetIfNeeded` extension. It
didn't add much and required passing a global object, so I removed it.
2023-03-21 10:55:46 -05:00
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
Igor Solomennikov
71cbc9d80d
Rename OWSVideoPlayer to VideoPlayer and stop exposing class to ObjC. 2023-03-15 11:52:19 -07:00
Harry
a146e18aaf
Set up account state and exit registration
* Go to chat list view after registration

* sync system contacts during registration

* Use explicit local credentials for storage service operations during registration

* fix tests

* Quick hack to get through double pin confirmation

* Finishing touches

* lint

* fix build

* reload phone number discoverability after storage service sync

* fix tests again

* Take chat auth on account and contact record initializers

* Change around branches for clarity in OWSUserProfile

* pr comments

* Split ChatServiceAuth into the same and AuthedAccount

* fix tests

* merge woes
2023-03-09 21:54:51 -08:00
Max Radermacher
898fd2c4d5
Clean up queue names 2023-02-27 14:16:09 -08:00
Evan Hahn
e2caeaa41f
Use consistent User-Agent for content proxy and captcha view 2023-02-24 08:28:37 -06:00
Max Radermacher
fdbdc9716d Swiftify formatDuration(seconds:…) 2023-02-22 14:05:35 -08:00
Sasha Weiss
d4760dc8b2
Show username edit/delete action sheet from profile settings 2023-02-13 18:03:14 -08:00
Sasha Weiss
1b2eda3851
Strip username from MentionPicker 2023-02-08 13:34:57 -08:00
Sasha Weiss
e5f1af6c2e
Support lookup-by-username 2023-02-08 10:16:57 -08: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
743c4e261c
Fix background for text overlays in media editor not preserving rounded corners. 2023-02-07 12:55:51 -08:00
Adam Mork
f405846faa
[Payments] Inset Styling Update for Payments
* inset styling updates, squashed to one commit off latest main

* linting
2023-02-06 09:13:35 -08:00
Igor Solomennikov
b46ee3380e
Fix debug crash when doing double-tap on image in media review screen. 2023-02-03 17:40:39 -08:00
Adam Mork
728862da6f
[Payments] Biometry Payments Lock
* payment lock

* add 30 day timeout to showing the payment lock suggestion

* fix linting

* update comment

* Payment Lock: Fix project file & submodules (#4878)

* revert ringrtc changes

* revert pods changes

* fix project file

* PR Comment suggestions and fixes

* PR suggestions

* revert screen lock to previous implementation

* rename OWSPaymentLock to OWSPaymentsLock (missing plural s), remove
super-class dependency. Make OWSPaymentsLock more "swifty".

* revert changes to call-site for OWSScreenLock

* update call-sites for OWSPaymentsLock

* forgot to add PaymentOnboarding class and localization comment improvements

* change function call-site

* Remove OWSLocalAuthentication from project

* remove OWSLocalAuth from project file

* make edge-case default more secure if storage not ready

* fix project file

* lint fix

* fix linting errors

* Revert compact format style for OWSLocalizedString

* fix localization call-sites to use literals, update localization file after autogen

* Add new Payments Lock Prompt view to be shown after activating payments. Factor out the BiometryType "current biometry" into its own class with helpers to easily getting the devices current setup.

* fix linting issues, sort project file, and autogen localizations

* require payments lock to look at the recovery phrase

* fix linting issue

* fix missing localizations (caused by dynamic creation in previous commit)

* use Pods commit from signal/main

* re-run linter on latest commits

* new header comments for new branch files

* update submodule commits

* Use existing secondsInDay constant kDayInterval, use weak self guard statement instead of optional self in escaping closure.

* Revert submodule changes

* Remove duplicate copyright headers

* Revert copyright header changes

* Restore some missing translations

* Add localization for unknown LocalAuthentication error/state.

* remove Pods changes

* linting

* use submodule commits from main

* subclass the old Objc OWSViewController super-class, should fix CICD

* change capitalized Passcode to lower-case in non-title situation.

* remove early exit guard from biometryType computed function. Reason being that the type can be gathered from a policy that evaluates to false. In a case where the user has a FaceID phone but its disabled, the messaging would be incorrect. removing the early exit evaluates the biometryType which apple provides even if the policy returns false.

* inline snooze date

* inject write transaction to some convenience methods to reduce database overhead when multiple calls need to happen at the same time.

* make combined set and snooze function, update combined call-site

* rename long function

* use false instead of sender.on to avoid sneaky view issues

* add tryToUnlockPromise function to clean up call sites

* change superclass, fix Promise statement

* call super class function

* remove objc

* add unlock failed action sheet helper class and put at all relevant call-sites, still need to test though.

* add unlock failed action sheet helper class and put at all relevant call-sites, still need to test though. linting

* project file changes for new file

* re-render payments lock toggle after failure to change setting.

re-render payments lock toggle after failure to change setting.

* move around action sheet call-site to account for an action sheet already being presented. remove unecc. return

* fix merge conflicts, linting

* re-gen strings file

---------

Co-authored-by: Max Radermacher <max@signal.org>
2023-02-03 12:56:54 -08:00
Pete Walters
f1c4eb6b7b
Fix unreadable search result highlighting
CVTextLabel incorrectly attempts to set default .font
and .foregroundColor on the label text, removing any
existing font & color attributes. This results
in unreadable text when displaying search results.

Instead, add helper method to set default attributes on
attributed strings, but only on ranges that don't have the
attribute already defined.
2023-02-02 10:17:38 -06:00
Max Radermacher
015803297a
Add .notAllowed to editingAuthorization for iPad 2023-02-01 11:33:37 -08:00
Max Radermacher
0c3cec9146
Update SignalCoreKit
* Update filterForDisplay call sites
2023-01-31 12:34:07 -08:00
Max Radermacher
3a1556ca46 Clean up & Swiftify allSortedContacts 2023-01-30 12:15:11 -08:00
Max Radermacher
223f6926db Simplify fetching "All Signal Connections" 2023-01-30 12:05:11 -08:00
Sasha Weiss
98bd0ef77c
Add a button to share your username from profile settings 2023-01-27 16:22:34 -08:00
george-signal
4619eada2f
Change background color (#5724) 2023-01-26 14:46:30 -08:00
Evan Hahn
60ace0a8dc
Dismissing spinner shouldn't require callback
This is a minor change that should have no user impact.

We had a bunch of calls like this:

    modalActivityIndicator.dismiss {}

This makes the parameter optional, so you can do this:

    modalActivityIndicator.dismiss()
2023-01-20 18:11:55 -06:00
Max Radermacher
1311d3f665
Refactor contact access code
Split it based on whether the purpose is “editing” or “sharing”. If
we’re editing, it generally means we have full access to contacts, and
that we’ve checked which of the contacts are registered on Signal. If
we’re “sharing”, we don’t care whether or not they’re registered.

If we’re “sharing”, we check whether or not we’ve prompted for the
contacts permission yet. If not, we’ll show the prompt.

If we’re “editing”, we assume we’ve already prompted (which is already
the case today), so `.notDetermined` isn’t a possible state.

Other things to note:

- The `supportsContactEditing` was always true, so it’s been removed.

- The error when contacts access isn’t allowed is now shown more
  consistently. Previously, it was sometimes shown in response to
  initializing a view controller.

- Some RecipientPickerViewController code was moved from Obj-C to Swift.
  This is probably useful on its own, but it’ll also make it easier to
  build some new UI in subsequent commits.
2023-01-12 09:55:30 -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
e8788abc19
Fix vertical alignment of text in chat input bar. 2023-01-11 15:27:33 -08:00
Max Radermacher
a283045058 Improve collation methods in ContactsPicker 2023-01-10 14:43:09 -08:00
Max Radermacher
cbb7b07329 Make ContactCell conform to ReusableTableViewCell 2023-01-09 11:59:10 -08:00
Harry
7d89dfcb92
Don't let large custom keyboards break attachment keyboard height 2022-12-23 14:55:31 -08:00
Harry
98c124e3ee
Use solid color for dark theme navbar 2022-12-23 11:43:45 -08:00
Max Radermacher
46596ef33c Remove nonSignalContacts property 2022-12-21 14:24:38 -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
Harry
33e686319c
Use iOS 13+ UINavigationBarAppearance for navbar styling
* Use iOS 13+ UINavigationBarAppearance for navbar styling

* various individual view controller navbar style tweaks and fixes

* Remove unused navigation bar styles

* rename 'default' style blur

* Apply blur style to the UIVisualEffectView generated by UINavigationBarAppearance

* Use iOS 12 navbar blur method on iOS 13 since its bugged

* Fix on iOS 15, use old method on iOS 14

* PR comment nits

* explicitly invalidate KVO observers
2022-12-13 16:17:41 -08:00
Max Radermacher
6763747349
Attach link previews present in the message text 2022-12-07 16:13:49 -08:00
Igor Solomennikov
36954792b3
Larger margins around text overlay with a background in image editor. 2022-11-30 17:47:46 -08:00
Igor Solomennikov
8dcd75b0e0
Convert OWSBezierPathView to Swift. 2022-11-30 16:16:36 -08:00
Igor Solomennikov
ba17478464
Convert OWSTextView to Swift 2022-11-29 23:06:14 -08:00
Evan Hahn
173d8e793c
Swiftify OWSTextField
A pretty simple conversion. We had to mark it `open` so it could be
subclassed in other targets, but that was about the only difficult part.
2022-11-28 17:51:27 -06:00
Igor Solomennikov
dbb0824303
Improve animations in conversation input bar
* Make text input field's background translucent.

* Add animations to link preview panel in conversation input toolbar.

* Remove unused LinkPreviewViewDraftDelegate method.

* Add comment explaining layout logic.

* Improvements to "suggested stickers" panel in conversation input bar.

• ensure the panel doesn't show behind the text input area when sliding down.
• create panel lazily when it's needed for the first time.

* Do not disable user interaction on animated views in conversation input bar.

This change fixes an issue where Send button wasn't responsive for a few hundreds
of milliseconds after becoming visible.
2022-11-21 11:37:21 -08:00
Max Radermacher
b0e9af742a Fix missing animation when sending a message
Prior to 6a7d6c0fae, this comparison used
`isEqual:`. However, none of the `LinkPreviewState` concrete
implementations provided `isEqual:` implementations, so it was
equivalent to pointer equality. After that commit, these types no longer
subclassed `NSObject`, so the equality check always failed.
2022-11-09 14:15:21 -08:00
Harry
ca64272c56
Fix janky animation caused by uneccessary navbar hidden state changes
* Fix janky animation caused by uneccessary navbar hidden state changes

* Temporary fix for layout crash issues that re-introduces navbar sizing issue
2022-11-08 16:56:03 -08:00
Evan Hahn
198fc1784a
Consolidate one-time & monthly donation screens
Previously, one-time donations were on one screen and monthly donations
were on another. Now, they're on a single screen with a picker.

Most of the interesting changes are in `DonateViewController`.

Other things of note:

- There are some new TODOs here for existing bugs I didn't fix. For
  example, one-time donations don't do so well if there are any problems
  at all.

- Even though we only support Apple Pay, there's code that alludes to
  additional payment methods. For example,
  `DonateChoosePaymentMethodSheet`. We'll expand on this in the future.

- Users should only be able to select currencies that the server
  supports. For example, you shouldn't be able to select EUR if the
  server doesn't support euros. This wasn't working correctly before,
  but is fixed here.

  We already fixed one part, where users could change to an unsupported
  currency (see dab02f30ae). However, if
  your _default_ currency is unsupported and you didn't change it,
  that's no good. This is unlikely for most users but could happen.

  I fixed this by changing it from (effectively)
  `Locale.current.currencyCode ?? "USD"`, which might not be supported,
  to a preference list, choosing the first one the server likes.

- I skip animations if the Reduce Motion setting is enabled.

- On the donation screen, the logic for the preview badge has changed
  slightly. If you already have a badge, we'll always use that.
2022-11-08 16:27:50 -06:00
Igor Solomennikov
8a2fc1134f
Update text overlay UI in photo editor to match text story composer UI.
• same layout of text styling toolbar (Done button is new in the UI).
• default text color to white.
• now only allow to change text styling (color, font etc) while editing text;
  previously one could also update style after simply selecting a text overlay.
• clean up keyboard handling in photo editor's text overlay tool.
2022-11-08 11:26:54 -08:00
Igor Solomennikov
6a7d6c0fae
Switify some code related to ConversationInputToolbar.
* Remove "@objc" attribution in places related to ConversationInputToolbar where that is no longer necessary.
* Swiftify LinkPreviewState protocol.
* Convert ConversationScrollButton to Swift.
2022-11-07 16:32:59 -08:00
Igor Solomennikov
d8fc50cb42
Convert ConversationInputToolbar to Swift. 2022-11-07 16:22:51 -08:00
Max Radermacher
9439cc5191
Clean up recipient picker contact/group cells
- Move recipient picker code to the correct file.

- Add a helper to fetch typed reusable table view cells.

- Only set shouldUseAsyncSelection in the one place that uses it.

- Remove some code that was duplicated between sync/async selection.

- Fix some strong references in the async preparation flow.

- Allow network errors when preparing recipients -- these may do network
  fetches, and those can fail for non-interesting reasons.

- Move FindByPhoneNumberDelegate to Swift & make some code private.
2022-11-07 13:02:45 -08:00
Harry
aafb484583
Fix navbar size sometimes blinking when pushing conversations 2022-11-04 19:32:32 -05:00
Max Radermacher
49d7896f8e
Update “Find by Number/Username” to latest designs
Some changes:

- Convert most of the code to Swift.

- Update the search result section headers to “Find by Number”/“Find by
  Username” instead of “Phone number search”/“Username search”.

- Remove “New message to:” from the rows & update the icons.

- Don’t look up phone numbers until the user taps the row. As a result,
  there’s no “No user found. Invite via SMS?” row.

- Restore the invite via SMS feature if the user can’t be found. If a
  number appears unregistered, we’ll offer to send an SMS.

- Start showing search results after 3 digits (approximately).

- Show potentially-invalid phone numbers to avoid results that disappear
  if you happen to type a digit incorrectly.
2022-11-04 13:40:13 -07:00
Max Radermacher
f5eceb622a Make it explicit where we download missing avatars 2022-11-03 16:58:49 -07:00