@Override
    public void writeToParcel(Parcel parcel, int i) {

      parcel.writeInt(mType.ordinal());

      if (mType == Type.BUTTON) {

        parcel.writeString(mButtonText);
        parcel.writeFloat(mButtonTextSize);
        parcel.writeInt(mButtonTextColor);
        parcel.writeInt(mButtonResource);
        parcel.writeInt(mButtonDividerResource);
        parcel.writeInt(mButtonTypeface);
        parcel.writeString(mClickListenerTag);
      }

      if (mIconResource != 0 && mIconPosition != null) {

        parcel.writeByte((byte) 1);

        parcel.writeInt(mIconResource);
        parcel.writeInt(mIconPosition.ordinal());

      } else {

        parcel.writeByte((byte) 0);
      }

      parcel.writeString(mDismissListenerTag);
      parcel.writeInt(mAnimations.ordinal());
      parcel.writeString(mText);
      parcel.writeInt(mTypeface);
      parcel.writeInt(mDuration);
      parcel.writeInt(mTextColor);
      parcel.writeFloat(mTextSize);
      parcel.writeByte((byte) (isIndeterminate ? 1 : 0));
      parcel.writeInt(mBackgroundResource);
      parcel.writeByte((byte) (isTouchDismissable ? 1 : 0));
      parcel.writeByte((byte) (isSwipeDismissable ? 1 : 0));
    }
 private BackStackItem(Parcel aIn) {
   path = aIn.readString();
   parentIsBack = aIn.readInt() != 0;
 }
    public Style(Parcel parcel) {

      mType = Type.values()[parcel.readInt()];

      if (mType == Type.BUTTON) {

        mButtonText = parcel.readString();
        mButtonTextSize = parcel.readFloat();
        mButtonTextColor = parcel.readInt();
        mButtonResource = parcel.readInt();
        mButtonDividerResource = parcel.readInt();
        mButtonTypeface = parcel.readInt();
        mClickListenerTag = parcel.readString();
      }

      boolean hasIcon = parcel.readByte() != 0;

      if (hasIcon) {

        mIconResource = parcel.readInt();
        mIconPosition = IconPosition.values()[parcel.readInt()];
      }

      mDismissListenerTag = parcel.readString();
      mAnimations = Animations.values()[parcel.readInt()];
      mText = parcel.readString();
      mTypeface = parcel.readInt();
      mDuration = parcel.readInt();
      mTextColor = parcel.readInt();
      mTextSize = parcel.readFloat();
      isIndeterminate = parcel.readByte() != 0;
      mBackgroundResource = parcel.readInt();
      isTouchDismissable = parcel.readByte() != 0;
      isSwipeDismissable = parcel.readByte() != 0;
    }
 public void writeToParcel(Parcel out, int flags) {
   out.writeString(path);
   out.writeInt(parentIsBack ? 1 : 0);
 }