本文整理匯總了Java中android.transition.ChangeBounds.setStartDelay方法的典型用法代碼示例。如果您正苦於以下問題:Java ChangeBounds.setStartDelay方法的具體用法?Java ChangeBounds.setStartDelay怎麽用?Java ChangeBounds.setStartDelay使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.transition.ChangeBounds
的用法示例。
在下文中一共展示了ChangeBounds.setStartDelay方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setUpTransitions
import android.transition.ChangeBounds; //導入方法依賴的package包/類
private void setUpTransitions() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getWindow().setSharedElementsUseOverlay(true);
final float[] buttonLocation = getIntent().getFloatArrayExtra(EXTRA_REVEAL_ANIM_LOCATION);
final float x = buttonLocation[0];
final float y = buttonLocation[1];
CircularRevealTransition circularRevealTransition = new CircularRevealTransition(x, y);
circularRevealTransition.addTarget(getString(R.string.transition_name_circular_reveal));
circularRevealTransition.setInterpolator(new FastOutSlowInInterpolator());
Slide enterSlide = new Slide();
enterSlide.setDuration(300);
enterSlide.setStartDelay(400);
enterSlide.setInterpolator(new FastOutSlowInInterpolator());
enterSlide.excludeTarget(getString(R.string.transition_name_circular_reveal), true);
enterSlide.excludeTarget(Window.STATUS_BAR_BACKGROUND_TRANSITION_NAME, true);
Slide returnSide = new Slide();
returnSide.setDuration(300);
returnSide.setInterpolator(new FastOutSlowInInterpolator());
returnSide.excludeTarget(getString(R.string.transition_name_circular_reveal), true);
returnSide.excludeTarget(Window.STATUS_BAR_BACKGROUND_TRANSITION_NAME, true);
TransitionSet set =
new TransitionSet().addTransition(circularRevealTransition).addTransition(enterSlide);
TransitionSet set2 =
new TransitionSet().addTransition(returnSide).addTransition(circularRevealTransition);
getWindow().setEnterTransition(set);
getWindow().setReturnTransition(set2);
ChangeBounds enterBounds = new ChangeBounds();
enterBounds.setDuration(300);
enterBounds.setStartDelay(400);
enterBounds.setInterpolator(new FastOutSlowInInterpolator());
ChangeBounds returnBounds = new ChangeBounds();
returnBounds.setDuration(300);
returnBounds.setInterpolator(new FastOutSlowInInterpolator());
getWindow().setSharedElementEnterTransition(enterBounds);
getWindow().setSharedElementReturnTransition(returnBounds);
}
}