当前位置: 首页>>代码示例>>Java>>正文


Java ChangeBounds类代码示例

本文整理汇总了Java中android.transition.ChangeBounds的典型用法代码示例。如果您正苦于以下问题:Java ChangeBounds类的具体用法?Java ChangeBounds怎么用?Java ChangeBounds使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ChangeBounds类属于android.transition包,在下文中一共展示了ChangeBounds类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onClick

import android.transition.ChangeBounds; //导入依赖的package包/类
@OnClick(R.id.square2)
public void onClick() {

    FragmentSharedElementTransitionTarget targetFragment = new FragmentSharedElementTransitionTarget();
    // FIXME: 08/02/2017 the shared element transitions to the next fragment below other views while it should be on top as in Activity transitions
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        TransitionSet transitionSet = new TransitionSet();
        transitionSet.addTransition(new ChangeBounds());
        transitionSet.setPathMotion(new ArcMotion());
        targetFragment.setSharedElementEnterTransition(transitionSet);
        targetFragment.setSharedElementReturnTransition(transitionSet);
        targetFragment.setEnterTransition(TransitionInflater.from(getActivity()).inflateTransition(R.transition.slide_bottom));
        targetFragment.setExitTransition(TransitionInflater.from(getActivity()).inflateTransition(R.transition.slide_top_and_fade));
        setExitTransition(new Explode());
        setReenterTransition(new Explode());
        setAllowReturnTransitionOverlap(false);
    }
    getActivity().getSupportFragmentManager()
            .beginTransaction()
            .addSharedElement(square2, getString(R.string.custom_element_transition_name))
            .replace(R.id.fragmentContainer, targetFragment)
            .addToBackStack(null)
            .commit();
}
 
开发者ID:zawadz88,项目名称:AnimationShowcase,代码行数:25,代码来源:FragmentSharedElementTransitionSource.java

示例2: handleTransitions

import android.transition.ChangeBounds; //导入依赖的package包/类
@RequiresApi(api = Build.VERSION_CODES.HONEYCOMB)
private void handleTransitions() {
    useSysTransition = getIntent().getBooleanExtra(KEY_USE_SYS_TRANSITION, false);
    if(useSysTransition) {
        ivDetail.setVisibility(View.VISIBLE);
        Fade fade = new Fade();
        fade.setDuration(500);
        getWindow().setEnterTransition(fade);
        getWindow().setExitTransition(fade);
        ChangeBounds changeBounds = new ChangeBounds();
        getWindow().setSharedElementEnterTransition(changeBounds);
    }
    entity = (TransitionsEntity) getIntent().getSerializableExtra(KEY_ENTITY);
    KLog.d(entity);
    GlideUtils.displayImage(this, ivDetail, entity.getUrl(), R.drawable.def_placeholder);
}
 
开发者ID:Sherchen,项目名称:AnimationsDemo,代码行数:17,代码来源:DetailActivity.java

示例3: addNextFragment

import android.transition.ChangeBounds; //导入依赖的package包/类
private void addNextFragment(Sample sample, ImageView squareBlue, boolean overlap) {
    SharedElementFragment2 sharedElementFragment2 = SharedElementFragment2.newInstance(sample);

    Slide slideTransition = new Slide(Gravity.RIGHT);
    slideTransition.setDuration(getResources().getInteger(R.integer.anim_duration_medium));

    ChangeBounds changeBoundsTransition = new ChangeBounds();
    changeBoundsTransition.setDuration(getResources().getInteger(R.integer.anim_duration_medium));

    sharedElementFragment2.setEnterTransition(slideTransition);
    sharedElementFragment2.setAllowEnterTransitionOverlap(overlap);
    sharedElementFragment2.setAllowReturnTransitionOverlap(overlap);
    sharedElementFragment2.setSharedElementEnterTransition(changeBoundsTransition);

    getFragmentManager().beginTransaction()
            .replace(R.id.sample2_content, sharedElementFragment2)
            .addToBackStack(null)
            .addSharedElement(squareBlue, getString(R.string.square_blue_name))
            .commit();
}
 
开发者ID:shenhuanet,项目名称:AndroidOpen,代码行数:21,代码来源:SharedElementFragment1.java

示例4: 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

示例5: startTransition

import android.transition.ChangeBounds; //导入依赖的package包/类
private void startTransition(){
    lifeGridFragment = LifeGridFragment.newInstance();
    FragmentManager fragmentManager = getSupportFragmentManager();
    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
    if(Build.VERSION.SDK_INT >= 21) {
        TransitionSet gridTransition = new TransitionSet();
        gridTransition.setDuration(600);
        gridTransition.addTransition(new ChangeBounds());
        gridTransition.addTransition((new ChangeTransform()));
        lifeGridFragment.setSharedElementEnterTransition(gridTransition);
    }


    fragmentTransaction.addSharedElement(findViewById(R.id.intro_card_view), getString(R.string.card_view_transition_name));
    fragmentTransaction.replace(R.id.container, lifeGridFragment);
    fragmentTransaction.addToBackStack(null);
    fragmentTransaction.commit();
    appBarLayout.setExpanded(false, true);
}
 
开发者ID:lewismcgeary,项目名称:AndroidGameofLife,代码行数:20,代码来源:MainActivity.java

示例6: startToolbarAnimation

import android.transition.ChangeBounds; //导入依赖的package包/类
public static void startToolbarAnimation(
    Context context,
    ViewGroup v
) {
    if (new UpdaterOptions(context).disableAnimations()) {
        return;
    }

    if (Build.VERSION.SDK_INT >= 21) {
        TransitionManager.beginDelayedTransition(v, new TransitionSet()
            .addTransition(new Fade(Fade.IN))
            .addTransition(new Slide(Gravity.LEFT))
            .addTransition(new ChangeBounds())
        );

    } else if (Build.VERSION.SDK_INT >= 14){
        android.support.transition.TransitionManager.beginDelayedTransition(v, new AutoTransition().setDuration(250));
    } {
        // No animation
    }
}
 
开发者ID:rumboalla,项目名称:apkupdater,代码行数:22,代码来源:AnimationUtil.java

示例7: createTransition

import android.transition.ChangeBounds; //导入依赖的package包/类
@NonNull
@Override
protected Transition createTransition(@NonNull ViewGroup container, @NonNull View entering, @Nullable View leaving, boolean push) {
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
    return new TransitionSet()
        .setOrdering(ORDERING_TOGETHER)
        .addTransition(new Fade(Fade.OUT))
        .addTransition(new Fade(Fade.IN));
  }
  final TransitionSet transition = new TransitionSet()
      .addTransition(new ChangeBounds())
      .addTransition(new ChangeClipBounds())
      .addTransition(new ChangeTransform());

  transition.setPathMotion(new ArcMotion());

  return transition;
}
 
开发者ID:SiimKinks,项目名称:unicorn,代码行数:19,代码来源:ArcMoveTransitionHandler.java

示例8: 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

示例9: onCheckedChanged

import android.transition.ChangeBounds; //导入依赖的package包/类
@Override public void onCheckedChanged(final RadioGroup group, int checkedId) {
    switch (checkedId) {
        case R.id.select_scene_1: {
            // You can start an automatic transition with TransitionManager.go().
            TransitionManager.go(mScene1);
            break;
        }
        case R.id.select_scene_2: {
            TransitionSet set = new TransitionSet();
            Slide slide = new Slide(Gravity.LEFT);
            slide.addTarget(R.id.transition_title);
            set.addTransition(slide);
            set.addTransition(new ChangeBounds());
            set.setOrdering(TransitionSet.ORDERING_TOGETHER);
            set.setDuration(350);
            TransitionManager.go(mScene2, set);
            break;
        }
        case R.id.select_scene_3: {
            // You can also start a transition with a custom TransitionManager.
            mTransitionManagerForScene3.transitionTo(mScene3);
            break;
        }
    }
}
 
开发者ID:xu6148152,项目名称:binea_project_for_android,代码行数:26,代码来源:ScenesSample.java

示例10: makeSharedElementEnterTransition

import android.transition.ChangeBounds; //导入依赖的package包/类
public static Transition makeSharedElementEnterTransition(List<String> textTransitionNames) {
    TransitionSet set = new TransitionSet();
    set.setOrdering(TransitionSet.ORDERING_TOGETHER);

    Transition recolor = new Recolor();
    Transition changeBounds = new ChangeBounds();
    Transition textSize = new TextSizeTransition();

    for (String textTName : textTransitionNames) {
        changeBounds.addTarget(textTName);
        textSize.addTarget(textTName);
        recolor.addTarget(textTName);
    }

    set.addTransition(recolor);
    set.addTransition(changeBounds);
    set.addTransition(textSize);

    ///set.setDuration(3000);
    return set;
}
 
开发者ID:ndorigatti,项目名称:RevealPathMotion,代码行数:22,代码来源:TransitionUtils.java

示例11: setPitchBarPosition

import android.transition.ChangeBounds; //导入依赖的package包/类
private void setPitchBarPosition(double frequency) {
    View pitchBar = (View)findViewById(R.id.tune_view_current_pitch);
    int margin = 20;
    double leftDP = NoteCalculator.getPitchBarPosition(frequency, 560);

    Transition moveTransition = new ChangeBounds();
    moveTransition.setDuration(300);
    moveTransition.setInterpolator(new LinearInterpolator());

    TransitionManager.beginDelayedTransition((ViewGroup) pitchBar.getRootView(), moveTransition);

    ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams)(pitchBar.getLayoutParams());
    Log.d(TAG, String.format("Current: %d New: %f", params.leftMargin, leftDP));
    params.setMargins((int)leftDP,0,0,0);
    pitchBar.setLayoutParams(params);
}
 
开发者ID:GlassTune,项目名称:GlassTune,代码行数:17,代码来源:TuneGuitarActivity.java

示例12: onTextClick

import android.transition.ChangeBounds; //导入依赖的package包/类
@OnClick({ R.id.text1 })
public void onTextClick() {

    // Create a TransitionSet that will animated ChangeBounds and Fade
    TransitionSet transitionSet = new TransitionSet();
    transitionSet.addTransition(new ChangeBounds());
    transitionSet.addTransition(new Fade());

    TransitionManager.beginDelayedTransition(mLayout, transitionSet);

    // Remove text1 from the Layout
    mLayout.removeView(mText1);

    // Increase the height of Text1 and set a top margin
    LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) mText1.getLayoutParams();
    params.height *= 2;
    params.topMargin = 100;
    mText1.setLayoutParams(params);

    // Add text1 back to the layout
    // TransitionManager will automagically apply animations
    mLayout.addView(mText1, 1);


}
 
开发者ID:RealAndyLawton,项目名称:BreakMeOffKitKat,代码行数:26,代码来源:TransitionsDelayedFragment.java

示例13: createTransitionSet

import android.transition.ChangeBounds; //导入依赖的package包/类
public static TransitionSet createTransitionSet(
    ScalingUtils.ScaleType fromScale,
    ScalingUtils.ScaleType toScale) {
  TransitionSet transitionSet = new TransitionSet();
  transitionSet.addTransition(new ChangeBounds());
  transitionSet.addTransition(new DraweeTransition(fromScale, toScale));
  return transitionSet;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:DraweeTransition.java

示例14: prepare

import android.transition.ChangeBounds; //导入依赖的package包/类
public void prepare(Fragment toFragment) {
    final Bundle transitionBundle = TransitionBundleFactory.createTransitionBundle(context, fromView, bitmap);
    if (Build.VERSION.SDK_INT >= 21) {
        toFragment.setSharedElementEnterTransition(new ChangeBounds());
        toFragment.setSharedElementReturnTransition(new ChangeBounds());
    }
    toFragment.setArguments(transitionBundle);
}
 
开发者ID:MSay2,项目名称:Mire,代码行数:9,代码来源:FragmentTransitionLauncher.java

示例15: getTransition

import android.transition.ChangeBounds; //导入依赖的package包/类
@Override
@NonNull
protected Transition getTransition(@NonNull ViewGroup container, View from, View to, boolean isPush) {
    TransitionSet transition = new TransitionSet()
            .setOrdering(TransitionSet.ORDERING_SEQUENTIAL)
            .addTransition(new Fade(Fade.OUT))
            .addTransition(new TransitionSet().addTransition(new ChangeBounds()).addTransition(new ChangeClipBounds()).addTransition(new ChangeTransform()))
            .addTransition(new Fade(Fade.IN));

    transition.setPathMotion(new ArcMotion());

    return transition;
}
 
开发者ID:zawadz88,项目名称:Conductor-TransitionsEverywhere,代码行数:14,代码来源:ArcFadeMoveChangeHandler.java


注:本文中的android.transition.ChangeBounds类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。