Commit Graph

19 Commits

Author SHA1 Message Date
Sasha Weiss
d267ec8305
Run swiftformat . 2025-12-30 11:34:05 -08:00
Harry
4ccfb958f6
Disable ai writing tools on all text fields in the app 2024-08-27 09:53:07 -07:00
Max Radermacher
42c704a4e3
Remove some debug/verbose lines 2024-03-19 19:24:54 -05:00
Igor Solomennikov
52f0015dfe
New set of icons. 2023-06-22 17:38:01 -07:00
Igor Solomennikov
0686b39547 Add necessary imports to Swift files.
Those would be required for future PRs.
2023-06-13 14:46:12 -07:00
Harry
f728457039
Update build target to iOS 13.0 2023-06-08 16:21:20 -07: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
9000a5cbb9
Add support for appropriate fonts for different scripts in Text Story composer / viewer. 2022-11-01 16:16:12 -07:00
Igor Solomennikov
55be3e6405
Make text input cursor same color as text in text story composer and photo editor. 2022-10-20 15:52:49 -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
Igor Solomennikov
bb9d0edabb
Update text color adjustment behavior in photo editor and text story creation.
• text story composer now has three options: colored text with no background,
colored text on white background, white text on colored background.
• text/background color is switched to black if user chooses background/text
color close to white, to avoid white on white look.
• photo editor has three options from above + white text with colored underline.
2022-10-12 23:19:07 -07:00
Igor Solomennikov
e1ed6cae08
Fix incorrect layout of bottom bar when editing text story without on-screen keyboard. 2022-10-12 10:10:45 -07:00
Igor Solomennikov
f8a0066284
Better layout for text story composer on iPad.
• Constrain text styling toolbar width to the width of the story card.

• Align Add Link and Background buttons with the leading edge of text story card.
2022-10-11 22:32:13 -07:00
Igor Solomennikov
d25a595f55
Media Composer: text styling toolbar now reflects currently selected font. 2022-10-11 10:55:02 -07:00
Igor Solomennikov
e926b26f5d
Text stories UI improvements
* Allow to force "compact" style for a link preview view.

Link previews should be displayed in "compact" mode when there's a significant
amount of text.

* RoundMediaButton should never be allowed to be made smaller than its desired size.

* Improved layout for text stories: both composer and viewer.

There is now a shared UI layout logic between editor and viewer, editor being
a subclass of viewer.

New behavior for composer:
 • text view will grow in height as much as possible and becomes scollable
   when max height is reached.
 • link preview starts in "regular" layout (image above the text) and then
   is updated to "compact" layout (image on the left, text on the right)
   as text view grows.

New behavior for viewer:
 • updated font sizes for match spec.
 • for extra tall stories text label is scaled down to fit.

* Fix bug where Proceed button would stay disabled after composing a text story.

* Fix two UX issues reported in PR review.
2022-10-05 12:46:03 -07:00
Igor Solomennikov
19cf2d07f6 Change font weight for 'regular' text style in text stories from Bold to Medium. 2022-09-21 11:33:27 -07:00
Igor Solomennikov
c8831ed921
Improved appearance for text on colored background in text story composer.
Also in photo editing UI - for text overlays.

Previous implementation used NSAttributedString's ability to set text background
color. Appearance wasn't impressive though as there wasn't a way to add padding
around the text or round corners for the background.

New approach is to add a rectangle background underneath the text - which
story viewer was already doing.
2022-09-20 12:52:43 -07:00
Igor Solomennikov
a6ff75a24c
Text story composer
* Hide camera controls when switching to TEXT.

* Streamline camera capture session state tracking.

Stop camera when switching to TEXT.

* Basic text story composer.

All UI works, but needs fine-tuning and tapping on Next (->) doesn't do anything.

* Run auto-genstrings.

* Adjust text size and alignment as user enters text.

1..49 characters: 34 pt, center-aligned.
50..199 characters: 24 pt, center-aligned.
200.. characters: 18 pt, natural alignment.

* Change default text color in text story composer to white.

* Added support for changing background of text story composer.

Selection is allowed from palette of 5 gradients and 11 solid colors.

* Improve vertical alignment of text in text story composer.

Text (and possible link preview panel in the future) should be vertically
centered in the area above either bottom controls or onscreen keyboard.

* Add UI for attaching a link preview to a text story.

* Add support for posting text stories.

* Lint.
2022-09-12 11:38:28 -07:00
Igor Solomennikov
37c0447a6e
Update to allow re-use of code related to text overlays in photo editor.
• rename VAlignTextView to MediaTextView.
• rename ImageEditorPaletteView to ColorPickerBarView.
• move text style declarations from ImageEditorTextItem to MediaTextView because
  those would no longer be specific to image editor.
• extract TextToolbar from ImageEditorViewController to a standalone public class
  that is supposed to work in conjunction with MediaTextView.
2022-08-23 17:30:20 -07:00