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. I'm stuck and need some help with touchable widgets

Hi Folks,

I am working on an app (for the future tablet market), and I am stuck
on some basic stuff.  My app will draw a background (got that far) and
then it needs to create a Widget-like object on the background that
can be touched.  Imagine a chess board app where you can touch a chess
piece and drag it to the target square.  I can't seem to figure that
out.

I've looked at the Widget class, but I don't need all the grid and
layout stuff.  I'm not sure if I should keep playing with widget class
or look elsewhere.

Any thoughts or suggestions would be most helpful.

-- 

2. ViewGroup with round angle

Hi,

I like to have a ViewGroup (like LinearLayout) that has rounded
angles. The angle can cover
content of the ViewGroup.

Any suggestion?

-- 
 _| _.  o _| _
(_| (_| \/ | (_| (/_

-- 

3. how to capture more than 2 Views?

4. Custom Account Preferences using AccountManager / AccountAuthenticators

5. "WPA2-PEAPv0-MSCHAPv2" support in "android.net.wifi" package

6. how to upgrade android 1.5 to 2.1

7. user application logi