2013-02-26 38 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