Class SizeConstraint

com.yandex.mobile.ads.nativeads.template

java.lang.Object ⇽ SizeConstraint

public class SizeConstraint implements android.os.Parcelable

All Implemented Interfaces:
android.os.Parcelable

The class determines sizing constraints for objects included in the ad template (NativeBannerView).

Nested Classes

Constructors

SizeConstraint(final SizeConstraintType sizeConstraintType, final float value)

Creates an object of the class SizeConstraint with the specified object sizing constraint.

Methods

int describeContents()
boolean equals(final Object o)
SizeConstraintType getSizeConstraintType()

Returns the sizing constraint specified when creating an object of the SizeConstraint.

float getValue()

Returns the value specified when creating an object of the SizeConstraint class.

int hashCode()
void writeToParcel(android.os.Parcel dest, int flags)

Fields

final Creator< SizeConstraint > CREATOR

Constructor Detail

SizeConstraint

public SizeConstraint (final SizeConstraintType sizeConstraintType, final float value)

Creates an object of the class SizeConstraint with the specified object sizing constraint.

Parameters:
sizeConstraintType

Object sizing constraint. For acceptable values, see SizeConstraint.SizeConstraintType.

value

The constraint value. The meaning of the value depends on the sizeConstraintType parameter.

Note.
Options:
  • sizeConstraintType.FIXED — Value is indicated in points.

  • sizeConstraintType.FIXED_RATIO — Value is specified in the range [0;1]. For example, if you set the value 0.5 for a container of 200 points, the width value will be equal to 100 points.

  • sizeConstraintType.PREFERRED_RATIO — Value is specified in the range [0; 1].

Method Detail

describeContents

public int describeContents ()

equals

public boolean equals (final Object o)

getSizeConstraintType

public SizeConstraintType getSizeConstraintType ()

Returns the sizing constraint specified when creating an object of the SizeConstraint.

Returns:

The sizing constraint specified when creating an object of the SizeConstraint class.

getValue

public float getValue ()

Returns the value specified when creating an object of the SizeConstraint class.

Returns:

The value specified when creating an object of the SizeConstraint class.

hashCode

public int hashCode ()

writeToParcel

public void writeToParcel (android.os.Parcel dest, int flags)