Example usage for android.os Bundle putFloat

List of usage examples for android.os Bundle putFloat

Introduction

In this page you can find the example usage for android.os Bundle putFloat.

Prototype

@Override
public void putFloat(@Nullable String key, float value) 

Source Link

Document

Inserts a float value into the mapping of this Bundle, replacing any existing value for the given key.

Usage

From source file:com.shurik.droidzebra.ZebraEngine.java

private JSONObject Callback(int msgcode, JSONObject data) {
    JSONObject retval = null;//  ww w .ja  v  a  2  s. co m
    Message msg = mHandler.obtainMessage(msgcode);
    Bundle b = new Bundle();
    msg.setData(b);
    // Log.d("ZebraEngine", String.format("Callback(%d,%s)", msgcode, data.toString()));
    if (bInCallback)
        fatalError("Recursive vallback call");
    try {
        bInCallback = true;
        switch (msgcode) {
        case MSG_ERROR: {
            b.putString("error", data.getString("error"));
            if (getEngineState() == ES_INITIAL) {
                // delete .bin files if initialization failed
                // will be recreated from resources
                new File(mFilesDir, PATTERNS_FILE).delete();
                new File(mFilesDir, BOOK_FILE).delete();
                new File(mFilesDir, BOOK_FILE_COMPRESSED).delete();
            }
            mHandler.sendMessage(msg);
        }
            break;

        case MSG_DEBUG: {
            b.putString("message", data.getString("message"));
            mHandler.sendMessage(msg);
        }
            break;

        case MSG_BOARD: {
            int len;
            JSONObject info;
            JSONArray zeArray;
            byte[] moves;

            JSONArray zeboard = data.getJSONArray("board");
            byte newBoard[] = new byte[BOARD_SIZE * BOARD_SIZE];
            for (int i = 0; i < zeboard.length(); i++) {
                JSONArray row = zeboard.getJSONArray(i);
                for (int j = 0; j < row.length(); j++) {
                    newBoard[i * BOARD_SIZE + j] = (byte) row.getInt(j);
                }
            }
            b.putByteArray("board", newBoard);
            b.putInt("side_to_move", data.getInt("side_to_move"));
            mCurrentGameState.mDisksPlayed = data.getInt("disks_played");

            // black info
            {
                Bundle black = new Bundle();
                info = data.getJSONObject("black");
                black.putString("time", info.getString("time"));
                black.putFloat("eval", (float) info.getDouble("eval"));
                black.putInt("disc_count", info.getInt("disc_count"));
                black.putString("time", info.getString("time"));

                zeArray = info.getJSONArray("moves");
                len = zeArray.length();
                moves = new byte[len];
                assert (2 * len <= mCurrentGameState.mMoveSequence.length);
                for (int i = 0; i < len; i++) {
                    moves[i] = (byte) zeArray.getInt(i);
                    mCurrentGameState.mMoveSequence[2 * i] = moves[i];
                }
                black.putByteArray("moves", moves);
                b.putBundle("black", black);
            }

            // white info
            {
                Bundle white = new Bundle();
                info = data.getJSONObject("white");
                white.putString("time", info.getString("time"));
                white.putFloat("eval", (float) info.getDouble("eval"));
                white.putInt("disc_count", info.getInt("disc_count"));
                white.putString("time", info.getString("time"));

                zeArray = info.getJSONArray("moves");
                len = zeArray.length();
                moves = new byte[len];
                assert ((2 * len + 1) <= mCurrentGameState.mMoveSequence.length);
                for (int i = 0; i < len; i++) {
                    moves[i] = (byte) zeArray.getInt(i);
                    mCurrentGameState.mMoveSequence[2 * i + 1] = moves[i];
                }
                white.putByteArray("moves", moves);
                b.putBundle("white", white);
            }

            mHandler.sendMessage(msg);
        }
            break;

        case MSG_CANDIDATE_MOVES: {
            JSONArray jscmoves = data.getJSONArray("moves");
            CandidateMove cmoves[] = new CandidateMove[jscmoves.length()];
            mValidMoves = new int[jscmoves.length()];
            for (int i = 0; i < jscmoves.length(); i++) {
                JSONObject jscmove = jscmoves.getJSONObject(i);
                mValidMoves[i] = jscmoves.getJSONObject(i).getInt("move");
                cmoves[i] = new CandidateMove(new Move(jscmove.getInt("move")));
            }
            msg.obj = cmoves;
            mHandler.sendMessage(msg);
        }
            break;

        case MSG_GET_USER_INPUT: {
            mMovesWithoutInput = 0;

            setEngineState(ES_USER_INPUT_WAIT);

            waitForEngineState(ES_PLAY);

            while (mPendingEvent == null) {
                setEngineState(ES_USER_INPUT_WAIT);
                waitForEngineState(ES_PLAY);
            }

            retval = mPendingEvent;

            setEngineState(ES_PLAYINPROGRESS);

            mValidMoves = null;
            mPendingEvent = null;
        }
            break;

        case MSG_PASS: {
            setEngineState(ES_USER_INPUT_WAIT);
            mHandler.sendMessage(msg);
            waitForEngineState(ES_PLAY);
            setEngineState(ES_PLAYINPROGRESS);
        }
            break;

        case MSG_OPENING_NAME: {
            b.putString("opening", data.getString("opening"));
            mHandler.sendMessage(msg);
        }
            break;

        case MSG_LAST_MOVE: {
            b.putInt("move", data.getInt("move"));
            mHandler.sendMessage(msg);
        }
            break;

        case MSG_GAME_START: {
            mHandler.sendMessage(msg);
        }
            break;

        case MSG_GAME_OVER: {
            mHandler.sendMessage(msg);
        }
            break;

        case MSG_MOVE_START: {
            mMoveStartTime = android.os.SystemClock.uptimeMillis();

            mSideToMove = data.getInt("side_to_move");

            // can change player info here
            if (mPlayerInfoChanged) {
                zeSetPlayerInfo(PLAYER_BLACK, mPlayerInfo[PLAYER_BLACK].skill,
                        mPlayerInfo[PLAYER_BLACK].exactSolvingSkill, mPlayerInfo[PLAYER_BLACK].wldSolvingSkill,
                        mPlayerInfo[PLAYER_BLACK].playerTime, mPlayerInfo[PLAYER_BLACK].playerTimeIncrement);
                zeSetPlayerInfo(PLAYER_WHITE, mPlayerInfo[PLAYER_WHITE].skill,
                        mPlayerInfo[PLAYER_WHITE].exactSolvingSkill, mPlayerInfo[PLAYER_WHITE].wldSolvingSkill,
                        mPlayerInfo[PLAYER_WHITE].playerTime, mPlayerInfo[PLAYER_WHITE].playerTimeIncrement);
                zeSetPlayerInfo(PLAYER_ZEBRA, mPlayerInfo[PLAYER_ZEBRA].skill,
                        mPlayerInfo[PLAYER_ZEBRA].exactSolvingSkill, mPlayerInfo[PLAYER_ZEBRA].wldSolvingSkill,
                        mPlayerInfo[PLAYER_ZEBRA].playerTime, mPlayerInfo[PLAYER_ZEBRA].playerTimeIncrement);
            }
            mHandler.sendMessage(msg);
        }
            break;

        case MSG_MOVE_END: {
            // introduce delay between moves made by the computer without user input
            // so we can actually to see that the game is being played :)
            if (mMoveDelay > 0 || (mMovesWithoutInput > 1 && mPlayerInfo[mSideToMove].skill > 0)) {
                long moveEnd = android.os.SystemClock.uptimeMillis();
                int delay = mMoveDelay > 0 ? mMoveDelay : SELFPLAY_MOVE_DELAY;
                if ((moveEnd - mMoveStartTime) < delay) {
                    android.os.SystemClock.sleep(delay - (moveEnd - mMoveStartTime));
                }
            }

            // this counter is reset by user input
            mMovesWithoutInput += 1;

            mHandler.sendMessage(msg);
        }
            break;

        case MSG_EVAL_TEXT: {
            b.putString("eval", data.getString("eval"));
            mHandler.sendMessage(msg);
        }
            break;

        case MSG_PV: {
            JSONArray zeArray = data.getJSONArray("pv");
            int len = zeArray.length();
            byte[] moves = new byte[len];
            for (int i = 0; i < len; i++)
                moves[i] = (byte) zeArray.getInt(i);
            b.putByteArray("pv", moves);
            mHandler.sendMessage(msg);
        }
            break;

        case MSG_CANDIDATE_EVALS: {
            JSONArray jscevals = data.getJSONArray("evals");
            CandidateMove cmoves[] = new CandidateMove[jscevals.length()];
            for (int i = 0; i < jscevals.length(); i++) {
                JSONObject jsceval = jscevals.getJSONObject(i);
                cmoves[i] = new CandidateMove(new Move(jsceval.getInt("move")), jsceval.getString("eval_s"),
                        jsceval.getString("eval_l"), (jsceval.getInt("best") != 0));
            }
            msg.obj = cmoves;
            mHandler.sendMessage(msg);

        }
            break;

        default: {
            b.putString("error", String.format("Unkown message ID %d", msgcode));
            msg.setData(b);
            mHandler.sendMessage(msg);
        }
            break;
        }
    } catch (JSONException e) {
        msg.what = MSG_ERROR;
        b.putString("error", "JSONException:" + e.getMessage());
        msg.setData(b);
        mHandler.sendMessage(msg);
    } finally {
        bInCallback = false;
    }
    return retval;
}

From source file:me.xiaopan.android.inject.sample.MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    listView = new ListView(getBaseContext());
    setContentView(listView);/*from   w  w w. j  a  v  a2s . c o m*/

    // SharedPreferences?
    PreferenceUtils.putBoolean(getBaseContext(), KEY_BOOLEAN, true);
    PreferenceUtils.putFloat(getBaseContext(), KEY_FLOAT, 10000f);
    PreferenceUtils.putInt(getBaseContext(), KEY_INT, 2000);
    PreferenceUtils.putLong(getBaseContext(), KEY_LONG, 50000);
    PreferenceUtils.putString(getBaseContext(), KEY_STRING, "Preference String");
    Set<String> stringSet = new HashSet<String>();
    stringSet.add("String Set 1");
    stringSet.add("String Set 2");
    stringSet.add("String Set 3");
    stringSet.add("String Set 4");
    PreferenceUtils.putStringSet(getBaseContext(), KEY_STRING_SET, stringSet);
    MyBean bean2 = new MyBean();
    bean2.setEmail("sky@xiaopan.me2");
    bean2.setName("?2");
    bean2.setSex("2");
    PreferenceUtils.putObject(getBaseContext(), KEY_JSON, bean2);
    PreferenceUtils.putString(getBaseContext(), KEY_ENUM, Sex.WOMAN.name());

    // ??
    String[] items = new String[] { "", "?", "FragmentDialog",
            "InjectAdapter", "InjectExpandableListAdapter" };
    listView.setAdapter(new ArrayAdapter<String>(getBaseContext(), android.R.layout.simple_list_item_1,
            android.R.id.text1, items));
    listView.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            if (position <= 2) {
                Bundle bundle = new Bundle();
                bundle.putBoolean(MainActivity.PARAM_BOOLEAN, true);
                bundle.putBooleanArray(MainActivity.PARAM_BOOLEAN_ARRAY, new boolean[] { true, false, true });
                bundle.putByte(MainActivity.PARAM_BYTE, (byte) 110);
                bundle.putByteArray(MainActivity.PARAM_BYTE_ARRAY, new byte[] { 111, 112, 113 });
                bundle.putChar(MainActivity.PARAM_CHAR, 'R');
                bundle.putCharArray(MainActivity.PARAM_CHAR_ARRAY, new char[] { 'c', 'h', 'a', 'r' });
                bundle.putCharSequence(MainActivity.PARAM_CHAR_SEQUENCE, "CharSequence");
                bundle.putCharSequenceArray(MainActivity.PARAM_CHAR_SEQUENCE_ARRAY,
                        new CharSequence[] { "Char", " ", "Sequence" });
                bundle.putDouble(MainActivity.PARAM_DOUBLE, 12.00d);
                bundle.putDoubleArray(MainActivity.PARAM_DOUBLE_ARRAY, new double[] { 12.01d, 12.02d, 12.03d });
                bundle.putFloat(MainActivity.PARAM_FLOAT, 13.00f);
                bundle.putFloatArray(MainActivity.PARAM_FLOAT_ARRAY, new float[] { 13.01f, 13.02f, 13.03f });
                bundle.putInt(MainActivity.PARAM_INT, 120);
                bundle.putIntArray(MainActivity.PARAM_INT_ARRAY, new int[] { 121, 122, 123, });
                bundle.putLong(MainActivity.PARAM_LONG, 12345);
                bundle.putLongArray(MainActivity.PARAM_LONG_ARRAY, new long[] { 12346, 12347, 12348 });
                bundle.putShort(MainActivity.PARAM_SHORT, (short) 2);
                bundle.putShortArray(MainActivity.PARAM_SHORT_ARRAY, new short[] { 3, 4, 5 });
                bundle.putString(MainActivity.PARAM_STRING, "String");
                bundle.putStringArray(MainActivity.PARAM_STRING_ARRAY,
                        new String[] { "String1", "String2", "String3" });

                // ??JSONBundle
                MyBean bean = new MyBean();
                bean.setEmail("sky@xiaopan.me");
                bean.setName("?");
                bean.setSex("");
                bundle.putString(PARAM_STRING_JSON, new Gson().toJson(bean));

                bundle.putString(MainActivity.PARAM_STRING_ENUM, Sex.WOMAN.name());

                // 
                ArrayList<String> stringList = new ArrayList<String>();
                stringList.add("ArrayList String 1");
                stringList.add("ArrayList String 2");
                stringList.add("ArrayList String 3");
                bundle.putStringArrayList(MainActivity.PARAM_STRING_ARRAY_LIST, stringList);
                switch (position) {
                case 0:
                    Second.SECOND_CHRONOGRAPH.lap();
                    Intent intent = new Intent(getBaseContext(), InjectTestActivity.class);
                    intent.putExtras(bundle);
                    startActivity(intent);
                    break;
                case 1:
                    Second.SECOND_CHRONOGRAPH.lap();
                    Intent intent2 = new Intent(getBaseContext(), NormalActivity.class);
                    intent2.putExtras(bundle);
                    startActivity(intent2);
                    break;
                case 2:
                    Second.SECOND_CHRONOGRAPH.lap();
                    new TestDialogFragment().show(getSupportFragmentManager(), "");
                    break;
                }
            } else {
                Class<?> targetClass = null;
                if (position == 3) {
                    targetClass = InjectAdapterActivity.class;
                } else if (position == 4) {
                    targetClass = InjectExpandableListAdapterActivity.class;
                }
                if (targetClass != null) {
                    startActivity(new Intent(getBaseContext(), targetClass));
                }
            }
        }
    });
}

From source file:uk.org.rivernile.edinburghbustracker.android.fragments.general.BusStopMapFragment.java

/**
 * Refresh the bus stop marker icons on the map. This may be because the
 * camera has moved, a configuration change has happened or the user has
 * selected services to filter by./* w  w w .ja v  a  2 s  .co  m*/
 * 
 * @param position If a CameraPosition is available, send it in so that it
 * doesn't need to be looked up again. If it's not available, use null.
 */
private void refreshBusStops(CameraPosition position) {
    if (map == null || !isAdded()) {
        return;
    }

    // Populate the CameraPosition if it wasn't given.
    if (position == null) {
        position = map.getCameraPosition();
    }

    // Get the visible bounds.
    final LatLngBounds lastVisibleBounds = map.getProjection().getVisibleRegion().latLngBounds;
    final Bundle b = new Bundle();

    // Populate the Bundle of arguments for the bus stops Loader.
    b.putDouble(LOADER_ARG_MIN_X, lastVisibleBounds.southwest.latitude);
    b.putDouble(LOADER_ARG_MIN_Y, lastVisibleBounds.southwest.longitude);
    b.putDouble(LOADER_ARG_MAX_X, lastVisibleBounds.northeast.latitude);
    b.putDouble(LOADER_ARG_MAX_Y, lastVisibleBounds.northeast.longitude);
    b.putFloat(LOADER_ARG_ZOOM, position.zoom);

    // If there are chosen services, then set the filtered services
    // argument.
    if (chosenServices != null && chosenServices.length > 0) {
        b.putStringArray(LOADER_ARG_FILTERED_SERVICES, chosenServices);
    }

    // Start the bus stops Loader.
    getLoaderManager().restartLoader(LOADER_ID_BUS_STOPS, b, this);
}

From source file:com.transistorsoft.cordova.bggeo.CDVBackgroundGeolocation.java

private void addGeofence(CallbackContext callbackContext, JSONObject config) {
    try {/*  w  w w.  j ava  2 s.  c o m*/
        String identifier = config.getString("identifier");
        final Bundle event = new Bundle();
        event.putString("name", BackgroundGeolocationService.ACTION_ADD_GEOFENCE);
        event.putBoolean("request", true);
        event.putFloat("radius", (float) config.getLong("radius"));
        event.putDouble("latitude", config.getDouble("latitude"));
        event.putDouble("longitude", config.getDouble("longitude"));
        event.putString("identifier", identifier);

        if (config.has("notifyOnEntry")) {
            event.putBoolean("notifyOnEntry", config.getBoolean("notifyOnEntry"));
        }
        if (config.has("notifyOnExit")) {
            event.putBoolean("notifyOnExit", config.getBoolean("notifyOnExit"));
        }
        if (config.has("notifyOnDwell")) {
            event.putBoolean("notifyOnDwell", config.getBoolean("notifyOnDwell"));
        }
        if (config.has("loiteringDelay")) {
            event.putInt("loiteringDelay", config.getInt("loiteringDelay"));
        }
        addGeofenceCallbacks.put(identifier, callbackContext);

        postEvent(event);

    } catch (JSONException e) {
        e.printStackTrace();
        callbackContext.error(e.getMessage());
    }
}

From source file:com.plusub.lib.service.BaseRequestService.java

/**
 * ??//  ww  w .  j  av  a  2 s  . c  o m
 * <p>Title: transmitParams
 * <p>Description: 
 * @param map
 * @return
 */
private Bundle transmitParams(Map map) {
    String keys;
    if (map != null && map.size() > 0) {
        Bundle bd = new Bundle();
        for (Object key : map.keySet()) {
            //String
            if (key instanceof String) {
                keys = (String) key;
                //
                Object obj = map.get(key);
                if (obj instanceof String) {
                    bd.putString(keys, (String) obj);
                } else if (obj instanceof Integer) {
                    bd.putInt(keys, (Integer) obj);
                } else if (obj instanceof Boolean) {
                    bd.putBoolean(keys, (Boolean) obj);
                } else if (obj instanceof Serializable) {
                    bd.putSerializable(keys, (Serializable) obj);
                } else if (obj instanceof Character) {
                    bd.putChar(keys, (Character) obj);
                } else if (obj instanceof Double) {
                    bd.putDouble(keys, (Double) obj);
                } else if (obj instanceof Float) {
                    bd.putFloat(keys, (Float) obj);
                } else {
                    Logger.e("[MainService] : unknow map values type ! keys:" + keys);
                }
            }
        }
        return bd;
    }
    return null;
}

From source file:org.onebusaway.android.map.googlemapsv2.BaseMapFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    if (mController != null) {
        mController.onSaveInstanceState(outState);
    }/*from   ww w .  j av  a  2 s.co  m*/
    outState.putString(MapParams.MODE, getMapMode());
    outState.putString(MapParams.STOP_ID, mFocusStopId);
    Location center = getMapCenterAsLocation();
    if (mMap != null) {
        outState.putDouble(MapParams.CENTER_LAT, center.getLatitude());
        outState.putDouble(MapParams.CENTER_LON, center.getLongitude());
        outState.putFloat(MapParams.ZOOM, getZoomLevelAsFloat());
    }
    outState.putInt(MapParams.MAP_PADDING_LEFT, mMapPaddingLeft);
    outState.putInt(MapParams.MAP_PADDING_TOP, mMapPaddingTop);
    outState.putInt(MapParams.MAP_PADDING_RIGHT, mMapPaddingRight);
    outState.putInt(MapParams.MAP_PADDING_BOTTOM, mMapPaddingBottom);
}

From source file:org.spontaneous.trackservice.RemoteService.java

/**
 * Consult broadcast options and execute broadcast if necessary
 *
 * @param location/*from   w  w w.java2s. c o m*/
 */
public void broadcastLocation(Location location) {

    final long nowTime = location.getTime();
    if (this.mLastTimeBroadcast == 0) {
        this.mLastTimeBroadcast = nowTime;
    }
    long passedTime = (nowTime - this.mLastTimeBroadcast);

    Message msg = this.mHandler.obtainMessage(REPORT_MSG);
    Bundle data = new Bundle();
    data.putLong(TrackingServiceConstants.TRACK_ID, this.mTrackId);
    data.putLong(TrackingServiceConstants.SEGMENT_ID, this.mSegmentId);
    data.putLong(TrackingServiceConstants.WAYPOINT_ID, this.mWaypointId);
    data.putLong(TrackingServiceConstants.EXTRA_TIME, passedTime);
    data.putParcelable(TrackingServiceConstants.EXTRA_LOCATION, location);
    data.putFloat(TrackingServiceConstants.EXTRA_DISTANCE, this.mDistance);
    data.putFloat(TrackingServiceConstants.TOTAL_DISTANCE, this.mTotalDistance);
    data.putFloat(TrackingServiceConstants.EXTRA_SPEED, location.getSpeed());
    msg.setData(data);
    this.mHandler.sendMessage(msg);

}

From source file:org.navitproject.navit.Navit.java

private void parseNavigationURI(String schemeSpecificPart) {
    String naviData[] = schemeSpecificPart.split("&");
    Pattern p = Pattern.compile("(.*)=(.*)");
    Map<String, String> params = new HashMap<String, String>();
    for (int count = 0; count < naviData.length; count++) {
        Matcher m = p.matcher(naviData[count]);

        if (m.matches()) {
            params.put(m.group(1), m.group(2));
        }/*from   ww  w . java2  s.  co m*/
    }

    // d: google.navigation:q=blabla-strasse # (this happens when you are offline, or from contacts)
    // a: google.navigation:ll=48.25676,16.643&q=blabla-strasse
    // c: google.navigation:ll=48.25676,16.643
    // b: google.navigation:q=48.25676,16.643

    Float lat;
    Float lon;
    Bundle b = new Bundle();

    String geoString = params.get("ll");
    if (geoString != null) {
        String address = params.get("q");
        if (address != null)
            b.putString("q", address);
    } else {
        geoString = params.get("q");
    }

    if (geoString != null) {
        if (geoString.matches("^[+-]{0,1}\\d+(|\\.\\d*),[+-]{0,1}\\d+(|\\.\\d*)$")) {
            String geo[] = geoString.split(",");
            if (geo.length == 2) {
                try {
                    lat = Float.valueOf(geo[0]);
                    lon = Float.valueOf(geo[1]);
                    b.putFloat("lat", lat);
                    b.putFloat("lon", lon);
                    Message msg = Message.obtain(N_NavitGraphics.callback_handler,
                            NavitGraphics.msg_type.CLB_SET_DESTINATION.ordinal());

                    msg.setData(b);
                    msg.sendToTarget();
                    Log.e("Navit", "target found (b): " + geoString);
                } catch (NumberFormatException e) {
                } // nothing to do here
            }
        } else {
            start_targetsearch_from_intent(geoString);
        }
    }
}

From source file:com.dgmltn.ranger.internal.AbsRangeBar.java

@Override
public Parcelable onSaveInstanceState() {

    Bundle bundle = new Bundle();

    bundle.putParcelable("instanceState", super.onSaveInstanceState());

    bundle.putFloat("BAR_WEIGHT", mBarWeight);
    bundle.putInt("BAR_COLOR", mBarColor);

    bundle.putInt("TICK_COUNT", mTickCount);
    bundle.putInt("TICK_COLOR", mTickColor);
    bundle.putFloat("TICK_SIZE", mTickSize);

    bundle.putFloat("CONNECTING_LINE_WEIGHT", mConnectingLineWeight);
    bundle.putInt("FIRST_CONNECTING_LINE_COLOR", mFirstConnectingLineColor);
    bundle.putInt("SECOND_CONNECTING_LINE_COLOR", mSecondConnectingLineColor);

    bundle.putFloat("SELECTOR_SIZE", mSelectorSize);
    bundle.putInt("FIRST_SELECTOR_COLOR", mFirstSelectorColor);
    bundle.putInt("SECOND_SELECTOR_COLOR", mSecondSelectorColor);

    bundle.putFloat("PIN_RADIUS", mPinRadius);
    bundle.putFloat("EXPANDED_PIN_RADIUS", mExpandedPinRadius);
    bundle.putFloat("PIN_PADDING", mPinPadding);
    bundle.putBoolean("IS_RANGE_BAR", mIsRangeBar);
    bundle.putBoolean("ARE_PINS_TEMPORARY", mArePinsTemporary);

    bundle.putInt("FIRST_PIN_INDEX", getFirstPinIndex());
    bundle.putInt("SECOND_PIN_INDEX", getSecondPinIndex());

    bundle.putFloat("MIN_PIN_FONT", mMinPinFont);
    bundle.putFloat("MAX_PIN_FONT", mMaxPinFont);

    return bundle;
}

From source file:com.github.omadahealth.slidepager.lib.views.ProgressView.java

@Override
protected Parcelable onSaveInstanceState() {
    final Bundle bundle = new Bundle();
    bundle.putParcelable(INSTANCE_STATE, super.onSaveInstanceState());
    bundle.putBoolean(INSTANCE_SHOW_STREAKS, mShowStreaks);
    bundle.putBoolean(INSTANCE_SHOW_PROGRESS_TEXT, mShowProgressText);
    bundle.putBoolean(INSTANCE_SHOW_PROGRESS_PLUSMARK, mShowProgressPlusMark);
    bundle.putBoolean(INSTANCE_REANIMATE, mHasToReanimate);

    bundle.putInt(INSTANCE_COMPLETED_COLOR, mCompletedColor);
    bundle.putInt(INSTANCE_COMPLETED_FILL_COLOR, mCompletedFillColor);
    bundle.putInt(INSTANCE_NOT_COMPLETED_COLOR, mNotCompletedReachColor);
    bundle.putInt(INSTANCE_NOT_COMPLETED_OUTLINE_COLOR, mNotCompletedOutlineColor);
    bundle.putFloat(INSTANCE_NOT_COMPLETED_OUTLINE_SIZE, mNotCompletedOutlineSize);
    bundle.putFloat(INSTANCE_NOT_COMPLETED_FUTURE_OUTLINE_SIZE, mNotCompletedFutureOutlineSize);
    bundle.putInt(INSTANCE_NOT_COMPLETED_FILL_COLOR, mNotCompletedFillColor);
    bundle.putInt(INSTANCE_SPECIAL_COMPLETED_COLOR, mSpecialReachColor);
    bundle.putInt(INSTANCE_SPECIAL_COMPLETED_OUTLINE_COLOR, mSpecialOutlineColor);
    bundle.putInt(INSTANCE_SPECIAL_COMPLETED_FILL_COLOR, mSpecialFillColor);
    bundle.putInt(INSTANCE_TEXT_COLOR, mProgressTextColor);
    bundle.putFloat(INSTANCE_REACHED_WIDTH, mReachedWidth);

    return bundle;
}