I have a development platform with a 800x480 landscape panel. For the
wallpaper, launcher (using eclair) is setting the wallpaper dimensions
to 960x800 instead of 1600x480.
Following code is the suspect (from
http://android.git.kernel.org/?p=platform/packages/apps/Launcher.git;a=blob;f=src/com/android/launcher/Launcher.java;hb=HEAD)
private void setWallpaperDimension() {
WallpaperManager wpm = (WallpaperManager)getSystemService(WALLPAPER_SERVICE);
Display display = getWindowManager().getDefaultDisplay();
boolean isPortrait = display.getWidth() < display.getHeight();
final int width = isPortrait ? display.getWidth() : display.getHeight();
final int height = isPortrait ? display.getHeight() : display.getWidth();
wpm.suggestDesiredDimensions(width * WALLPAPER_SCREENS_SPAN, height);
}
Should the fix be to change the above code to get the
portrait/landscape information from android:screenOrientation?
Even after I fixed above, when I attempt to change the wallpaper with
the bitmap of 1600x480 com.android.camera.cropImage is launched and
the resulting wallpaper is the cropped and zoomed version of my
original bitmap. Cropping/Zooming seems to kick-in no matter what the
dimensions of my bitmap is. I was wondering under what conditions the
cropping will kicks-in.
I am tyring to understand the logic here by digging through the code.
But, if someone can provide a quick answer or pointer to look for that
would be great.
Thanks
-Muni
On Wed, Dec 30, 2009 at 9:58 PM, Dianne Hackborn <hac...@android.com> wrote:
> The purpose of this code is to avoid making the wallpaper larger along the
> larger dimension, to avoid the keep the size to something reasonable.
I was under the impression that size needs to be double of the x-axis
times y-axis not matter what the orientation is. That is because the
Android virtual desktop spans 2 horizontal screens. If that is right,
the logic used appears to only works for some panels which has width <
height in the portrait orientation.
If the idea is to just minimize the size and use scaling to fit the
panel's virtual desktop in any orientation, then any width/height/size
will do.
I was under the impression that size needs to be double of the x-axis
times y-axis not matter what the orientation is. That is because the
Android virtual desktop spans 2 horizontal screens. If that is right,
the logic used appears to only works for some panels which has width <
height in the portrait orientation.
If the idea is to just minimize the size and use scaling to fit the
panel's virtual desktop in any orientation, then any width/height/size
will do.