List of usage examples for android.app ActivityOptions toBundle
public Bundle toBundle()
From source file:com.sughimura.samplebitmaps.ui.ImageGridFragment.java
@TargetApi(Build.VERSION_CODES.JELLY_BEAN) @Override//from w w w . j a v a 2 s. com public void onItemClick(AdapterView<?> parent, View v, int position, long id) { final Intent i = new Intent(getActivity(), ImageDetailActivity.class); i.putExtra(ImageDetailActivity.EXTRA_IMAGE, (int) id); if (Utils.hasJellyBean()) { // makeThumbnailScaleUpAnimation() looks kind of ugly here as the loading spinner may // show plus the thumbnail image in GridView is cropped. so using // makeScaleUpAnimation() instead. ActivityOptions options = ActivityOptions.makeScaleUpAnimation(v, 0, 0, v.getWidth(), v.getHeight()); getActivity().startActivity(i, options.toBundle()); } else { startActivity(i); } }
From source file:com.example.samsisekki.displayingbitmaps.ui.ImageGridFragment.java
@TargetApi(VERSION_CODES.JELLY_BEAN) @Override//from w w w . j ava 2s .c om public void onItemClick(AdapterView<?> parent, View v, int position, long id) { final Intent i = new Intent(getActivity(), FoodList.class); i.putExtra(ImageDetailActivity.EXTRA_IMAGE, (int) id); if (Utils.hasJellyBean()) { // makeThumbnailScaleUpAnimation() looks kind of ugly here as the loading spinner may // show plus the thumbnail image in GridView is cropped. so using // makeScaleUpAnimation() instead. ActivityOptions options = ActivityOptions.makeScaleUpAnimation(v, 0, 0, v.getWidth(), v.getHeight()); getActivity().startActivity(i, options.toBundle()); } else { startActivity(i); } }
From source file:com.volley.demo.SimpleCacheFragment.java
@TargetApi(VERSION_CODES.JELLY_BEAN) @Override/*from w w w .j a v a 2 s.c o m*/ public void onItemClick(AdapterView<?> parent, View v, int position, long id) { final Intent i = new Intent(getActivity(), ImageDetailActivity.class); i.putExtra(ImageDetailActivity.EXTRA_IMAGE, (int) id); if (Utils.hasJellyBean()) { // makeThumbnailScaleUpAnimation() looks kind of ugly here as the // loading spinner may // show plus the thumbnail image in GridView is cropped. so using // makeScaleUpAnimation() instead. ActivityOptions options = ActivityOptions.makeScaleUpAnimation(v, 0, 0, v.getWidth(), v.getHeight()); getActivity().startActivity(i, options.toBundle()); } else { startActivity(i); } }
From source file:com.ffmpeger.card.utils.LPreviewUtilsBase.java
public void startActivityWithTransition(Intent intent, final View clickedView, final String transitionName) { ActivityOptions options = null; // if (hasL() && clickedView != null && !TextUtils.isEmpty(transitionName)) { // options = ActivityOptions.makeSceneTransitionAnimation( // mActivity, clickedView, transitionName); // }//from w w w .jav a2 s. c o m mActivity.startActivity(intent, (options != null) ? options.toBundle() : null); }
From source file:com.lithiumli.fiction.NowPlayingActivity.java
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: Intent parentIntent = new Intent(this, LibraryActivity.class); parentIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); ActivityOptions options = ActivityOptions.makeCustomAnimation(this, R.anim.activity_slide_down, R.anim.activity_slide_up); startActivity(parentIntent, options.toBundle()); finish();/*from w w w .ja va2s . c o m*/ return true; case R.id.select_artist_image: selectArtistImage(); } return super.onOptionsItemSelected(item); }
From source file:com.wulian.icam.view.album.AlbumGridFragment.java
@TargetApi(VERSION_CODES.JELLY_BEAN) @Override//from w w w. j ava 2 s .c om public void onItemClick(AdapterView<?> parent, View v, int position, long id) { final Intent i = new Intent(getActivity(), AlbumPicActivity.class); i.putExtra("AlbumEntity", mAlbumEntity); i.putExtra("position", position); if (Utils.hasJellyBean()) { // makeThumbnailScaleUpAnimation() looks kind of ugly here as the // loading spinner may // show plus the thumbnail image in GridView is cropped. so using // makeScaleUpAnimation() instead. ActivityOptions options = ActivityOptions.makeScaleUpAnimation(v, 0, 0, v.getWidth(), v.getHeight()); getActivity().startActivity(i, options.toBundle()); } else { startActivity(i); } }
From source file:io.plaidapp.designernews.PostNewDesignerNewsStory.java
protected void postNewStory() { if (DesignerNewsPrefs.get(this).isLoggedIn()) { ImeUtils.hideIme(title);/*from w w w . jav a 2 s . c o m*/ Intent postIntent = new Intent(PostStoryService.ACTION_POST_NEW_STORY, null, this, PostStoryService.class); postIntent.putExtra(PostStoryService.EXTRA_STORY_TITLE, title.getText().toString()); postIntent.putExtra(PostStoryService.EXTRA_STORY_URL, url.getText().toString()); postIntent.putExtra(PostStoryService.EXTRA_STORY_COMMENT, comment.getText().toString()); postIntent.putExtra(PostStoryService.EXTRA_BROADCAST_RESULT, getIntent().getBooleanExtra(PostStoryService.EXTRA_BROADCAST_RESULT, false)); startService(postIntent); setResult(Activities.DesignerNews.PostStory.RESULT_POSTING); finishAfterTransition(); } else { Intent login = ActivityHelper.intentTo(Activities.DesignerNews.Login.INSTANCE); MorphTransform.addExtras(login, ContextCompat.getColor(this, io.plaidapp.R.color.designer_news), 0); ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(this, post, getString(io.plaidapp.R.string.transition_designer_news_login)); startActivity(login, options.toBundle()); } }
From source file:com.greendev.image.ImageGridFragment.java
@TargetApi(16) @Override/* w w w .j av a2s. c o m*/ public void onItemClick(AdapterView<?> parent, View v, int position, long id) { /* transferring information to ImageDetailActivity */ Bundle b = new Bundle(); b.putStringArray("URLS_TYPE", typeUrls); b.putStringArray("CAPTIONS", captions); final Intent i = new Intent(context, ImageDetailActivity.class); i.putExtras(b); i.putExtra(ImageDetailActivity.EXTRA_IMAGE, (int) id); if (Utils.hasJellyBean()) { // makeThumbnailScaleUpAnimation() looks kind of ugly here as the // loading spinner may // show plus the thumbnail image in GridView is cropped. so using // makeScaleUpAnimation() instead. ActivityOptions options = ActivityOptions.makeScaleUpAnimation(v, 0, 0, v.getWidth(), v.getHeight()); context.startActivity(i, options.toBundle()); } else { startActivity(i); } }
From source file:io.indy.seni.ui.EvolveGridFragment.java
@Override public void onItemClick(AdapterView<?> parent, View v, int position, long id) { Genotype genotype = mEvolveContainer.getGenotype((int) id); AstHolder astHolder = genotype.getAstHolder(); try {/*from w ww .j a va 2 s .c om*/ String script = astHolder.scribe(genotype); Intent intent = new Intent(getActivity(), RenderActivity.class); intent.putExtra(GENESIS_SCRIPT, script); // startActivity(intent); if (AppConfig.hasJellyBean()) { // makeThumbnailScaleUpAnimation() looks kind of ugly here as the loading spinner may // show plus the thumbnail image in GridView is cropped. so using // makeScaleUpAnimation() instead. ActivityOptions options = ActivityOptions.makeScaleUpAnimation(v, 0, 0, v.getWidth(), v.getHeight()); getActivity().startActivity(intent, options.toBundle()); } else { startActivity(intent); } } catch (Node.ScribeException e) { e.printStackTrace(); } }
From source file:com.sachinshinde.theweatherapp.utils.LUtils.java
public void startActivityWithTransition(Intent intent, final View clickedView, final String transitionName) { ActivityOptions options = null; if (hasL() && clickedView != null && !TextUtils.isEmpty(transitionName)) { // options = ActivityOptions.makeSceneTransitionAnimation( // mActivity, clickedView, transitionName); }//from w w w .j ava 2 s.c o m mActivity.startActivity(intent, (options != null) ? options.toBundle() : null); }