Skip to content

Icon pack support

SuperDragonXD edited this page Sep 15, 2024 · 3 revisions

Lawnchair supports two different types of icon sources: icon packs, and themed icon packs.

Note

Work in progress

Icon packs

For icon packs, Lawnchair supports the ADW launcher icon pack standard, a format used by many launchers and icon packs.

Get started

AndroidManifest.xml

To be recognized as an icon pack, your app must declare an activity with at least one of the following intent filters in your AndroidManifest.xml:

<activity android:name="[...]" android:exported="true">
    <intent-filter>
        <action android:name="org.adw.ActivityStarter.THEMES" />
    </intent-filter>
    <intent-filter>
        <action android:name="com.novalauncher.THEME" />
    </intent-filter>
</activity>

appfilter.xml

Icons are mapped to apps using a file called appfilter.xml. This file must be located in one of these locations:

  • res/xml/appfilter.xml (recommended)
  • res/raw/appfilter.xml
  • assets/appfilter.xml

The file has the following structure:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- icons are added here -->
</resources>

drawable.xml

drawable.xml is a file that lists all icons that are included in the icon pack. This file is required for manual icon picking. The file lives in res/xml/drawable.xml, and looks like this:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <item drawable="messages" />
    <category title="System" />
    <item drawable="settings" />
    <item drawable="settings_alt_1" />
</resources>

Every icon that should be available for manual icon picking must be listed in this file. You can optionally group icons by adding <category> elements.

Static icons

Icons are added to the appfilter.xml file using the <item> tag:

<item component="ComponentInfo{com.android.deskclock/com.android.deskclock.DeskClockTabActivity}"
    drawable="clock" />
  • component is the component name of the target activity. The short form is also supported if the class' package name starts with the app's package name: ComponentInfo{com.android.deskclock/.DeskClockTabActivity}
  • drawable is the name of the icon drawable which must be located in the res/drawable/ folder (or any of its variants, e.g. res/drawable-hdpi/)

Themed icon packs

Lawnchair also supports themed icon packs. These are a limited version of icon packs, using grayscale_icon_map.xml

Acknowledgements

This guide is based on Kvaesitso's guide to icon packs.