Skip to content

Conversation

@SergioEstevao
Copy link
Contributor

@SergioEstevao SergioEstevao commented Mar 29, 2017

Closes #385
Relate to this: wordpress-mobile/WordPress-iOS#6824

On this PR I'm converting the Title to an UITextView to allow multiple lines and adjusting the size of it depending of the text inserted.

I'm also adding a placeholder label because UITextView doesn't have placeholder labels!

How to test:

  • Start the demo app
  • On any of the demos app check the title placeholder shows correctly
  • Enter text on the title that expand to multiple lines and see if layout adapts correctly.

screen shot 2017-03-29 at 14 07 10


// MARK: - Title and Title placeholder position methods
func updateTitleHeight() {
let sizeThatShouldFitTheContent = titleTextField.sizeThatFits(CGSize(width:self.view.frame.size.width - ( 2 * Constants.margin), height: CGFloat.greatestFiniteMagnitude))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe move the CGSize instantiation one line upwards, to aid readability?

  • No need to use self nor size. view.frame.width should do the trick!

}

func updateTitlePlaceholderVisibility() {
self.titlePlaceholderLabel.isHidden = !self.titleTextField.text.isEmpty
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to use self

@jleandroperez
Copy link
Contributor

Only thing i'm not really sure about is: since we don't currently support "Scrolling the Title" to get it out of the way, in the multiline title scenario, users might end up with something like this:

screen shot 2017-03-29 at 5 34 07 pm

Note that "Line 1 ... 3" cannot be scrolled, and the edition area ends up being quite tight (this is on the iPhone SergioEstevao!).

Thoughts on this one? (Maybe we wanna delay this a bit until we can also implement the scrollabe title behavior, or merge it, but cap the mechanism to just one line, temporarily?)

@SergioEstevao
Copy link
Contributor Author

@jleandroperez I will tackle the title view scrolling out of the way next. Just after this PR is in.

Copy link
Contributor

@jleandroperez jleandroperez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me @SergioEstevao!. Worst case scenario, we can always cap the title's height, temporarily.

Nice work!

:shipit:

@SergioEstevao SergioEstevao merged commit 875adc6 into develop Mar 30, 2017
@SergioEstevao SergioEstevao deleted the issue/extend_title_view branch April 4, 2017 11:41
brbrr added a commit that referenced this pull request Nov 10, 2017
brbrr added a commit that referenced this pull request Dec 1, 2017
* Add AztecUITests to AztecExample scheme

* Add tests for #393

* Add #675 UI test and some refactoring

* Add #465 UI test

* Make tests work on iPhone SE

* Updates after PR review

* Add tests #771 & #768

* dont do missclick when mediaButton is not Hittable

* Reset simulator state before test run

* Check programatically whenever options strip is in expanded postion

* minor changes, some work on PageObject refactoring

* fix project structure

* tweaking failed test

* another tweak for failed test

* tweak for swiping issue on iPhone SE

* clean-up

* Add some reliability to tests on bigger screens

* Tests passing on iPads 🎉
brbrr added a commit that referenced this pull request Dec 8, 2017
* Add AztecUITests to AztecExample scheme

* Add tests for #393

* Add #675 UI test and some refactoring

* Add #465 UI test

* Make tests work on iPhone SE

* Updates after PR review

* Add tests #771 & #768

* dont do missclick when mediaButton is not Hittable

* Reset simulator state before test run

* Check programatically whenever options strip is in expanded postion

* minor changes, some work on PageObject refactoring

* PageObject & first a bit complex formatting test

* Add UnorderedListWithRemovedStyles test & some PO refactoring

* Add complex styling test & further refactoring

* Add few more tests 🎉

* New tests and refactoring:
* Add more Formatting tests
* Add Link related tests
* Add AccesibilityIDs into EditorDemoControler
* Refactor some tests to use PageObjects

* fix locator name

* Add Images Tests

* Make tests pass on iPhone X
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants