-
Notifications
You must be signed in to change notification settings - Fork 949
[Snackbar] Message View Styling. #1120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Snackbar] Message View Styling. #1120
Conversation
|
With seanoshea/BostonFreedomTrail@7185af9, seanoshea/BostonFreedomTrail#190 and bd88915, I seemed to be able to style the snack bar message background color and text color. |
Current coverage is 28.84% (diff: 14.28%)
|
|
Did a little investigation into how other view-based libraries manage this and found: I like the idea of overriding the getter and defaulting to the What do you think? |
|
I think there is a workaround where we don't have to check against nil. (Your concern above) I've pulled out my demo code to try and lock down the magic order / combination. [C&P some old notes on UIAppearance] Initial Thinking: Default values for properties annotated with UI_APPEARANCE_SELECTOR must be set in +initialize on the UIAppearance proxy.. Default values for properties annotated with IBInspectable should be set on the _ivar in -commonClassInit. If you have explicitly set a value to the property in your Storyboard, it will get set by the OS after this method. Default values for properties that are neither UI_APPEARANCE_SELECTOR nor IBInspectable should be set in -commonClassInit on the _ivar if they are non-zero. UIView subclasses should be annotated IBDesignable. UIView subclasses should have a -commonClassnameInit method that is called from both -initWithFrame and -initWithCoder. |
|
OK - I think all those Unsure of whether it makes sense to make these new properties I guess one other thing we could do in this PR would be to override |
boxes. Trying this as an experiment.
|
@seanoshea, @ianegordon don't worry about the Travis CI—I'll fix it later. |
|
@ajsecord - ok. Didn't realize that the travis-ci boxes came pre-packaged with Will fix my unit tests and revert that small change to the travis script. |
|
Yeah...it also looks like different versions of brew consider the "already installed" case to be error vs warning. Sorry for the confusion! |
|
Frustrated by the inability to fully unit test this out, but as there's no host window to add the I'm not exactly psyched about not having the PR have any unit tests associated with it - open to suggestions if you have any for testing out this kind of functionality. |
ianegordon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
We will revisit adding UITests when technology allows.
* Snackbar Message View Styling. * Small alteration to how colors are generated for the unit tests. * Not styling the snack bar in the init method. * Default styling for background views. * Remove overriding the styling in init. * Looks like swiftlint is already installed by default on travis-ci boxes. Trying this as an experiment. * Trying this? * Cant get unit tests to pass as there’s no window to add the message view to with logic tests.
* Extracts header code into method removing repetition * [AppBar] Header stack view in AppBarController (#1121) Since the header stack view is going to be laid out with auto layout, it should be inited with a CGRectZero. Doing it with self.view.bounds creates a tiny loop since the view is not loaded yet. * [ThumbTrack] Remove extra UIColor categories (#1122) * Pull the functionality of UIColor+MDC into MDCThumbTrack. MDCThumbTrack is now the only class using this behaviour, so three extra files have been removed now that they are no longer necessary. * Fixed colon alignment. * [Ink] Add nonnull to the MDCInkTouchController initializer (#1123) * Specify `nonnull` on the MDCInkTouchController initializer. This is a quick change since the initializer was never returning nil to begin with. * Update Shrine to use the nonnull MDCInkTouchController initializer. * Formatted all Objective-C sources with clang-format. (#1133) * [Scripts] Add scripts for "prepping" and cleaning the library/catalog/demo apps. (#1130) * Changed build_all to echo the xcodebuild command it is executing. * Added a clean_all script. * Added a prep_all script. * Updated README.md with new scripts. * Change Travis CI to use the new `prep_all` script. * Added a script to format Objective-C sources with clang-format. (#1132) * Added comment about Travis CI's 10.1 device bug. (#1135) * Removed the private/Color subspec. (#1128) * [Catalog] Center views in the Buttons (Swift and Storyboard) demo (#1126) * Center the Storyboard button demo. This uses an outer container to set up a view which is 50% the screen width (to allow for the other half of the button demo), and then an inner container to vertically and horizontally center the buttons. * Center the buttons added programatically. * Weakify strongify asynchronously dispatched snackbar view dismissal (#1136) * Update the button’s custom title color when the tint color changes. (#1134) * Add travis_wait prefixes on long-running commands. * Render Snackbar labels correctly for RTL (#1137) * Change the MDCInteractionTest deployment target to 8.0. (#1131) * Turn `inkController` into a lazy var. (#1139) This removes the need for storing it as an optional. * [ProgressView] Backward animation support (#1138) * Add backward progress animation mode support. This allows users to animate the progress view backward if they are giving it progress which is lesser than the current value. * Demonstrate the backward progress animation support. * Update the assets for the progress view. * Change ProgressViewExample with new enum name. * Updated enum names. * Update with new enum names. * Added script to install SwiftLint. (#1143) * Ran scripts/format_all. (#1141) * [Scripts] SwiftLint integration (#1129) * Integrate SwiftLint in the Catalog. * Update the disabled SwiftLint rules. * Reference a local swiftlint.yml symlink. This prevents us from getting warnings about code style violations from the other demos. * Fix SwiftLint violations in the Catalog and Components. * Ignore the `third_party` directory when running the linter. We should not have to deal with warnings in code we may not be able to fix easily. * Integrate SwiftLint into Shrine. Additionally, fix a number of warnings introduced. * Run SwiftLint on Travis. * Enable many of the previously disabled rules and correct them. * Fix control statement violations from SwiftLint. * Update README.md * Ignore "error" from already-installed brew packages. * [FlexibleHeader] - Update tests so as not to have 0 in contentSize (#1146) * Fixed broken links to versions.md. * Added component changes to CHANGELOG.md. * Added API diff, determined new version number is 20.0.0. * Bumped version number to 20.0.0. * Tell `brew install` to stop failing if swiftlint is already installed. * Changed clean script to force-clean Xcode projects. (#1144) * Fix SwiftLint warnings (#1149) * Exclude catalog/third_party from SwiftLint. * Added line length to .swiftlint.yml * Fixed SwiftLint warnings with some minor refactors. * Install SwiftLint via the install_contributor_tools script. (#1145) * Install SwiftLint via the install_contributor_tools script. * Exclude catalog/third_party from SwiftLint. * Added line length to .swiftlint.yml * Fixed SwiftLint warnings with some minor refactors. * Revert "Fixed SwiftLint warnings with some minor refactors." This reverts commit 2c19802. * Revert "Added line length to .swiftlint.yml" This reverts commit 12a6781. * Revert "Exclude catalog/third_party from SwiftLint." This reverts commit 8a00ad8. * [Collections] Added custom Storyboard cell to the Storyboard example. (#1152) * [Feature highlight] Dynamically size inner highlight (#1151) * Use instance based inner radius * Warning re ios sim * Scale outer highlight to encircle inner highlight * Dont scale innerhighlight pulsing with inner highlight size * Reset highlight example supplemental: * Build fix: CGFloat casts missing from MDCFeatureHighlightView.m. * More SwiftLint fixes for unit tests and example apps. (#1154) * ClangFormat changes. * Added swiftlint to scripts/format_all.` * Fix scripts/lint_all to work from any directory. * Fixed swiftlint invocation. * Remove the checks for force casting (! operator). * Some fixes. * More Swift fixes. * [Snackbar] Message View Styling. (#1120) * Snackbar Message View Styling. * Small alteration to how colors are generated for the unit tests. * Not styling the snack bar in the init method. * Default styling for background views. * Remove overriding the styling in init. * Looks like swiftlint is already installed by default on travis-ci boxes. Trying this as an experiment. * Trying this? * Cant get unit tests to pass as there’s no window to add the message view to with logic tests. * Fixed Shrine compilation. * [AppBar] - Added Modal Presentation App Bar Example (#1153) * ModalAppBar - Added additional AppBar example to display modal AppBar vc example * ModalAppBar - Added swift modal example * ModalAppBar - Updated naming * ModalAppBar - Updated swift example * ModalAppBar - Indentions and removed setting nil to title property * Moves the initialization of the header page into separate file * Moves the initialization of the header page into separate file
A replacement for #670.