Need Help with the android:weightSum and layout_weight attributes

by Business Talk » Thu, 26 Nov 2009 20:43:10 GMT


Sponsored Links
 I have a simple horizontal linear_layout  with bunch of image views in
it. the trick is that the views have different widths, relative to the
size of their parent (the linear layout). I set the layout's weightSum
to a 100 and the layout_weight to let's say 10 of one view and 15 of
the other, on so on. And it did not work. I also tired using float
values setting the weightSum to 1.0 and the layout_weight of the image
views to 0.2 and 0.3 and so on. But it didn't work either. I did
search this group for any references to the weightSum but found
nothing. Any ideas how to handle it?

--



Need Help with the android:weightSum and layout_weight attributes

by Romain Guy » Fri, 27 Nov 2009 01:41:51 GMT


 Hi,

What doesn't work exactly? What are you trying to do and what is the result?

On Thu, Nov 26, 2009 at 4:42 AM, Business Talk


>


Sponsored Links


Need Help with the android:weightSum and layout_weight attributes

by steelbytes » Fri, 27 Nov 2009 09:16:25 GMT


 I think you have to set the width of each item to 0px. then the
weighting will override this?  seems to work for me.

It's a shame that the docs are so spartan.




> >



Need Help with the android:weightSum and layout_weight attributes

by Romain Guy » Fri, 27 Nov 2009 09:39:06 GMT


 Using 0px is mostly an optimization. It is not required.




I think you have to set the width of each item to 0px. then the
weighting will override this?  seems to work for me.

It's a shame that the docs are so spartan.



doesn't work exactly? W...



linear_layout  with bunch of ...

to provide private suppo...
text -

--



Need Help with the android:weightSum and layout_weight attributes

by Business Talk » Fri, 27 Nov 2009 20:56:13 GMT


 Thanks to all, it worked. You can only guess how much time you saved
me. Good Luck






>



Other Threads

1. heeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeelp

hi all

i am currently working on an application that need to add, edit , insert and
update events( google calendar) ,i got as far as authenticating and getting
the existing events  , know i am trying to add an event :

according to google appi i should use http post method , along with the
authentication token , and media type (application/atom+xml) as headers +
event entry as a content.
/*adding my content and headers*/

entry as a content.

/* my content*/

new Thread() {

                        // String b = builder.toString();

                     @Override

                     public void run() {

                        Request req = new Request();

                        final StringBuilder builder = new StringBuilder();

                                                 builder.append("<entry
xmlns='http://www.w3.org/2005/Atom' xmlns:gd='
http://schemas.google.com/g/2005'>");

                                                 builder.append("<category
scheme='http://schemas.google.com/g/2005#kind' term='
http://schemas.google.com/g/2005#event'></category>");

                                                 builder.append("<title
type='text'>Tennis with Beth</title>");

                                                 builder.append(" <content
type='text'>Meet for a quick lesson.</content><gd:transparency value='
http://schemas.google.com/g/2005#event.opaque'> </gd:transparency>");

                                                 builder.append("
<gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'>
</gd:eventStatus>");

                                                 builder.append(" <gd:where
valueString='Rolling Lawn Courts'></gd:where>");

                                                 builder.append(" <gd:when
startTime='2010-03-17T15:00:00.000Z'
endTime='2010-04-17T17:00:00.000Z'></gd:when></entry>");



                                    // do the HTTP dance in a separate
thread (the responseHandler will fire when complete)



                                                String b =
builder.toString();

                     //  HashMap<String ,String> headers = new
HashMap<String,String>();

                       HashMap<String ,String> headers = new
HashMap<String,String>();

                       headers.put(Constant.GTOKEN_AUTH_HEADER_NAME ,
Constant.GTOKEN_AUTH_HEADER_VALUE_PREFIX+mTokenValue);



                        try {

//posting to google server
- Show quoted text -
- Show quoted text -
03-02 22:10:45.937: DEBUG/ReminderAppVersion_1.1(3636): <?xml version='1.0'
encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom'
xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gCal='
http://schemas.google.com/gCal/2005' xmlns:gd='
http://schemas.google.com/g/2005'><id>
http://www.google.com/calendar/feeds/default/private/full</id><updated>2010-03-02T21:04:22.000Z</updated><category
scheme='http://schemas.google.com/g/2005#kind' term='
http://schemas.google.com/g/2005#event'/><title type='text'>
faithfullgh...@gmail.com</title><subtitle type='text'>
faithfullgh...@gmail.com</subtitle><link rel='alternate' type='text/html'
href='http://www.google.com/calendar/embed?src=faithfullgh...@gmail.com'/><link
rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml'
href='http://www.google.com/calendar/feeds/default/private/full'/><link
rel='http://schemas.google.com/g/2005#post' type='application/atom+xml'
href='http://www.google.com/calendar/feeds/default/private/full'/><link
rel='http://schemas.google.com/g/2005#batch' type='application/atom+xml'
href='http://www.google.com/calendar/feeds/default/private/full/batch'/><link
rel='self' type='application/atom+xml' href='
http://www.google.com/calendar/feeds/default/private/full?max-results=25'/><author><name>alfadel
mohamed</name><email>faithfullgh...@gmail.com</email></author><generator
version='1.0' uri='http://www.google.com/calendar'>Google
Calendar</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><gCal:timezone
value='Europe/Dublin'/><gCal:timesCleaned value='2'/><entry><id>
http://www.google.com/calendar/feeds/default/private/full/qarpmjs6qdgjpplhbls3o4kv7k</id><published>2010-02-28T22:23:05.000Z</published><updated>2010-02-28T22:23:05.000Z</updated><category
scheme='http://schemas.google.com/g/2005#kind' term='
http://schemas.google.com/g/2005#event'/><title type='text'>my
event</title><content type='text'/><link rel='alternate' type='text/html'
href='
http://www.google.com/calendar/event?eid=cWFycG1qczZxZGdqcHBsaGJsczNvNGt2N2sgZmFpdGhmdWxsZ2hvc3RAbQ'
title='alternate'/><link rel='self' type='application/atom+xml' href='
http://www.google.com/calendar/feeds/default/private/full/qarpmjs6qdgjpplhbls3o4kv7k'/><link
rel='edit' type='application/atom+xml' href='
http://www.google.com/calendar/feeds/default/private/full/qarpmjs6qdgjpplhbls3o4kv7k/63403078985'/><author><name>alfadel
mohamed</name><email>faithfullgh...@gmail.com</email></author><gd:comments><gd:feedLink
href='
http://www.google.com/calendar/feeds/default/private/full/qarpmjs6qdgjpplhbls3o4kv7k/comments'/></gd:comments><gd:eventStatus
value='http://schemas.google.com/g/2005#event.confirmed'/><gd:where
valueString=''/><gd:who email='faithfullgh...@gmail.com' rel='
http://schemas.google.com/g/2005#event.organizer' valueString='alfadel
mohamed'/><gd:when endTime='2010-03-01T16:30:00.000Z'
startTime='2010-03-01T15:30:00.000Z'/><gd:transparency value='
http://schemas.google.com/g/2005#event.opaque'/><gd:visibility value='
http://schemas.google.com/g/2005#event.default'/><gCal:anyoneCanAddSelf
value='false'/><gCal:guestsCanInviteOthers
value='true'/><gCal:guestsCanModify value='false'/><gCal:guestsCanSeeGuests
value='true'/><gCal:sequence value='0'/><gCal:uid value='
qarpmjs6qdgjpplhbls3o4k...@google.com'/></entry></feed>

so i am wondering what is wrong here , any help will be appreciated.

/==========================google Api+++++++++++++++++++++++++++++++++++
Creating single-occurrence events

<entry xmlns='http://www.w3.org/2005/Atom'
    xmlns:gd='http://schemas.google.com/g/2005'>
  <category scheme='http://schemas.google.com/g/2005#kind'
    term='http://schemas.google.com/g/2005#event'></category>
  <title type='text'>Tennis with Beth</title>
  <content type='text'>Meet for a quick lesson.</content>
  <gd:transparency
    value='http://schemas.google.com/g/2005#event.opaque'>
  </gd:transparency>
  <gd:eventStatus
    value='http://schemas.google.com/g/2005#event.confirmed'>
  </gd:eventStatus>
  <gd:where valueString='Rolling Lawn Courts'></gd:where>
  <gd:when startTime='2006-04-17T15:00:00.000Z'
    endTime='2006-04-17T17:00:00.000Z'></gd:when>
</entry>

Note that this entry does not contain the standard APP <author> tag. The
server will insert author information based on the user that submits the
request (i.e. the user whose authentication token accompanies the request).

To post an entry, send the following HTTP request to Calendar, using a
special "default" URL (and an Authorization header; see the section on
authentication<http://code.google.com/apis/calendar/data/2.0/developers_guide_protocol.html#Auth>
above).
Calendar automatically redirects the default URL to the URL of the
read/write private feed of the calendar belonging to the authenticated user.
(Note that you don't have to use the default URL to send a POST request to
Calendar; you can specify the user ID instead of "default" if you prefer.
For more information, see the Calendar feed
types<http://code.google.com/apis/calendar/data/2.0/reference.html#Feeds>
 reference.)

POST http://www.google.com/calendar/feeds/default/private/full

The content that you send with the POST request should be the <entry> element
you created above, using the application/atom+xml content type.

When you send that second POST request (or the first one in cases where
there's no redirect), Calendar creates a calendar event, then returns an
HTTP 201 CREATED status code, along with a copy of the new event in the form
of an <entry> element. The returned entry is similar to the one you sent,
but the returned one contains various elements added by Calendar, such as
an <id> element.

-- 

2. listview with customview background issuew while scrolling listview

Thanks a lot that did the trick.






> 

3. caching listview

4. Cara mindahin Contact/Phoneboo

5. listview with customview background issuew while scrolling listview

6. selecting language from within the app rather than by locale of the system settings

7. Resources with multiple roots