Search in sources :

Example 46 with ChangeBounds

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

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);
}
Also used : TransitionManager(android.transition.TransitionManager) TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) View(android.view.View) Fade(android.transition.Fade) Recolor(android.transition.Recolor)

Example 47 with ChangeBounds

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

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);
}
Also used : TransitionManager(android.transition.TransitionManager) TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) View(android.view.View) Fade(android.transition.Fade) Recolor(android.transition.Recolor)

Example 48 with ChangeBounds

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

the class ChangingText method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.changing_text_1);
    View container = findViewById(R.id.container);
    mSceneRoot = (ViewGroup) container.getParent();
    mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.changing_text_1, this);
    mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.changing_text_2, this);
    mChanger = new TransitionSet().setOrdering(TransitionSet.ORDERING_TOGETHER);
    mChanger.addTransition(new ChangeBounds()).addTransition(new ChangeText());
    mCurrentScene = mScene1;
}
Also used : ChangeText(android.transition.ChangeText) TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) View(android.view.View)

Example 49 with ChangeBounds

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

the class InstanceTargets method sendMessage.

public void sendMessage(final View view) {
    TransitionManager.beginDelayedTransition(mSceneRoot, new ChangeBounds().addTarget(view));
    for (int i = 0; i < mSceneRoot.getChildCount(); ++i) {
        Button button = (Button) mSceneRoot.getChildAt(i);
        LayoutParams params = (LayoutParams) button.getLayoutParams();
        int[] rules = params.getRules();
        if (rules[ALIGN_PARENT_RIGHT] != 0) {
            params.removeRule(ALIGN_PARENT_RIGHT);
            params.addRule(ALIGN_PARENT_LEFT);
        } else {
            params.removeRule(ALIGN_PARENT_LEFT);
            params.addRule(ALIGN_PARENT_RIGHT);
        }
        button.setLayoutParams(params);
    }
}
Also used : LayoutParams(android.widget.RelativeLayout.LayoutParams) Button(android.widget.Button) ChangeBounds(android.transition.ChangeBounds)

Example 50 with ChangeBounds

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

the class InterruptionTest method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.interruption);
    ViewGroup sceneRoot = (ViewGroup) findViewById(R.id.sceneRoot);
    mScene1 = Scene.getSceneForLayout(sceneRoot, R.layout.interruption_inner_1, this);
    mScene2 = Scene.getSceneForLayout(sceneRoot, R.layout.interruption_inner_2, this);
    mScene3 = Scene.getSceneForLayout(sceneRoot, R.layout.interruption_inner_3, this);
    mScene4 = Scene.getSceneForLayout(sceneRoot, R.layout.interruption_inner_4, this);
    mScene1RB = (RadioButton) findViewById(R.id.scene1RB);
    mScene2RB = (RadioButton) findViewById(R.id.scene2RB);
    mScene3RB = (RadioButton) findViewById(R.id.scene3RB);
    mScene4RB = (RadioButton) findViewById(R.id.scene4RB);
    ChangeBounds changeBounds1 = new ChangeBounds();
    changeBounds1.addTarget(R.id.button);
    ChangeBounds changeBounds2 = new ChangeBounds();
    changeBounds2.addTarget(R.id.button1);
    mSequencedMove.addTransition(changeBounds1).addTransition(changeBounds2);
    mSequencedMove.setDuration(1000);
}
Also used : ViewGroup(android.view.ViewGroup) ChangeBounds(android.transition.ChangeBounds)

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