Created
July 31, 2020 20:28
-
-
Save ricknout/379c179ceb5a59ac9867d80e117d917c to your computer and use it in GitHub Desktop.
MDC-Android shape elevation in custom views
This file contains hidden or 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 */ | |
class AppCustomView ... { | |
... | |
private lateinit var materialShapeDrawable: MaterialShapeDrawable | |
override fun setElevation(elevation: Float) { | |
super.setElevation(elevation) | |
materialShapeDrawable.setElevation(elevation) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment