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

The following examples show how to use android.os.Parcel#writeIntArray() . 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 File: HistoryData.java    From data-mediator with Apache License 2.0 6 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(this.age);
    dest.writeLong(this.id);
    dest.writeInt(this.testShort);
    dest.writeByte(this.testByte);
    dest.writeByte(this.testBoolean ? (byte) 1 : (byte) 0);
    dest.writeFloat(this.testFloat);
    dest.writeDouble(this.testDouble);
    dest.writeInt(this.testChar);
    dest.writeValue(this.testLONG);
    dest.writeValue(this.testDOUBLE);
    dest.writeSerializable(this.testCharacter);
    dest.writeValue(this.testBOOLEAN);
    dest.writeValue(this.testSHORT);
    dest.writeString(this.name);
    dest.writeParcelable(this.data, flags);
    dest.writeTypedList(this.datas);
    dest.writeTypedArray(this.testArrayResultData, flags);
    dest.writeIntArray(this.testArrayInt);
    dest.writeArray(this.testArrayInteger);
}
 
Example 2
Source File: NodeModel.java    From v2ex-daily-android with Apache License 2.0 6 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeIntArray(new int[]{
            id,
            topics
    });
    String[] strings = new String[6];
    strings[0] = name;
    strings[1] = title;
    strings[2] = url;
    if((strings[3] = titleAlternative) == null){
        strings[3] = "";
    }
    if((strings[4] = header) == null){
        strings[4] = "";
    }
    if((strings[5] = footer) == null){
        strings[5] = "";
    }
    dest.writeStringArray(strings);
    dest.writeBooleanArray(new boolean[]{ isCollected });
}
 
Example 3
Source File: ParcelableSparseArray.java    From material-components-android with Apache License 2.0 5 votes vote down vote up
@Override
public void writeToParcel(@NonNull 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);
    values[i] = valueAt(i);
  }
  parcel.writeInt(size);
  parcel.writeIntArray(keys);
  parcel.writeParcelableArray(values, flags);
}
 
Example 4
Source File: PrimitiveArrayParcelable.java    From android-parcelable-intellij-plugin with Apache License 2.0 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeIntArray(this.a);
    dest.writeDoubleArray(this.b);
    dest.writeStringArray(this.c);
    dest.writeFloatArray(this.e);
    dest.writeBooleanArray(this.f);
    dest.writeByteArray(this.g);
}
 
Example 5
Source File: BufferConnectionInfo.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void writeToParcel(final Parcel out, final int flags) {
    // Gathering data
    final int[] integers = new int[]{connectionID, samplesGotten, samplesPut,
            eventsGotten, eventsPut, lastActivity, waitEvents, waitSamples,
            error, diff};
    final long[] longs = new long[]{timeLastActivity, waitTimeout, time};

    // Write it to parcel
    out.writeString(address);
    out.writeIntArray(integers);
    out.writeLongArray(longs);
    out.writeInt(connected ? 1 : 0);
}
 
Example 6
Source File: ParcelableSparseBooleanArray.java    From material-components-android with Apache License 2.0 5 votes vote down vote up
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
  int[] keys = new int[size()];
  boolean[] values = new boolean[size()];

  for (int i = 0; i < size(); i++) {
    keys[i] = keyAt(i);
    values[i] = valueAt(i);
  }

  dest.writeInt(size());
  dest.writeIntArray(keys);
  dest.writeBooleanArray(values);
}
 
Example 7
Source File: AppCompatColorPreference.java    From FastAccess with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    super.writeToParcel(dest, flags);
    // Write the preference's values
    dest.writeInt(current);
    dest.writeIntArray(colors);
    dest.writeInt(columns);
}
 
Example 8
Source File: Configuration.java    From Storm with Apache License 2.0 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {

    dest.writeIntArray(getOrdinals(orms));
    dest.writeIntArray(getOrdinals(opTypes));

    dest.writeIntArray(this.rounds);
    dest.writeInt(this.time == null ? -1 : this.time.ordinal());
}
 
Example 9
Source File: ArrayPalette.java    From color-picker with Apache License 2.0 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags)
{
    dest.writeString(mPaletteId);
    dest.writeString(mPaletteName);
    dest.writeIntArray(mColors);
    dest.writeInt(mColumns);
    dest.writeStringArray(mColorNames);
}
 
Example 10
Source File: StaggeredGridLayoutManager.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(mPosition);
    dest.writeInt(mGapDir);
    dest.writeInt(mHasUnwantedGapAfter ? 1 : 0);
    if (mGapPerSpan != null && mGapPerSpan.length > 0) {
        dest.writeInt(mGapPerSpan.length);
        dest.writeIntArray(mGapPerSpan);
    } else {
        dest.writeInt(0);
    }
}
 
Example 11
Source File: BackStackRecord.java    From android-recipes-app with Apache License 2.0 5 votes vote down vote up
public void writeToParcel(Parcel dest, int flags) {
    dest.writeIntArray(mOps);
    dest.writeInt(mTransition);
    dest.writeInt(mTransitionStyle);
    dest.writeString(mName);
    dest.writeInt(mIndex);
    dest.writeInt(mBreadCrumbTitleRes);
    TextUtils.writeToParcel(mBreadCrumbTitleText, dest, 0);
    dest.writeInt(mBreadCrumbShortTitleRes);
    TextUtils.writeToParcel(mBreadCrumbShortTitleText, dest, 0);
}
 
Example 12
Source File: ActivityManager.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(stackId);
    dest.writeInt(bounds.left);
    dest.writeInt(bounds.top);
    dest.writeInt(bounds.right);
    dest.writeInt(bounds.bottom);
    dest.writeIntArray(taskIds);
    dest.writeStringArray(taskNames);
    final int boundsCount = taskBounds == null ? 0 : taskBounds.length;
    dest.writeInt(boundsCount);
    for (int i = 0; i < boundsCount; i++) {
        dest.writeInt(taskBounds[i].left);
        dest.writeInt(taskBounds[i].top);
        dest.writeInt(taskBounds[i].right);
        dest.writeInt(taskBounds[i].bottom);
    }
    dest.writeIntArray(taskUserIds);
    dest.writeInt(displayId);
    dest.writeInt(userId);
    dest.writeInt(visible ? 1 : 0);
    dest.writeInt(position);
    if (topActivity != null) {
        dest.writeInt(1);
        topActivity.writeToParcel(dest, 0);
    } else {
        dest.writeInt(0);
    }
    configuration.writeToParcel(dest, flags);
}
 
Example 13
Source File: ClientInfo.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void writeToParcel(final Parcel out, final int flags) {
    // Gathering data
    final int[] integers = new int[]{clientID, samplesGotten, samplesPut,
            eventsGotten, eventsPut, lastActivity, waitEvents, waitSamples,
            error, diff};
    final long[] longs = new long[]{timeLastActivity, waitTimeout, time};

    // Write it to parcel
    out.writeString(address);
    out.writeIntArray(integers);
    out.writeLongArray(longs);
    out.writeInt(connected ? 1 : 0);
}
 
Example 14
Source File: MagicLinkParcel.java    From alpha-wallet-android with MIT License 5 votes vote down vote up
@Override
public void writeToParcel(Parcel parcel, int i) {
    parcel.writeLong(magicLink.expiry);
    parcel.writeDouble(magicLink.price);
    parcel.writeInt(magicLink.ticketStart);
    parcel.writeInt(magicLink.ticketCount);
    parcel.writeString(magicLink.contractAddress);
    parcel.writeInt(magicLink.indices.length);
    parcel.writeIntArray(magicLink.indices);
    parcel.writeInt(magicLink.signature.length);
    parcel.writeByteArray(magicLink.signature);
    parcel.writeInt(magicLink.message.length);
    parcel.writeByteArray(magicLink.message);
    parcel.writeString(magicLink.priceWei.toString(10));
}
 
Example 15
Source File: SentenceSuggestionsInfo.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
/**
 * Used to package this object into a {@link Parcel}.
 *
 * @param dest The {@link Parcel} to be written.
 * @param flags The flags used for parceling.
 */
@Override
public void writeToParcel(Parcel dest, int flags) {
    final int infoSize = mSuggestionsInfos.length;
    dest.writeInt(infoSize);
    dest.writeTypedArray(mSuggestionsInfos, 0);
    dest.writeIntArray(mOffsets);
    dest.writeIntArray(mLengths);
}
 
Example 16
Source File: OpsCommands.java    From AppOpsX with MIT License 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeString(this.action);
  dest.writeString(this.packageName);
  dest.writeInt(this.userHandleId);
  dest.writeInt(this.opInt);
  dest.writeInt(this.modeInt);
  dest.writeIntArray(this.ops);
  dest.writeByte(this.reqNet ? (byte) 1 : (byte) 0);
}
 
Example 17
Source File: ColorPreference.java    From ColorPicker with Apache License 2.0 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    super.writeToParcel(dest, flags);
    // Write the preference's values
    dest.writeInt(current);
    dest.writeIntArray(colors);
    dest.writeInt(columns);
    dest.writeByte((byte) (material ? 1 : 0));
    dest.writeByte((byte) (backwardsOrder ? 1 : 0));
    dest.writeInt(strokeWidth);
    dest.writeInt(strokeColor);
}
 
Example 18
Source File: FragmentManager.java    From CodenameOne with GNU General Public License v2.0 4 votes vote down vote up
public void writeToParcel(Parcel dest, int flags) {
    dest.writeTypedArray(mActive, flags);
    dest.writeIntArray(mAdded);
    dest.writeTypedArray(mBackStack, flags);
}
 
Example 19
Source File: MarkSizeView.java    From timecat with Apache License 2.0 4 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(pathX.size());
    dest.writeIntArray(getXArray());
    dest.writeIntArray(getYArray());
}
 
Example 20
Source File: RandomPalette.java    From color-picker with Apache License 2.0 4 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags)
{
    dest.writeString(mName);
    dest.writeIntArray(mValues);
}