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

The following examples show how to use android.os.Parcel#writeFloat() . 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: android_9.0.0_r45   File: DragEvent.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Creates a {@link android.os.Parcel} object from this DragEvent object.
 * @param dest A {@link android.os.Parcel} object in which to put the DragEvent object.
 * @param flags Flags to store in the Parcel.
 */
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(mAction);
    dest.writeFloat(mX);
    dest.writeFloat(mY);
    dest.writeInt(mDragResult ? 1 : 0);
    if (mClipData == null) {
        dest.writeInt(0);
    } else {
        dest.writeInt(1);
        mClipData.writeToParcel(dest, flags);
    }
    if (mClipDescription == null) {
        dest.writeInt(0);
    } else {
        dest.writeInt(1);
        mClipDescription.writeToParcel(dest, flags);
    }
    if (mDragAndDropPermissions == null) {
        dest.writeInt(0);
    } else {
        dest.writeInt(1);
        dest.writeStrongBinder(mDragAndDropPermissions.asBinder());
    }
}
 
Example 2
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeParcelable(scaledBitmapRect, flags);
    dest.writeParcelable(imageViewEntireRect, flags);
    dest.writeParcelable(imageViewVisibleRect, flags);
    dest.writeInt(type);
    dest.writeBooleanArray(new boolean[]{
            isTotalVisible
    });
    dest.writeBooleanArray(new boolean[]{
            isTotalInvisible
    });
    dest.writeBooleanArray(new boolean[]{
            isScreenPortrait
    });
    dest.writeFloat(thumbnailWidthHeightRatio);
    dest.writeInt(thumbnailWidth);
    dest.writeInt(thumbnailHeight);
    dest.writeInt(widgetWidth);
    dest.writeInt(widgetHeight);
    dest.writeFloat(clipByParentRectTop);
    dest.writeFloat(clipByParentRectBottom);
    dest.writeFloat(clipByParentRectLeft);
    dest.writeFloat(clipByParentRectRight);
}
 
Example 3
@Override
public void writeToParcel(Parcel out, int flags) {
    super.writeToParcel(out, flags);
    out.writeFloat(this.max);
    out.writeFloat(this.progress);
    out.writeFloat(this.secondaryProgress);

    out.writeInt(this.radius);
    out.writeInt(this.padding);

    out.writeInt(this.colorBackground);
    out.writeInt(this.colorProgress);
    out.writeInt(this.colorSecondaryProgress);
    out.writeInt(this.colorProgressArray != null ? this.colorProgressArray.length : 0);
    out.writeIntArray(this.colorProgressArray != null ? this.colorProgressArray : new int[0]);
    out.writeInt(this.colorSecondaryProgressArray != null ? this.colorSecondaryProgressArray.length : 0);
    out.writeIntArray(this.colorSecondaryProgressArray != null ? this.colorSecondaryProgressArray : new int[0]);

    out.writeByte((byte) (this.isReverse ? 1 : 0));
}
 
Example 4
@Override
public void writeToParcel(final Parcel dest, final int flags) {
	super.writeToParcel(dest, flags);
	dest.writeByte((byte) (running ? 1 : 0));
	dest.writeFloat(instantaneousSpeed);
	dest.writeInt(instantaneousCadence);
	if (strideLength == null) {
		dest.writeByte((byte) 0);
	} else {
		dest.writeByte((byte) 1);
		dest.writeInt(strideLength);
	}
	if (totalDistance == null) {
		dest.writeByte((byte) 0);
	} else {
		dest.writeByte((byte) 1);
		dest.writeLong(totalDistance);
	}
}
 
Example 5
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(mStrokeId);
    dest.writeInt(mContinuedStrokeId);
    int startEnd = mIsStartOfPath ? FLAG_IS_START_OF_PATH : 0;
    startEnd |= mIsEndOfPath ? FLAG_IS_END_OF_PATH : 0;
    dest.writeInt(startEnd);
    dest.writeFloat(mX);
    dest.writeFloat(mY);
}
 
Example 6
Source Project: BookReader   File: LoadingView.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeFloat(this.strokeInset);
    dest.writeFloat(this.strokeWidth);
    dest.writeFloat(this.ringCenterRadius);
    dest.writeFloat(this.start);
    dest.writeFloat(this.end);
    dest.writeFloat(this.sweep);
    dest.writeFloat(this.sweeping);
    dest.writeFloat(this.starting);
    dest.writeFloat(this.ending);
    dest.writeInt(this.color);
}
 
Example 7
@Override
public void writeToParcel(Parcel dest, int flags) {
	dest.writeValue(this.firstColor);
	dest.writeValue(this.secondColor);
	dest.writeValue(this.thirdColor);
	dest.writeValue(this.fourthColor);
	dest.writeValue(this.backgroundColor);
	dest.writeFloat(this.speedCoefficient);
}
 
Example 8
Source Project: ParcelCheck   File: Animal.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(this.numberOfLegs);
    dest.writeFloat(this.topSpeed);
    dest.writeDouble(this.lifespan);
    dest.writeString(this.name);
    dest.writeByte(this.canFly ? (byte) 1 : (byte) 0);
}
 
Example 9
@Override public void writeToParcel(Parcel out, int flags) {
  super.writeToParcel(out, flags);
  out.writeFloat(this.mProgress);
  out.writeFloat(this.mTargetProgress);
  out.writeByte((byte) (isSpinning ? 1 : 0));
  out.writeFloat(this.spinSpeed);
  out.writeInt(this.barWidth);
  out.writeInt(this.barColor);
  out.writeInt(this.rimWidth);
  out.writeInt(this.rimColor);
  out.writeInt(this.circleRadius);
  out.writeByte((byte) (linearProgress ? 1 : 0));
  out.writeByte((byte) (fillRadius ? 1 : 0));
}
 
Example 10
Source Project: CSDN   File: ProgressWheel.java    License: Apache License 2.0 5 votes vote down vote up
@Override public void writeToParcel(Parcel out, int flags) {
    super.writeToParcel(out, flags);
    out.writeFloat(this.mProgress);
    out.writeFloat(this.mTargetProgress);
    out.writeByte((byte) (isSpinning ? 1 : 0));
    out.writeFloat(this.spinSpeed);
    out.writeInt(this.barWidth);
    out.writeInt(this.barColor);
    out.writeInt(this.rimWidth);
    out.writeInt(this.rimColor);
    out.writeInt(this.circleRadius);
    out.writeByte((byte) (linearProgress ? 1 : 0));
    out.writeByte((byte) (fillRadius ? 1 : 0));
}
 
Example 11
Source Project: pandroid   File: ViewInfosContainer.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeSerializable(viewClass);
    dest.writeInt(viewId);
    dest.writeSerializable(viewTagS);
    dest.writeParcelable(viewTagP, flags);
    dest.writeSerializable(backgroundColor);
    dest.writeIntArray(padding);
    dest.writeFloatArray(position);
    dest.writeIntArray(size);
    dest.writeInt(textColor);
    dest.writeFloat(textSize);
    dest.writeInt(textGravity);
    dest.writeFloat(elevation);
}
 
Example 12
@Override public void writeToParcel(Parcel out, int flags) {
  super.writeToParcel(out, flags);
  out.writeFloat(this.mProgress);
  out.writeFloat(this.mTargetProgress);
  out.writeByte((byte) (isSpinning ? 1 : 0));
  out.writeFloat(this.spinSpeed);
  out.writeInt(this.barWidth);
  out.writeInt(this.barColor);
  out.writeInt(this.rimWidth);
  out.writeInt(this.rimColor);
  out.writeInt(this.circleRadius);
  out.writeByte((byte) (linearProgress ? 1 : 0));
  out.writeByte((byte) (fillRadius ? 1 : 0));
}
 
Example 13
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeFloat(this.joinAngle);
    dest.writeFloat(this.joinx);
    dest.writeFloat(this.joiny);
    dest.writeFloat(this.lineDelx);
}
 
Example 14
Source Project: android_9.0.0_r45   File: Configuration.java    License: Apache License 2.0 5 votes vote down vote up
public void writeToParcel(Parcel dest, int flags) {
    dest.writeFloat(fontScale);
    dest.writeInt(mcc);
    dest.writeInt(mnc);

    fixUpLocaleList();
    dest.writeParcelable(mLocaleList, flags);

    if(userSetLocale) {
        dest.writeInt(1);
    } else {
        dest.writeInt(0);
    }
    dest.writeInt(touchscreen);
    dest.writeInt(keyboard);
    dest.writeInt(keyboardHidden);
    dest.writeInt(hardKeyboardHidden);
    dest.writeInt(navigation);
    dest.writeInt(navigationHidden);
    dest.writeInt(orientation);
    dest.writeInt(screenLayout);
    dest.writeInt(colorMode);
    dest.writeInt(uiMode);
    dest.writeInt(screenWidthDp);
    dest.writeInt(screenHeightDp);
    dest.writeInt(smallestScreenWidthDp);
    dest.writeInt(densityDpi);
    dest.writeInt(compatScreenWidthDp);
    dest.writeInt(compatScreenHeightDp);
    dest.writeInt(compatSmallestScreenWidthDp);
    dest.writeValue(windowConfiguration);
    dest.writeInt(assetsSeq);
    dest.writeInt(seq);
}
 
Example 15
Source Project: spline   File: Document.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeParcelable(root, 0);
    dest.writeParcelable(currentLayer, 0);
    dest.writeFloat(viewportX);
    dest.writeFloat(viewportY);
}
 
Example 16
public void writeToParcelInternal(Parcel dest, int flags) {
	dest.writeFloat(mProportion);
}
 
Example 17
Source Project: PaintView   File: DrawPoint.java    License: MIT License 4 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeSerializable(paint);
    dest.writeFloat(x);
    dest.writeFloat(y);
}
 
Example 18
@Override
public void writeToParcel(Parcel out, int flags) {
	super.writeToParcel(out, flags);
	out.writeFloat(mProgress);
	out.writeInt(mState);
}
 
Example 19
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(idIndex);
    dest.writeInt(geometryIndex);
    dest.writeString(tableName);
    dest.writeString(databasePath);
    dest.writeList(attributeNames);
    dest.writeList(attributeTypes);
    for (int i = 0; i < attributeValues.size(); i++) {
        Object obj = attributeValues.get(i);
        if (i == geometryIndex) {
            if (obj == null) {
                dest.writeByteArray(null);
            } else {
                Geometry geom = (Geometry) obj;
                WKBWriter wkbWriter = new WKBWriter();
                dest.writeByteArray(wkbWriter.write(geom));
            }
        } else {
            String type = attributeTypes.get(i);
            EDataType type4Name = EDataType.getType4Name(type);
            switch (type4Name) {
                case TEXT: {
                    if (obj == null) {
                        dest.writeString("null");
                    } else {
                        dest.writeString((String) obj);
                    }
                    break;
                }
                case INTEGER: {
                    if (obj == null) {
                        dest.writeInt(Integer.MIN_VALUE);
                    } else {
                        dest.writeInt(((Number) obj).intValue());
                    }
                    break;
                }
                case FLOAT: {
                    if (obj == null) {
                        dest.writeFloat(Float.NaN);
                    } else {
                        dest.writeFloat(((Number) obj).floatValue());
                    }
                    break;
                }
                case DOUBLE: {
                    if (obj == null) {
                        dest.writeDouble(Double.NaN);
                    } else {
                        dest.writeDouble(((Number) obj).doubleValue());
                    }
                    break;
                }
                case LONG: {
                    if (obj == null) {
                        dest.writeLong(Long.MIN_VALUE);
                    } else {
                        dest.writeLong(((Number) obj).longValue());
                    }
                    break;
                }
                case BLOB: {
                    dest.writeValue(obj);
                    break;
                }
            }

        }
    }
}
 
Example 20
Source Project: IPCInvoker   File: IPCFloat.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeFloat(value);
}