Last active
August 25, 2020 18:04
-
-
Save ricknout/68d1408f3d880aaf8897d16716955621 to your computer and use it in GitHub Desktop.
MDC-Android MaterialShapeDrawable instantiation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Copyright 2020 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 */ | |
// Default constructor | |
val msd = MaterialShapeDrawable() | |
// ShapeAppearanceModel constructor | |
val msdFromSam = MaterialShapeDrawable(shapeAppearanceModel) | |
// Style/attr resources constructor (reads shapeAppearance and shapeAppearanceOverlay) | |
val msdFromStyles = MaterialShapeDrawable(context, attrs, defStyleAttr, defStyleRes) | |
// Cast from widget background | |
val msdFromWidget = widget.background as MaterialShapeDrawable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment