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:com.richtodd.android.quiltdesign.block.Quilt.java

@Override
public void writeToParcel(Parcel out, int flags) {
    out.writeInt(m_new ? -1 : 0);
    out.writeInt(m_rowCount);/*  www . j av a 2 s . c o  m*/
    out.writeInt(m_columnCount);
    out.writeFloat(m_width);
    out.writeFloat(m_height);
    for (int row = 0; row < m_rowCount; ++row) {
        for (int column = 0; column < m_columnCount; ++column) {
            QuiltBlock quiltBlock = getQuiltBlock(row, column);
            out.writeParcelable(quiltBlock, 0);
        }
    }
}

From source file:com.marianhello.bgloc.Config.java

public void writeToParcel(Parcel out, int flags) {
    out.writeFloat(getStationaryRadius());
    out.writeInt(getDistanceFilter());/*w w w  .  j  a va  2 s.c om*/
    out.writeInt(getDesiredAccuracy());
    out.writeValue(isDebugging());
    out.writeString(getNotificationTitle());
    out.writeString(getNotificationText());
    out.writeString(getLargeNotificationIcon());
    out.writeString(getSmallNotificationIcon());
    out.writeString(getNotificationIconColor());
    out.writeValue(getStopOnTerminate());
    out.writeValue(getStartOnBoot());
    out.writeValue(getStartForeground());
    out.writeInt(getLocationProvider());
    out.writeInt(getInterval());
    out.writeInt(getFastestInterval());
    out.writeInt(getActivitiesInterval());
    out.writeValue(getStopOnStillActivity());
    out.writeString(getUrl());
    out.writeString(getSyncUrl());
    out.writeInt(getSyncThreshold());
    out.writeInt(getMaxLocations());
    Bundle bundle = new Bundle();
    bundle.putSerializable("httpHeaders", getHttpHeaders());
    out.writeBundle(bundle);
}

From source file:com.kevinquan.android.location.SimpleRecordedLocation.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeDouble(mLatitude);//from  w w w .  j  av a  2 s.com
    dest.writeDouble(mLongitude);
    dest.writeFloat(mAccuracy);
    dest.writeDouble(mAltitude);
    dest.writeFloat(mBearing);
    dest.writeFloat(mSpeed);
    dest.writeLong(mRecordedAt);
    dest.writeString(mProvider.toString());
}

From source file:com.marianhello.cordova.bgloc.Config.java

public void writeToParcel(Parcel out, int flags) {
    out.writeFloat(getStationaryRadius());
    out.writeInt(getDistanceFilter());// ww  w.ja va2s.  c  om
    out.writeInt(getDesiredAccuracy());
    out.writeValue(isDebugging());
    out.writeString(getNotificationTitle());
    out.writeString(getNotificationText());
    out.writeString(getLargeNotificationIcon());
    out.writeString(getSmallNotificationIcon());
    out.writeString(getNotificationIconColor());
    out.writeValue(getStopOnTerminate());
    out.writeValue(getStartOnBoot());
    out.writeValue(getStartForeground());
    out.writeInt(getServiceProvider().asInt());
    out.writeInt(getInterval());
    out.writeInt(getFastestInterval());
    out.writeInt(getActivitiesInterval());
    out.writeString(getUrl());
    out.writeString(getMethod());
    out.writeSerializable(getHeaders());
    out.writeSerializable(getParams());
}

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

private static void writeValue(Parcel out, int flags, Object v) {
    if (v == null || v == JSONObject.NULL) {
        out.writeInt(VAL_NULL);/*  ww w.j  a va 2 s  .c  o  m*/
    } else {
        Class<?> c = v.getClass();
        if (c == String.class) {
            out.writeInt(VAL_STRING);
            out.writeString((String) v);
        } else if (c == Long.class) {
            out.writeInt(VAL_LONG);
            out.writeLong((Long) v);
        } else if (c == Boolean.class) {
            out.writeInt(VAL_BOOLEAN);
            out.writeInt((Boolean) v ? 1 : 0);
        } else if (c == JSONObject.class) {
            out.writeInt(VAL_MAP);
            wrap((JSONObject) v).writeToParcel(out, flags);
        } else if (c == JSONArray.class) {
            out.writeInt(VAL_OBJECTARRAY);
            wrap((JSONArray) v).writeToParcel(out, flags);
        } else if (c == Double.class) {
            out.writeInt(VAL_DOUBLE);
            out.writeDouble((Double) v);
        } else if (c == Integer.class) {
            out.writeInt(VAL_INTEGER);
            out.writeInt((Integer) v);
        } else if (c == Float.class) {
            out.writeInt(VAL_FLOAT);
            out.writeFloat((Float) v);
        } else {
            throw new RuntimeException("Json: unable to marshal value " + v);
        }
    }
}

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

@Override
public void writeToParcel(Parcel dest, int flags) {
    int numTaints = taints.size();
    dest.writeInt(numTaints);/* w ww .  j  ava 2 s  .co m*/
    for (Map.Entry<ComponentName, Float> entry : taints.entrySet()) {
        entry.getKey().writeToParcel(dest, flags);
        dest.writeFloat(entry.getValue());
    }
}

From source file:com.google.android.apps.flexbox.FlexItem.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(this.index);
    dest.writeInt(this.width);
    dest.writeInt(this.height);
    dest.writeInt(this.topMargin);
    dest.writeInt(this.startMargin);
    dest.writeInt(this.endMargin);
    dest.writeInt(this.bottomMargin);
    dest.writeInt(this.paddingTop);
    dest.writeInt(this.paddingStart);
    dest.writeInt(this.paddingEnd);
    dest.writeInt(this.paddingBottom);
    dest.writeInt(this.order);
    dest.writeFloat(this.flexGrow);
    dest.writeFloat(this.flexShrink);
    dest.writeInt(this.alignSelf);
    dest.writeFloat(this.flexBasisPercent);
    dest.writeInt(this.minWidth);
    dest.writeInt(this.minHeight);
    dest.writeInt(this.maxWidth);
    dest.writeInt(this.maxHeight);
    dest.writeByte((byte) (wrapBefore ? 1 : 0));
}

From source file:com.orbar.pxdemo.Model.FiveZeroZeroImageBean.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    Log.v(TAG, "writeToParcel..." + flags);

    dest.writeInt(id);/*  w ww.  jav a2s  .c om*/
    dest.writeInt(userId);
    dest.writeString(name);
    dest.writeString(description);
    dest.writeString(camera);
    dest.writeString(lens);
    dest.writeString(focalLength);
    dest.writeString(iso);
    dest.writeString(shutterSpeed);
    dest.writeString(aperture);
    dest.writeInt(timesViewed);
    dest.writeFloat(rating);
    dest.writeString(createdAt);
    dest.writeInt(status);
    dest.writeString(createdAt);
    dest.writeInt(category);
    dest.writeString(location);
    dest.writeByte((byte) (privacy ? 1 : 0)); // Boolean
    dest.writeString(latitude);
    dest.writeString(longitude);
    dest.writeString(takenAt);
    dest.writeInt(hiResUploaded);
    dest.writeByte((byte) (forSale ? 1 : 0)); // Boolean
    dest.writeInt(width);
    dest.writeInt(height);
    dest.writeInt(votesCount);
    dest.writeInt(favoritesCount);
    dest.writeInt(commentsCount);
    dest.writeByte((byte) (nsfw ? 1 : 0)); // Boolean
    dest.writeInt(salesCount);
    dest.writeFloat(highestRating);
    dest.writeString(highestRatingDate);
    dest.writeInt(licenseType);
    dest.writeString(imageUrl);
    dest.writeByte((byte) (storeDownload ? 1 : 0)); // Boolean
    dest.writeByte((byte) (storePrint ? 1 : 0)); // Boolean

    dest.writeByte((byte) (voted ? 1 : 0)); // Boolean
    dest.writeByte((byte) (favorited ? 1 : 0)); // Boolean
    dest.writeByte((byte) (purchased ? 1 : 0)); // Boolean

    dest.writeParcelable(userBean, flags);
}