use of android.app.ActivityOptions in project animate by hitherejoe.
the class MorphTransitionsActivity method onFabClick.
@OnClick(R.id.fab_morph)
public void onFabClick(View view) {
Intent login = PopupActivity.getStartIntent(this, PopupActivity.MORPH_TYPE_FAB);
ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(MorphTransitionsActivity.this, view, getString(R.string.transition_morph_view));
startActivity(login, options.toBundle());
}
use of android.app.ActivityOptions in project Timber by naman14.
the class NavigationUtils method navigateToPlaylistDetail.
@TargetApi(21)
public static void navigateToPlaylistDetail(Activity context, String action, long firstAlbumID, String playlistName, int foregroundcolor, long playlistID, ArrayList<Pair> transitionViews) {
final Intent intent = new Intent(context, PlaylistDetailActivity.class);
if (!PreferencesUtility.getInstance(context).getSystemAnimations()) {
intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
}
intent.setAction(action);
intent.putExtra(Constants.PLAYLIST_ID, playlistID);
intent.putExtra(Constants.PLAYLIST_FOREGROUND_COLOR, foregroundcolor);
intent.putExtra(Constants.ALBUM_ID, firstAlbumID);
intent.putExtra(Constants.PLAYLIST_NAME, playlistName);
intent.putExtra(Constants.ACTIVITY_TRANSITION, transitionViews != null);
if (transitionViews != null && TimberUtils.isLollipop() && PreferencesUtility.getInstance(context).getAnimations()) {
ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(MainActivity.getInstance(), transitionViews.get(0), transitionViews.get(1), transitionViews.get(2));
context.startActivityForResult(intent, Constants.ACTION_DELETE_PLAYLIST, options.toBundle());
} else {
context.startActivityForResult(intent, Constants.ACTION_DELETE_PLAYLIST);
}
}
use of android.app.ActivityOptions in project plaid by nickbutcher.
the class FeedAdapter method createDesignerNewsStoryHolder.
@NonNull
private DesignerNewsStoryHolder createDesignerNewsStoryHolder(ViewGroup parent) {
final DesignerNewsStoryHolder holder = new DesignerNewsStoryHolder(layoutInflater.inflate(R.layout.designer_news_story_item, parent, false), pocketIsInstalled);
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final Story story = (Story) getItem(holder.getAdapterPosition());
CustomTabActivityHelper.openCustomTab(host, DesignerNewsStory.getCustomTabIntent(host, story, null).build(), Uri.parse(story.url));
}
});
holder.comments.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View commentsView) {
final Intent intent = new Intent();
intent.setClass(host, DesignerNewsStory.class);
intent.putExtra(DesignerNewsStory.EXTRA_STORY, (Story) getItem(holder.getAdapterPosition()));
ReflowText.addExtras(intent, new ReflowText.ReflowableTextView(holder.title));
setGridItemContentTransitions(holder.itemView);
// on return, fade the pocket & comments buttons in
host.setExitSharedElementCallback(new SharedElementCallback() {
@Override
public void onSharedElementStart(List<String> sharedElementNames, List<View> sharedElements, List<View> sharedElementSnapshots) {
host.setExitSharedElementCallback(null);
notifyItemChanged(holder.getAdapterPosition(), HomeGridItemAnimator.STORY_COMMENTS_RETURN);
}
});
final ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(host, Pair.create((View) holder.title, host.getString(R.string.transition_story_title)), Pair.create(holder.itemView, host.getString(R.string.transition_story_title_background)), Pair.create(holder.itemView, host.getString(R.string.transition_story_background)));
host.startActivity(intent, options.toBundle());
}
});
if (pocketIsInstalled) {
// grumble... no xml setter, grumble...
holder.pocket.setImageAlpha(178);
holder.pocket.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(final View view) {
PocketUtils.addToPocket(host, ((Story) getItem(holder.getAdapterPosition())).url);
// notify changed with a payload asking RV to run the anim
notifyItemChanged(holder.getAdapterPosition(), HomeGridItemAnimator.ADD_TO_POCKET);
}
});
}
return holder;
}
use of android.app.ActivityOptions in project plaid by nickbutcher.
the class HomeActivity method fabClick.
@OnClick(R.id.fab)
protected void fabClick() {
if (designerNewsPrefs.isLoggedIn()) {
Intent intent = new Intent(this, PostNewDesignerNewsStory.class);
FabTransform.addExtras(intent, ContextCompat.getColor(this, R.color.accent), R.drawable.ic_add_dark);
intent.putExtra(PostStoryService.EXTRA_BROADCAST_RESULT, true);
registerPostStoryResultListener();
ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(this, fab, getString(R.string.transition_new_designer_news_post));
startActivityForResult(intent, RC_NEW_DESIGNER_NEWS_STORY, options.toBundle());
} else {
Intent intent = new Intent(this, DesignerNewsLogin.class);
FabTransform.addExtras(intent, ContextCompat.getColor(this, R.color.accent), R.drawable.ic_add_dark);
ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(this, fab, getString(R.string.transition_designer_news_login));
startActivityForResult(intent, RC_NEW_DESIGNER_NEWS_LOGIN, options.toBundle());
}
}
use of android.app.ActivityOptions in project plaid by nickbutcher.
the class PostNewDesignerNewsStory method postNewStory.
@OnClick(R.id.new_story_post)
protected void postNewStory() {
if (DesignerNewsPrefs.get(this).isLoggedIn()) {
ImeUtils.hideIme(title);
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(RESULT_POSTING);
finishAfterTransition();
} else {
Intent login = new Intent(this, DesignerNewsLogin.class);
MorphTransform.addExtras(login, ContextCompat.getColor(this, R.color.designer_news), 0);
ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(this, post, getString(R.string.transition_designer_news_login));
startActivity(login, options.toBundle());
}
}
Aggregations