Scaling objects within an AbsoluteLayout

by Pachu » Thu, 15 Jan 2009 00:25:41 GMT


Sponsored Links
 Hello, I am currently using an AbsoluteLayout in order to position
things as they would be on the pc based on centimeters, and converting
that to its pixel value. My question is, how to go about scaling the
layout/entire view so that all of the content is visible. AKA
essentially a zoom feature like in the webkit browser.

Thanks!

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



Scaling objects within an AbsoluteLayout

by Pachu » Fri, 16 Jan 2009 03:36:08 GMT


 Okay, I got a working version of scaling the view but there is one
major problem.
Let me start by describing the situation.

The top level view is a ScrollView.
This ScrollView contains an AbsoluteLayout.
The AbsoluteLayout contains text/image widgets that go beyond the
bounds of the display.

Now interestingly when I get the width/height of the layout, the full
height is returned properly,
however the width returned is the same as the display width. When I
get the ScrollView's width/height I get the screen size values which
is expected.

Is there any particular reason why the AbsoluteLayout will only return
the screen width but returns the proper height?

This is the only reason my horizontal scrolling/scrollbars and scaling
behave erratically.

Thanks,
Pachu.
--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Scaling objects within an AbsoluteLayout

by Romain Guy » Fri, 16 Jan 2009 03:39:45 GMT


 This is because ScrollView does not support horizontal scrolling.






-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

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



Scaling objects within an AbsoluteLayout

by Pachu » Fri, 16 Jan 2009 03:54:18 GMT


 Right, but shouldn't the AbsoluteLayout still return its own full
width?




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



Scaling objects within an AbsoluteLayout

by Romain Guy » Fri, 16 Jan 2009 04:00:17 GMT


 No because the ScrollView is responsible for the layout of
AbsoluteLayout. That means the width of AbsoluteLayout is decided by
ScrollView.








-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

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



Scaling objects within an AbsoluteLayout

by Pachu » Fri, 16 Jan 2009 04:13:11 GMT


 Ah, I see, so the only possibility is to rewrite the ScrollView class?
I was hoping there would be a quick solution, because the
AbsoluteLayout
still seems to render the data that is past the ScrollView area,
because
if I manually scroll using the scrollTo and overriding the keyListener
I can still see all of the content just fine.

Thanks,
Pachu






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



Scaling objects within an AbsoluteLayout

by Pachu » Fri, 16 Jan 2009 05:46:51 GMT


 lso I have tried creating my own ScrollView class but, there are
several member variables that I see being used in the source code on
GIT namely mScrollX and mScrollY, but as far as I know these have been
removed from View going from 0.9 to 1.0, and they are critical to the
functionality of ScrollView as far as I can tell by looking at the
source.

http://code.google.com/android/migrating/0.9-1.0/changes/android.view.View.html



On Jan 15, 3:13pm, Pachu <pach...@gmail.com> wrote:
--~--~---------~--~----~------------~-------~--~----~



Scaling objects within an AbsoluteLayout

by Romain Guy » Fri, 16 Jan 2009 05:47:44 GMT


 hey're not, you can use getScrollX/Y instead.

On Thu, Jan 15, 2009 at 1:46 PM, Pachu <pach...@gmail.com> wrote:



--
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support. All such questions should be posted on
public forums, where I and others can see and answer them

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



Other Threads

1. Testing e CodeCoverage report

hi guys i'm tryng to do some testing in my adroid application,

I've set-up my project in eclipse and I can successfoully run my code.
I've alredy written some JUnit test cases, now I'm tryng to generate a
code coverage report. However it seems that there are different ways
to accomplish this and the documantation is not very clear.

Can someone tell me what's the best solution considering that I've all
my code in eclipse?
What steps do I need to take to get the reports.

(I've seen some posts about EMMA but the whole thing seems hackish and
I'm not sure how it works when with eclipse, i.e. when the project is
rebuilt).

Thank you very much,
Regards

SirValerius

-- 

2. Add app icon to car mode app

Hello,

I looked around but did not find any info about it. Is it possible to
add an application icon to the Froyo car mode app (there are several
place holders at the second page)?

Thanks for any information,

Chris

-- 

3. How to know if child activity exit by unexpected exception (onActivityResult() is not called)

4. Delete Contact field value in SDK early 5

5. Seeking advice on a first program (includes general idea, just implementation advice.)

6. Contact added through API does not get synced

7. Trying to move multiple widgets at the same time