Skip to content

Commit

Permalink
Version 0.8.2
Browse files Browse the repository at this point in the history
Fixed path is convex crash on some devices
  • Loading branch information
Rishabh Harit committed Jun 17, 2019
1 parent 57c4e84 commit 9e4fe44
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 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.1'
libraryVersion = '0.8.2'

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

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import android.content.Context
import android.graphics.*
import android.os.Build
import android.util.AttributeSet
import android.util.DisplayMetrics
import android.view.View
import android.view.ViewOutlineProvider
import androidx.appcompat.widget.AppCompatImageView
Expand Down Expand Up @@ -207,7 +206,11 @@ class RoundedImageView : AppCompatImageView {
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
inner class RoundedRectangleOutlineProvider : ViewOutlineProvider() {
override fun getOutline(view: View, outline: Outline) {
outline.setConvexPath(path)
try {
outline.setConvexPath(path)
} catch (iae: IllegalArgumentException) {
outline.setRoundRect(_paddingStart, paddingTop, pathWidth + _paddingStart, paddingTop + pathHeight, cornerRadius.toFloat())
}
}
}

Expand Down

0 comments on commit 9e4fe44

Please sign in to comment.