當前位置: 首頁>>代碼示例>>Java>>正文


Java ChangeBounds.setInterpolator方法代碼示例

本文整理匯總了Java中android.transition.ChangeBounds.setInterpolator方法的典型用法代碼示例。如果您正苦於以下問題:Java ChangeBounds.setInterpolator方法的具體用法?Java ChangeBounds.setInterpolator怎麽用?Java ChangeBounds.setInterpolator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.transition.ChangeBounds的用法示例。


在下文中一共展示了ChangeBounds.setInterpolator方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getNextButtonTransition

import android.transition.ChangeBounds; //導入方法依賴的package包/類
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private ChangeBounds getNextButtonTransition() {
    ChangeBounds arcMoveTransition = new ChangeBounds();
    //create "zorro" like path
    arcMoveTransition.setPathMotion(new PathMotion() {
        @Override
        public Path getPath(float startX, float startY, float endX, float endY) {
            Path p = new Path();
            p.moveTo(startX, startY);
            p.lineTo(endX, startY);
            p.lineTo(startX, endY);
            p.lineTo(endX, endY);
            return p;
        }
    });
    arcMoveTransition.setDuration(500);
    arcMoveTransition.setInterpolator(new AccelerateDecelerateInterpolator());
    return arcMoveTransition;
}
 
開發者ID:fzymek,項目名稱:FunWithAndroid,代碼行數:20,代碼來源:WelcomeFragmentStep1.java

示例2: onCreate

import android.transition.ChangeBounds; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    mSceneRoot = (ViewGroup) findViewById(R.id.scene_root);

    mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.scene1, this);
    mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.scene2, this);

    mTransition = new ChangeBounds();
    mTransition.setDuration(DateUtils.SECOND_IN_MILLIS);
    mTransition.setInterpolator(new AccelerateDecelerateInterpolator());
    TransitionManager.go(mScene1);
    mCurrentScene = mScene1;

    findViewById(R.id.button).setOnClickListener(this);
}
 
開發者ID:IanGClifton,項目名稱:auid2,代碼行數:22,代碼來源:MainActivity.java

示例3: 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);
  }
}
 
開發者ID:afollestad,項目名稱:polar-dashboard,代碼行數:48,代碼來源:IconMoreActivity.java

示例4: setTransition

import android.transition.ChangeBounds; //導入方法依賴的package包/類
private void setTransition() {
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
    return;
  }

  final TransitionSet transition = new TransitionSet();

  ChangeBounds transition1 = new ChangeBounds();
  transition.addTransition(transition1);
  ChangeTransform transition2 = new ChangeTransform();
  transition.addTransition(transition2);
  ChangeClipBounds transition3 = new ChangeClipBounds();
  transition.addTransition(transition3);
  ChangeImageTransform transition4 = new ChangeImageTransform();
  transition.addTransition(transition4);

  transition.setDuration(SHARED_ELEMENT_TRANSITION_DURATION);

  FastOutSlowInInterpolator interpolator = new FastOutSlowInInterpolator();
  transition1.setInterpolator(interpolator);
  transition2.setInterpolator(interpolator);
  transition3.setInterpolator(interpolator);
  transition4.setInterpolator(interpolator);

  final GravityArcMotion pathMotion = new GravityArcMotion();
  transition.setPathMotion(pathMotion);

  getWindow().setSharedElementEnterTransition(transition);
  getWindow().setSharedElementReturnTransition(transition);
  getWindow().setSharedElementsUseOverlay(false);

  Slide slide = new Slide(Gravity.TOP);
  slide.setInterpolator(new LinearOutSlowInInterpolator());
  slide.addTarget(appBar);
  slide.setDuration(225);
  slide.setStartDelay(100);
  getWindow().setEnterTransition(slide);
  Slide slideOut = (Slide) slide.clone();
  slideOut.setInterpolator(new FastOutLinearInInterpolator());
  slideOut.setStartDelay(0);
  getWindow().setReturnTransition(slideOut);
}
 
開發者ID:afollestad,項目名稱:polar-dashboard,代碼行數:43,代碼來源:ViewerActivity.java


注:本文中的android.transition.ChangeBounds.setInterpolator方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。