Added in API level 1

PointF

open class PointF : Parcelable
kotlin.Any
   ↳ android.graphics.PointF

PointF holds two float coordinates

Summary

Inherited constants
Public constructors

PointF(x: Float, y: Float)

Create a new PointF initialized with the values in the specified PointF (which is left unmodified).

Public methods
open Int

Parcelable interface methods

Boolean
equals(x: Float, y: Float)

Returns true if the point's coordinates equal (x,y)

open Boolean
equals(other: Any?)

open Int

Float

Return the euclidian distance from (0,0) to the point

open static Float
length(x: Float, y: Float)

Returns the euclidian distance from (0,0) to (x,y)

Unit

Unit
offset(dx: Float, dy: Float)

open Unit

Set the point's coordinates from the data stored in the specified parcel.

Unit
set(x: Float, y: Float)

Set the point's x and y coordinates

Unit
set(p: PointF)

Set the point's x and y coordinates to the coordinates of p

open String

open Unit
writeToParcel(out: Parcel, flags: Int)

Write this point to the specified parcel.

Properties
static Parcelable.Creator<PointF!>

Float

Float

Public constructors

PointF

Added in API level 1
PointF()

PointF

Added in API level 1
PointF(
    x: Float,
    y: Float)

PointF

Added in API level 1
PointF(p: Point)
Parameters
p Point: This value cannot be null.

PointF

Added in API level 1
PointF(p: PointF)

Create a new PointF initialized with the values in the specified PointF (which is left unmodified).

Parameters
p PointF: The point whose values are copied into the new point. This value cannot be null.

Public methods

describeContents

Added in API level 13
open fun describeContents(): Int

Parcelable interface methods

Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

equals

Added in API level 1
fun equals(
    x: Float,
    y: Float
): Boolean

Returns true if the point's coordinates equal (x,y)

equals

Added in API level 1
open fun equals(other: Any?): Boolean
Parameters
obj the reference object with which to compare.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

hashCode

Added in API level 1
open fun hashCode(): Int
Return
Int a hash code value for this object.

length

Added in API level 1
fun length(): Float

Return the euclidian distance from (0,0) to the point

length

Added in API level 1
open static fun length(
    x: Float,
    y: Float
): Float

Returns the euclidian distance from (0,0) to (x,y)

negate

Added in API level 1
fun negate(): Unit

offset

Added in API level 1
fun offset(
    dx: Float,
    dy: Float
): Unit

readFromParcel

Added in API level 13
open fun readFromParcel(in: Parcel): Unit

Set the point's coordinates from the data stored in the specified parcel. To write a point to a parcel, call writeToParcel().

Parameters
in Parcel: The parcel to read the point's coordinates from This value cannot be null.

set

Added in API level 1
fun set(
    x: Float,
    y: Float
): Unit

Set the point's x and y coordinates

set

Added in API level 1
fun set(p: PointF): Unit

Set the point's x and y coordinates to the coordinates of p

Parameters
p PointF: This value cannot be null.

toString

Added in API level 1
open fun toString(): String
Return
String a string representation of the object.

writeToParcel

Added in API level 13
open fun writeToParcel(
    out: Parcel,
    flags: Int
): Unit

Write this point to the specified parcel. To restore a point from a parcel, use readFromParcel()

Parameters
dest The Parcel in which the object should be written. This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES
out Parcel: The parcel to write the point's coordinates into

Properties

CREATOR

Added in API level 13
static val CREATOR: Parcelable.Creator<PointF!>

x

Added in API level 1
var x: Float

y

Added in API level 1
var y: Float