android repo中可用的壁纸选择器源代码在哪里。任何人都可以提供这条路吗?
答案 0 :(得分:9)
AOSP启动器(Launcher2
)的位置(路径)为packages/apps/Launcher2/
,然后是src/com/android/launcher2/
完整路径是:packages/apps/Launcher2/src/com/android/launcher2/
。
文件是 WallpaperChooser.java 和 WallpaperChooserDialogFragment.java 。
修改强>
您需要以下资源(来自res
)文件夹:
/res/drawable
:
/res/drawable/drawable-hdpi
(以及-mdpi
,-xhdpi
):
/res/drawable/
/res/drawable-sw720dp-nodpi
/res/layout/
/res/layout-sw720dp
<强> dimens.xml 强>
<!-- dimensions for the wallpaper picker wallpaper thumbnail width
-->
<dimen name="wallpaper_chooser_grid_width">196dp</dimen>
<dimen name="wallpaper_chooser_grid_height">140dp</dimen>
<强> styles.xml 强>
<style name="Theme"
parent="android:Theme.Holo.Wallpaper.NoTitleBar">
<item name="android:windowActionModeOverlay">true</item>
<style>
/res/values
<强> styles.xml 强>
<style name="Theme.WallpaperPicker"
parent="@android:style/Theme.Holo.NoActionBar"/>
<强>的strings.xml 强>
<!-- Title of dialog that appears after user selects Wallpaper from
menu -->
<string name="chooser_wallpaper">Choose wallpaper from</string>
<!-- Button label on Wallpaper Gallery screen; user selects this
button to set a specific wallpaper -->
<string name="wallpaper_instructions">Set wallpaper</string>
/res/xml
<强>的AndroidManifest.xml 强>
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.SET_WALLPAPER_HINTS" />
<activity
android:name="com.android.launcher2.WallpaperChooser"
android:theme="@style/Theme.WallpaperPicker"
android:label="@string/pick_wallpaper"
android:icon="@mipmap/ic_launcher_wallpaper"
android:finishOnCloseSystemDialogs="true"
android:process=":wallpaper_chooser">
<intent-filter>
<action android:name="android.intent.action.SET_WALLPAPER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="android.wallpaper.preview"
android:resource="@xml/wallpaper_picker_preview" />
</activity>