Package android.widget

Examples of android.widget.LinearLayout


  {
    super.onCreate(saved);
   
    ScrollView scroll = new ScrollView(this);
   
    LinearLayout layout = new LinearLayout(this);
    layout.setOrientation(LinearLayout.VERTICAL);
   
    scroll.addView(layout);
   
    Button close = new Button(this);
    close.setText("Close");
    close.setOnClickListener(this);
    close.setGravity(Gravity.CENTER);
   
    TextView text = new TextView(this);
    text.setText("http://code.google.com/p/jfireeagle/wiki/Android");
    text.setAutoLinkMask(Linkify.ALL);
    text.setTextSize( (text.getTextSize() - 2.0f));
    text.setGravity(Gravity.CENTER);
   
    layout.addView(text);
    layout.addView(close);
   
    setContentView(scroll);
  }
View Full Code Here


    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);

        // Create a LinearLayout in which to add the ImageView
        mLinearLayout = new LinearLayout(this);

        // get the display metric (width and height)
        DisplayMetrics metrics = new DisplayMetrics();
        getWindowManager().getDefaultDisplay().getMetrics(metrics);
        final int width = metrics.widthPixels;
View Full Code Here

    } catch (IOException e) {
      Log.i("DisplayFriendActivity", "Couldn't fetch friends from the " +
          "container: " + e.getMessage());
    }

    LinearLayout linearLayout = new LinearLayout(this);
    linearLayout.setLayoutParams(new LinearLayout.LayoutParams(
        LinearLayout.LayoutParams.FILL_PARENT,
        LinearLayout.LayoutParams.FILL_PARENT));
    linearLayout.setOrientation(LinearLayout.VERTICAL);

    if (friends != null && friends.size() > 0) {
      FriendListView contactsView = new FriendListView(this);
      contactsView.setFriends(friends);
      contactsView.setVerticalScrollBarEnabled(true);
      contactsView.setLayoutParams(new ViewGroup.LayoutParams(
          ViewGroup.LayoutParams.FILL_PARENT, 300));
      linearLayout.addView(contactsView);
    } else {
      TextView textView = new TextView(this);
      textView.setText("No contacts found.");
      linearLayout.addView(textView);
    }

    final FriendListActivity activity = this;

    Button clearAuthButton = new Button(this);
    clearAuthButton.setText("Clear Auth");
    clearAuthButton.setOnClickListener(new View.OnClickListener() {
      public void onClick(View view) {
        clearSavedAuthentication();
      }
    });

    Button fetchFriendsButton = new Button(this);
    fetchFriendsButton.setText("Fetch Friends");
    fetchFriendsButton.setOnClickListener(new View.OnClickListener() {
      public void onClick(View view) {
        activity.setupClient();
      }
    });

    linearLayout.addView(fetchFriendsButton);
    linearLayout.addView(clearAuthButton);

    setContentView(linearLayout);
  }
View Full Code Here

TOP

Related Classes of android.widget.LinearLayout

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.