1

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

Workspace.java:

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

2 に答える 2

3

これは多くの人がやりたいと思っていることで、私も少し前にやったことがあります。

私は Launcher2 をコンパイルして独立したアプリとして実行し、ここで私の取り組みをオープンソース化しました。

これは、JB ではなく ICS の Launcher2 ですが、非常によく似ています。完全にバグがないわけではなく、ウィジェットを追加するとアプリがクラッシュすることに注意してください (システム レベルのアクセス許可を使用するためです。ルート経由でインストールした場合は動作する可能性があります)。

これが私がしなければならなかったすべてのことのリストであり、私が覚えていることは次のとおりです。

setFastXXX(たとえば、 ) のような、使用できないメソッドがたくさんありますsetFastAlpha()。これらをsetXXX(たとえば、「setAlpha()」)に変更するとうまくいきました。

getSystemService()Vibrator クラスの使用のように、コード内で直接初期化されるものがあります。これらを使用するには変更する必要がありますgetSystemService()

最終的に、多くのメソッドを Android ソース コードから自分のクラスに直接コピーすることになりました。

ICS launcher2 の新しいバージョンをチェックアウトし、私がオープンソース化したものとの差分を実行して、完全な変更リストを確認できます。

于 2013-02-26T10:51:02.340 に答える
2

chrislacy によって GitHub でホストされているスタンドアロンの Android JellyBean Launcher があり、AppWidgets をホーム画面に追加できます:) https://github.com/chrislacy/LauncherJellyBean

于 2013-03-14T22:59:30.957 に答える