Search in sources :

Example 36 with LayoutParams

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

the class LinearLayoutTest method create.

public ViewGroup create(Context context) {
    LinearLayout container = new LinearLayout(context);
    container.setOrientation(LinearLayout.VERTICAL);
    for (int i = 0; i < VERTICAL_ALIGNMENTS.length; i++) {
        int va = VERTICAL_ALIGNMENTS[i];
        for (int j = 0; j < HORIZONTAL_ALIGNMENTS.length; j++) {
            int ha = HORIZONTAL_ALIGNMENTS[j];
            LayoutParams lp = new LayoutParams(WRAP_CONTENT, WRAP_CONTENT);
            lp.gravity = va | ha;
            View v = create(context, VERTICAL_NAMES[i] + "-" + HORIZONTAL_NAMES[j], 20);
            container.addView(v, lp);
        }
    }
    return container;
}
Also used : LayoutParams(android.widget.LinearLayout.LayoutParams) View(android.view.View) LinearLayout(android.widget.LinearLayout)

Example 37 with LayoutParams

use of android.widget.LinearLayout.LayoutParams in project platform_frameworks_base by android.

the class GlyphCacheActivity method createTextView.

private TextView createTextView() {
    TextView textview = new TextView(this);
    textview.setTextSize(6 + (int) (Math.random() * 5) * 10);
    textview.setTextColor(0xff << 24 | (int) (Math.random() * 255) << 16 | (int) (Math.random() * 255) << 8 | (int) (Math.random() * 255) << 16);
    textview.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
    int numChars = 5 + (int) (Math.random() * 10);
    mTotalChars += numChars;
    textview.setText(createString(numChars));
    return textview;
}
Also used : LayoutParams(android.widget.LinearLayout.LayoutParams) TextView(android.widget.TextView)

Example 38 with LayoutParams

use of android.widget.LinearLayout.LayoutParams in project platform_frameworks_base by android.

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 39 with LayoutParams

use of android.widget.LinearLayout.LayoutParams in project platform_frameworks_base by android.

the class CirclePropActivity 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));
    // For testing with a functor in the tree
    //        WebView wv = new WebView(this);
    //        wv.setWebViewClient(new WebViewClient());
    //        wv.setWebChromeClient(new WebChromeClient());
    //        wv.loadUrl("http://theverge.com");
    //        layout.addView(wv, new LayoutParams(LayoutParams.MATCH_PARENT, 100));
    layout.addView(new CircleView(this), new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
    setContentView(layout);
}
Also used : LayoutParams(android.widget.LinearLayout.LayoutParams) ProgressBar(android.widget.ProgressBar) LinearLayout(android.widget.LinearLayout)

Example 40 with LayoutParams

use of android.widget.LinearLayout.LayoutParams in project platform_frameworks_base by android.

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)

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