private void conferma() { if (dataInizio.after(dataFine)) { new MioToast(Statistiche.this, getString(R.string.statistiche_periodoSbagliato)) .visualizza(Toast.LENGTH_SHORT); return; } Intent intGrafico = new Intent(Statistiche.this, StatisticheGrafico.class); intGrafico.putExtra("spese", spese); intGrafico.putExtra("grafico", spGrafico.getSelectedItemPosition()); if ((spGrafico.getSelectedItemPosition() == CostantiGrafici.GRAFICO_TEMPORALE_TAG || spGrafico.getSelectedItemPosition() == CostantiGrafici.GRAFICO_DIAL) && spese) { intGrafico.putExtra("voce", arrVociSpese[spVoci.getSelectedItemPosition()]); } else if ((spGrafico.getSelectedItemPosition() == CostantiGrafici.GRAFICO_TEMPORALE_TAG || spGrafico.getSelectedItemPosition() == CostantiGrafici.GRAFICO_DIAL) && !spese) { intGrafico.putExtra("voce", arrVociEntrate[spVoci.getSelectedItemPosition()]); } intGrafico.putExtra("data_inizio", dataInizio.getTimeInMillis()); intGrafico.putExtra("data_fine", dataFine.getTimeInMillis()); if (spGrafico.getSelectedItemPosition() == CostantiGrafici.GRAFICO_DOUGHNUT) { intGrafico.putExtra("data_inizio2", dataInizio2.getTimeInMillis()); intGrafico.putExtra("data_fine2", dataFine2.getTimeInMillis()); } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { startActivity( intGrafico, ActivityOptions.makeSceneTransitionAnimation(Statistiche.this).toBundle()); } else { startActivity(intGrafico); } }
public void openRecipeDetail(View view, int position) { try { // Image imageItem = adapter.GetItemAt(position); Intent intent = new Intent(this, RecipeActivity.class); intent.putExtra( Constants.exRecipeTitle, String.valueOf(BrewSharedPrefs.getCurrentContentTitle())); intent.putExtra( Constants.exContentItemPk, String.valueOf(BrewSharedPrefs.getNextContentItemId())); intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(this); ActivityCompat.startActivity(this, intent, options.toBundle()); } else { this.startActivity(intent); this.overridePendingTransition(R.anim.slide_in_from_right, R.anim.slide_out_to_left); } } catch (Exception e) { if (BuildConfig.DEBUG) { Log.e(Constants.LOG, e.getMessage()); } } }
public static ActivityOptionsCompat21 makeSceneTransitionAnimation( Activity paramActivity, View[] paramArrayOfView, String[] paramArrayOfString) { Pair[] arrayOfPair = null; if (paramArrayOfView != null) { arrayOfPair = new Pair[paramArrayOfView.length]; for (int i = 0; i < arrayOfPair.length; i++) arrayOfPair[i] = Pair.create(paramArrayOfView[i], paramArrayOfString[i]); } return new ActivityOptionsCompat21( ActivityOptions.makeSceneTransitionAnimation(paramActivity, arrayOfPair)); }
@Override public void onClick(View view) { switch (view.getId()) { case R.id.btn_next: Intent intent = new Intent(StartUpActivity.this, LoginActivity.class); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { startActivity(intent, ActivityOptions.makeSceneTransitionAnimation(this).toBundle()); } else { startActivity(intent); } } }
private void showQrCodeDialog() { Intent qrCodeIntent = new Intent(getActivity(), QrCodeViewActivity.class); // create the transition animation - the images in the layouts // of both activities are defined with android:transitionName="qr_code" Bundle opts = null; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(getActivity(), mQrCodeLayout, "qr_code"); opts = options.toBundle(); } qrCodeIntent.setData(mDataUri); ActivityCompat.startActivity(getActivity(), qrCodeIntent, opts); }
@SuppressLint("NewApi") public void onActivityAnim(View view) { if (Build.VERSION.SDK_INT >= 21) { getWindow().setSharedElementEnterTransition(new Explode()); Intent intent = new Intent(this, ShareActivityB.class); // 一个共有元素 // ActivityOptions options = // ActivityOptions.makeSceneTransitionAnimation( // this, mViewImage, "image"); // 多个共有元素 Pair[] pairs = new Pair[2]; pairs[0] = Pair.create(mViewContent, "text"); pairs[1] = Pair.create(mViewImage, "image"); ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(ShareActivityA.this, pairs); startActivity(intent, options.toBundle()); } else { Toast.makeText(this, "sorry~", Toast.LENGTH_SHORT).show(); } }
public void clicked(View v) { Intent intent = new Intent(this, ImageAnimationDemo.class); intent.putExtra(KEY_ID, mName); ActivityOptions activityOptions = ActivityOptions.makeSceneTransitionAnimation(this, v, "hero"); startActivity(intent, activityOptions.toBundle()); }
public static ActivityOptionsCompat21 makeSceneTransitionAnimation( Activity paramActivity, View paramView, String paramString) { return new ActivityOptionsCompat21( ActivityOptions.makeSceneTransitionAnimation(paramActivity, paramView, paramString)); }