use of android.support.v4.app.ActivityOptionsCompat in project Remindy by abicelis.
the class ImageAttachmentViewHolder method launchImageViewAttachmentActivity.
private void launchImageViewAttachmentActivity() {
Pair[] pairs = new Pair[1];
pairs[0] = new Pair<View, String>(mImage, mActivity.getResources().getString(R.string.transition_image_attachment_image));
ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(mActivity, pairs);
Intent goToViewImageAttachmentActivity = new Intent(mActivity, ViewImageAttachmentActivity.class);
goToViewImageAttachmentActivity.putExtra(ViewImageAttachmentActivity.IMAGE_ATTACHMENT_EXTRA, mCurrent);
goToViewImageAttachmentActivity.putExtra(ViewImageAttachmentActivity.HOLDER_POSITION_EXTRA, mPosition);
mActivity.startActivityForResult(goToViewImageAttachmentActivity, ViewImageAttachmentActivity.VIEW_IMAGE_ATTACHMENT_REQUEST_CODE, options.toBundle());
}
use of android.support.v4.app.ActivityOptionsCompat in project Remindy by abicelis.
the class ProgrammedOneTimeTaskViewHolder method onClick.
@Override
public void onClick(View view) {
int id = view.getId();
switch(id) {
case R.id.item_task_programmed_one_time_container:
Pair[] pairs = new Pair[1];
pairs[0] = new Pair<View, String>(mCategoryIcon, mFragment.getResources().getString(R.string.transition_task_list_category));
// pairs[1] = new Pair<View, String>(mTitle, mFragment.getResources().getString(R.string.transition_task_list_title));
// pairs[2] = new Pair<View, String>(mDescription, mFragment.getResources().getString(R.string.transition_task_list_description));
ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(mFragment.getActivity(), pairs);
Intent openTaskDetailActivity = new Intent(mFragment.getActivity(), TaskDetailActivity.class);
openTaskDetailActivity.putExtra(TaskDetailActivity.TASK_ID_TO_DISPLAY, mCurrent.getId());
openTaskDetailActivity.putExtra(TaskDetailActivity.TASK_POSITION, mReminderPosition);
if (mClickListener != null) {
mClickListener.onItemClicked(mReminderPosition, openTaskDetailActivity, options.toBundle());
}
break;
}
}
use of android.support.v4.app.ActivityOptionsCompat in project Remindy by abicelis.
the class UnprogrammedTaskViewHolder method onClick.
@Override
public void onClick(View view) {
int id = view.getId();
switch(id) {
case R.id.item_task_unprogrammed_container:
Pair[] pairs = new Pair[1];
pairs[0] = new Pair<View, String>(mCategoryIcon, mFragment.getResources().getString(R.string.transition_task_list_category));
// pairs[1] = new Pair<View, String>(mTitle, mFragment.getResources().getString(R.string.transition_task_list_title));
// pairs[2] = new Pair<View, String>(mDescription, mFragment.getResources().getString(R.string.transition_task_list_description));
ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(mFragment.getActivity(), pairs);
Intent openTaskDetailActivity = new Intent(mFragment.getActivity(), TaskDetailActivity.class);
openTaskDetailActivity.putExtra(TaskDetailActivity.TASK_ID_TO_DISPLAY, mCurrent.getId());
openTaskDetailActivity.putExtra(TaskDetailActivity.TASK_POSITION, mReminderPosition);
if (mClickListener != null) {
mClickListener.onItemClicked(mReminderPosition, openTaskDetailActivity, options.toBundle());
}
break;
}
}
use of android.support.v4.app.ActivityOptionsCompat in project MaterialEverywhere by antoniolg.
the class DetailActivity method launch.
public static void launch(BaseActivity activity, View transitionView, String url) {
ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(activity, transitionView, EXTRA_IMAGE);
Intent intent = new Intent(activity, DetailActivity.class);
intent.putExtra(EXTRA_IMAGE, url);
ActivityCompat.startActivity(activity, intent, options.toBundle());
}
use of android.support.v4.app.ActivityOptionsCompat in project Tapad by berict.
the class IntentHelper method intentSharedElementWithExtra.
public void intentSharedElementWithExtra(final Activity activity, final String targetName, final int start_element_id, final String transitionName, final String extraName, final String extra, int delay) {
final String classname = "com.bedrock.padder." + targetName;
final Class<Object> classToLoad;
try {
classToLoad = (Class<Object>) Class.forName(classname);
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
if (Build.VERSION.SDK_INT >= 21) {
Intent intent = new Intent(activity, classToLoad);
intent.putExtra(extraName, extra);
View view = activity.findViewById(start_element_id);
ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(activity, // The view which starts the transition
view, // The transitionName of the view we’re transitioning to
transitionName);
ActivityCompat.startActivity(activity, intent, options.toBundle());
} else {
intentWithExtra(activity, targetName, extraName, extra, 0);
}
}
}, delay);
} catch (ClassNotFoundException e) {
Log.i("IntentHelper", "Error, there is no such class");
}
}
Aggregations