Search in sources :

Example 71 with ChangeBounds

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

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 72 with ChangeBounds

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

the class HierarchicalMove method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.hierarchical_move);
    View container = (View) findViewById(R.id.container);
    mSceneRoot = (ViewGroup) container.getParent();
    buttons[0] = (Button) findViewById(R.id.button0);
    buttons[1] = (Button) findViewById(R.id.button1);
    buttons[2] = (Button) findViewById(R.id.button2);
    buttons[3] = (Button) findViewById(R.id.button3);
    buttons[4] = (Button) findViewById(R.id.button4);
    buttons[5] = (Button) findViewById(R.id.button5);
    // Move button0, then buttons 1/2 together, then buttons 3/4/5 sequentially:
    // group (seq)
    //    Move 0
    //    group (seq)
    //       group (together)
    //          Move 1
    //          Move 2
    //       group (sequentially)
    //          Move 3
    //          Move 4/5
    TransitionSet rootTransition = new TransitionSet().setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
    // button0
    Transition move0 = new ChangeBounds();
    move0.addTarget(buttons[0]);
    // buttons 1/2/3/4/5
    TransitionSet group12345 = new TransitionSet().setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
    // buttons 1/2
    TransitionSet group12 = new TransitionSet().setOrdering(TransitionSet.ORDERING_TOGETHER);
    ChangeBounds changeBounds1 = new ChangeBounds();
    changeBounds1.addTarget(buttons[1]);
    ChangeBounds changeBounds2 = new ChangeBounds();
    changeBounds2.addTarget(buttons[2]);
    group12.addTransition(changeBounds1).addTransition(changeBounds2);
    TransitionSet group345 = new TransitionSet().setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
    ChangeBounds changeBounds3 = new ChangeBounds();
    changeBounds3.addTarget(buttons[3]);
    ChangeBounds changeBounds45 = new ChangeBounds();
    changeBounds45.addTarget(buttons[4]).addTarget(buttons[5]);
    group345.addTransition(changeBounds3).addTransition(changeBounds45);
    group12345.addTransition(move0).addTransition(group12).addTransition(group345);
    rootTransition.addTransition(group12345);
    rootTransition.setDuration(1000);
    mTransition = rootTransition;
}
Also used : TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) Transition(android.transition.Transition) View(android.view.View)

Example 73 with ChangeBounds

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

the class ScenesTestAutoTargets 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 74 with ChangeBounds

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

the class ClippingText method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.clipping_text_1);
    View container = (View) findViewById(R.id.container);
    mSceneRoot = (ViewGroup) container.getParent();
    mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.clipping_text_1, this);
    mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.clipping_text_2, this);
    mChanger = new TransitionSet().setOrdering(TransitionSet.ORDERING_TOGETHER);
    ChangeBounds changeBounds = new ChangeBounds();
    changeBounds.setResizeClip(true);
    mChanger.addTransition(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 75 with ChangeBounds

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

the class ContactsExpansion method addContact.

private void addContact(ViewGroup container, int dataIndex, int thumbnailID) {
    LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View contactItem = inflater.inflate(R.layout.contact_collapsed, container, false);
    ImageView thumbnailView = (ImageView) contactItem.findViewById(R.id.contact_picture);
    thumbnailView.setImageResource(thumbnailID);
    ((TextView) contactItem.findViewById(R.id.contact_name)).setText(contactsData[dataIndex++]);
    ((TextView) contactItem.findViewById(R.id.contact_street)).setText(contactsData[dataIndex++]);
    ((TextView) contactItem.findViewById(R.id.contact_city)).setText(contactsData[dataIndex++]);
    ((TextView) contactItem.findViewById(R.id.contact_phone)).setText(contactsData[dataIndex++]);
    ((TextView) contactItem.findViewById(R.id.contact_email)).setText(contactsData[dataIndex++]);
    container.addView(contactItem);
    final TransitionSet myTransition = new TransitionSet();
    myTransition.addTransition(new Fade(Fade.IN)).addTransition(new Rotate().addTarget(R.id.contact_arrow)).addTransition(new ChangeBounds()).addTransition(new Fade(Fade.OUT)).addTransition(new Crossfade().addTarget(R.id.contact_picture));
    final ToggleScene toggleScene = new ToggleScene(container, myTransition);
    contactItem.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            currentItem = v;
            toggleScene.changeToScene();
        }
    });
}
Also used : Rotate(android.transition.Rotate) TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) LayoutInflater(android.view.LayoutInflater) Crossfade(android.transition.Crossfade) TextView(android.widget.TextView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) Fade(android.transition.Fade)

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