Question

I am trying to create my own Android Launcher so I have been reading through Google's own Launcher2 code, Cyanogen's Trebuchet code and the Home Example provided with the ADK but keep coming across the same question: What kind of layout is the home screen (the one with shortcuts and widgets on it and with user-selectable wallpaper)?

From what I can tell, Trebuchet is based largely on the Launcher2 code but sifting through it is proving really hard.

Was it helpful?

Solution

Looking quickly at the Trebuchet sources on github at

https://github.com/CyanogenMod/android_packages_apps_Trebuchet

They seem to make heavy use of custom layouts.

While purely one example, some of the layout xml's make use of PagedViewGridLayout which is defined over in the src folder in a file called PagedViewGridLayout.java

public class PagedViewGridLayout extends GridLayout implements Page

GridLayout is in turn a standard Android component - and just by its name seems to be the type of thing you would want for a launcher. Obviously something as complex as current launchers is going to use many varieties and tricks for it's various configurable, interactive panes.

Your basic keys to understanding the sources will be figuring out the hierarchy of the layout xml files (and anything created from code rather than inflated from xml). Then looking through the inheritance hierarchy and mechanisms of the various custom layouts used.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top