2013-02-26 32 views
1

我想讓我的Android 4.1.1設備(Branch jb-release; API Level 16)的Launcher2(AOSP Launcher)成爲一個獨立的數據應用程序(不是系統)。Make Launcher2 standalone

我找不到什麼修改,使其獨立的任何資源,所以我沒有嘗試過自己。 希望有人能幫助我做(下面的錯誤列表,請參閱列表)這一點。

的源代碼可以在這裏找到:https://android.googlesource.com/platform/packages/apps/Launcher2/+/jb-release/src/com/android/launcher2

AppsCustomizedPagedView.java:

The import android.graphics.Insets cannot be resolved 
The import android.graphics.TableMaskFilter cannot be resolved 

我想都是由於@Hide。任何解決辦法或在這裏很好的解決方案?

Cling.java:

The method findViewToTakeAccessibilityFocusFromHover(View, View) of type Cling must override or implement a supertype method (Class Cling extends android.widget.FrameLayout) 
The method includeForAccessibility() is undefined for the type View 

HolographicOutlineHelper.java:

The import android.graphics.TableMaskFilter cannot be resolved 

相同AppsCustomizedPagedView.java(@Hide

Launcher.java:

The import android.os.SystemProperties cannot be resolved 
The import com.android.common cannot be resolved 
The method clearAllAnimations() is undefined for the type ValueAnimator 
The method startSearch(String, boolean, ComponentName, Bundle, boolean) in the type SearchManager is not applicable for the arguments (String, boolean, ComponentName, Bundle, boolean, Rect) 
SystemProperties cannot be resolved 
The method requestAccessibilityFocus() is undefined for the type Cling 

PagedViewWidgetImageView.java:

The import android.graphics.Insets cannot be resolved 
The method getLayoutInsets() is undefined for the type Drawable 

RocketLauncher.java:

The import android.support cannot be resolved 
The constructor RocketLauncher.Board(RocketLauncher, null) is undefined 

SearchDropTargetBar.java:

The method getCompatibilityInfo() is undefined for the type Resources 

Utilities.java:

The import android.graphics.TableMaskFilter cannot be resolved 

Workspace.java:

The method getRealMetrics(DisplayMetrics) is undefined for the type Display 
The method setChildrenLayersEnabled(boolean) is undefined for the type ViewGroup 

回答

3

這是值得很多人似乎想要做的,我做的事而回。

我得到了Launcher2作爲一個獨立的應用程序編譯和運行,然後開放源代碼我的努力here

這是來自ICS的Launcher2,不是JB,但它們非常相似。請注意,它不是完全沒有bug的,並且添加小部件會導致應用程序崩潰(因爲它使用系統級權限。也許如果您是通過root進行安裝的話,它將起作用)。

這裏是我不得不做的名單,我記得做:

有許多像setFastXXX方法(例如,setFastAlpha())未提供給我們。將它們更改爲setXXX(例如,'setAlpha()`)適用於我。

有些東西可以通過getSystemService()直接在代碼中初始化,就像使用Vibrator類一樣。這些需要更改爲使用getSystemService()

我最終將Android源代碼中的很多方法直接複製到我的類中。

您可以簽出一個新版本的ICS launcher2,然後針對我打開的那個運行diff以查看完整的更改列表。

+0

謝謝!這是一個開始工作的非常好的基礎!這就是我會做的。你從哪個發佈版本開始? mr0或mr1? – dtrunk 2013-02-26 10:55:45

+0

@dtrunk不客氣!我將編輯我的文章,其中列出了一些我爲編譯所做的更改。 – 2013-02-26 10:56:41

+0

@dtrunk我不記得我使用了哪個版本。我在一年前編寫了代碼(我認爲在六月的某個時候),但是最近在看到很多人試圖做同樣的事情之後才公開發布它。 – 2013-02-26 11:28:53

2

有一個獨立的Android豆形軟糖啓動託管在GitHub上的chrislacy,你可以添加AppWidgets到主屏幕:) https://github.com/chrislacy/LauncherJellyBean

+1

我似乎無法讓它作爲獨立應用運行 - 它會啓動,但它不會響應底部欄區域中的觸摸(您知道,電話,聯繫人,所有應用程序,消息和瀏覽器圖標在哪裏)。 – 2013-09-09 01:14:55