Remove All Ads from XDA
Honor View 10

[GUIDE][MOD] Modify Launcher2 3D for any screen resolution or size UPDATE - 2/12/12

368 posts
Thanks Meter: 314
By gh123man, Senior Member on 5th February 2012, 11:41 PM
Post Reply Email Thread

I have continued my research and discovered some better ways to port the launcher. the key update im adding to the guide today is how to fix the icon label aliasing. see step 11

Greetings all XDA friends,
I have been up all night working on this for my Atrix 4g.
I think I have made enough documentation to make an official guide

This guide will teach you how to modify the stock android 3D Launcher to work with any screen size and resolution.
Last night I successfully ported it to QHD screens and posted the source/changes on my github page (

Launcher2 has 2 views for the app drawer. A 2D view that works with any phone and is the default as outlined in the source. A 3D view that only works correctly with phones of a 850x480 resolution.
Being I am a lover of the stock android experence I wanted to make this possible on my device.
While I am aware this has been done before on QHD screens, I could not find any source code or documentation on how to make some changes that I wanted to make. This guide should allow you to correct the possition of the 3D app drawer on any device. I am using QHD as an example.



1) the first thing you need to do is download the android source code and sdk. why? because the stock launcher can only be compiled with the tools used to build the entire firmware from source. it CANNOT BE COMPILED IN ECLIPSE because some libraries are private and not included in the sdk. so the first step is to set up the build environment. we need the sdk because of adb. I would assume you have it.
follow the guide as outlined here
go to for the sdk

after you have the build environment configured you should download the cyanogenmod 7 source. I decided against the official source from google because cm7 has support for tons of devices and wont compile odexed apks.

so folow this guide

but replace

repo init -u -b android-4.0.1_r1


repo init -u git:// -b gingerbread

so you get cm7 source and not the stock ICS source.

2) long step 1 eh? anyways. once the source is downloaded into a working directory your going to want to compile it for a device. because if we are only going to compile launcher 2 it needs a clean build first. so...
cd into your /working_dir (or whatever you called it) and type these commands


. build/

when the big menu comes up pick a device. not full-eng, a real device. I picked the olympus because I work on the atrix anyway. you need to pick a device because it will ensure you get a deodexed apk in your /out directory.
so after lunch I type



...waits a long time
then if all went well

make -j4

(if it fails change it to -j1)

i have a dual core hyperthreaded i5 laptop. a -j1 build takes about 2 hrs because its only working off one logical core.
be paitent you only need to do this once.

3) let build the launcher on its own to make sure it compiles clean.

make Launcher2

this will go much faster.
now you can navigate to


and pull out the Launcher2.apk

4) make sure adb is in your path, if its not and you have the sdk installed this should help

5) make sure you have an alternate launcher installed. most people do now, weather its adw or something that comes with your rom. make sure Launcher2 is not your only launcher on your phone if you even have it.


adb remount
adb push out/target/product/<device_name>/system/app/Launcher2.apk /system/app
adb shell
cd /system/app
chmod 644 Launcher2.apk

or you can do this all with root explorer. adb is much faster if your doing the whole trial and error methond like I did

6) now that you have the pure unmodded stock launcher on your phone, it should not have 3d turned on. we will fix that next

7) now to jump into some code. first things first your going to want to back up your launcher2 folder in /Packages/apps
just save it anywere in its current state. if you dont its not that big a deal, a repo sync will fix it if its broked too.
navigate to
and open all_apps.xml in any text editor.
and change this line

<include layout="@layout/all_apps_2d" />


<include layout="@layout/all_apps_3d" />

8) now you have 3d mode enabled compile and push it over again to make sure it runs and your changes took effect. go through steps 3 - 5
it should look something like this if your using a QHD device

9) its time to start resizing it to fit our screen. navigate to



and open in any text editor. one that colors the code helps. the stock ubuntu editor does this. go down to around line 280.
This is the magic block of code we are looking for.

now let me shed some light on how this works. it took me a few hours to find this and figure out what it does and how it works. basicly the values in the array tf control the possition, zoom level, and start and end point of the 3d drawer. this is what I came up with using the trial and error method.
if you have any programming experence you know the number has to do with the possiton in the list starting at 0.

tf 6 = vertical streatch of main grid from the bottom
tf 7 = vertical streatch of main grid from the top
tf 8 = zoom level
tf 10 = horizontal shift
tf 11 = vertical shift


tf 6 = 120.f
tf 7 = 680.f
tf 8 = (2.f / 480.f)
tf 10 = -((float)w / 2) - 0.25f
tf 11 = -380.25

that should make it a little easier for anyone to understand.

so what you basicly want to to is change these valuse, compile it, push it, test it, repeat until your figure out what looks best. Dont worry about the icons looking horrible. we are fixing that next.

10) now we need to resize the icons to match your screen resolution. so head to the top-ish of AllApps3D and look for this section around line 149
your looking for this

you mainly want to worry about




as long as these 2 values are the same the icons will be square. so size them up and down until it looks right. or you can use figure out the ratio to match your resolution perfectly. its up to you. the goal is to make sure that when scrolling the icons do get "ripples" through them.

11) the last step is to fix the icon labels. as you zoom in and out and realign the grid and re-size the icons. The icon labels become distorted. To fix this you need to go to


I want to say .rs stands for render script? someone correct me if im wrong.
Anyways what you need to do is go to line 338ish and find

vpConstants->ImgSize.x = 107.f;
vpConstants->ImgSize.y = 57.f;

your number will look different as these are my settings.
x = the width of the icon label
y = the hight of the icon label
I dont know any easy way to do this other then the old "compile it, push it, test it, repeat" method.
so mess with them until the text is crisp and clear all changes are updated on my github if you want to use it for reference!

my final product looks like this

If anyone would like more information or the source for QHD just head over to my github.
If you have any questions. let me know. ill do my best to help out.
good Luck!

small update. I fixed texture tearing on QHD. see my github for changes

front page link

just fixing errors and stuff
The Following 5 Users Say Thank You to gh123man For This Useful Post: [ View ] Gift gh123man Ad-Free
6th February 2012, 04:18 PM |#2  
-Grift-'s Avatar
Senior Member
Flag Singapore
Thanks Meter: 2,010
Cool! dont know what to say :/
6th February 2012, 05:05 PM |#3  
Senior Member
Flag Rouen
Thanks Meter: 45
Could you post a guide or an APK for HVGA? That would be awesome
6th February 2012, 05:57 PM |#4  
gh123man's Avatar
OP Senior Member
Flag Rochester NY -school (Kendall park NJ - home)
Thanks Meter: 314
Originally Posted by Rores

Could you post a guide or an APK for HVGA? That would be awesome

If I get some free time I could try to build it for the emulator (as i dont have an HVGA device). The guide applies to all devices so I would only release an apk and I could post the changes in the source. I still need to finish with QHD so Ill post back if I get around to it. Thanks for your interest!
6th February 2012, 06:15 PM |#5  
myn's Avatar
Retired Senior Recognized Developer
Thanks Meter: 4,000
Donate to Me
Great mod

Thanks for documenting this so detailed
The Following User Says Thank You to myn For This Useful Post: [ View ]
6th February 2012, 08:23 PM |#6  
bL33d's Avatar
Senior Member
Flag Illinois
Thanks Meter: 75
hopefully someone smarter then i can get this working on 720p displays.
6th February 2012, 09:04 PM |#7  
Amir.Adel's Avatar
Flag Milano
Thanks Meter: 12
thats coool
13th February 2012, 04:43 PM |#8  
gh123man's Avatar
OP Senior Member
Flag Rochester NY -school (Kendall park NJ - home)
Thanks Meter: 314
I have continued my research and discovered some better ways to port the launcher. the key update im adding to the guide today is how to fix the icon label aliasing. see step 11
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes