Search in sources :

Example 26 with ChangeBounds

use of android.transition.ChangeBounds in project android_frameworks_base by ResurrectionRemix.

the class SequenceTest method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.fading_test);
    View container = (View) findViewById(R.id.container);
    mSceneRoot = (ViewGroup) container.getParent();
    mRemovingButton = (Button) findViewById(R.id.removingButton);
    mInvisibleButton = (Button) findViewById(R.id.invisibleButton);
    mGoneButton = (Button) findViewById(R.id.goneButton);
    mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test, this);
    mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test_scene_2, this);
    Transition fade1 = new Fade().addTarget(R.id.removingButton);
    Transition fade2 = new Fade().addTarget(R.id.invisibleButton);
    Transition fade3 = new Fade().addTarget(R.id.goneButton);
    TransitionSet fader = new TransitionSet().setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
    fader.addTransition(fade1).addTransition(fade2).addTransition(fade3).addTransition(new ChangeBounds());
    sequencedFade = fader;
    reverseSequencedFade = new TransitionSet().setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
    reverseSequencedFade.addTransition(new ChangeBounds()).addTransition(fade3).addTransition(fade2).addTransition(fade1);
    mCurrentScene = mScene1;
}
Also used : TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) Transition(android.transition.Transition) View(android.view.View) Fade(android.transition.Fade)

Example 27 with ChangeBounds

use of android.transition.ChangeBounds in project android_frameworks_base by ResurrectionRemix.

the class SequenceTestSimple method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.fading_test_simple);
    View container = (View) findViewById(R.id.container);
    mSceneRoot = (ViewGroup) container.getParent();
    mRemovingButton = (Button) findViewById(R.id.removingButton);
    mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test_simple, this);
    mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test_simple2, this);
    TransitionSet fader = new TransitionSet().setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
    fader.addTransition(new Fade().addTarget(R.id.removingButton));
    fader.addTransition(new ChangeBounds().addTarget(R.id.sceneSwitchButton));
    sequencedFade = fader;
    sequencedFadeReverse = new TransitionSet().setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
    sequencedFadeReverse.addTransition(new ChangeBounds().addTarget(R.id.sceneSwitchButton));
    sequencedFadeReverse.addTransition(new Fade().addTarget(R.id.removingButton));
    mCurrentScene = mScene1;
}
Also used : TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) View(android.view.View) Fade(android.transition.Fade)

Example 28 with ChangeBounds

use of android.transition.ChangeBounds in project AndroidUtilCode by Blankj.

the class DetailTransition method init.

private void init() {
    setOrdering(ORDERING_TOGETHER);
    addTransition(new ChangeBounds()).addTransition(new ChangeTransform()).addTransition(new ChangeImageTransform());
}
Also used : ChangeTransform(android.transition.ChangeTransform) ChangeBounds(android.transition.ChangeBounds) ChangeImageTransform(android.transition.ChangeImageTransform)

Example 29 with ChangeBounds

use of android.transition.ChangeBounds in project android_frameworks_base by DirtyUnicorns.

the class SequenceTestSimple method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.fading_test_simple);
    View container = (View) findViewById(R.id.container);
    mSceneRoot = (ViewGroup) container.getParent();
    mRemovingButton = (Button) findViewById(R.id.removingButton);
    mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test_simple, this);
    mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test_simple2, this);
    TransitionSet fader = new TransitionSet().setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
    fader.addTransition(new Fade().addTarget(R.id.removingButton));
    fader.addTransition(new ChangeBounds().addTarget(R.id.sceneSwitchButton));
    sequencedFade = fader;
    sequencedFadeReverse = new TransitionSet().setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
    sequencedFadeReverse.addTransition(new ChangeBounds().addTarget(R.id.sceneSwitchButton));
    sequencedFadeReverse.addTransition(new Fade().addTarget(R.id.removingButton));
    mCurrentScene = mScene1;
}
Also used : TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) View(android.view.View) Fade(android.transition.Fade)

Example 30 with ChangeBounds

use of android.transition.ChangeBounds in project android_frameworks_base by DirtyUnicorns.

the class SurfaceAndTextureViews method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.surface_texture_views);
    final ViewGroup container = (ViewGroup) findViewById(R.id.container);
    Button toggleButton = (Button) findViewById(R.id.toggleButton);
    mView = new SimpleView(this);
    mView.setId(0);
    mView.setLayoutParams(new LayoutParams(SMALL_SIZE, SMALL_SIZE));
    container.addView(mView);
    mSurfaceView = new SimpleSurfaceView(this);
    mSurfaceView.setId(1);
    mSurfaceView.setLayoutParams(new LayoutParams(SMALL_SIZE, SMALL_SIZE));
    container.addView(mSurfaceView);
    mTextureView = new SimpleTextureView(this);
    mTextureView.setId(2);
    mTextureView.setLayoutParams(new LayoutParams(SMALL_SIZE, SMALL_SIZE));
    container.addView(mTextureView);
    final TransitionSet transition = new TransitionSet();
    transition.addTransition(new ChangeBounds()).addTransition(new Crossfade().addTarget(0).addTarget(1).addTarget(2));
    toggleButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Scene newScene = new Scene(container);
            newScene.setEnterAction(new Runnable() {

                @Override
                public void run() {
                    if (mView.getWidth() <= SMALL_SIZE) {
                        mView.setLayoutParams(new LayoutParams(SMALL_SIZE * 2, SMALL_SIZE));
                        mSurfaceView.setLayoutParams(new LayoutParams(SMALL_SIZE * 2, SMALL_SIZE));
                        mTextureView.setLayoutParams(new LayoutParams(SMALL_SIZE * 2, SMALL_SIZE));
                        mView.mColor = SimpleView.LARGE_COLOR;
                        mSurfaceView.mColor = SimpleSurfaceView.LARGE_COLOR;
                        mTextureView.mColor = SimpleTextureView.LARGE_COLOR;
                    } else {
                        mView.setLayoutParams(new LayoutParams(SMALL_SIZE, SMALL_SIZE));
                        mSurfaceView.setLayoutParams(new LayoutParams(SMALL_SIZE, SMALL_SIZE));
                        mTextureView.setLayoutParams(new LayoutParams(SMALL_SIZE, SMALL_SIZE));
                        mView.mColor = SimpleView.SMALL_COLOR;
                        mSurfaceView.mColor = SimpleSurfaceView.SMALL_COLOR;
                        mTextureView.mColor = SimpleTextureView.SMALL_COLOR;
                    }
                }
            });
            TransitionManager.go(newScene, transition);
        }
    });
}
Also used : LayoutParams(android.widget.LinearLayout.LayoutParams) ViewGroup(android.view.ViewGroup) ChangeBounds(android.transition.ChangeBounds) Scene(android.transition.Scene) SurfaceView(android.view.SurfaceView) TextureView(android.view.TextureView) View(android.view.View) Button(android.widget.Button) TransitionSet(android.transition.TransitionSet) Crossfade(android.transition.Crossfade)

Aggregations

ChangeBounds (android.transition.ChangeBounds)93 TransitionSet (android.transition.TransitionSet)71 View (android.view.View)54 Fade (android.transition.Fade)46 TransitionManager (android.transition.TransitionManager)28 Crossfade (android.transition.Crossfade)20 Recolor (android.transition.Recolor)20 ViewGroup (android.view.ViewGroup)17 Transition (android.transition.Transition)14 ChangeText (android.transition.ChangeText)12 TextView (android.widget.TextView)9 Scene (android.transition.Scene)8 Button (android.widget.Button)8 ImageView (android.widget.ImageView)7 AutoTransition (android.transition.AutoTransition)5 AdapterView (android.widget.AdapterView)5 LinearLayout (android.widget.LinearLayout)5 ChangeImageTransform (android.transition.ChangeImageTransform)4 ChangeTransform (android.transition.ChangeTransform)4 Rotate (android.transition.Rotate)4