Java Code Examples for android.os.Bundle.putFloatArray()

The following are Jave code examples for showing how to use putFloatArray() of the android.os.Bundle class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Android-Code-Demos   File: BoxDrawingView.java   View Source Code Vote up 6 votes
@Override
protected Parcelable onSaveInstanceState() {
    // We must save the parent class state first.
    Parcelable parentState = super.onSaveInstanceState();

    //Bundle used to save the state.
    Bundle bundle = new Bundle();
    bundle.putParcelable(PARENT_STATE_KEY, parentState);

    // Saved the state of the draw boxes
    // the order of the points are origin.x, origin.y,
    // current.x, current,y.
    int boxNumber = 1;
    for (Box box : mBoxen) {
        float[] pointsArray = {
                box.getOrigin().x,
                box.getOrigin().y,
                box.getCurrent().x,
                box.getCurrent().y,
        };

        bundle.putFloatArray("box" + boxNumber, pointsArray);
        boxNumber++;
    }
    return bundle;
}
 
Example 2
Project: ThunderMusic   File: ColorPicker.java   View Source Code Vote up 5 votes
@Override
protected Parcelable onSaveInstanceState() {
    Bundle state = new Bundle();
    state.putFloatArray("color", colorHSV);
    state.putParcelable("super", super.onSaveInstanceState());
    return state;
}
 
Example 3
Project: buildAPKsApps   File: ColorPicker.java   View Source Code Vote up 5 votes
@Override
protected Parcelable onSaveInstanceState() {
    Bundle state = new Bundle();
    state.putFloatArray("color", colorHSV);
    state.putParcelable("super", super.onSaveInstanceState());
    return state;
}
 
Example 4
Project: yphoto   File: TouchImageView.java   View Source Code Vote up 5 votes
@Override
public Parcelable onSaveInstanceState() {
    Bundle bundle = new Bundle();
    bundle.putParcelable("instanceState", super.onSaveInstanceState());
    bundle.putFloat("saveScale", normalizedScale);
    bundle.putFloat("matchViewHeight", matchViewHeight);
    bundle.putFloat("matchViewWidth", matchViewWidth);
    bundle.putInt("viewWidth", viewWidth);
    bundle.putInt("viewHeight", viewHeight);
    matrix.getValues(m);
    bundle.putFloatArray("matrix", m);
    bundle.putBoolean("imageRendered", imageRenderedAtLeastOnce);
    return bundle;
}
 
Example 5
Project: Android_ImagePicker   File: TouchImageView.java   View Source Code Vote up 5 votes
@Override
public Parcelable onSaveInstanceState() {
    Bundle bundle = new Bundle();
    bundle.putParcelable("instanceState", super.onSaveInstanceState());
    bundle.putFloat("saveScale", normalizedScale);
    bundle.putFloat("matchViewHeight", matchViewHeight);
    bundle.putFloat("matchViewWidth", matchViewWidth);
    bundle.putInt("viewWidth", viewWidth);
    bundle.putInt("viewHeight", viewHeight);
    matrix.getValues(m);
    bundle.putFloatArray("matrix", m);
    bundle.putBoolean("imageRendered", imageRenderedAtLeastOnce);
    return bundle;
}
 
Example 6
Project: buildAPKsApps   File: MultiColorPicker.java   View Source Code Vote up 5 votes
@Override
protected Parcelable onSaveInstanceState() {
    Bundle state = new Bundle();
    state.putFloatArray("color", colorHSV);
    state.putParcelable("super", super.onSaveInstanceState());
    return state;
}
 
Example 7
Project: planetcon   File: ColorPicker.java   View Source Code Vote up 5 votes
@Override
protected Parcelable onSaveInstanceState() {
    Bundle state = new Bundle();
    state.putFloatArray("color", mColorHSV);
    state.putInt("previous", mColorInitial);
    state.putParcelable("super", super.onSaveInstanceState());
    return state;
}
 
Example 8
Project: ucar-weex-core   File: ArgumentsUtil.java   View Source Code Vote up 5 votes
public static void fromArrayToBundle(Bundle bundle, String key, Object array) {
    if (bundle != null && !TextUtils.isEmpty(key) && array != null) {
        if (array instanceof String[]) {
            bundle.putStringArray(key, (String[]) ((String[]) array));
        } else if (array instanceof byte[]) {
            bundle.putByteArray(key, (byte[]) ((byte[]) array));
        } else if (array instanceof short[]) {
            bundle.putShortArray(key, (short[]) ((short[]) array));
        } else if (array instanceof int[]) {
            bundle.putIntArray(key, (int[]) ((int[]) array));
        } else if (array instanceof long[]) {
            bundle.putLongArray(key, (long[]) ((long[]) array));
        } else if (array instanceof float[]) {
            bundle.putFloatArray(key, (float[]) ((float[]) array));
        } else if (array instanceof double[]) {
            bundle.putDoubleArray(key, (double[]) ((double[]) array));
        } else if (array instanceof boolean[]) {
            bundle.putBooleanArray(key, (boolean[]) ((boolean[]) array));
        } else if (array instanceof char[]) {
            bundle.putCharArray(key, (char[]) ((char[]) array));
        } else {
            if (!(array instanceof JSONArray)) {
                throw new IllegalArgumentException("Unknown array type " + array.getClass());
            }

            ArrayList arraylist = new ArrayList();
            JSONArray jsonArray = (JSONArray) array;
            Iterator it = jsonArray.iterator();

            while (it.hasNext()) {
                JSONObject object = (JSONObject) it.next();
                arraylist.add(fromJsonToBundle(object));
            }

            bundle.putParcelableArrayList(key, arraylist);
        }

    }
}
 
Example 9
Project: JsoupSample   File: TouchImageView.java   View Source Code Vote up 5 votes
@Override
public Parcelable onSaveInstanceState() {
    Bundle bundle = new Bundle();
    bundle.putParcelable("instanceState", super.onSaveInstanceState());
    bundle.putFloat("saveScale", normalizedScale);
    bundle.putFloat("matchViewHeight", matchViewHeight);
    bundle.putFloat("matchViewWidth", matchViewWidth);
    bundle.putInt("viewWidth", viewWidth);
    bundle.putInt("viewHeight", viewHeight);
    matrix.getValues(m);
    bundle.putFloatArray("matrix", m);
    bundle.putBoolean("imageRendered", imageRenderedAtLeastOnce);
    return bundle;
}
 
Example 10
Project: boohee_v5.6   File: TouchImageView.java   View Source Code Vote up 5 votes
public Parcelable onSaveInstanceState() {
    Bundle bundle = new Bundle();
    bundle.putParcelable("instanceState", super.onSaveInstanceState());
    bundle.putFloat("saveScale", this.normalizedScale);
    bundle.putFloat("matchViewHeight", this.matchViewHeight);
    bundle.putFloat("matchViewWidth", this.matchViewWidth);
    bundle.putInt("viewWidth", this.viewWidth);
    bundle.putInt("viewHeight", this.viewHeight);
    this.matrix.getValues(this.m);
    bundle.putFloatArray("matrix", this.m);
    bundle.putBoolean("imageRendered", this.imageRenderedAtLeastOnce);
    return bundle;
}
 
Example 11
Project: cordova-plugin-video-picture-preview-picker-V2   File: TouchImageView.java   View Source Code Vote up 5 votes
@Override
public Parcelable onSaveInstanceState() {
	Bundle bundle = new Bundle();
	bundle.putParcelable("instanceState", super.onSaveInstanceState());
	bundle.putFloat("saveScale", normalizedScale);
	bundle.putFloat("matchViewHeight", matchViewHeight);
	bundle.putFloat("matchViewWidth", matchViewWidth);
	bundle.putInt("viewWidth", viewWidth);
	bundle.putInt("viewHeight", viewHeight);
	matrix.getValues(m);
	bundle.putFloatArray("matrix", m);
	bundle.putBoolean("imageRendered", imageRenderedAtLeastOnce);
	return bundle;
}
 
Example 12
Project: Expert-Android-Programming   File: TouchImageView.java   View Source Code Vote up 5 votes
@Override
public Parcelable onSaveInstanceState() {
    Bundle bundle = new Bundle();
    bundle.putParcelable("instanceState", super.onSaveInstanceState());
    bundle.putFloat("saveScale", normalizedScale);
    bundle.putFloat("matchViewHeight", matchViewHeight);
    bundle.putFloat("matchViewWidth", matchViewWidth);
    bundle.putInt("viewWidth", viewWidth);
    bundle.putInt("viewHeight", viewHeight);
    matrix.getValues(m);
    bundle.putFloatArray("matrix", m);
    bundle.putBoolean("imageRendered", imageRenderedAtLeastOnce);
    return bundle;
}
 
Example 13
Project: ImageMagnifier   File: TouchImageView.java   View Source Code Vote up 5 votes
public Parcelable onSaveInstanceState() {
    Bundle bundle = new Bundle();
    bundle.putParcelable("instanceState", super.onSaveInstanceState());
    bundle.putFloat("saveScale", this.normalizedScale);
    bundle.putFloat("matchViewHeight", this.matchViewHeight);
    bundle.putFloat("matchViewWidth", this.matchViewWidth);
    bundle.putInt("viewWidth", this.viewWidth);
    bundle.putInt("viewHeight", this.viewHeight);
    this.matrix.getValues(this.values);
    bundle.putFloatArray("matrix", this.values);
    bundle.putBoolean("imageRendered", this.imageRenderedAtLeastOnce);
    return bundle;
}
 
Example 14
Project: Matrix-Calculator-for-Android   File: Matrix.java   View Source Code Vote up 5 votes
public Bundle GetDataBundled() {
    Bundle AllInfo = new Bundle();
    AllInfo.putInt("ROW", this.GetRow());
    AllInfo.putInt("COL", this.GetCol());
    AllInfo.putString("NAME", name);
    AllInfo.putSerializable("TYPE", this.GetType());
    AllInfo.putFloatArray("VALUES", Compress(this.Elements, this.GetRow(), this.GetCol()));
    return AllInfo;
}
 
Example 15
Project: xlight_android_native   File: ValueBar.java   View Source Code Vote up 5 votes
@Override
protected Parcelable onSaveInstanceState() {
	Parcelable superState = super.onSaveInstanceState();

	Bundle state = new Bundle();
	state.putParcelable(STATE_PARENT, superState);
	state.putFloatArray(STATE_COLOR, mHSVColor);

	float[] hsvColor = new float[3];
	Color.colorToHSV(mColor, hsvColor);
	state.putFloat(STATE_VALUE, hsvColor[2]);

	return state;
}
 
Example 16
Project: OSchina_resources_android   File: TouchImageView.java   View Source Code Vote up 5 votes
@Override
public Parcelable onSaveInstanceState() {
    Bundle bundle = new Bundle();
    bundle.putParcelable("instanceState", super.onSaveInstanceState());
    bundle.putFloat("saveScale", normalizedScale);
    bundle.putFloat("matchViewHeight", matchViewHeight);
    bundle.putFloat("matchViewWidth", matchViewWidth);
    bundle.putInt("viewWidth", viewWidth);
    bundle.putInt("viewHeight", viewHeight);
    matrix.getValues(m);
    bundle.putFloatArray("matrix", m);
    bundle.putBoolean("imageRendered", imageRenderedAtLeastOnce);
    return bundle;
}
 
Example 17
Project: Customerly-Android-SDK   File: TouchImageView.java   View Source Code Vote up 5 votes
@Override
public Parcelable onSaveInstanceState() {
	Bundle bundle = new Bundle();
	bundle.putParcelable("instanceState", super.onSaveInstanceState());
	bundle.putFloat("saveScale", normalizedScale);
	bundle.putFloat("matchViewHeight", matchViewHeight);
	bundle.putFloat("matchViewWidth", matchViewWidth);
	bundle.putInt("viewWidth", viewWidth);
	bundle.putInt("viewHeight", viewHeight);
	matrix.getValues(m);
	bundle.putFloatArray("matrix", m);
	bundle.putBoolean("imageRendered", imageRenderedAtLeastOnce);
	return bundle;
}
 
Example 18
Project: android-state   File: InjectionHelper.java   View Source Code Vote up 4 votes
public void putFloatArray(Bundle state, String key, float[] x) {
    state.putFloatArray(key + mBaseKey, x);
}
 
Example 19
Project: MRouter   File: MainActivity.java   View Source Code Vote up 4 votes
public Bundle assembleBundle() {
    User user = new User();
    user.setAge(90);
    user.setGender(1);
    user.setName("kitty");

    Address address = new Address();
    address.setCity("HangZhou");
    address.setProvince("ZheJiang");

    Bundle extras = new Bundle();
    extras.putString("extra", "from extras");


    ArrayList<String> stringList = new ArrayList<>();
    stringList.add("Java");
    stringList.add("C#");
    stringList.add("Kotlin");

    ArrayList<String> stringArrayList = new ArrayList<>();
    stringArrayList.add("American");
    stringArrayList.add("China");
    stringArrayList.add("England");

    ArrayList<Integer> intArrayList = new ArrayList<>();
    intArrayList.add(100);
    intArrayList.add(101);
    intArrayList.add(102);

    ArrayList<Integer> intList = new ArrayList<>();
    intList.add(10011);
    intList.add(10111);
    intList.add(10211);

    ArrayList<Address> addressList = new ArrayList<>();
    addressList.add(new Address("JiangXi", "ShangRao", null));
    addressList.add(new Address("ZheJiang", "NingBo", null));

    Address[] addressArray = new Address[]{
            new Address("Beijing", "Beijing", null),
            new Address("Shanghai", "Shanghai", null),
            new Address("Guangzhou", "Guangzhou", null)
    };
    Bundle bundle = new Bundle();
    bundle.putSerializable("user", user);
    bundle.putParcelable("address", address);
    bundle.putParcelableArrayList("addressList", addressList);
    bundle.putParcelableArray("addressArray", addressArray);
    bundle.putString("param", "chiclaim");
    bundle.putStringArray("stringArray", new String[]{"a", "b", "c"});
    bundle.putStringArrayList("stringArrayList", stringList);
    bundle.putStringArrayList("stringList", stringArrayList);
    bundle.putByte("byte", (byte) 2);
    bundle.putByteArray("byteArray", new byte[]{1, 2, 3, 4, 5});
    bundle.putInt("age", 33);
    bundle.putIntArray("intArray", new int[]{10, 11, 12, 13});
    bundle.putIntegerArrayList("intList", intList);
    bundle.putIntegerArrayList("intArrayList", intArrayList);
    bundle.putChar("chara", 'c');
    bundle.putCharArray("charArray", "chiclaim".toCharArray());
    bundle.putShort("short", (short) 1000000);
    bundle.putShortArray("shortArray", new short[]{(short) 10.9, (short) 11.9});
    bundle.putDouble("double", 1200000);
    bundle.putDoubleArray("doubleArray", new double[]{1232, 9999, 8789, 3.1415926});
    bundle.putLong("long", 999999999);
    bundle.putLongArray("longArray", new long[]{1000, 2000, 3000});
    bundle.putFloat("float", 333);
    bundle.putFloatArray("floatArray", new float[]{12.9f, 234.9f});
    bundle.putBoolean("boolean", true);
    bundle.putBooleanArray("booleanArray", new boolean[]{true, false, true});

    return bundle;
}
 
Example 20
Project: MagicBox   File: FloatArrayWriter.java   View Source Code Vote up 4 votes
@Override
public void write(Bundle bundle, Object to, StateField field) throws IllegalAccessException {
    Field propertyField = field.getField();
    propertyField.setAccessible(true);
    bundle.putFloatArray(field.getBundleKey(), (float[]) propertyField.get(to));
}