Is there any type of "spacer" type widget?

by Danny » Sat, 14 Jun 2008 03:45:10 GMT


Sponsored Links
 It would be nice to have some sort of spacer widget rather than having
to continuously play with marginBottom or padding attributes.  Just a
quick and dirty way of adding a gap to signify something between say,
two EditText's in vertical LinearLayout.

I guess I could make a custom view, but anyone else have a better idea
than that or padding/margin settings?

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



Is there any type of "spacer" type widget?

by Romain Guy » Sat, 14 Jun 2008 03:50:24 GMT


 You can just use a View and give it the appropriate layout
width/height. For instance:

<View layout_width="2dip" layout_height="wrap_content" />






-- 
Romain Guy
www.curious-creature.org

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


Sponsored Links


Is there any type of "spacer" type widget?

by Danny » Sat, 14 Jun 2008 04:08:39 GMT


 great idea, thought of using the parent class as a widget never
occurred to me.




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



Is there any type of "spacer" type widget?

by Romain Guy » Sat, 14 Jun 2008 04:13:21 GMT


 You can see a few uses of View in the ApiDemos, for instance to create
a horizontal ruler in the TableLayout demos.








-- 
Romain Guy
www.curious-creature.org

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



Other Threads

1. SmsMananger.getDefault().sendTextMessage stopped working.

public class Foo extends Broadcast Receiver {
  public void onReceive(Context context, Intent intent) {
    if(intent.getAction().equals
("android.provider.Telephony.SMS_RECEIVED")) {
      SmsManager.getDefault().sendTextMessage("5556", null, "foobar",
null, null);
    }
  }
}

Start the app from eclipse, which brings up emulator on port 5554,
start another emulator in commandline against another avd (this starts
the emulator on port 5556 which is hardcoded in the code snippet).  In
DDMS view, send 5554 a sms text, upon receiving the above code snippet
runs without error.  However, 5556 doesn't receive any sms.

This code worked fine in sdk1.1 now stopped functioning in sdk 1.5.

Zhao
--~--~---------~--~----~------------~-------~--~----~

2. Throttling rate of messages to handler

My app makes use of threads and uses handlers to send messages to the gui.
The thread maintain a connection to a server and receive messages from it.

The problem I'm having is that sometimes messages arrive really fast, and
although the app doesn't anr, the UI freezes as it tries to cope with the
fast influx of messages in the queue.

The rate at which messages arrive from the server is beyond my control, but
I need to find a way to throttle to make sure the UI stays responsive. I've
read about people having issues in games where touch events have a negative
effect on fps and they've used thread.sleep to throttle. Although similar to
my issue, I don't think it would work for me because both the UI and
background threads as just as important here.

Does anyone have any other ideas for solving this? Thanks.

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

3. Errors in VideoPlayer

4. How to enable logs for Android Applications like camera

5. How to enable logs for Android Applications like camera

6. Loading bitmap: java.lang.OutOfMemoryError: bitmap size

7. yet another WIFI question