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

The following examples show how to use android.os.Parcel#writeFloat() . 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: RunningSpeedAndCadenceMeasurementResponse.java    From Android-BLE-Library with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@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 2
Source File: BaseRoundCornerProgressBar.java    From RoundCornerProgressBar with Apache License 2.0 6 votes vote down vote up
@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 3
Source File: AnimationRect.java    From iBeebo with GNU General Public License v3.0 6 votes vote down vote up
@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 4
Source File: DragEvent.java    From android_9.0.0_r45 with 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 5
Source File: ViewInfosContainer.java    From pandroid with 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 6
Source File: Document.java    From spline with 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 7
Source File: Configuration.java    From android_9.0.0_r45 with 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 8
Source File: DribSearchView.java    From AndroidBeautifulSearch with Apache License 2.0 5 votes vote down vote up
@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 9
Source File: ProgressWheel.java    From MNVideoPlayer with GNU General Public License v3.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 10
Source File: ProgressWheel.java    From CSDN with 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 File: ProgressWheel.java    From materialish-progress with 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 12
Source File: Animal.java    From ParcelCheck with 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 13
Source File: AnimationDialogFragment.java    From Android-Marshmallow-Boot-Animation with MIT License 5 votes vote down vote up
@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 14
Source File: LoadingView.java    From BookReader with 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 15
Source File: GestureDescription.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(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 16
Source File: AnimatedCircleProgressView.java    From animated-circle-progress-view with Apache License 2.0 4 votes vote down vote up
@Override
public void writeToParcel(Parcel out, int flags) {
	super.writeToParcel(out, flags);
	out.writeFloat(mProgress);
	out.writeInt(mState);
}
 
Example 17
Source File: Feature.java    From geopaparazzi with GNU General Public License v3.0 4 votes vote down vote up
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 18
Source File: DrawPoint.java    From PaintView with 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 19
Source File: ScaleXSpan.java    From PowerFileExplorer with GNU General Public License v3.0 4 votes vote down vote up
public void writeToParcelInternal(Parcel dest, int flags) {
	dest.writeFloat(mProportion);
}
 
Example 20
Source File: IPCFloat.java    From IPCInvoker with Apache License 2.0 4 votes vote down vote up
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeFloat(value);
}