Example usage for android.os Parcel writeFloat

List of usage examples for android.os Parcel writeFloat

Introduction

In this page you can find the example usage for android.os Parcel writeFloat.

Prototype

public final void writeFloat(float val) 

Source Link

Document

Write a floating point value into the parcel at the current dataPosition(), growing dataCapacity() if needed.

Usage

From source file:Main.java

/***********************************/

public static void writeLocation(Parcel dest, Location loc) {
    dest.writeString(loc.getProvider());
    dest.writeLong(loc.getTime());//  w  w  w  .  j a va 2 s .c  o m
    dest.writeDouble(loc.getLatitude());
    dest.writeDouble(loc.getLongitude());
    dest.writeDouble(loc.getAltitude());
    dest.writeFloat(loc.getAccuracy());
    dest.writeFloat(loc.getBearing());
    dest.writeFloat(loc.getSpeed());
}

From source file:org.opendatakit.database.queries.BindArgs.java

private static void marshallObject(Parcel out, Object toMarshall) {
    if (toMarshall == null) {
        out.writeInt(0);/*from w w w  .j a  v a2  s  .c  om*/
    } else if (toMarshall instanceof String) {
        out.writeInt(1);
        out.writeString((String) toMarshall);
    } else if (toMarshall instanceof Integer) {
        out.writeInt(2);
        out.writeInt((Integer) toMarshall);
    } else if (toMarshall instanceof Boolean) {
        if ((Boolean) toMarshall) {
            out.writeInt(3);
        } else {
            out.writeInt(4);
        }
    } else if (toMarshall instanceof Double) {
        out.writeInt(5);
        out.writeDouble((Double) toMarshall);
    } else if (toMarshall instanceof Float) {
        out.writeInt(6);
        out.writeFloat((Float) toMarshall);
    } else if (toMarshall instanceof Long) {
        out.writeInt(7);
        out.writeLong((Long) toMarshall);
    } else {
        throw new IllegalStateException("should have been prevented in constructor");
    }
}

From source file:com.facebook.notifications.internal.configuration.HeroConfiguration.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeFloat(height);
    dest.writeParcelable(background, flags);

    dest.writeParcelable(content, flags);
    dest.writeParcelable(contentVerticalAlignment, flags);
}

From source file:io.github.data4all.model.DeviceOrientation.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeFloat(azimuth);
    dest.writeFloat(pitch);//from   ww  w.  j a va  2s. co  m
    dest.writeFloat(roll);
    dest.writeLong(timestamp);
}

From source file:com.facebook.notifications.internal.configuration.ActionConfiguration.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(backgroundColor);// w w  w . ja v a  2 s. co m
    dest.writeInt(borderColor);

    dest.writeFloat(borderWidth);
    dest.writeParcelable(content, flags);

    dest.writeParcelable(actionUri, flags);
}

From source file:com.facebook.notifications.internal.configuration.CardConfiguration.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeParcelable(cardSize, flags);
    dest.writeFloat(cornerRadius);
    dest.writeFloat(contentInset);//from   www . j  ava  2s .  com

    dest.writeInt(backdropColor);

    dest.writeParcelable(heroConfiguration, flags);
    dest.writeParcelable(bodyConfiguration, flags);
    dest.writeParcelable(actionsConfiguration, flags);
}

From source file:com.facebook.notifications.internal.content.TextContent.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(text);/*from  ww w . j av a  2  s  .c  om*/
    dest.writeInt(textColor);

    dest.writeString(typeface);
    dest.writeFloat(typefaceSize);

    dest.writeParcelable(textAlignment, flags);
}

From source file:org.onepf.opfmaps.osmdroid.model.BitmapDescriptor.java

@Override
public void writeToParcel(final Parcel dest, final int flags) {
    dest.writeString(source.name());//ww  w  . j  av  a  2 s .co  m
    dest.writeParcelable(image, flags);
    dest.writeString(path);
    dest.writeFloat(hue);
    dest.writeInt(resourceId);
}

From source file:com.richtodd.android.quiltdesign.block.PaperPiecedBlock.java

@Override
public void writeToParcel(Parcel out, int flags) {
    out.writeInt(m_dirty ? -1 : 0);/*from ww w  . j  ava2  s  .c  o  m*/
    out.writeFloat(m_width);
    out.writeFloat(m_height);
    out.writeInt(m_backgroundColor);
    out.writeTypedList(m_pieces);
}

From source file:com.facebook.notifications.internal.configuration.ActionsConfiguration.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeParcelable(style, flags);//from   w  w  w.  j  a  v a 2 s .co  m
    dest.writeParcelable(layoutStyle, flags);

    dest.writeParcelable(background, flags);

    dest.writeFloat(topInset);
    dest.writeFloat(contentInset);
    dest.writeFloat(cornerRadius);

    dest.writeTypedArray(actions, flags);
    dest.writeFloat(height);
}