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. If you want different behavior for your device, then you could certainly change this logic, but what is there now is working as intended.
On Tue, Dec 29, 2009 at 2:20 PM, muni anda <[email protected]> wrote: > Hi, > > 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 > > -- > unsubscribe: > [email protected]<android-porting%[email protected]> > website: http://groups.google.com/group/android-porting > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- unsubscribe: [email protected] website: http://groups.google.com/group/android-porting
