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

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

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

Bundle.getFloat介绍

暂无

代码示例

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

@Override public void onRestoreInstanceState(Parcelable state) {
  if (state instanceof Bundle) {
    Bundle bundle = (Bundle) state;
    this.roundedCorners = bundle.getBoolean(RoundableView.KEY);
    this.showOutline = bundle.getBoolean(OutlineableView.KEY);
    this.bootstrapSize = bundle.getFloat(BootstrapSizeView.KEY);
    Serializable direction = bundle.getSerializable(KEY_DIRECTION);
    if (direction instanceof ExpandDirection) {
      expandDirection = (ExpandDirection) direction;
    }
  }
  super.onRestoreInstanceState(state);
}

代码示例来源:origin: MikeOrtiz/TouchImageView

@Override
public void onRestoreInstanceState(Parcelable state) {
  if (state instanceof Bundle) {
    Bundle bundle = (Bundle) state;
    normalizedScale = bundle.getFloat("saveScale");
    m = bundle.getFloatArray("matrix");
    prevMatrix.setValues(m);
    prevMatchViewHeight = bundle.getFloat("matchViewHeight");
    prevMatchViewWidth = bundle.getFloat("matchViewWidth");
    prevViewHeight = bundle.getInt("viewHeight");
    prevViewWidth = bundle.getInt("viewWidth");
    imageRenderedAtLeastOnce = bundle.getBoolean("imageRendered");
    viewSizeChangeFixedPixel = (FixedPixel) bundle.getSerializable("viewSizeChangeFixedPixel");
    orientationChangeFixedPixel = (FixedPixel) bundle.getSerializable("orientationChangeFixedPixel");
    int oldOrientation = bundle.getInt("orientation");
    if (orientation != oldOrientation) {
      orientationJustChanged = true;
    }
    super.onRestoreInstanceState(bundle.getParcelable("instanceState"));
    return;
  }
  super.onRestoreInstanceState(state);
}

代码示例来源:origin: stephentuso/welcome-android

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  View view = inflater.inflate(R.layout.wel_fragment_parallax_full_screen, container, false);
  Bundle args = getArguments();
  frameLayout = (FrameLayout) view.findViewById(R.id.wel_parallax_frame);
  if (args == null)
    return view;
  startFactor = args.getFloat(KEY_START_FACTOR, startFactor);
  endFactor = args.getFloat(KEY_END_FACTOR, endFactor);
  parallaxRecursive = args.getBoolean(KEY_PARALLAX_RECURSIVE, parallaxRecursive);
  inflater.inflate(args.getInt(KEY_LAYOUT_ID), frameLayout, true);
  return view;
}

代码示例来源:origin: konmik/nucleus

when(bundle.getFloat(anyString())).thenAnswer(get);
when(bundle.getFloat(anyString(), anyFloat())).thenAnswer(getOrDefault);
when(bundle.getFloat(anyString())).thenAnswer(get);
when(bundle.getFloat(anyString(), anyFloat())).thenAnswer(getOrDefault);

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

@Override public void onRestoreInstanceState(Parcelable state) {
  if (state instanceof Bundle) {
    Bundle bundle = (Bundle) state;
    this.rounded = bundle.getBoolean(RoundableView.KEY);
    this.bootstrapSize = bundle.getFloat(BootstrapSizeView.KEY);
    Serializable brand = bundle.getSerializable(BootstrapBrand.KEY);
    if (brand instanceof BootstrapBrand) {
      bootstrapBrand = (BootstrapBrand) brand;
    }
    state = bundle.getParcelable(TAG);
  }
  super.onRestoreInstanceState(state);
  updateBootstrapState();
}

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

@Test
public void getWrongType() {
 bundle.putFloat("foo", 5f);
 assertThat(bundle.getCharArray("foo")).isNull();
 assertThat(bundle.getInt("foo")).isEqualTo(0);
 assertThat(bundle.getIntArray("foo")).isNull();
 assertThat(bundle.getIntegerArrayList("foo")).isNull();
 assertThat(bundle.getShort("foo")).isEqualTo((short) 0);
 assertThat(bundle.getShortArray("foo")).isNull();
 assertThat(bundle.getBoolean("foo")).isFalse();
 assertThat(bundle.getBooleanArray("foo")).isNull();
 assertThat(bundle.getLong("foo")).isEqualTo(0);
 assertThat(bundle.getLongArray("foo")).isNull();
 assertThat(bundle.getFloatArray("foo")).isNull();
 assertThat(bundle.getDouble("foo")).isEqualTo(0.0);
 assertThat(bundle.getDoubleArray("foo")).isNull();
 assertThat(bundle.getString("foo")).isNull();
 assertThat(bundle.getStringArray("foo")).isNull();
 assertThat(bundle.getStringArrayList("foo")).isNull();
 assertThat(bundle.getBundle("foo")).isNull();
 assertThat((Parcelable) bundle.getParcelable("foo")).isNull();
 assertThat(bundle.getParcelableArray("foo")).isNull();
 assertThat(bundle.getParcelableArrayList("foo")).isNull();
 bundle.putInt("foo", 1);
 assertThat(bundle.getFloat("foo")).isEqualTo(0.0f);
}

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

@Override public void onRestoreInstanceState(Parcelable state) {
  if (state instanceof Bundle) {
    Bundle bundle = (Bundle) state;
    this.hasBorder = bundle.getBoolean(BorderView.KEY_DISPLAYED);
    this.bootstrapSize = bundle.getFloat(BootstrapSizeView.KEY);
    Serializable brand = bundle.getSerializable(BootstrapBrandView.KEY);
    if (brand instanceof BootstrapBrand) {
      this.bootstrapBrand = (BootstrapBrand) brand;
    }
    state = bundle.getParcelable(TAG);
  }
  super.onRestoreInstanceState(state);
  updateImageState();
}

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

assertEquals(originalBundle.getLong(LONG_KEY), cachedBundle.getLong(LONG_KEY));
assertArrayEquals(originalBundle.getLongArray(LONG_ARRAY_KEY), cachedBundle.getLongArray(LONG_ARRAY_KEY));
assertEquals(originalBundle.getFloat(FLOAT_KEY), cachedBundle.getFloat(FLOAT_KEY), TestUtils.DOUBLE_EQUALS_DELTA);
assertArrayEquals(originalBundle.getFloatArray(FLOAT_ARRAY_KEY), cachedBundle.getFloatArray(FLOAT_ARRAY_KEY));
assertEquals(originalBundle.getDouble(DOUBLE_KEY), cachedBundle.getDouble(DOUBLE_KEY), TestUtils.DOUBLE_EQUALS_DELTA);

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

@Override
  protected void onRestoreInstanceState(Parcelable state) {
    Bundle savedState = (Bundle) state;

    Parcelable superState = savedState.getParcelable(STATE_PARENT);
    super.onRestoreInstanceState(superState);

    mAngle = savedState.getFloat(STATE_ANGLE);
    mPointerColor.setColor(calculateColor(mAngle));
  }
}

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

@Override public void onRestoreInstanceState(Parcelable state) {
  if (state instanceof Bundle) {
    Bundle bundle = (Bundle) state;
    this.roundedCorners = bundle.getBoolean(RoundableView.KEY);
    this.showOutline = bundle.getBoolean(OutlineableView.KEY);
    this.parentIndex = bundle.getInt(KEY_INDEX);
    this.bootstrapSize = bundle.getFloat(BootstrapSizeView.KEY);
    if (bootstrapBadge != null) {
      setBadgeText(bundle.getString(BadgeContainerView.KEY));
    }
    Serializable m = bundle.getSerializable(KEY_MODE);
    if (m instanceof ButtonMode) {
      buttonMode = (ButtonMode) m;
    }
  }
  super.onRestoreInstanceState(state);
}

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

@Override
public void onRestoreInstanceState(Parcelable state) {
  if (state instanceof Bundle) {
    Bundle bundle = (Bundle) state;
    Serializable brand = bundle.getSerializable(BootstrapBrand.KEY);
    if (brand instanceof BootstrapBrand) {
      bootstrapBrand = (BootstrapBrand) brand;
    }
    this.userProgress = bundle.getInt(KEY_USER_PROGRESS);
    this.drawnProgress = bundle.getInt(KEY_DRAWN_PROGRESS);
    this.striped = bundle.getBoolean(KEY_STRIPED);
    this.animated = bundle.getBoolean(KEY_ANIMATED);
    this.rounded = bundle.getBoolean(RoundableView.KEY);
    this.bootstrapSize = bundle.getFloat(BootstrapSizeView.KEY);
    state = bundle.getParcelable(TAG);
  }
  super.onRestoreInstanceState(state);
  updateBootstrapState();
  setProgress(userProgress);
}

代码示例来源:origin: joyoyao/superCleanMaster

@Override
  protected void onRestoreInstanceState(Parcelable state) {
    if (state instanceof Bundle) {
      final Bundle bundle = (Bundle) state;
      strokeWidth = bundle.getFloat(INSTANCE_STROKE_WIDTH);
      suffixTextSize = bundle.getFloat(INSTANCE_SUFFIX_TEXT_SIZE);
      suffixTextPadding = bundle.getFloat(INSTANCE_SUFFIX_TEXT_PADDING);
      bottomTextSize = bundle.getFloat(INSTANCE_BOTTOM_TEXT_SIZE);
      bottomText = bundle.getString(INSTANCE_BOTTOM_TEXT);
      textSize = bundle.getFloat(INSTANCE_TEXT_SIZE);
      textColor = bundle.getInt(INSTANCE_TEXT_COLOR);
      setMax(bundle.getInt(INSTANCE_MAX));
      setProgress(bundle.getInt(INSTANCE_PROGRESS));
      finishedStrokeColor = bundle.getInt(INSTANCE_FINISHED_STROKE_COLOR);
      unfinishedStrokeColor = bundle
          .getInt(INSTANCE_UNFINISHED_STROKE_COLOR);
      suffixText = bundle.getString(INSTANCE_SUFFIX);
      initPainters();
      super.onRestoreInstanceState(bundle.getParcelable(INSTANCE_STATE));
      return;
    }
    super.onRestoreInstanceState(state);
  }
}

代码示例来源:origin: stephentuso/welcome-android

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  View view = inflater.inflate(R.layout.wel_fragment_parallax, container, false);
  Bundle args = getArguments();
  frameLayout = (FrameLayout) view.findViewById(R.id.wel_parallax_frame);
  titleView = (TextView) view.findViewById(R.id.wel_title);
  descriptionView = (TextView) view.findViewById(R.id.wel_description);
  if (args == null)
    return view;
  startFactor = args.getFloat(KEY_START_FACTOR, startFactor);
  endFactor = args.getFloat(KEY_END_FACTOR, endFactor);
  parallaxRecursive = args.getBoolean(KEY_PARALLAX_RECURSIVE, parallaxRecursive);
  inflater.inflate(args.getInt(KEY_LAYOUT_ID), frameLayout, true);
  if (args.getString(KEY_TITLE) != null)
    titleView.setText(args.getString(KEY_TITLE));
  if (args.getString(KEY_DESCRIPTION) != null)
    descriptionView.setText(args.getString(KEY_DESCRIPTION));
  int headerColor = args.getInt(KEY_HEADER_COLOR, WelcomeUtils.NO_COLOR_SET);
  if (headerColor != WelcomeUtils.NO_COLOR_SET)
    titleView.setTextColor(headerColor);
  int descriptionColor = args.getInt(KEY_DESCRIPTION_COLOR, WelcomeUtils.NO_COLOR_SET);
  if (descriptionColor != WelcomeUtils.NO_COLOR_SET)
    descriptionView.setTextColor(descriptionColor);
  WelcomeUtils.setTypeface(titleView, args.getString(KEY_HEADER_TYPEFACE_PATH), getActivity());
  WelcomeUtils.setTypeface(descriptionView, args.getString(KEY_DESCRIPTION_TYPEFACE_PATH), getActivity());
  return view;
}

代码示例来源:origin: HotBitmapGG/bilibili-android-client

@Override
protected void onRestoreInstanceState(Parcelable state) {
  if (state instanceof Bundle) {
    final Bundle bundle = (Bundle) state;
    mTextColor = bundle.getInt(INSTANCE_TEXT_COLOR);
    mTextSize = bundle.getFloat(INSTANCE_TEXT_SIZE);
    mReachedBarHeight = bundle.getFloat(INSTANCE_REACHED_BAR_HEIGHT);
    mUnreachedBarHeight = bundle.getFloat(INSTANCE_UNREACHED_BAR_HEIGHT);
    mReachedBarColor = bundle.getInt(INSTANCE_REACHED_BAR_COLOR);
    mUnreachedBarColor = bundle.getInt(INSTANCE_UNREACHED_BAR_COLOR);
    initializePainters();
    setMax(bundle.getInt(INSTANCE_MAX));
    setProgress(bundle.getInt(INSTANCE_PROGRESS));
    setPrefix(bundle.getString(INSTANCE_PREFIX));
    setSuffix(bundle.getString(INSTANCE_SUFFIX));
    setProgressTextVisibility(bundle.getBoolean(INSTANCE_TEXT_VISIBILITY)
        ? ProgressTextVisibility.Visible
        : ProgressTextVisibility.Invisible);
    super.onRestoreInstanceState(bundle.getParcelable(INSTANCE_STATE));
    return;
  }
  super.onRestoreInstanceState(state);
}

代码示例来源:origin: WVector/AppUpdate

@Override
protected void onRestoreInstanceState(Parcelable state) {
  if (state instanceof Bundle) {
    final Bundle bundle = (Bundle) state;
    mTextColor = bundle.getInt(INSTANCE_TEXT_COLOR);
    mTextSize = bundle.getFloat(INSTANCE_TEXT_SIZE);
    mReachedBarHeight = bundle.getFloat(INSTANCE_REACHED_BAR_HEIGHT);
    mUnreachedBarHeight = bundle.getFloat(INSTANCE_UNREACHED_BAR_HEIGHT);
    mReachedBarColor = bundle.getInt(INSTANCE_REACHED_BAR_COLOR);
    mUnreachedBarColor = bundle.getInt(INSTANCE_UNREACHED_BAR_COLOR);
    initializePainters();
    setMax(bundle.getInt(INSTANCE_MAX));
    setProgress(bundle.getInt(INSTANCE_PROGRESS));
    setPrefix(bundle.getString(INSTANCE_PREFIX));
    setSuffix(bundle.getString(INSTANCE_SUFFIX));
    setProgressTextVisibility(bundle.getBoolean(INSTANCE_TEXT_VISIBILITY) ? ProgressTextVisibility.VISIBLE : ProgressTextVisibility.INVISIBLE);
    super.onRestoreInstanceState(bundle.getParcelable(INSTANCE_STATE));
    return;
  }
  super.onRestoreInstanceState(state);
}

代码示例来源: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);
}

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

mGestureCropImageView.setMaxScaleMultiplier(bundle.getFloat(UCrop.Options.EXTRA_MAX_SCALE_MULTIPLIER, CropImageView.DEFAULT_MAX_SCALE_MULTIPLIER));
mGestureCropImageView.setImageToWrapCropBoundsAnimDuration(bundle.getInt(UCrop.Options.EXTRA_IMAGE_TO_CROP_BOUNDS_ANIM_DURATION, CropImageView.DEFAULT_IMAGE_TO_CROP_BOUNDS_ANIM_DURATION));
float aspectRatioX = bundle.getFloat(UCrop.EXTRA_ASPECT_RATIO_X, 0);
float aspectRatioY = bundle.getFloat(UCrop.EXTRA_ASPECT_RATIO_Y, 0);

代码示例来源:origin: JZ-Darkal/AndroidHttpCapture

scaleFactor = bundle.getFloat(DecodeThread.BARCODE_SCALED_FACTOR);

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

assertThat(meta.getFloat("org.robolectric.metaFloat")).isEqualTo(1.23f);

代码示例来源:origin: stackoverflow.com

Bundle extras = getIntent().getExtras(); 
if(extras !=null)
{
 float foo = extras.getFloat("foo");
 String bar = extras.getString("bar");
}

相关文章

Bundle类方法