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

Development #22

Merged
merged 17 commits into from
Feb 22, 2021
Merged
Show file tree
Hide file tree
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
general api improvements
  • Loading branch information
EudyContreras committed Feb 22, 2021
commit e6ca2783ceccf2ee21460fa25d579f7ce29cf05a
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fun View.applyBoneDrawable(): BoneDrawable {
return BoneDrawable.create(this)
}

fun View.compareBounds(bounds: Bounds): Int {
internal fun View.compareBounds(bounds: Bounds): Int {
val xDiff = left - bounds.left.toInt()
val yDiff = top - bounds.top.toInt()
val widthDiff = measuredWidth - bounds.width.toInt()
Expand All @@ -64,7 +64,7 @@ fun View.compareBounds(bounds: Bounds): Int {
return xDiff + yDiff + widthDiff + heightDiff
}

fun View.getBounds(): Bounds {
internal fun View.getBounds(): Bounds {
return Bounds(
x = this.left.toFloat(),
y = this.top.toFloat(),
Expand All @@ -73,7 +73,7 @@ fun View.getBounds(): Bounds {
)
}

fun View.hasValidMinBounds(boneProps: BoneProperties): Boolean {
internal fun View.hasValidMinBounds(boneProps: BoneProperties): Boolean {
boneProps.minHeight?.let {
if (measuredHeight < it) {
return false
Expand All @@ -87,11 +87,11 @@ fun View.hasValidMinBounds(boneProps: BoneProperties): Boolean {
return true
}

fun View.hasValidBounds(): Boolean {
internal fun View.hasValidBounds(): Boolean {
return (measuredWidth > 0 && measuredHeight > 0)
}

fun View.hasDrawableBounds(boneProps: BoneProperties): Boolean {
internal fun View.hasDrawableBounds(boneProps: BoneProperties): Boolean {
return (measuredWidth > 0 && measuredHeight > boneProps.minThickness)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ class SkeletonProperties internal constructor() : Cloneable<SkeletonProperties>
* @see BoneProperties
*/
@Synchronized
fun addIgnored(ownerId: Int) {
ignoredIds.add(ownerId)
fun addIgnored(vararg ownerId: Int) {
ignoredIds.addAll(ownerId.asList())
}

/**
Expand Down Expand Up @@ -499,8 +499,7 @@ class SkeletonProperties internal constructor() : Cloneable<SkeletonProperties>
it.skeletonCornerRadii = this.skeletonCornerRadii?.clone()
it.shimmerRayProperties = this.shimmerRayProperties.clone()
it.stateTransitionDuration = this.stateTransitionDuration
it.boneProperties =
HashMap(this.boneProperties.mapValues { entry -> entry.value.clone() })
it.boneProperties = HashMap(this.boneProperties.mapValues { entry -> entry.value.clone() })
}
}

Expand Down