Example usage for android.os Parcel readFloat

List of usage examples for android.os Parcel readFloat

Introduction

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

Prototype

public final float readFloat() 

Source Link

Document

Read a floating point value from the parcel at the current dataPosition().

Usage

From source file:Main.java

public static Location readLocation(Parcel in) {
    Location loc = new Location(in.readString());
    loc.setTime(in.readLong());//from  w  w w .j  a  va2  s  .com
    loc.setLatitude(in.readDouble());
    loc.setLongitude(in.readDouble());
    loc.setAltitude(in.readDouble());
    loc.setAccuracy(in.readFloat());
    loc.setBearing(in.readFloat());
    loc.setSpeed(in.readFloat());
    return loc;
}

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

private static Object unmarshallObject(Parcel in) {
    int dataType = in.readInt();
    switch (dataType) {
    case 0:/*  w w  w  . ja  v a2  s. c o m*/
        return null;
    case 1:
        return in.readString();
    case 2:
        return in.readInt();
    case 3:
        return Boolean.TRUE;
    case 4:
        return Boolean.FALSE;
    case 5:
        return in.readDouble();
    case 6:
        return in.readFloat();
    case 7:
        return in.readLong();
    default:
        throw new IllegalStateException("should have been prevented in constructor");
    }
}

From source file:com.clover.sdk.v3.JsonParcelHelper.java

private static Object readValue(Parcel in) {
    int type = in.readInt();

    switch (type) {
    case VAL_NULL:
        return JSONObject.NULL;

    case VAL_STRING:
        return in.readString();

    case VAL_INTEGER:
        return in.readInt();

    case VAL_MAP:
        return ObjectWrapper.CREATOR.createFromParcel(in).unwrap();

    case VAL_LONG:
        return in.readLong();

    case VAL_FLOAT:
        return in.readFloat();

    case VAL_DOUBLE:
        return in.readDouble();

    case VAL_BOOLEAN:
        return in.readInt() != 0;

    case VAL_OBJECTARRAY:
        return ArrayWrapper.CREATOR.createFromParcel(in).unwrap();

    default://from   www.j  a v  a2  s . c o m
        int off = in.dataPosition() - 4;
        throw new IllegalArgumentException(
                "Json: unmarshalling unknown type code " + type + " at offset " + off);
    }
}

From source file:edu.umich.flowfence.common.TaintSet.java

public static TaintSet readFromParcel(Parcel source) {
    int numTaints = source.readInt();
    if (numTaints == -1) {
        return null;
    }/*from   w ww  .  j a  v a2s . co  m*/
    if (numTaints == 0) {
        return TaintSet.EMPTY;
    }
    Map<ComponentName, Float> taints = new HashMap<>(numTaints);
    while (numTaints-- > 0) {
        ComponentName taintKind = new ComponentName(source);
        float taintAmount = Math.max(source.readFloat(), 0.0f);
        taints.put(taintKind, taintAmount);
    }
    return new TaintSet(taints);
}

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

/**
 * Constructor to create a node from a parcel.
 * /*w  w  w  .j a  v a 2 s  .c om*/
 * @param in
 *            The Parcel to read from
 */
private DeviceOrientation(Parcel in) {
    azimuth = in.readFloat();
    pitch = in.readFloat();
    roll = in.readFloat();
    timestamp = in.readLong();
}

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

private HeroConfiguration(Parcel parcel) {
    ClassLoader loader = getClass().getClassLoader();

    height = parcel.readFloat();
    background = parcel.readParcelable(loader);

    content = parcel.readParcelable(loader);
    contentVerticalAlignment = parcel.readParcelable(loader);
}

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

private ActionConfiguration(Parcel source) {
    ClassLoader classLoader = getClass().getClassLoader();

    backgroundColor = source.readInt();// w  w  w.  java 2s.c  o m
    borderColor = source.readInt();

    borderWidth = source.readFloat();
    content = source.readParcelable(classLoader);

    actionUri = source.readParcelable(classLoader);
}

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

private TextContent(Parcel source) {
    text = source.readString();// ww  w .  j  a v a 2  s .  c o  m
    textColor = source.readInt();

    typeface = source.readString();
    typefaceSize = source.readFloat();

    textAlignment = source.readParcelable(getClass().getClassLoader());
}

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

private CardConfiguration(@NonNull Parcel source) {
    ClassLoader loader = getClass().getClassLoader();

    cardSize = source.readParcelable(loader);
    cornerRadius = source.readFloat();
    contentInset = source.readFloat();/*from w  w w  . java2  s.  c  om*/

    backdropColor = source.readInt();

    heroConfiguration = source.readParcelable(loader);
    bodyConfiguration = source.readParcelable(loader);
    actionsConfiguration = source.readParcelable(loader);
}

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

private PaperPiecedBlock(Parcel in) {
    m_dirty = in.readInt() == 0 ? false : true;
    m_width = in.readFloat();
    m_height = in.readFloat();//from   ww  w. j  a  v a  2 s  .c om
    m_backgroundColor = in.readInt();
    m_pieces = new ArrayList<PaperPiecedBlockPiece>();

    in.readTypedList(m_pieces, PaperPiecedBlockPiece.CREATOR);

    m_backgroundPaint = new Paint();
    m_backgroundPaint.setStyle(Style.FILL);
    m_backgroundPaint.setColor(m_backgroundColor);

    m_backgroundPaintWhite = new Paint();
    m_backgroundPaintWhite.setStyle(Style.FILL);
    m_backgroundPaintWhite.setColor(Color.WHITE);
}