10 Commits

Author SHA1 Message Date
Cody Weaver
8fa0811d63 #Dialog Add an API for the Dialog insets
PiperOrigin-RevId: 525523575
2023-04-19 12:45:42 -07:00
Nobody
1ffbee43b2 Fixed up imports and nullability for Dialogs
PiperOrigin-RevId: 485926719
2022-11-03 11:31:45 -07:00
Alyssa Weiss
18c9da00e0 Add an option that allows the title to scroll with the message for a MDCAlertController.
PiperOrigin-RevId: 406822869
2021-11-01 07:45:03 -07:00
Jeff Verkoeyen
25c9049d5a Optimizing imports
PiperOrigin-RevId: 356791916
2021-02-10 12:00:57 -08:00
Wenyu Zhang
313135ece2 [Dialogs] Add visibleAreaInsets support.
PiperOrigin-RevId: 317137957
2020-06-18 11:01:22 -07:00
Galia Kaufman
f4fd6d015f [Dialogs] replace the message UILabel type to UITextview
The type of the message in Material Dialogs was switched from UILabel to UITextView, That is done in order to support links in attributed text. We're seeing some differences in the text rendering in dialog snapshots. In some cases, the width of the dialog may also change, which can result in some other elements moving to maintain required spacing from the edges. Based on our testing, we're not expecting any other changes, so please let us know if you find anything unusual.

This change set includes:
* `messageLabel` was renamed to `messageTextView`.
* The UITextView has its editable flag set to false, and all internal padding set to
  zero, to ensure spacing remain the same as it was with UILabel.
* `scrollEnabled` was set to false to ensure text does't scroll when not needed (it
  still enables scrolling when needed: when there's more text than the visible area.)
* `backgroundColor` was set to `clear`. It seems UITextView's default is white, which
   breaks inverted/dark mode support.

Noticeable differences:
* `sizeThatFits` occasionally returns different width for some texts:
   -- Some texts result in a wider layout (ie: dialogs-presented-with-emphasis-buttons.png)
   -- Empty text views may have a non-zero height. Determining zero
      size based on `hasText` before calling `sizeThatFits` resolved the issue.
* Text rendering is slightly different in almost all snapshots.
* Links in attributed texts are rendered differently then before (ie: color).
* In a couple of RTL snapshot tests, I needed to set the RTL test direction before
  setting the message alignment for the test to work properly.

PiperOrigin-RevId: 313607718
2020-05-28 10:03:43 -07:00
Galia Kaufman
7346de3ce0 [Dialogs] Using the new Testing target in insets unit tests.
A followup for cl/305814799 - replacing calls to all private APIs in MDCAlertControllerInsetsTests.m with the new testing utilities in MDCAlertController+Testing.h

PiperOrigin-RevId: 305863373
2020-04-10 05:46:11 -07:00
Jeff Verkoeyen
9c32878a48 [Dialogs] Disable broken test.
b/153457451 tracking fix of the test.

PiperOrigin-RevId: 305861929
2020-04-10 05:26:51 -07:00
Galia Kaufman
8c7be049e9 [Dialogs] Moving static c helper functions outside of test classes.
PiperOrigin-RevId: 303289751
2020-03-27 02:46:49 -07:00
Galia Kaufman
6b790fe2e1 [Dialogs] Calculate title Insets independently of content insets (resolve scuba diff)
Insets calculations of the title and content panes in dialogs were using the same insets values, causing various misalignments.  This is fixed by ensuring that title calculations are using the titleInsets and that content calculations (of the message or accessory view) are using the content insets.

PiperOrigin-RevId: 303166366
2020-03-26 12:16:07 -07:00