use of android.support.v4.app.ActivityOptionsCompat in project Tapad by berict.
the class IntentHelper method intentSharedElement.
public void intentSharedElement(final Activity activity, final String targetName, final int start_element_id, final String transitionName, 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);
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 {
intent(activity, targetName);
}
}
}, delay);
} catch (ClassNotFoundException e) {
Log.i("IntentHelper", "Error, there is no such class");
}
}
use of android.support.v4.app.ActivityOptionsCompat in project EasyVolley by asifmujteba.
the class DetailsActivity method launch.
public static void launch(BaseActivity mContext, Product product, ImageView imageView) {
Intent intent = new Intent(mContext, DetailsActivity.class);
intent.putExtra(EXTRA_PRODUCT, Parcels.wrap(product));
ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(mContext, imageView, "productImage");
ActivityCompat.startActivity(mContext, intent, options.toBundle());
}
use of android.support.v4.app.ActivityOptionsCompat in project MaterialLogin by fanrunqi.
the class AActivityOne method setListener.
private void setListener() {
btGo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Explode explode = new Explode();
explode.setDuration(500);
getWindow().setExitTransition(explode);
getWindow().setEnterTransition(explode);
ActivityOptionsCompat oc2 = ActivityOptionsCompat.makeSceneTransitionAnimation(AActivityOne.this);
Intent i2 = new Intent(AActivityOne.this, AActivityThree.class);
startActivity(i2, oc2.toBundle());
}
});
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
getWindow().setExitTransition(null);
getWindow().setEnterTransition(null);
ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(AActivityOne.this, fab, fab.getTransitionName());
startActivity(new Intent(AActivityOne.this, AActivityTwo.class), options.toBundle());
}
});
}
use of android.support.v4.app.ActivityOptionsCompat in project Material-Animations by lgvalle.
the class SamplesRecyclerAdapter method startActivity.
private void startActivity(Class target, Pair<View, String>[] pairs, Sample sample) {
Intent i = new Intent(activity, target);
ActivityOptionsCompat transitionActivityOptions = ActivityOptionsCompat.makeSceneTransitionAnimation(activity, pairs);
i.putExtra("sample", sample);
activity.startActivity(i, transitionActivityOptions.toBundle());
}
use of android.support.v4.app.ActivityOptionsCompat in project Material-Animations by lgvalle.
the class BaseDetailActivity method transitionTo.
@SuppressWarnings("unchecked")
void transitionTo(Intent i) {
final Pair<View, String>[] pairs = TransitionHelper.createSafeTransitionParticipants(this, true);
ActivityOptionsCompat transitionActivityOptions = ActivityOptionsCompat.makeSceneTransitionAnimation(this, pairs);
startActivity(i, transitionActivityOptions.toBundle());
}
Aggregations