use of android.transition.ChangeBounds in project platform_frameworks_base by android.
the class Demo3 method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.search_screen);
View container = (View) findViewById(R.id.container);
mSceneRoot = (ViewGroup) container.getParent();
mSearchScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this);
mResultsScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.results_screen, this);
TransitionSet transition = new TransitionSet();
transition.addTransition(new Fade()).addTransition(new ChangeBounds()).addTransition(new Recolor());
mTransitionManager = new TransitionManager();
mTransitionManager.setTransition(mSearchScreen, transition);
mTransitionManager.setTransition(mResultsScreen, transition);
}
use of android.transition.ChangeBounds in project platform_frameworks_base by android.
the class Demo4 method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.search_screen);
View container = (View) findViewById(R.id.container);
mSceneRoot = (ViewGroup) container.getParent();
mSearchScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this);
mResultsScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.results_screen, this);
TransitionSet transitionToResults = new TransitionSet();
Fade fade = new Fade();
fade.addTarget(R.id.resultsText).addTarget(R.id.resultsList);
fade.setStartDelay(300);
fade.setDuration(1000);
transitionToResults.addTransition(fade).addTransition(new ChangeBounds().addTarget(R.id.searchContainer)).addTransition(new Recolor().addTarget(R.id.container));
TransitionSet transitionToSearch = new TransitionSet();
transitionToSearch.addTransition(fade).addTransition(new ChangeBounds().addTarget(R.id.searchContainer)).addTransition(new Recolor().addTarget(R.id.container));
mTransitionManager = new TransitionManager();
mTransitionManager.setTransition(mSearchScreen, transitionToSearch);
mTransitionManager.setTransition(mResultsScreen, transitionToResults);
}
use of android.transition.ChangeBounds in project platform_frameworks_base by android.
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;
}
use of android.transition.ChangeBounds in project Material-Animations by lgvalle.
the class AnimationsActivity2 method setupLayout.
private void setupLayout() {
final ViewGroup activityRoot = (ViewGroup) findViewById(R.id.buttons_group);
ViewGroup sceneRoot = (ViewGroup) findViewById(R.id.scene_root);
scene0 = Scene.getSceneForLayout(sceneRoot, R.layout.activity_animations_scene0, this);
scene0.setEnterAction(new Runnable() {
@Override
public void run() {
for (int i = 0; i < viewsToAnimate.size(); i++) {
View child = viewsToAnimate.get(i);
child.animate().setStartDelay(i * DELAY).scaleX(1).scaleY(1);
}
}
});
scene0.setExitAction(new Runnable() {
@Override
public void run() {
TransitionManager.beginDelayedTransition(activityRoot);
View title = scene0.getSceneRoot().findViewById(R.id.scene0_title);
title.setScaleX(0);
title.setScaleY(0);
}
});
scene1 = Scene.getSceneForLayout(sceneRoot, R.layout.activity_animations_scene1, this);
scene2 = Scene.getSceneForLayout(sceneRoot, R.layout.activity_animations_scene2, this);
scene3 = Scene.getSceneForLayout(sceneRoot, R.layout.activity_animations_scene3, this);
scene4 = Scene.getSceneForLayout(sceneRoot, R.layout.activity_animations_scene4, this);
View button1 = findViewById(R.id.sample3_button1);
button1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
TransitionManager.go(scene1, new ChangeBounds());
}
});
View button2 = findViewById(R.id.sample3_button2);
button2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
TransitionManager.go(scene2, TransitionInflater.from(AnimationsActivity2.this).inflateTransition(R.transition.slide_and_changebounds));
}
});
View button3 = findViewById(R.id.sample3_button3);
button3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
TransitionManager.go(scene3, TransitionInflater.from(AnimationsActivity2.this).inflateTransition(R.transition.slide_and_changebounds_sequential));
}
});
View button4 = findViewById(R.id.sample3_button4);
button4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
TransitionManager.go(scene4, TransitionInflater.from(AnimationsActivity2.this).inflateTransition(R.transition.slide_and_changebounds_sequential_with_interpolators));
}
});
viewsToAnimate.add(button1);
viewsToAnimate.add(button2);
viewsToAnimate.add(button3);
viewsToAnimate.add(button4);
}
use of android.transition.ChangeBounds in project fresco by facebook.
the class DraweeTransition method createTransitionSet.
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;
}
Aggregations