gpt4 book ai didi

android - 使 Launcher2 独立

转载 作者:行者123 更新时间:2023-11-29 15:23:50 28 4
gpt4 key购买 nike

我想让 Launcher2 (AOSP Launcher) 成为我的 Android 4.1.1 设备(Branch jb-release;API 级别 16)的独立数据应用程序(非系统)。

我找不到任何有关修改内容以使其独立的资源,所以我自己尝试了。希望有人可以帮助我做到这一点(有关错误列表,请参见下面的列表)。

源代码可以在这里找到: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

工作区.java:

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

最佳答案

这似乎是很多人都想做的事情,而我不久前也做过。

我让 Launcher2 作为一个独立的应用程序编译和运行,然后开源了我的努力 here .

这是 ICS 的 Launcher2,不是 JB,但它们非常相似。请注意,它并非完全没有错误,添加小部件会使应用程序崩溃(因为它使用系统级权限。也许如果您通过 root 安装它会起作用)。

这是我必须做的所有事情的列表,我记得做过:

我们无法使用许多方法,例如 setFastXXX(例如,setFastAlpha())。将这些更改为 setXXX(例如,'setAlpha()`)对我有用。

我们可以通过 getSystemService() 获得的一些东西直接在代码中初始化,比如 Vibrator 类的使用。这些需要更改为使用 getSystemService()

我最终从 Android 源代码中直接复制了很多方法到我的类中。

您可以 checkout 新版本的 ICS launcher2,并与我开源的版本运行差异以查看完整的更改列表。

关于android - 使 Launcher2 独立,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15087070/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com