Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use nullable types on primitive to avoid tons of (un)boxing #11

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into unnecessary-nullable
# Conflicts:
#	timerangepicker/src/main/java/nl/joery/timerangepicker/TimeRangePicker.kt
pelmenstar1 committed Sep 10, 2021
commit 3855468b71181d365643c94c75a956852c3342d9
Original file line number Diff line number Diff line change
@@ -29,7 +29,6 @@ import java.time.LocalTime
import java.util.*
import javax.xml.datatype.DatatypeFactory
import kotlin.math.*
import kotlin.properties.Delegates

class TimeRangePicker @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
@@ -45,7 +44,7 @@ class TimeRangePicker @JvmOverloads constructor(
private val _sliderRect: RectF = RectF()
private val _sliderCapRect: RectF = RectF()

private var _sliderWidth: Int = 8.px
private var _sliderWidth: Int = dpToPx(8f).toInt()
private var _sliderColor: Int = 0xFFE1E1E1.toInt()
private var _sliderRangeColor: Int = COLOR_NONE

@@ -64,7 +63,7 @@ class TimeRangePicker @JvmOverloads constructor(

private var _clockVisible: Boolean = true
private var _clockFace: ClockFace = ClockFace.APPLE
private var _clockLabelSize = 15.sp
private var _clockLabelSize = spToPx(15f).toInt()
private var _clockLabelColor: Int = COLOR_NONE
private var _clockTickColor: Int = COLOR_NONE

@@ -545,9 +544,8 @@ class TimeRangePicker @JvmOverloads constructor(
val iconSize = if(_thumbIconSize != -1) {
_thumbIconSize.toFloat()
} else {
min(24.px.toFloat(), _thumbSize * 0.625f)
min(dpToPx(24f), _thumbSize * 0.625f)
}

icon.setBounds(
(x - iconSize / 2).toInt(),
(y - iconSize / 2).toInt(),
You are viewing a condensed version of this merge commit. You can view the full changes here.