Skip to content

Commit

Permalink
Fixed requested changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
turkergoksu committed Sep 30, 2020
1 parent c366ffa commit 104c6e0
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions lib/src/main/java/com/faskn/lib/ClickablePieChart.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import androidx.core.widget.ImageViewCompat
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.faskn.lib.legend.LegendAdapter
import kotlin.math.abs
import kotlin.math.atan2
import kotlin.math.cos
import kotlin.math.sin
Expand Down Expand Up @@ -75,23 +76,19 @@ class ClickablePieChart @JvmOverloads constructor(
context.theme.obtainStyledAttributes(attrs, R.styleable.ClickablePieChart, 0, 0)

try {
// Popup text
popupText = typedArray.getString(R.styleable.ClickablePieChart_popupText) ?: ""

// Show percentage
showPercentage = typedArray.getBoolean(R.styleable.ClickablePieChart_showPercentage, false)
showPercentage =
typedArray.getBoolean(R.styleable.ClickablePieChart_showPercentage, false)

// Animation duration
animationDuration = typedArray.getInt(R.styleable.ClickablePieChart_animationDuration, 0)
if (animationDuration < 0) animationDuration = 0
animationDuration =
abs(typedArray.getInt(R.styleable.ClickablePieChart_animationDuration, 0))

// CenterPaint color
centerPaint.color = typedArray.getColor(
R.styleable.ClickablePieChart_centerColor,
ContextCompat.getColor(context, android.R.color.white)
)

// Show popup
showPopup = typedArray.getBoolean(R.styleable.ClickablePieChart_showPopup, true)
} finally {
typedArray.recycle()
Expand Down

0 comments on commit 104c6e0

Please sign in to comment.