android.os.Bundle.putFloat()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(195)

本文整理了Java中android.os.Bundle.putFloat()方法的一些代码示例,展示了Bundle.putFloat()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bundle.putFloat()方法的具体详情如下:
包路径:android.os.Bundle
类名称:Bundle
方法名:putFloat

Bundle.putFloat介绍

暂无

代码示例

代码示例来源:origin: androidannotations/androidannotations

public I arg(String key, float value) {
  args.putFloat(key, value);
  return (I) this;
}

代码示例来源:origin: Yalantis/uCrop

/**
 * 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 void useSourceImageAspectRatio() {
  mOptionBundle.putFloat(EXTRA_ASPECT_RATIO_X, 0);
  mOptionBundle.putFloat(EXTRA_ASPECT_RATIO_Y, 0);
}

代码示例来源:origin: Yalantis/uCrop

/**
 * 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;
}

代码示例来源:origin: Yalantis/uCrop

/**
 * 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);
}

代码示例来源:origin: Yalantis/uCrop

/**
 * 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;
}

代码示例来源:origin: ogaclejapan/SmartTabLayout

/**
 * 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;
}

代码示例来源:origin: ogaclejapan/SmartTabLayout

/**
 * 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;
}

代码示例来源:origin: bluelinelabs/Conductor

public BundleBuilder putFloat(String key, float value) {
  bundle.putFloat(key, value);
  return this;
}

代码示例来源:origin: Yalantis/uCrop

/**
 * 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);
}

代码示例来源:origin: Bearded-Hen/Android-Bootstrap

@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;
}

代码示例来源:origin: Bearded-Hen/Android-Bootstrap

@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;
}

代码示例来源:origin: Bearded-Hen/Android-Bootstrap

@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;
}

代码示例来源:origin: Bearded-Hen/Android-Bootstrap

@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;
}

代码示例来源:origin: k9mail/k-9

@Override
protected Parcelable onSaveInstanceState() {
  Parcelable superState = super.onSaveInstanceState();
  Bundle state = new Bundle();
  state.putParcelable(STATE_PARENT, superState);
  state.putFloat(STATE_ANGLE, mAngle);
  return state;
}

代码示例来源:origin: Bearded-Hen/Android-Bootstrap

@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;
}

代码示例来源:origin: facebook/facebook-android-sdk

private static void putFloat(String key, Bundle bundle) {
  bundle.putFloat(key, random.nextFloat());
}

代码示例来源:origin: robolectric/robolectric

@Test
public void remove() {
 bundle.putFloat("foo", 5f);
 bundle.putFloat("foo2", 5f);
 bundle.remove("foo");
 assertThat(bundle.containsKey("foo")).isFalse();
 assertThat(bundle.containsKey("foo2")).isTrue();
}

代码示例来源:origin: robolectric/robolectric

@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);
}

代码示例来源:origin: robolectric/robolectric

@Test
public void clear() {
 bundle.putFloat("foo", 5f);
 bundle.clear();
 assertThat(bundle.size()).isEqualTo(0);
}

代码示例来源:origin: robolectric/robolectric

@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);
}

相关文章

Bundle类方法