How to implement onMeasure() for my custom widget

by silverburgh » Wed, 17 Feb 2010 02:47:34 GMT


Sponsored Links
 Hi,

I am trying to implement my own custom widget, but I am not sure how
to implement the onMeasure() for my custom Widget.

protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
...
}

I want to put my custom widget in a linear layout, so that myWidget's
width can fill up the rest of the linear layout after the android
widget on the same LinearLayout :

<LinearLayout xmlns:android=" http://schemas.android.com/apk/res/android" ;
        xmlns:app=" http://schemas.android.com/apk/res/com.tmobile.socialhub" ;
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
    <Button android:id="@+id/buttonA"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/buttonA" />

    <com.mycompany.MyWidget
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
           android:layout_weight="1"
            app:text="Red some more text and more text etc etc"/>

  <ImageView android:id="@+id/icon"
            android:layout_width="wrap_content"
                android:layout_height="fill_parent"
                android:src="@drawable/icon" />

</LinearLayout>

--



Other Threads

1. AudioRecord APIs

Hi,

I have two questions

1. Has anyone been able to use an AudioRecord properly WITHOUT the
"buffer overflow" messages?

2. What is the audio latency parameter?

Cheers,
Earlence



--~--~---------~--~----~------------~-------~--~----~

2. How to license Google Closed Source Apps for device

Where can I find information to license Google closed source apps for
Android devices? These apps include

* Gmail
* Google Map
* Google Talk
* Android Market


--~--~---------~--~----~------------~-------~--~----~

3. Null pointer exception while receiving at Broadcast receiver

4. DISABLE_DEXPREOPT ?

5. Have GET_INTENT_FILTERS been supported?

6. Pixelated Image

7. Image Pixelation (PNG)