Back to project page RockAndDeal.
The source code is released under:
Apache License
If you think the Android project RockAndDeal listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.rockanddeal.rockanddeal.model; /*from w w w . java2s .c om*/ import android.os.Parcel; import com.felipecsl.asymmetricgridview.library.model.AsymmetricItem; /** * Created by gregoire on 9/16/14. */ public class CategoryAsymetric extends Category implements AsymmetricItem { private int columnSpan; private int rowSpan; private int position; public CategoryAsymetric() { this(1, 1, 0); } public CategoryAsymetric(final int columnSpan, final int rowSpan, int position) { super(); this.columnSpan = columnSpan; this.rowSpan = rowSpan; this.position = position; } public CategoryAsymetric(final int columnSpan, final int rowSpan, int position, Category category) { super(category.id, category.name, category.picturePath); this.columnSpan = columnSpan; this.rowSpan = rowSpan; this.position = position; } public CategoryAsymetric(final Parcel in) { readFromParcel(in); } @Override public int getColumnSpan() { return columnSpan; } @Override public int getRowSpan() { return rowSpan; } public int getPosition() { return position; } @Override public String toString() { return String.format("%s: %sx%s", position, rowSpan, columnSpan); } @Override public int describeContents() { return 0; } private void readFromParcel(final Parcel in) { columnSpan = in.readInt(); rowSpan = in.readInt(); position = in.readInt(); } @Override public void writeToParcel(final Parcel dest, final int flags) { dest.writeInt(columnSpan); dest.writeInt(rowSpan); dest.writeInt(position); } /* Parcelable interface implementation */ public static final Creator<CategoryAsymetric> CREATOR = new Creator<CategoryAsymetric>() { @Override public CategoryAsymetric createFromParcel(final Parcel in) { return new CategoryAsymetric(in); } @Override public CategoryAsymetric[] newArray(final int size) { return new CategoryAsymetric[size]; } }; }