public I arg(String key, float value) { args.putFloat(key, value); return (I) this; }
/** * Set an aspect ratio for crop bounds. * User won't see the menu with other ratios options. * * @param x aspect ratio X * @param y aspect ratio Y */ public UCrop withAspectRatio(float x, float y) { mCropOptionsBundle.putFloat(EXTRA_ASPECT_RATIO_X, x); mCropOptionsBundle.putFloat(EXTRA_ASPECT_RATIO_Y, y); return this; }
/** * Set an aspect ratio for crop bounds. * User won't see the menu with other ratios options. * * @param x aspect ratio X * @param y aspect ratio Y */ public void withAspectRatio(float x, float y) { mOptionBundle.putFloat(EXTRA_ASPECT_RATIO_X, x); mOptionBundle.putFloat(EXTRA_ASPECT_RATIO_Y, y); }
/** * Set an aspect ratio for crop bounds that is evaluated from source image width and height. * User won't see the menu with other ratios options. */ public UCrop useSourceImageAspectRatio() { mCropOptionsBundle.putFloat(EXTRA_ASPECT_RATIO_X, 0); mCropOptionsBundle.putFloat(EXTRA_ASPECT_RATIO_Y, 0); return this; }
/** * Inserts a float value into the mapping of this Bundle, replacing * any existing value for the given key. * * @param key a String, or null * @param value a float */ public Bundler putFloat(String key, float value) { bundle.putFloat(key, value); return this; }
/** * Inserts a float value into the mapping of this Bundle, replacing * any existing value for the given key. * * @param key a String, or null * @param value a float */ public Bundler putFloat(String key, float value) { bundle.putFloat(key, value); return this; }
public BundleBuilder putFloat(String key, float value) { bundle.putFloat(key, value); return this; }
/** * This method sets multiplier that is used to calculate max image scale from min image scale. * * @param maxScaleMultiplier - (minScale * maxScaleMultiplier) = maxScale */ public void setMaxScaleMultiplier(@FloatRange(from = 1.0, fromInclusive = false) float maxScaleMultiplier) { mOptionBundle.putFloat(EXTRA_MAX_SCALE_MULTIPLIER, maxScaleMultiplier); }
@Override public Parcelable onSaveInstanceState() { Bundle bundle = new Bundle(); bundle.putParcelable(TAG, super.onSaveInstanceState()); bundle.putSerializable(BootstrapBrandView.KEY, bootstrapBrand); bundle.putBoolean(BorderView.KEY_DISPLAYED, hasBorder); bundle.putFloat(BootstrapSizeView.KEY, bootstrapSize); return bundle; }
@Override public Parcelable onSaveInstanceState() { Bundle bundle = new Bundle(); bundle.putParcelable(TAG, super.onSaveInstanceState()); bundle.putBoolean(RoundableView.KEY, rounded); bundle.putFloat(BootstrapSizeView.KEY, bootstrapSize); bundle.putSerializable(BootstrapBrand.KEY, bootstrapBrand); return bundle; }
@Override public Parcelable onSaveInstanceState() { Bundle bundle = new Bundle(); bundle.putParcelable(TAG, super.onSaveInstanceState()); bundle.putBoolean(RoundableView.KEY, roundedCorners); bundle.putBoolean(OutlineableView.KEY, showOutline); bundle.putSerializable(KEY_DIRECTION, expandDirection); bundle.putFloat(BootstrapSizeView.KEY, bootstrapSize); return bundle; }
@Override public Parcelable onSaveInstanceState() { Bundle bundle = new Bundle(); bundle.putParcelable(TAG, super.onSaveInstanceState()); bundle.putInt(KEY_USER_PROGRESS, userProgress); bundle.putInt(KEY_DRAWN_PROGRESS, drawnProgress); bundle.putBoolean(KEY_STRIPED, striped); bundle.putBoolean(KEY_ANIMATED, animated); bundle.putBoolean(RoundableView.KEY, rounded); bundle.putFloat(BootstrapSizeView.KEY, bootstrapSize); bundle.putSerializable(BootstrapBrand.KEY, bootstrapBrand); return bundle; }
@Override protected Parcelable onSaveInstanceState() { Parcelable superState = super.onSaveInstanceState(); Bundle state = new Bundle(); state.putParcelable(STATE_PARENT, superState); state.putFloat(STATE_ANGLE, mAngle); return state; }
@Override public Parcelable onSaveInstanceState() { Bundle bundle = new Bundle(); bundle.putParcelable(TAG, super.onSaveInstanceState()); bundle.putBoolean(RoundableView.KEY, roundedCorners); bundle.putBoolean(OutlineableView.KEY, showOutline); bundle.putInt(KEY_INDEX, parentIndex); bundle.putFloat(BootstrapSizeView.KEY, bootstrapSize); bundle.putSerializable(KEY_MODE, buttonMode); if (bootstrapBadge != null) { bundle.putString(BadgeContainerView.KEY, bootstrapBadge .getBadgeText()); } return bundle; }
private static void putFloat(String key, Bundle bundle) { bundle.putFloat(key, random.nextFloat()); }
@Test public void shouldValidateSyncExtras() { Bundle bundle = new Bundle(); bundle.putString("foo", "strings"); bundle.putLong("long", 10L); bundle.putDouble("double", 10.0d); bundle.putFloat("float", 10.0f); bundle.putInt("int", 10); bundle.putParcelable("account", a); ContentResolver.validateSyncExtrasBundle(bundle); }
@Test public void clear() { bundle.putFloat("foo", 5f); bundle.clear(); assertThat(bundle.size()).isEqualTo(0); }
@Test public void getFloat() { bundle.putFloat("foo", 5f); assertThat(bundle.getFloat("foo")).isEqualTo(5.0f); assertThat(bundle.getFloat("bar")).isEqualTo(0.0f); assertThat(bundle.getFloat("bar", 7)).isEqualTo(7.0f); }