List of usage examples for android.os Bundle putFloat
@Override public void putFloat(@Nullable String key, float value)
From source file:org.jorge.lolin1.ui.frags.ChampionSkinSupportFragment.java
public static Fragment newInstance(Context _context, int position, Champion champion, float scale) { context = _context;/*from w w w . ja va2 s .c o m*/ Bundle args = new Bundle(); args.putFloat(KEY_SCALE, scale); args.putInt(KEY_POSITION, position); args.putParcelable(KEY_CHAMPION, champion); return Fragment.instantiate(_context, ChampionSkinSupportFragment.class.getName(), args); }
From source file:com.meg7.emailer.ui.fragment.ProgressFragment.java
public static ProgressFragment newInstance(float progressPercentage, int sentCount, int failedCount) { ProgressFragment fragment = new ProgressFragment(); Bundle args = new Bundle(); args.putFloat(ARGS_PROGRESS_PERCENTAGE, progressPercentage); args.putInt(ARGS_SENT_COUNT, sentCount); args.putInt(ARGS_FAILED_COUNT, failedCount); fragment.setArguments(args);// ww w . j a v a 2s . c o m return fragment; }
From source file:com.chrynan.guitartuner.PitchFragment.java
public static PitchFragment newInstance(Note note, float x, float y) { PitchFragment fragment = new PitchFragment(); Bundle args = new Bundle(); args.putSerializable("note", note); args.putFloat("x", x); args.putFloat("y", y); fragment.setArguments(args);//ww w .ja v a2 s . c om return fragment; }
From source file:de.uni_weimar.m18.anatomiederstadt.element.SliderFragment.java
public static SliderFragment newInstance(int min, int max, float granularity, String suffix, String var) { SliderFragment fragment = new SliderFragment(); Bundle args = new Bundle(); args.putInt(ARG_PARAM1, min);/*from ww w . j a v a 2 s . com*/ args.putInt(ARG_PARAM2, max); args.putFloat(ARG_PARAM3, granularity); args.putString(ARG_PARAM4, suffix); args.putString(ARG_PARAM5, var); fragment.setArguments(args); return fragment; }
From source file:com.android.talkback.menurules.RuleSeekBar.java
static void setProgress(AccessibilityNodeInfoCompat node, int progress) { RangeInfoCompat rangeInfo = node.getRangeInfo(); if (rangeInfo != null && progress >= 0 && progress <= 100) { Bundle args = new Bundle(); args.putFloat(AccessibilityNodeInfo.ACTION_ARGUMENT_PROGRESS_VALUE, percentToReal(progress, rangeInfo.getMin(), rangeInfo.getMax())); PerformActionUtils.performAction(node, AccessibilityAction.ACTION_SET_PROGRESS.getId(), args); }/*from w w w.ja v a 2 s . c om*/ }
From source file:eu.geopaparazzi.library.core.dialogs.StrokeDashDialogFragment.java
/** * Create a dialog instance./* w ww . j a v a2 s . c o m*/ * * @param dash the current dash to show. * @return the instance. */ public static StrokeDashDialogFragment newInstance(float[] dash, float shift) { StrokeDashDialogFragment f = new StrokeDashDialogFragment(); if (dash != null) { Bundle args = new Bundle(); args.putFloatArray(PREFS_KEY_STROKEDASH, dash); args.putFloat(PREFS_KEY_STROKEDASHSHIFT, shift); f.setArguments(args); } return f; }
From source file:it.cosenonjaviste.mv2m.ArgumentManager.java
public static Bundle writeArgument(Bundle bundle, Object argument) { if (argument != null) { if (argument instanceof Integer) { bundle.putInt(ARGUMENT, (Integer) argument); } else if (argument instanceof Float) { bundle.putFloat(ARGUMENT, (Float) argument); } else if (argument instanceof Double) { bundle.putDouble(ARGUMENT, (Double) argument); } else if (argument instanceof Long) { bundle.putLong(ARGUMENT, (Long) argument); } else if (argument instanceof Parcelable) { bundle.putParcelable(ARGUMENT, (Parcelable) argument); } else if (argument instanceof String) { bundle.putString(ARGUMENT, (String) argument); } else if (argument instanceof Serializable) { bundle.putSerializable(ARGUMENT, (Serializable) argument); } else {/* w w w .j av a2 s. c om*/ throw new RuntimeException( "Invalid argument of class " + argument.getClass() + ", it can't be stored in a bundle"); } } return bundle; }
From source file:com.facebook.LegacyTokenCacheTest.java
private static void putFloat(String key, Bundle bundle) { bundle.putFloat(key, random.nextFloat()); }
From source file:com.cypress.cysmart.CommonFragments.CarouselFragment.java
/** * Fragment new Instance creation with arguments * * @param pos/* ww w .j av a 2s . c o m*/ * @param scale * @param name * @param uuid * @param service * @return CarouselFragment */ public static Fragment newInstance(int pos, float scale, String name, String uuid, BluetoothGattService service) { CarouselFragment fragment = new CarouselFragment(); if (service.getInstanceId() > 0) { uuid = uuid + service.getInstanceId(); } bleHashMap.put(uuid, service); Bundle b = new Bundle(); b.putInt(EXTRA_FRAG_POS, pos); b.putFloat(EXTRA_FRAG_SCALE, scale); b.putString(EXTRA_FRAG_NAME, name); b.putString(EXTRA_FRAG_UUID, uuid); fragment.setArguments(b); return fragment; }
From source file:com.dabay6.android.apps.carlog.ui.fuel.fragments.FuelHistoryDetailFragment.java
/** * * @param id//www . j a v a 2 s.com * @param mpg * @return */ public static FuelHistoryDetailFragment newInstance(final Long id, final Float mpg) { final Bundle arguments = new Bundle(); final FuelHistoryDetailFragment fragment = new FuelHistoryDetailFragment(); if (id != null) { arguments.putLong(PARAMS_ENTITY_ID, id); } if (mpg != null) { arguments.putFloat(PARAMS_MPG, mpg); } fragment.setArguments(arguments); return fragment; }