Example usage for android.transition ChangeBounds ChangeBounds

List of usage examples for android.transition ChangeBounds ChangeBounds

Introduction

In this page you can find the example usage for android.transition ChangeBounds ChangeBounds.

Prototype

public ChangeBounds() 

Source Link

Usage

From source file:com.achep.acdisplay.ui.fragments.AcDisplayFragment.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Resources res = getResources();
    mConfigWidgetPinDuration = res.getInteger(R.integer.config_maxPinTime);
    mConfigWidgetSelectDelay = res.getInteger(R.integer.config_iconSelectDelayMillis);
    ViewConfiguration vc = ViewConfiguration.get(getActivity());
    mMaxFlingVelocity = vc.getScaledMaximumFlingVelocity();
    mMinFlingVelocity = vc.getScaledMinimumFlingVelocity();

    // Clock widget
    mClockWidget = getConfig().isCustomWidgetEnabled() ? new HostWidget(this, this)
            : new ClockWidget(this, this);

    // Media widget
    mMediaController = MediaController2.newInstance(getActivity()).asyncWrap();
    mMediaWidget = new MediaWidget(this, this);

    // Transitions
    if (Device.hasKitKatApi()) {
        mTransitionJit = new TransitionSet().setOrdering(TransitionSet.ORDERING_TOGETHER)
                .addTransition(new Fade()).addTransition(new ChangeBounds());
        mTransitionSwitchScene = new TransitionSet().setOrdering(TransitionSet.ORDERING_TOGETHER)
                .addTransition(new Fade(Fade.OUT).setDuration(200))
                .addTransition(new Fade(Fade.IN).setStartDelay(80))
                .addTransition(new ChangeBounds().setStartDelay(80));
    }//  w  w  w  .j  a  v a  2  s. c om

    // Timeout
    mTimeout = isNotDemo() ? mActivityAcd.getTimeout() : new Timeout();
}

From source file:com.sociablue.nanodegree_p1.MovieListFragment.java

public void setupTransitions(final MovieDetailPagerFragment newFragment, ImageView posterImageView) {
    //TODO: Shared Element Return Transition

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        // Inflate transitions to apply
        TransitionSet changeTransitionSet = new TransitionSet();
        Transition changeTransform = new ChangeTransform();
        changeTransitionSet.addTransition(changeTransform);
        changeTransitionSet.addTransition(new ChangeBounds());
        changeTransitionSet.setDuration(200);
        changeTransitionSet.setInterpolator(new AccelerateDecelerateInterpolator());
        this.setAllowEnterTransitionOverlap(true);
        this.setAllowReturnTransitionOverlap(true);

        // Setup enter transition on second fragment
        newFragment.setSharedElementEnterTransition(changeTransitionSet);
        newFragment.setAllowEnterTransitionOverlap(true);

        // Find the shared element (in Fragment A)
        moviePoster = posterImageView;/*from   ww  w. j ava2  s.  co m*/
        moviePoster.setTransitionName("movie_poster");

        // Add and hide details view pager fragment. Adding fragment, creates view and downloads images.
        getFragmentManager().beginTransaction().add(R.id.movie_list_fragment, newFragment, "detail")
                .addToBackStack("transaction2").hide(newFragment).commit();

    } else {
        // Code to run on older devices
        //TODO: Handle older devices
    }
}

From source file:com.roselism.bottomsheet.BottomSheet.java

private void showFullItems() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        Transition changeBounds = new ChangeBounds();
        changeBounds.setDuration(300);/*from   w  w  w .  j av  a  2  s.c  om*/
        TransitionManager.beginDelayedTransition(list, changeBounds);
    }
    actions = fullMenuItem;
    updateSection();
    adapter.notifyDataSetChanged();
    list.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
            LinearLayout.LayoutParams.MATCH_PARENT));
    icon.setVisibility(View.VISIBLE);
    icon.setImageDrawable(close);
    icon.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            showShortItems();
        }
    });
    setListLayout();
}

From source file:nu.yona.app.ui.YonaActivity.java

private void profileIcon() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        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));

        mContent.setEnterTransition(slideTransition);
        mContent.setAllowEnterTransitionOverlap(true);
        mContent.setAllowReturnTransitionOverlap(true);
        mContent.setSharedElementEnterTransition(changeBoundsTransition);
    }/* ww w . j ava 2  s. c  o  m*/
}