OffsetLinearDistanceFactor

class OffsetLinearDistanceFactor(@FloatRange(from = 0.0, to = Infinity) start: Float = 0.0f, @FloatRange(from = 0.0, to = Infinity) end: Float = 0.5f) : DistanceFactor, Parcelable

DistanceFactor based on two values.

Parameters

start

determines from which distance the factor starts to increase.

end

determines from which distance the factor is 1f.

Constructors

Link copied to clipboard
constructor(@FloatRange(from = 0.0, to = Infinity) start: Float = 0.0f, @FloatRange(from = 0.0, to = Infinity) end: Float = 0.5f)

Functions

Link copied to clipboard
abstract fun describeContents(): Int
Link copied to clipboard
open override fun factor(relativeDistance: Float): Float

The factor grows from -1 to 0 to 1. The slope depend on the start and end parameters of the class.

Link copied to clipboard
abstract fun writeToParcel(p0: Parcel, p1: Int)