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. Why can't I set the device Microphone mute

Now I am trying to build a apk which can control the device's
hardware.
When I try to mute microphone with the "AudioManager.muteMicrophone"
and "AudioSystem.muteMicrophone" methods. As a result, I can only mute
the
Microphone in my own apk, when I jump to another apk such as some
other recorder,
the microphone seem to do nothing with my setting...

But there seem to be only one way to the JNI, so I am very confuced,
is there any other solution can help me with this??

To sum up, I want to make an apk whick can mute my device's
microphone,
anybody can give me a few hints about it?

Or I can only make it by turn the driver down?

-- 

2. update WTA: soal inject lokalplus

Iseng test di Droid 1, berhasil tapi evdo blm naik :(
Call, sms n data dah jalan normal tapi 1x aja *hiks
Mesti cari parameter yang bener buat unlock evdo-nya

Nanti gw update lagi ya :)





-- 
"

3. Ok, re-phrasing the question about the "Conversion to Dalvik format failed with error 1" question

4. [WTA] NFS Shift di O1...

5. I need portrait only for all screen sizes except xlarge screen size which needs to be landscape only

6. parse image

7.