Search in sources :

Example 76 with LayoutParams

use of android.widget.LinearLayout.LayoutParams in project android_frameworks_base by crdroidandroid.

the class RevealActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    final LinearLayout layout = new LinearLayout(this);
    layout.setOrientation(LinearLayout.VERTICAL);
    ProgressBar spinner = new ProgressBar(this, null, android.R.attr.progressBarStyleLarge);
    layout.addView(spinner, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
    View revealView = new MyView(this);
    layout.addView(revealView, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
    setContentView(layout);
    revealView.setOnClickListener(this);
}
Also used : LayoutParams(android.widget.LinearLayout.LayoutParams) ProgressBar(android.widget.ProgressBar) View(android.view.View) LinearLayout(android.widget.LinearLayout)

Example 77 with LayoutParams

use of android.widget.LinearLayout.LayoutParams in project android_frameworks_base by crdroidandroid.

the class HierarchicalMove method sendMessage.

public void sendMessage(View view) {
    TransitionManager.beginDelayedTransition(mSceneRoot, mTransition);
    int widthSpec = wide ? LayoutParams.WRAP_CONTENT : LayoutParams.MATCH_PARENT;
    LayoutParams params = new LayoutParams(widthSpec, LayoutParams.WRAP_CONTENT);
    for (int i = 0; i < buttons.length; ++i) {
        buttons[i].setLayoutParams(params);
    }
    wide = !wide;
}
Also used : LayoutParams(android.widget.LinearLayout.LayoutParams)

Example 78 with LayoutParams

use of android.widget.LinearLayout.LayoutParams in project android_frameworks_base by crdroidandroid.

the class DelayedTransition method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.two_buttons);
    final Button button1 = (Button) findViewById(R.id.button1);
    final Button button2 = (Button) findViewById(R.id.button2);
    final LinearLayout container = (LinearLayout) findViewById(R.id.container);
    button1.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            int buttonWidth = button1.getWidth();
            int containerWidth = container.getWidth();
            if (buttonWidth < containerWidth) {
                TransitionManager.beginDelayedTransition(container, null);
                button1.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
                TransitionManager.beginDelayedTransition(container, null);
                button2.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));
            } else {
                TransitionManager.beginDelayedTransition(container, null);
                button1.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
                TransitionManager.beginDelayedTransition(container, null);
                button2.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
            }
        }
    });
}
Also used : LayoutParams(android.widget.LinearLayout.LayoutParams) Button(android.widget.Button) View(android.view.View) LinearLayout(android.widget.LinearLayout)

Aggregations

LayoutParams (android.widget.LinearLayout.LayoutParams)78 LinearLayout (android.widget.LinearLayout)44 View (android.view.View)36 TextView (android.widget.TextView)24 ImageView (android.widget.ImageView)17 Button (android.widget.Button)16 ProgressBar (android.widget.ProgressBar)9 Message (android.os.Message)8 OnClickListener (android.view.View.OnClickListener)8 ScrollView (android.widget.ScrollView)7 Handler (android.os.Handler)6 ViewGroup (android.view.ViewGroup)6 WebView (android.webkit.WebView)6 HorizontalScrollView (android.widget.HorizontalScrollView)5 ChangeBounds (android.transition.ChangeBounds)4 Crossfade (android.transition.Crossfade)4 Scene (android.transition.Scene)4 TransitionSet (android.transition.TransitionSet)4 SurfaceView (android.view.SurfaceView)4 TextureView (android.view.TextureView)4