1 /* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.android.test.uibench.leanback; 17 18 import android.os.Parcel; 19 import android.os.Parcelable; 20 21 public class PhotoItem implements Parcelable { 22 23 private String mTitle; 24 private long mId; 25 PhotoItem(String title, long id)26 public PhotoItem(String title, long id) { 27 mTitle = title; 28 mId = id; 29 } 30 getId()31 public long getId() { 32 return mId; 33 } 34 getTitle()35 public String getTitle() { 36 return mTitle; 37 } 38 39 @Override toString()40 public String toString() { 41 return mTitle; 42 } 43 44 @Override describeContents()45 public int describeContents() { 46 return 0; 47 } 48 49 @Override writeToParcel(Parcel dest, int flags)50 public void writeToParcel(Parcel dest, int flags) { 51 dest.writeString(mTitle); 52 dest.writeLong(mId); 53 } 54 55 public static final Creator<PhotoItem> CREATOR 56 = new Creator<PhotoItem>() { 57 @Override 58 public PhotoItem createFromParcel(Parcel in) { 59 return new PhotoItem(in); 60 } 61 62 @Override 63 public PhotoItem[] newArray(int size) { 64 return new PhotoItem[size]; 65 } 66 }; 67 PhotoItem(Parcel in)68 private PhotoItem(Parcel in) { 69 mTitle = in.readString(); 70 mId = in.readLong(); 71 } 72 } 73