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);
}
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);
}
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;
}
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);
}
}
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);
}
Aggregations