Example usage for android.os Parcel writeInt

List of usage examples for android.os Parcel writeInt

Introduction

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

Prototype

public final void writeInt(int val) 

Source Link

Document

Write an integer value into the parcel at the current dataPosition(), growing dataCapacity() if needed.

Usage

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

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

From source file:com.simas.vc.nav_drawer.NavCAB.java

public void writeToParcel(Parcel out, int flags) {
    // Save the selected position
    out.writeInt(mInitiallySelectedPosition);
    // Save the items that were checked by the CAB
    out.writeSerializable((java.io.Serializable) checkedPositions);
}

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);//from  w  w w .  j  a  v  a2  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:edu.umich.flowfence.common.QMDetails.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    // This space will be filled in with the final size of the object, minus this header.
    final int headerPos = dest.dataPosition();
    dest.writeInt(0);
    final int startPos = dest.dataPosition();
    // Special handling for completely null objects - leave length at zero.
    if (ObjectUtils.firstNonNull(descriptor, resultType, paramInfo, requiredTaints, optionalTaints) == null) {
        if (localLOGV) {
            Log.v(TAG, "Null case, writing size 0");
        }/* w w  w  .j a  v a  2 s. c  o m*/
        return;
    }
    QMDescriptor.writeToParcel(descriptor, dest, flags);
    dest.writeString(resultType);
    dest.writeTypedList(paramInfo);
    TaintSet.writeToParcel(requiredTaints, dest, flags);
    TaintSet.writeToParcel(optionalTaints, dest, flags);

    final int endPos = dest.dataPosition();
    dest.setDataPosition(headerPos);
    dest.writeInt(endPos - startPos);
    dest.setDataPosition(endPos);
    if (localLOGV) {
        Log.v(TAG, "Total size: " + (endPos - startPos));
    }
}

From source file:edu.umich.oasis.common.SodaDetails.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    // This space will be filled in with the final size of the object, minus this header.
    final int headerPos = dest.dataPosition();
    dest.writeInt(0);
    final int startPos = dest.dataPosition();
    // Special handling for completely null objects - leave length at zero.
    if (ObjectUtils.firstNonNull(descriptor, resultType, paramInfo, requiredTaints, optionalTaints) == null) {
        if (localLOGV) {
            Log.v(TAG, "Null case, writing size 0");
        }//from w  w w  .  j  ava 2s. c  o  m
        return;
    }
    SodaDescriptor.writeToParcel(descriptor, dest, flags);
    dest.writeString(resultType);
    dest.writeTypedList(paramInfo);
    TaintSet.writeToParcel(requiredTaints, dest, flags);
    TaintSet.writeToParcel(optionalTaints, dest, flags);

    final int endPos = dest.dataPosition();
    dest.setDataPosition(headerPos);
    dest.writeInt(endPos - startPos);
    dest.setDataPosition(endPos);
    if (localLOGV) {
        Log.v(TAG, "Total size: " + (endPos - startPos));
    }
}

From source file:com.vk.sdk.api.model.VKApiPhoto.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(this.id);
    dest.writeInt(this.album_id);
    dest.writeInt(this.owner_id);
    dest.writeInt(this.width);
    dest.writeInt(this.height);
    dest.writeString(this.text);
    dest.writeLong(this.date);
    dest.writeParcelable(this.src, flags);
    dest.writeString(this.photo_75);
    dest.writeString(this.photo_130);
    dest.writeString(this.photo_604);
    dest.writeString(this.photo_807);
    dest.writeString(this.photo_1280);
    dest.writeString(this.photo_2560);
    dest.writeByte(user_likes ? (byte) 1 : (byte) 0);
    dest.writeByte(can_comment ? (byte) 1 : (byte) 0);
    dest.writeInt(this.likes);
    dest.writeInt(this.comments);
    dest.writeInt(this.tags);
    dest.writeString(this.access_key);
}

From source file:android.support.design.internal.ParcelableSparseArray.java

@Override
public void writeToParcel(Parcel parcel, int flags) {
    int size = size();
    int[] keys = new int[size];
    Parcelable[] values = new Parcelable[size];
    for (int i = 0; i < size; ++i) {
        keys[i] = keyAt(i);//  w ww  . j  a  va 2  s  .c om
        values[i] = valueAt(i);
    }
    parcel.writeInt(size);
    parcel.writeIntArray(keys);
    parcel.writeParcelableArray(values, flags);
}

From source file:com.paranoid.gerrit.objects.CommitComment.java

@Override
public void writeToParcel(Parcel parcel, int i) {
    parcel.writeString(mJsonObject.toString());
    parcel.writeString(mId);//from   w  ww  . ja  va 2 s  .c o m
    parcel.writeParcelable(mAuthorObject, 0);
    parcel.writeString(mDate);
    parcel.writeString(mMessage);
    parcel.writeInt(mRevisionNumber);
}

From source file:com.v2soft.dnremote.dao.Server.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(mId.toString());/*  w ww . j a v a2  s .c o  m*/
    dest.writeString(mName);
    dest.writeString(mServer);
    dest.writeInt(mPort);
    dest.writeByte((byte) (mRelative ? 1 : 0));
    if (mIPAddr != null) {
        dest.writeInt(mIPAddr.length);
        dest.writeByteArray(mIPAddr);
    } else {
        dest.writeInt(0);
    }
}

From source file:com.artemchep.horario.models.SubjectStudent.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(key);//from   w w w.j a v a2 s.  c  o m
    dest.writeString(title);
    dest.writeString(description);
    dest.writeString(descriptionHtml);
    dest.writeString(author);
    dest.writeInt(type);
    dest.writeLong(due);
    dest.writeLong(timestamp);
    dest.writeInt(isEdited ? 1 : 0);
}