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

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

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

Bundle.getFloatArray介绍

暂无

代码示例

代码示例来源:origin: wangdan/AisenWeiBo

@Override
protected void onRestoreInstanceState(Parcelable state) {
  if (state instanceof Bundle) {
    Bundle bundle = (Bundle) state;
    colorHSV = bundle.getFloatArray("color");
    super.onRestoreInstanceState(bundle.getParcelable("super"));
  } else {
    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: konmik/nucleus

when(bundle.getFloatArray(anyString())).thenAnswer(get);

代码示例来源: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: facebook/facebook-android-sdk

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);
assertArrayEquals(originalBundle.getDoubleArray(DOUBLE_ARRAY_KEY), cachedBundle.getDoubleArray(DOUBLE_ARRAY_KEY));

代码示例来源:origin: multidots/android-app-common-tasks

@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");
    super.onRestoreInstanceState(bundle.getParcelable("instanceState"));
    return;
  }
  super.onRestoreInstanceState(state);
}

代码示例来源:origin: multidots/android-app-common-tasks

@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");
    super.onRestoreInstanceState(bundle.getParcelable("instanceState"));
    return;
  }
  super.onRestoreInstanceState(state);
}

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

Bundle b = this.getIntent().getExtras();
float original[];
if (b!=null) {
  original = b.getFloatArray(GLCamTest.TWEETS);
}
if (original!=null) {
  //do something with original
}

代码示例来源:origin: arvinljw/ClipView

public Parcelable onRestoreInstanceState(Parcelable state) {
    Bundle bundle = (Bundle) state;
    radii = bundle.getFloatArray(DATA_RADII);
    if (radii != null) {
      radiusLeftTop = radii[0];
      radiusRightTop = radii[2];
      radiusRightBottom = radii[4];
      radiusLeftBottom = radii[6];
    }

    return bundle.getParcelable(SUPER_DATA);
  }
}

代码示例来源:origin: SwiftyWang/FingerColoring-Android

@Override
protected void onRestoreInstanceState(Parcelable state) {
  if (state instanceof Bundle) {
    Bundle bundle = (Bundle) state;
    colorHSV = bundle.getFloatArray("color");
    super.onRestoreInstanceState(bundle.getParcelable("super"));
  } else {
    super.onRestoreInstanceState(state);
  }
}

代码示例来源:origin: marzika/Snapprefs

@Override
protected void onRestoreInstanceState(Parcelable state) {
  if (state instanceof Bundle) {
    Bundle bundle = (Bundle) state;
    colorHSV = bundle.getFloatArray("color");
    super.onRestoreInstanceState(bundle.getParcelable("super"));
  } else {
    super.onRestoreInstanceState(state);
  }
}

代码示例来源:origin: zxfnicholas/CameraSDK

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

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

    setColor(Color.HSVToColor(savedState.getFloatArray(STATE_COLOR)));
    setOpacity(savedState.getInt(STATE_OPACITY));
  }
}

代码示例来源:origin: xingxing-yan/BLImage

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

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

    setColor(Color.HSVToColor(savedState.getFloatArray(STATE_COLOR)));
    setOpacity(savedState.getInt(STATE_OPACITY));
  }
}

代码示例来源:origin: mkulesh/microMathematics

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

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

    setColor(Color.HSVToColor(savedState.getFloatArray(STATE_COLOR)));
    setOpacity(savedState.getInt(STATE_OPACITY));
  }
}

代码示例来源:origin: zxfnicholas/CameraSDK

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

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

    setColor(Color.HSVToColor(savedState.getFloatArray(STATE_COLOR)));
    setValue(savedState.getFloat(STATE_VALUE));
  }
}

代码示例来源:origin: mkulesh/microMathematics

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

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

    setColor(Color.HSVToColor(savedState.getFloatArray(STATE_COLOR)));
    setValue(savedState.getFloat(STATE_VALUE));
  }
}

代码示例来源:origin: zxfnicholas/CameraSDK

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

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

    setColor(Color.HSVToColor(savedState.getFloatArray(STATE_COLOR)));
    setSaturation(savedState.getFloat(STATE_SATURATION));
  }
}

代码示例来源:origin: eliotstocker/Light-Controller

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

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

    setColor(Color.HSVToColor(savedState.getFloatArray(STATE_COLOR)));
    setValue(savedState.getFloat(STATE_VALUE));
  }
}

代码示例来源:origin: xingxing-yan/BLImage

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

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

    setColor(Color.HSVToColor(savedState.getFloatArray(STATE_COLOR)));
    setSaturation(savedState.getFloat(STATE_SATURATION));
  }
}

代码示例来源:origin: xingxing-yan/BLImage

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

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

    setColor(Color.HSVToColor(savedState.getFloatArray(STATE_COLOR)));
    setValue(savedState.getFloat(STATE_VALUE));
  }
}

相关文章

Bundle类方法