@Override public Parcelable onSaveInstanceState() { final Bundle bundle = new Bundle(); bundle.putParcelable("instanceState", super.onSaveInstanceState()); bundle.putInt("TICK_COUNT", mTickCount); bundle.putFloat("TICK_HEIGHT_DP", mTickHeightDP); bundle.putFloat("BAR_WEIGHT", mBarWeight); bundle.putInt("BAR_COLOR", mBarColor); bundle.putFloat("CONNECTING_LINE_WEIGHT", mConnectingLineWeight); bundle.putInt("CONNECTING_LINE_COLOR", mConnectingLineColor); bundle.putInt("THUMB_IMAGE_NORMAL", mThumbImageNormal); bundle.putInt("THUMB_IMAGE_PRESSED", mThumbImagePressed); bundle.putFloat("THUMB_RADIUS_DP", mThumbRadiusDP); bundle.putInt("THUMB_COLOR_NORMAL", mThumbColorNormal); bundle.putInt("THUMB_COLOR_PRESSED", mThumbColorPressed); bundle.putInt("LEFT_INDEX", mLeftIndex); bundle.putInt("RIGHT_INDEX", mRightIndex); bundle.putBoolean("FIRST_SET_TICK_COUNT", mFirstSetTickCount); return bundle; }
/* * (non-Javadoc) * * @see android.view.View#onSaveInstanceState() */ @Override protected Parcelable onSaveInstanceState() { final Bundle bundle = new Bundle(); bundle.putParcelable(INSTANCE_STATE_SAVEDSTATE, super.onSaveInstanceState()); bundle.putFloat(INSTANCE_STATE_PROGRESS, mProgress); bundle.putFloat(INSTANCE_STATE_MARKER_PROGRESS, mMarkerProgress); bundle.putInt(INSTANCE_STATE_PROGRESS_COLOR, mProgressColor); bundle.putInt(INSTANCE_STATE_PROGRESS_BACKGROUND_COLOR, mProgressBackgroundColor); return bundle; }
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); // Save the current article selection in case we need to recreate the fragment outState.putInt(ORDER_PREFERENCES_INDEX, mPrefsIndex); outState.putFloat(ARG_HUE_START, mHueStart); outState.putFloat(ARG_HUE_END, mHueEnd); outState.putFloat(ARG_SATURATION, mSaturation); outState.putFloat(ARG_VALUE, mValue); }
void setDestination(float latitude, float longitude, String address) { Toast.makeText( getApplicationContext(),getString(R.string.address_search_set_destination) + "\n" + address, Toast.LENGTH_LONG).show(); //TRANS Message msg = Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_SET_DESTINATION.ordinal()); Bundle b = new Bundle(); b.putFloat("lat", latitude); b.putFloat("lon", longitude); b.putString("q", address); msg.setData(b); msg.sendToTarget(); }
@TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override protected void onSaveInstanceState(Bundle outState) { if (AndroidUtils.isLollipop()) { outState.putFloat(STATE_TOOLBAR_ELEVATION, tToolbar.getElevation()); } outState.putFloat(STATE_TOOLBAR_TRANSLATION_Y, tToolbar.getTranslationY()); outState.putInt(STATE_VERTICAL_OFFSET, verticalOffset); outState.putInt(STATE_SCROLLING_OFFSET, scrollingOffset); outState.putParcelable(STATE_RECYCLER_VIEW, rvCities.getLayoutManager().onSaveInstanceState()); super.onSaveInstanceState(outState); }
@Override protected Parcelable onSaveInstanceState() { Parcelable superState = super.onSaveInstanceState(); Bundle state = new Bundle(); state.putParcelable("superState", superState); state.putBoolean("handInitialized", handInitialized); state.putFloat("handPosition", handPosition); state.putFloat("handTarget", handTarget); state.putFloat("handVelocity", handVelocity); state.putFloat("handAcceleration", handAcceleration); state.putLong("lastHandMoveTime", lastHandMoveTime); return state; }
@Override protected Parcelable onSaveInstanceState() { final Parcelable superState = super.onSaveInstanceState(); final Bundle state = new Bundle(); state.putParcelable("superState", superState); state.putBoolean("needleInitialized", mNeedleInitialized); state.putFloat("needleVelocity", mNeedleVelocity); state.putFloat("needleAcceleration", mNeedleAcceleration); state.putLong("needleLastMoved", mNeedleLastMoved); state.putFloat("currentValue", mCurrentValue); state.putFloat("targetValue", mTargetValue); return state; }
@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; }
@Override public void onHueSelected(float hueStart, float hueEnd) { SaturationFragment saturationFragment = new SaturationFragment(); Bundle args = new Bundle(); args.putFloat(SaturationFragment.ARG_HUE_START, hueStart); args.putFloat(SaturationFragment.ARG_HUE_END, hueEnd); saturationFragment.setArguments(args); FragmentTransaction transaction = getFragmentManager().beginTransaction(); transaction.replace(R.id.fragment_container, saturationFragment); transaction.addToBackStack(null); transaction.commit(); }
@Override protected Parcelable onSaveInstanceState() { Bundle bundle = new Bundle(); bundle.putParcelable(INSTANCE_STATE, super.onSaveInstanceState()); bundle.putFloat(STATE_ALPHA, mAlpha); return bundle; }
private void writeFrequency() { // get the text entered in edit box String text = mUserText.getText().toString(); try { int iFreq = Integer.parseInt(text); Float validFreq = UpdateFrequency(iFreq); if (validFreq != 0) { // reset the text in edit box for the next entry mUserText.setText(null); Bundle bundle = new Bundle(); bundle.putFloat(FREQ_VALUE, validFreq); Intent result = new Intent(); result.putExtras(bundle); setResult(RESULT_OK, result); finish(); } else { new AlertDialog.Builder(this) .setIcon(android.R.drawable.ic_dialog_alert) .setMessage("Enter valid frequency!!") .setNegativeButton(android.R.string.ok, null) .show(); mUserText.setText(null); } } catch (NumberFormatException nfe) { if (DBG) Log.d(TAG, "NumberFormatException:" + nfe.getMessage()); new AlertDialog.Builder(this) .setIcon(android.R.drawable.ic_dialog_alert) .setMessage("Enter valid number!!") .setNegativeButton(android.R.string.ok, null) .show(); mUserText.setText(null); } }
public Bundle convertToBundle() { Bundle bundle = new Bundle(); Iterator<String> it = map.keySet().iterator(); while (it.hasNext()) { String key = it.next(); Object value = map.get(key); if (value instanceof Boolean) { bundle.putBoolean(key, (Boolean) value); } else if (value instanceof String) { bundle.putString(key, (String) value); } else if (value instanceof Serializable) { bundle.putSerializable(key, (Serializable) value); } else if (value instanceof Integer) { bundle.putInt(key, (Integer) value); } else if (value instanceof Float) { bundle.putFloat(key, (Float) value); } else if (value instanceof Double) { bundle.putDouble(key, (Double) value); } else if (value instanceof Short) { bundle.putShort(key, (Short) value); } else if (value instanceof Long) { bundle.putLong(key, (Long) value); } else if (value instanceof Parcelable) { bundle.putParcelable(key, (Parcelable) value); } } return bundle; }
/** * Add extended data to the extra. * * @param name The name of the extra data, with package prefix. * @param value The float data value. * @return Returns the same extra object, for chaining multiple calls into a single statement. * @see #putExtras * @see #removeExtra * @see #getFloatExtra(String, float) */ public Request putExtra(String name, float value) { if (mExtras == null) { mExtras = new Bundle(); } mExtras.putFloat(name, value); return this; }
public static Fragment newInstance(VotingActivity context, int pos, float scale) { Bundle bundle = new Bundle(); bundle.putInt("pos", pos); bundle.putFloat("scale", scale); return Fragment.instantiate(context, VideoCarouselFragment.class.getName(), bundle); }
public static ScrollableDialog newInstance(float friction) { final Bundle bundle = new Bundle(); bundle.putFloat(ARG_FRICTION, friction); final ScrollableDialog fragment = new ScrollableDialog(); fragment.setArguments(bundle); return fragment; }
@Override public void onValueSelected(float hueStart, float hueEnd, float saturation, float value) { // Log.d("Values:", " HueStart: " + hueStart + " HueEnd: " + hueEnd + " Sat:" + saturation + " // Val: " + value); DetailsFragment valueFragment = new DetailsFragment(); Bundle args = new Bundle(); args.putFloat(DetailsFragment.ARG_HUE_START, hueStart); args.putFloat(DetailsFragment.ARG_HUE_END, hueEnd); args.putFloat(DetailsFragment.ARG_SATURATION, saturation); args.putFloat(DetailsFragment.ARG_VALUE, value); valueFragment.setArguments(args); FragmentTransaction transaction = getFragmentManager().beginTransaction(); transaction.replace(R.id.fragment_container, valueFragment); transaction.addToBackStack(null); transaction.commit(); }
@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); if (hsvColor[1] < hsvColor[2]) { state.putFloat(STATE_SATURATION, hsvColor[1]); } else { state.putFloat(STATE_VALUE, hsvColor[2]); } state.putBoolean(STATE_ORIENTATION, ORIENTATION_HORIZONTAL); return state; }
private static void bundleThumbnail(PlanarYUVLuminanceSource source, Bundle bundle) { int[] pixels = source.renderThumbnail(); int width = source.getThumbnailWidth(); int height = source.getThumbnailHeight(); Bitmap bitmap = Bitmap.createBitmap(pixels, 0, width, width, height, Bitmap.Config.ARGB_8888); ByteArrayOutputStream out = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.JPEG, 50, out); bundle.putByteArray(DecodeThread.BARCODE_BITMAP, out.toByteArray()); bundle.putFloat(DecodeThread.BARCODE_SCALED_FACTOR, (float) width / source.getWidth()); }
@Override public void onSaveInstanceState(Bundle outState) { outState.putParcelable(STATE_BASE_URI, mBaseUri); outState.putLongArray(STATE_ENTRIES_IDS, mEntriesIds); outState.putLong(STATE_INITIAL_ENTRY_ID, mInitialEntryId); outState.putInt(STATE_CURRENT_PAGER_POS, mCurrentPagerPos); outState.putFloat(STATE_SCROLL_PERCENTAGE, mEntryPagerAdapter.getScrollPercentage()); super.onSaveInstanceState(outState); }
@Override protected Parcelable onSaveInstanceState() { Parcelable superState = super.onSaveInstanceState(); Bundle state = new Bundle(); state.putParcelable(STATE_PARENT, superState); state.putFloat(STATE_ANGLE, mAngle); state.putInt(STATE_OLD_COLOR, mCenterOldColor); return state; }
@Override public void writeToParcel(Parcel dest, int flags) { Bundle bundle = new Bundle(); bundle.putString(KEY_ID, this.ID); bundle.putString(KEY_TITLE_NAME, this.titleName); bundle.putString(KEY_POSTER_IMAGE, this.posterImage); bundle.putString(KEY_SYNOPSIS, this.synopsis); bundle.putFloat(KEY_USER_RATING, this.userRating); bundle.putString(KEY_RELEASE_DATE, this.releaseDate); dest.writeBundle(bundle); }
public static SearchResultsFragment newInstance(final Place place) { SearchResultsFragment fragment = new SearchResultsFragment(); Bundle args = new Bundle(); args.putCharSequence(NAME_KEY, place.getName()); args.putCharSequence(ADDRESS_KEY, place.getAddress()); args.putCharSequence(PHONE_NUMBER_KEY, place.getPhoneNumber()); args.putFloat(RATING_KEY, place.getRating()); args.putParcelable(WEBSITE_KEY, place.getWebsiteUri()); fragment.setArguments(args); return fragment; }
public void onScaleChanged(float oldScale, float newScale) { // Do an unsynchronized quick check to avoid posting if no callback has // been set. if (mWebViewClient == null) { return; } Message msg = obtainMessage(SCALE_CHANGED); Bundle bundle = msg.getData(); bundle.putFloat("old", oldScale); bundle.putFloat("new", newScale); sendMessage(msg); }
@Override protected Parcelable onSaveInstanceState() { Bundle bundle = new Bundle(); bundle.putParcelable(INATANCE_STATE, super.onSaveInstanceState()); bundle.putInt(INSTANCE_MAX_PROCESS, mMaxProcess); bundle.putInt(INSTANCE_CUR_PROCESS, mCurProcess); bundle.putInt(INSTANCE_REACHED_COLOR, mReachedColor); bundle.putFloat(INSTANCE_REACHED_WIDTH, mReachedWidth); bundle.putBoolean(INSTANCE_REACHED_CORNER_ROUND, isHasReachedCornerRound); bundle.putInt(INSTANCE_UNREACHED_COLOR, mUnreachedColor); bundle.putFloat(INSTANCE_UNREACHED_WIDTH, mUnreachedWidth); bundle.putInt(INSTANCE_POINTER_COLOR, mPointerColor); bundle.putFloat(INSTANCE_POINTER_RADIUS, mPointerRadius); bundle.putBoolean(INSTANCE_POINTER_SHADOW, isHasPointerShadow); bundle.putFloat(INSTANCE_POINTER_SHADOW_RADIUS, mPointerShadowRadius); bundle.putBoolean(INSTANCE_WHEEL_SHADOW, isHasWheelShadow); bundle.putFloat(INSTANCE_WHEEL_SHADOW_RADIUS, mPointerShadowRadius); bundle.putBoolean(INSTANCE_WHEEL_HAS_CACHE, isHasCache); bundle.putBoolean(INSTANCE_WHEEL_CAN_TOUCH, isCanTouch); return bundle; }
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)); } } // 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); } } }
@Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); saveNoteIfNotEmpty(); if (mRowId != -1) { outState.putLong(KEY_SAVED_POSITION, mRowId); } if (mTextSize != 0) { outState.putFloat(TEXT_SIZE, mTextSize); } }
/** * Create a new Instance of MapAdditionFragment. * * @param name Name of the spot. * @param description Description of the spot. * @param imageUrl Url of the image. * @param location Location of the spot. * @param distance Distance from user to spot. * @return A MapAdditionFragment. */ public static MapAdditionFragment newInstance( String name, String description, String imageUrl, Location location, float distance) { MapAdditionFragment fragment = new MapAdditionFragment(); Bundle args = new Bundle(); args.putString(ARG_PARAM1, name); args.putString(ARG_PARAM2, description); args.putString(ARG_PARAM3, imageUrl); args.putDouble(ARG_PARAM4, location.getLat()); args.putDouble(ARG_PARAM5, location.getLon()); args.putFloat(ARG_PARAM6, distance); fragment.setArguments(args); return fragment; }
@Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); zoomlevel = worldMap.getCameraPosition().zoom; outState.putFloat("zoom", zoomlevel); outState.putBoolean("loaded", loaded); outState.putDouble("lat", currentLat); outState.putDouble("lng", currentLng); if (loaded) dataRestorer.saveData(outState); outState.putString("redo", fileToReload); }
@Override protected Parcelable onSaveInstanceState() { Bundle bundle = new Bundle(); bundle.putInt(KEY_PROGRESS_STROKE_COLOR, progressStrokeColor); bundle.putInt(KEY_BACKGROUND_STROKE_COLOR, backgroundStrokeColor); bundle.putInt(KEY_STROKE_WIDTH, strokeWidth); bundle.putInt(KEY_PROGRESS, progress); bundle.putInt(KEY_MAX_PROGRESS, maxProgress); bundle.putFloat(KEY_TEXT_SIZE, textSize); bundle.putInt(KEY_TEXT_COLOR, textColor); bundle.putParcelable(KEY_SUPER, super.onSaveInstanceState()); return bundle; }
@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_SATURATION, hsvColor[1]); return state; }