FileDocCategorySizeDatePackage
InstanceTargets.javaAPI DocAndroid 5.1 API2205Thu Mar 12 22:22:44 GMT 2015com.android.transitiontests

InstanceTargets

public class InstanceTargets extends android.app.Activity

Fields Summary
android.view.ViewGroup
mSceneRoot
static int
mCurrentScene
Constructors Summary
Methods Summary
public voidonCreate(android.os.Bundle savedInstanceState)

        super.onCreate(savedInstanceState);
        setContentView(R.layout.instance_targets);

        View container = (View) findViewById(R.id.container);
        mSceneRoot = (ViewGroup) container;
    
public voidsendMessage(android.view.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);
        }