Skip to content

Commit

Permalink
Version 0.8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Rishabh Harit committed Jun 17, 2019
1 parent 9e4fe44 commit fcd133d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
6 changes: 3 additions & 3 deletions roundedimageview/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ext {
siteUrl = 'https://rishabh876.github.io/RoundedImageView/'
gitUrl = 'https://github.com/rishabh876/RoundedImageView.git'

libraryVersion = '0.8.2'
libraryVersion = '0.8.3'

developerId = 'rishabh876'
developerName = 'Rishabh Harit'
Expand All @@ -34,8 +34,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 28
versionCode 3
versionName "0.8.2"
versionCode 4
versionName "0.8.3"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,16 @@ class RoundedImageView : AppCompatImageView {
bl = roundedBottomLeft,
reverseMask = reverseMask)
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
outlineProvider = ViewOutlineProvider.BACKGROUND
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
if (outlineProvider == ViewOutlineProvider.BACKGROUND
|| outlineProvider is CircularOutlineProvider
|| outlineProvider is RoundedRectangleOutlineProvider)
outlineProvider = ViewOutlineProvider.BACKGROUND

if (isInEditMode && !reverseMask) {
clipToOutline = true
}
}
}

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
Expand All @@ -209,7 +217,9 @@ class RoundedImageView : AppCompatImageView {
try {
outline.setConvexPath(path)
} catch (iae: IllegalArgumentException) {
outline.setRoundRect(_paddingStart, paddingTop, pathWidth + _paddingStart, paddingTop + pathHeight, cornerRadius.toFloat())
if (roundedTopLeft && roundedBottomLeft && roundedBottomRight && roundedTopRight)
outline.setRoundRect(_paddingStart, paddingTop, pathWidth + _paddingStart, paddingTop + pathHeight, cornerRadius.toFloat())
else outline.setEmpty()
}
}
}
Expand Down

0 comments on commit fcd133d

Please sign in to comment.