Skip to content

Commit

Permalink
Fix minSdkVersion to small bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
pokercc committed Nov 6, 2020
1 parent 0cd4b4e commit f2faa4a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ import kotlin.math.absoluteValue
* @date 2020-10-20 00:10:19
*/
@Suppress("unused", "MemberVisibilityCanBePrivate")
class BoxShadowLayout(context: Context, attrs: AttributeSet? = null) : FrameLayout(context, attrs) {
class BoxShadowLayout @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
) : FrameLayout(context, attrs, defStyleAttr) {

companion object {
private const val LOG_TAG = "BoxShadowLayout"
Expand Down Expand Up @@ -52,15 +54,13 @@ class BoxShadowLayout(context: Context, attrs: AttributeSet? = null) : FrameLayo

init {
setWillNotDraw(false)
init(attrs, 0)
init(attrs, defStyleAttr)
}


private fun init(attrs: AttributeSet?, defStyle: Int) {
private fun init(attrs: AttributeSet?, defStyleAttr: Int) {
// Load attributes
context.obtainStyledAttributes(
attrs, R.styleable.BoxShadowLayout, defStyle, 0
).apply {
context.obtainStyledAttributes(attrs, R.styleable.BoxShadowLayout, defStyleAttr, 0).apply {
val vOffset = getDimension(R.styleable.BoxShadowLayout_shadowOffsetVertical, 0f)
setShadowVerticalOffset(vOffset)
val hOffset = getDimension(R.styleable.BoxShadowLayout_shadowOffsetHorizontal, 0f)
Expand Down
2 changes: 1 addition & 1 deletion config.gradle.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ android {
buildToolsVersion "29.0.3"

defaultConfig {
minSdkVersion 19
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
Expand Down

0 comments on commit f2faa4a

Please sign in to comment.