Wallpaper Changer Scaling - SOLVED

General discussions about Automagic and automation in general

Moderator: Martin

Post Reply
User avatar
acerzw
Posts: 39
Joined: 10 May 2015 13:38

Wallpaper Changer Scaling - SOLVED

Post by acerzw » 18 Jun 2015 18:44

Hi,

I can see that there have been many discussions regarding wallpaper not scaling correctly to the screen and the effects of various launcher settings. I have a wallpaper changer I have written and am using Nova Launcher and am experiencing the scaling problem. I have adjusted various settings in the launcher and tried those in combination with various scaling methods. Both Android and the Launcher seem to effect the scaling and I think it is caused by android scaling the wallpaper in such a way that if the tablet is rotated the image does not become distorted, so in landscape mode maybe the top and bottom are cropped and in portraiit mode the left and right are cropped. Has anyone solved this problem, does anyone know the correct scaling ratio, which I am guessing may be dependant on the screen and picture aspect ratios and resolutions? Does anyone have a formula that works?

Many Thanks

Rob
Last edited by acerzw on 24 Jun 2015 18:29, edited 3 times in total.

User avatar
acerzw
Posts: 39
Joined: 10 May 2015 13:38

Re: Wallpaper Changer Scaling - SOLUTION

Post by acerzw » 21 Jun 2015 18:36

--- Changing the Wallpaper So It Scales Correctly Using A Customer Widget Overlay ---
First I created a non-clickable custom widget overlay the size of the screen with a single image element also the size of the screen. The image element was set to load an image `wallpaper.jpg` from a set location and to preserve the aspect ratio of the loaded image. The wallpaper changer flow then copies a random image from a folder over the `wallpaper.jpg` file and uses the `refreshWidget` script function to refresh the custom overlay widget and reload the image. This handles the image changing.

-- Placing The Wallpaper Overlay Below Everything Else On The Desktop ---
The problem with most launchers is they won`t let you place a widget over other widgets or icons and if you do the whole screen is then blanked out as the widget is in the foreground and hides everything (and makes it non-clickable). The solution to this is that Nova Launcher has some special widget management functions. First in the `Desktop` settings under `Advanced` are the settings `Widget Overlap` and `Overlap when placing`, if these are turned on you can place a widget anywhere including over your entire main home screen. If you then click on the widget again you can turn off the padding so there is no border around the widget. When these settings are turned on if you place the custom widget and then hold your finger down on it you get a menu, and two new options appear `Bring to front` and `Send to back`! If you click `Send to back` the custom overlay goes behind everything else!

-- Dealing With Wallpapers That Have A Different Aspect Ratio To Your Screen ---
One thing to bear in mind is if the wallpaper does not fit exacly into the widget element due to its aspect ration being different it will leave a transparent section at the sides or top and bottom, where the actual normal desktop wallpaper will be visible through.

You can solve this by several ways. By setting the image element not to preserve the image aspect ratio, which will distort the wallpaper a bit. Or if you are only going to use custom widget overlays on all home screens you can set the normal desktop wallpaper to a black image the size of the screen, so that your overay image shows black borders.

Another more fiddly option is to create another customer widget overlay with no elements and a background colour of your choice and place this behind the wallpaper overlay. It is easiest to create the widget initially on a blank home screen and then move it to the home screen where you need it, then send it to the back. Note: If your phone/tablet has software keys (home etc, `GMD Immersive`` is great for hiding these) then this affects how the widget and image are displayed, so you will probably have to adjust the widget image elements bounds to sligltly less than your devices screen resolution to get it to fully cover the desktop, finding the exact X and Y bounds takes a while as changing one affects the aspect ratio and therefore hw the image scales in the other dimension!

In Nova Launcher you can use the `Gestures & Inputs` setings to assign a gesture (swipe up?) to toggle the dock and hide it, this along with GMD Immersive if you have softkeys allows you to remove everything from the screen so only the wallpaper shows fullscreen on a blank home screen.

-- You Can Now Have Different Wallpapers On Different Home Screens, including a Live Wallpaper! ---
You can place the same custom overlay on each home screen or just some. This means you can have a live wallpaper or other wallpaper on one home screen and the custom widget overlay on another, allowing different wallpapers on different screens! If you use several custom widget overlays with different names you can then have different wallpapers changing on different screens, e.g. wallpapers of favourite games on one screen and family on another and a live wallpaper on your main screen! You could even have several different wallpaper overlays on the same screen, so a different picture in each quarter, or possible create a collage or montage by slightly overlapping widgets of different sizes.

I have a wallpaper overlay on my main home screen behind the icons/widgets, the same wallpaper overlay on a blank home screen so I can see the full pictures and use it as a digital photo frame, and then a live audio responsive wallpaper (Audio Glow, very colourful) as my android background wallpaper on another blank screen which I switch to when playing music (as my tab root functions are not active I cannot use a flow to change to this automatically, so this is the next best solution). I like to make the wallpaper overlay a little bit smaller than my screen resolution which results in the twinking Audio Glow background appearing as the border to my wallpaper (also saves using a second overlay and the difficulty of finding the right size because of the softkeys).

--- Creating Frames ---
You can of course set the overlay to have a border or use other rectangle or image elements to create a frame. Using four image elements using images of wood you could create a wooden frame!

So many options, the only limit is your infinite imagination!

Hope this helps anyone who has had the same problems.

Rob
Attachments
Screenshot_2015-06-21-20-30-29.png
Single Overlay
Screenshot_2015-06-21-20-30-29.png (1.36 MiB) Viewed 8845 times
Screenshot_2015-06-21-20-30-24.png
Dual Overlays
Screenshot_2015-06-21-20-30-24.png (1.11 MiB) Viewed 8845 times
Screenshot_2015-06-21-21-33-12.png
Wallpaper Spinner Controls & Overlay On Nova Launcher
Screenshot_2015-06-21-21-33-12.png (1.05 MiB) Viewed 8845 times

Post Reply