Search in sources :

Example 76 with ChangeBounds

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

the class Demo2 method sendMessage.

public void sendMessage(View view) {
    if (mFirstTime) {
        mFirstTime = false;
        //        mResultsScreen = new Scene(this, mSceneRoot, R.layout.results_screen);
        try {
            mSearchScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this);
            mResultsScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this);
        } catch (Exception e) {
            System.out.println("Problem loading scene resource: " + e);
        }
        TransitionSet transition = new TransitionSet();
        transition.addTransition(new Fade().addTarget(R.id.resultsText).addTarget(R.id.resultsList)).addTransition(new ChangeBounds().addTarget(R.id.searchContainer)).addTransition(new Recolor().addTarget(R.id.container));
        mTransitionManager = new TransitionManager();
        mTransitionManager.setTransition(mSearchScreen, transition);
        mTransitionManager.setTransition(mResultsScreen, transition);
    }
    if (mCurrentScene == mResultsScreen) {
        mTransitionManager.transitionTo(mSearchScreen);
        mCurrentScene = mSearchScreen;
    } else {
        mTransitionManager.transitionTo(mResultsScreen);
        mCurrentScene = mResultsScreen;
    }
}
Also used : TransitionManager(android.transition.TransitionManager) TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) Fade(android.transition.Fade) Recolor(android.transition.Recolor)

Example 77 with ChangeBounds

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

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

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

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

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

the class CrossFadeDemo method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.crossfade);
    View container = (View) findViewById(R.id.container);
    mSceneRoot = (ViewGroup) container.getParent();
    mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.crossfade, this);
    mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.crossfade_1, this);
    Crossfade crossfade = new Crossfade();
    crossfade.setFadeBehavior(Crossfade.FADE_BEHAVIOR_CROSSFADE);
    crossfade.setResizeBehavior(Crossfade.RESIZE_BEHAVIOR_NONE);
    crossfade.addTarget(R.id.textview).addTarget(R.id.textview1).addTarget(R.id.textview2);
    mTransitionManager = new TransitionManager();
    TransitionSet moveCrossFade = new TransitionSet();
    moveCrossFade.addTransition(crossfade).addTransition(new ChangeBounds());
    mTransitionManager.setTransition(mScene1, moveCrossFade);
    mTransitionManager.setTransition(mScene2, moveCrossFade);
    mCurrentScene = 1;
}
Also used : TransitionManager(android.transition.TransitionManager) TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) Crossfade(android.transition.Crossfade) View(android.view.View)

Example 80 with ChangeBounds

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

the class CrossfadeImage method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.crossfade_image);
    ViewGroup container = (ViewGroup) findViewById(R.id.container);
    mSceneRoot = container;
    mImageView = (ImageView) findViewById(R.id.contact_picture);
    mImageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
    Crossfade mCrossfade = new Crossfade();
    mCrossfade.addTarget(R.id.contact_picture);
    TransitionSet group = new TransitionSet();
    group.setDuration(1500);
    group.addTransition(mCrossfade).addTransition(new ChangeBounds());
    mTransition = group;
}
Also used : TransitionSet(android.transition.TransitionSet) ViewGroup(android.view.ViewGroup) ChangeBounds(android.transition.ChangeBounds) 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