Search in sources :

Example 1 with ChangeText

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

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 2 with ChangeText

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

the class CrossfadeMultiple method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.crossfade_multiple);
    ViewGroup container = (ViewGroup) findViewById(R.id.container);
    mSceneRoot = container;
    mButton = (Button) findViewById(R.id.button);
    mImageView = (ImageView) findViewById(R.id.imageview);
    mTextView = (TextView) findViewById(R.id.textview);
    mCrossfade = new Crossfade();
    mCrossfade.addTarget(R.id.button).addTarget(R.id.textview).addTarget(R.id.imageview);
    mCrossfadeGroup = new TransitionSet();
    mCrossfadeGroup.setDuration(300);
    mCrossfadeGroup.addTransition(mCrossfade).addTransition(new ChangeBounds());
    mTransition = mCrossfadeGroup;
    mInOutGroup = new TransitionSet();
    Crossfade inOut = new Crossfade();
    inOut.setDuration(300);
    inOut.setFadeBehavior(Crossfade.FADE_BEHAVIOR_OUT_IN);
    ChangeBounds changeBounds = new ChangeBounds();
    changeBounds.setStartDelay(150);
    changeBounds.setDuration(0);
    mInOutGroup.addTransition(inOut).addTransition(changeBounds);
    mTextChangeGroup1 = new TransitionSet();
    ChangeText changeTextInOut = new ChangeText();
    changeTextInOut.setChangeBehavior(ChangeText.CHANGE_BEHAVIOR_OUT_IN);
    mTextChangeGroup1.addTransition(changeTextInOut).addTransition(new ChangeBounds());
    mTextChangeGroup2 = new TransitionSet();
    mTextChangeGroup2.setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
    ChangeText changeTextOut = new ChangeText();
    changeTextOut.setChangeBehavior(ChangeText.CHANGE_BEHAVIOR_OUT);
    mTextChangeGroup2.addTransition(changeTextOut).addTransition(new ChangeBounds());
    mTextChangeGroup3 = new TransitionSet();
    mTextChangeGroup3.setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
    ChangeText changeTextIn = new ChangeText();
    changeTextIn.setChangeBehavior(ChangeText.CHANGE_BEHAVIOR_IN);
    mTextChangeGroup3.addTransition(changeTextIn).addTransition(new ChangeBounds());
}
Also used : ChangeText(android.transition.ChangeText) TransitionSet(android.transition.TransitionSet) ViewGroup(android.view.ViewGroup) ChangeBounds(android.transition.ChangeBounds) Crossfade(android.transition.Crossfade)

Example 3 with ChangeText

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

the class CrossfadeMultiple method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.crossfade_multiple);
    ViewGroup container = (ViewGroup) findViewById(R.id.container);
    mSceneRoot = container;
    mButton = (Button) findViewById(R.id.button);
    mImageView = (ImageView) findViewById(R.id.imageview);
    mTextView = (TextView) findViewById(R.id.textview);
    mCrossfade = new Crossfade();
    mCrossfade.addTarget(R.id.button).addTarget(R.id.textview).addTarget(R.id.imageview);
    mCrossfadeGroup = new TransitionSet();
    mCrossfadeGroup.setDuration(300);
    mCrossfadeGroup.addTransition(mCrossfade).addTransition(new ChangeBounds());
    mTransition = mCrossfadeGroup;
    mInOutGroup = new TransitionSet();
    Crossfade inOut = new Crossfade();
    inOut.setDuration(300);
    inOut.setFadeBehavior(Crossfade.FADE_BEHAVIOR_OUT_IN);
    ChangeBounds changeBounds = new ChangeBounds();
    changeBounds.setStartDelay(150);
    changeBounds.setDuration(0);
    mInOutGroup.addTransition(inOut).addTransition(changeBounds);
    mTextChangeGroup1 = new TransitionSet();
    ChangeText changeTextInOut = new ChangeText();
    changeTextInOut.setChangeBehavior(ChangeText.CHANGE_BEHAVIOR_OUT_IN);
    mTextChangeGroup1.addTransition(changeTextInOut).addTransition(new ChangeBounds());
    mTextChangeGroup2 = new TransitionSet();
    mTextChangeGroup2.setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
    ChangeText changeTextOut = new ChangeText();
    changeTextOut.setChangeBehavior(ChangeText.CHANGE_BEHAVIOR_OUT);
    mTextChangeGroup2.addTransition(changeTextOut).addTransition(new ChangeBounds());
    mTextChangeGroup3 = new TransitionSet();
    mTextChangeGroup3.setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
    ChangeText changeTextIn = new ChangeText();
    changeTextIn.setChangeBehavior(ChangeText.CHANGE_BEHAVIOR_IN);
    mTextChangeGroup3.addTransition(changeTextIn).addTransition(new ChangeBounds());
}
Also used : ChangeText(android.transition.ChangeText) TransitionSet(android.transition.TransitionSet) ViewGroup(android.view.ViewGroup) ChangeBounds(android.transition.ChangeBounds) Crossfade(android.transition.Crossfade)

Example 4 with ChangeText

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

the class CrossfadeMultiple method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.crossfade_multiple);
    ViewGroup container = (ViewGroup) findViewById(R.id.container);
    mSceneRoot = container;
    mButton = (Button) findViewById(R.id.button);
    mImageView = (ImageView) findViewById(R.id.imageview);
    mTextView = (TextView) findViewById(R.id.textview);
    mCrossfade = new Crossfade();
    mCrossfade.addTarget(R.id.button).addTarget(R.id.textview).addTarget(R.id.imageview);
    mCrossfadeGroup = new TransitionSet();
    mCrossfadeGroup.setDuration(300);
    mCrossfadeGroup.addTransition(mCrossfade).addTransition(new ChangeBounds());
    mTransition = mCrossfadeGroup;
    mInOutGroup = new TransitionSet();
    Crossfade inOut = new Crossfade();
    inOut.setDuration(300);
    inOut.setFadeBehavior(Crossfade.FADE_BEHAVIOR_OUT_IN);
    ChangeBounds changeBounds = new ChangeBounds();
    changeBounds.setStartDelay(150);
    changeBounds.setDuration(0);
    mInOutGroup.addTransition(inOut).addTransition(changeBounds);
    mTextChangeGroup1 = new TransitionSet();
    ChangeText changeTextInOut = new ChangeText();
    changeTextInOut.setChangeBehavior(ChangeText.CHANGE_BEHAVIOR_OUT_IN);
    mTextChangeGroup1.addTransition(changeTextInOut).addTransition(new ChangeBounds());
    mTextChangeGroup2 = new TransitionSet();
    mTextChangeGroup2.setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
    ChangeText changeTextOut = new ChangeText();
    changeTextOut.setChangeBehavior(ChangeText.CHANGE_BEHAVIOR_OUT);
    mTextChangeGroup2.addTransition(changeTextOut).addTransition(new ChangeBounds());
    mTextChangeGroup3 = new TransitionSet();
    mTextChangeGroup3.setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
    ChangeText changeTextIn = new ChangeText();
    changeTextIn.setChangeBehavior(ChangeText.CHANGE_BEHAVIOR_IN);
    mTextChangeGroup3.addTransition(changeTextIn).addTransition(new ChangeBounds());
}
Also used : ChangeText(android.transition.ChangeText) TransitionSet(android.transition.TransitionSet) ViewGroup(android.view.ViewGroup) ChangeBounds(android.transition.ChangeBounds) Crossfade(android.transition.Crossfade)

Example 5 with ChangeText

use of android.transition.ChangeText 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)

Aggregations

ChangeBounds (android.transition.ChangeBounds)12 ChangeText (android.transition.ChangeText)12 TransitionSet (android.transition.TransitionSet)12 View (android.view.View)8 Crossfade (android.transition.Crossfade)4 ViewGroup (android.view.ViewGroup)4