문제

My goal is to modify the Launcher application and dynamically modify and change the theme.

I saw several 'home' apps at http://www.cyrket.com/p/android/com.stain46.taghome/. It looks like they took the default Home(Launcher) and modified it. How did they do that? What do I need to modify to achieve the same thing?

도움이 되었습니까?

해결책

I have done this with the ICS launcher. You also need to do quite a number of code changes to get it to compile as a normal app because it uses a lot of private internal APIs (despite what Google may have implied). You also need to change the package name. There are two limitations I've found:

  1. There's a filter called TableMaskFilter that isn't available to normal apps. I think this allows the app drawer to be semi-transparent, but I removed uses of it and it looks fine I think.

  2. More critically, it appears there is no way to replicate the widget-adding experience because it requires a permission that only system apps can have. See this question.

Anyway, I put my source here. It compiles and works on the official Galaxy S2 4.0.3, but if you try to add widgets it will crash.

Note, when you're changing the package name, there are places that Eclipse's refactor doesn't notice (e.g. XML layouts). I recommend you do a global text search/replace instead.

다른 팁

The standard Launcher is open source so you can definitely grab it and modify it the way you want. For your app to be used as the Home Screen you will need to specify the correct Intent filter in your AndroidManifest.xml and the user will have to choose your app when they press the Home button. Why don't you grab that code, play with it and come back when you have more questions and more of an idea of what you want to change.

Here i found one stable version Launcher2

I have sharing that GitHub repo. HERE

WIKI of this project :

This project contains the code for the Launcher app that ships with Android Jelly Bean (API 16).

Some minor changes were required from this source code to remove the use of private APIs. These changes have been marked by "// AOSP Change"

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top