Android custom xml widget

Posted by DrogoNevets on Stack Overflow See other posts from Stack Overflow or by DrogoNevets
Published on 2010-04-14T14:48:16Z Indexed on 2010/04/14 21:53 UTC
Read the original article Hit count: 384

Filed under:
|

I have an XML file in my layout folder that has how i want my custom widget/view (not sure what correct terminology is here).

but how do i make it so that i can programatically, add one or more to an activity

the xml file is as follows

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:id="@+id/viewLog">
  <TextView android:id="@+id/viewLogClimbName"
            android:layout_width="fill_parent"
            android:singleLine="true"
            android:ellipsize="end"
            android:gravity="left"
  />
  <LinearLayout android:orientation="horizontal"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1">
    <LinearLayout android:orientation="vertical"
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content">
      <TextView android:id="@+id/viewLogDate"
                android:layout_width="fill_parent"
                android:singleLine="true"
                android:ellipsize="end"
                android:gravity="left"
      />
      <TextView android:id="@+id/viewLogStyle"
                android:layout_width="fill_parent"
                android:singleLine="true"
                android:ellipsize="end"
                android:gravity="left"
      />
    </LinearLayout>
    <TextView android:id="@+id/viewLogDetails"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:ellipsize="end"
              android:gravity="left"
              android:layout_weight="1"
    />
  </LinearLayout>
</LinearLayout>

I have looked at the android how-to and dont really understand what its getting at

© Stack Overflow or respective owner

Related posts about android

Related posts about widgets