Java Code Examples for android.os.Parcel#writeValue()

The following examples show how to use android.os.Parcel#writeValue() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: material   File: SimpleDialog.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void onWriteToParcel(Parcel dest, int flags) {
    dest.writeInt(mMode);
    switch (mMode){
        case MODE_MESSAGE:
            dest.writeValue(mMessage);
            break;
        case MODE_ITEMS:
            dest.writeArray(mItems);
            dest.writeInt(mSelectedIndexes == null ? 0 : mSelectedIndexes[0]);
            break;
        case MODE_MULTI_ITEMS:
            dest.writeArray(mItems);
            int length = mSelectedIndexes == null ? 0 : mSelectedIndexes.length;
            dest.writeInt(length);
            if(length > 0)
                dest.writeIntArray(mSelectedIndexes);
            break;
        }
    }
 
Example 2
Source Project: edx-app-android   File: CourseDetail.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(course_id);
    dest.writeString(name);
    dest.writeString(number);
    dest.writeString(org);
    dest.writeString(short_description);
    dest.writeString(start);
    dest.writeValue(start_type);
    dest.writeString(start_display);
    dest.writeString(end);
    dest.writeString(enrollment_start);
    dest.writeString(enrollment_end);
    dest.writeString(blocks_url);
    dest.writeValue(media);
    dest.writeString(effort);
    dest.writeString(overview);
    dest.writeValue(invitation_only);
}
 
Example 3
Source Project: HeaderView   File: Profile.java    License: MIT License 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(id);
    dest.writeValue(avatarUri);
    dest.writeValue(avatarRes);
    dest.writeValue(backgroundUri);
    dest.writeValue(backgroundRes);
    dest.writeValue(username);
    dest.writeValue(email);
}
 
Example 4
Source Project: hacker-news-android   File: Story.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeValue(this.mStoryId);
    dest.writeString(this.mTitle);
    dest.writeString(this.mUrl);
    dest.writeString(this.mDomain);
    dest.writeInt(this.mPoints);
    dest.writeString(this.mSubmitter);
    dest.writeString(this.mPublishedTime);
    dest.writeInt(this.mNumComments);
    dest.writeString(this.mType);
    dest.writeByte(isSaved ? (byte) 1 : (byte) 0);
    dest.writeByte(mIsRead ? (byte) 1 : (byte) 0);
}
 
Example 5
Source Project: AnimeTaste   File: DownloadRecord.java    License: MIT License 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeValue(this.AnimationId);
    dest.writeString(this.Name);
    dest.writeString(this.OriginVideoUrl);
    dest.writeString(this.HDVideoUrl);
    dest.writeString(this.CommonVideoUrl);
    dest.writeString(this.Author);
    dest.writeString(this.Year);
    dest.writeString(this.Brief);
    dest.writeString(this.HomePic);
    dest.writeString(this.DetailPic);
    dest.writeString(this.Youku);
    dest.writeString(this.UHD);
    dest.writeString(this.HD);
    dest.writeString(this.SD);
    dest.writeByte(IsFav ? (byte) 1 : (byte) 0);
    dest.writeByte(IsWatched ? (byte) 1 : (byte) 0);
    dest.writeLong(AddedTime != null ? AddedTime.getTime() : -1);
    dest.writeLong(this.Size);
    dest.writeLong(this.DownloadedSize);
    dest.writeInt(this.Duration);
    dest.writeInt(this.DownloadedDuration);
    dest.writeInt(this.Segments);
    dest.writeInt(this.DownloadedSegments);
    dest.writeInt(this.DownloadedPercentage);
    dest.writeInt(this.RangeStart);
    dest.writeInt(this.Status);
    dest.writeString(this.Extra);
    dest.writeString(this.SaveDir);
    dest.writeString(this.SaveFileName);
    dest.writeString(this.UsingDownloadUrl);
}
 
Example 6
Source Project: Stock-Hawk   File: Query.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeValue(this.mCount);
    dest.writeString(this.mCreated);
    dest.writeString(this.mLang);
    dest.writeParcelable(this.mResult, flags);
}
 
Example 7
static void writeSparseArray0(Parcel in, SparseArray val) {
    if (val == null) {
        in.writeInt(-1);
        return;
    }
    int N = val.size();
    in.writeInt(N);
    int i=0;
    while (i < N) {
        in.writeInt(val.keyAt(i));
        in.writeValue(val.valueAt(i));
        i++;
    }
}
 
Example 8
public void writeToParcel(Parcel out, int flags) {
  out.writeValue(stringItem);
  out.writeValue(numberItem);
  out.writeValue(integerItem);
  out.writeValue(boolItem);
  out.writeValue(arrayItem);
}
 
Example 9
Source Project: FlowGeek   File: ParcelFn.java    License: GNU General Public License v2.0 5 votes vote down vote up
static byte[] marshall(Object o) {
    Parcel parcel = Parcel.obtain();
    parcel.writeValue(o);
    byte[] result = parcel.marshall();
    parcel.recycle();
    return result;
}
 
Example 10
Source Project: droidddle   File: User.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeValue(this.id);
    dest.writeString(this.name);
    dest.writeString(this.username);
    dest.writeString(this.htmlUrl);
    dest.writeString(this.avatarUrl);
    dest.writeString(this.bio);
    dest.writeString(this.location);
    dest.writeParcelable(this.links, flags);
    dest.writeValue(this.bucketsCount);
    dest.writeValue(this.followersCount);
    dest.writeValue(this.followingsCount);
    dest.writeValue(this.likesCount);
    dest.writeValue(this.projectsCount);
    dest.writeValue(this.shotsCount);
    dest.writeValue(this.teamsCount);
    dest.writeString(this.type);
    dest.writeValue(this.pro);
    dest.writeString(this.bucketsUrl);
    dest.writeString(this.followersUrl);
    dest.writeString(this.followingUrl);
    dest.writeString(this.likesUrl);
    dest.writeString(this.shotsUrl);
    dest.writeString(this.teamsUrl);
    dest.writeLong(createdAt != null ? createdAt.getTime() : -1);
    dest.writeLong(updatedAt != null ? updatedAt.getTime() : -1);
}
 
Example 11
Source Project: fingen   File: Location.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    super.writeToParcel(dest, flags);
    dest.writeString(this.mName);
    dest.writeString(this.mAddress);
    dest.writeValue(this.mLon);
    dest.writeValue(this.mLat);
    dest.writeLong(this.mParentID);
    dest.writeInt(this.mOrderNum);
    dest.writeByte(this.mExpanded ? (byte) 1 : (byte) 0);
}
 
Example 12
Source Project: ESeal   File: Result.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeValue(this.RESULT);
    dest.writeValue(this.EFFECTIVETOKEN);
    dest.writeString(this.ERRORINFO);
    dest.writeValue(this.ICOUNT);
}
 
Example 13
Source Project: quickmark   File: LockPatternView.java    License: MIT License 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
	super.writeToParcel(dest, flags);
	dest.writeString(mSerializedPattern);
	dest.writeInt(mDisplayMode);
	dest.writeValue(mInputEnabled);
	dest.writeValue(mInStealthMode);
	dest.writeValue(mTactileFeedbackEnabled);
}
 
Example 14
Source Project: ESeal   File: DeviceSearchSuggestion.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(this.id);
    dest.writeString(this.name);
    dest.writeValue(this.type);
    dest.writeValue(this.isHistory);
}
 
Example 15
Source Project: spotify-web-api-android   File: PlaylistBase.java    License: MIT License 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeValue(this.collaborative);
    dest.writeMap(this.external_urls);
    dest.writeValue(this.href);
    dest.writeValue(this.id);
    dest.writeTypedList(this.images);
    dest.writeValue(this.name);
    dest.writeParcelable(owner, flags);
    dest.writeValue(is_public);
    dest.writeValue(snapshot_id);
    dest.writeValue(type);
    dest.writeValue(uri);
}
 
Example 16
Source Project: openapi-generator   File: Order.java    License: Apache License 2.0 5 votes vote down vote up
public void writeToParcel(Parcel out, int flags) {
  out.writeValue(id);
  out.writeValue(petId);
  out.writeValue(quantity);
  out.writeValue(shipDate);
  out.writeValue(status);
  out.writeValue(complete);
}
 
Example 17
public void writeToParcel(Parcel dest, int flags) {
    dest.writeValue(hash);
    dest.writeValue(addr);
    dest.writeValue(bund);
}
 
Example 18
Source Project: InstaTag   File: Tag.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(this.unique_tag_id);
    dest.writeValue(this.x_co_ord);
    dest.writeValue(this.y_co_ord);
}
 
Example 19
public void writeToParcel(Parcel out, int flags) {
  super.writeToParcel(out, flags);
  out.writeValue(name);
}
 
Example 20
Source Project: AndroidUnplash   File: Download.java    License: MIT License 4 votes vote down vote up
public void writeToParcel(Parcel dest, int flags) {
    dest.writeValue(url);
}