Go to file
Clark Scheff 9a94bc262b Provide a better project structure
Change-Id: Ie5d7c20a68d492c0dbc30d3cfa869dc6472e5ad3
2014-09-12 09:44:45 -07:00
gradle/wrapper Provide a better project structure 2014-09-12 09:44:45 -07:00
theme Provide a better project structure 2014-09-12 09:44:45 -07:00
.gitignore Provide a better project structure 2014-09-12 09:44:45 -07:00
README.md Reintroduce README.md 2014-06-25 14:45:20 -07:00
ThemeTemplate.iml Migrate to Gradle and junk cleanup 2014-06-24 17:35:05 -07:00
build.gradle Provide a better project structure 2014-09-12 09:44:45 -07:00
gradle.properties Migrate to Gradle and junk cleanup 2014-06-24 17:35:05 -07:00
gradlew Provide a better project structure 2014-09-12 09:44:45 -07:00
gradlew.bat Provide a better project structure 2014-09-12 09:44:45 -07:00
settings.gradle Provide a better project structure 2014-09-12 09:44:45 -07:00

README.md

AndroidManifest.xml

There are several entries in addition to the standard Android package information that must be present in your manifest for your theme to behave as expected. All of the following should be inside the main <manifest></manifest> tags.

<uses-feature android:required="true"
    android:name="org.cyanogenmod.theme" />

This entry indicates that the package should only be installable on devices that support the CM Theme Engine.

<uses-sdk android:minSdkVersion="19"
    android:targetSdkVersion="19" />

The CM Theme Engine is only available in versions of CyanogenMod that use SDK v19 and above. This entry will prevent your package from asking for additional unneccesary permissions.

<application android:hasCode="false"
    android:icon="@drawable/ic_launcher"
    android:label="Your Theme Name" />

This entry will place an item in the Installed Apps list on Android, and sets the app icon to be used (from res/drawable).

<meta-data android:name="org.cyanogenmod.theme.name"
    android:value="Theme Name" />

<meta-data android:name="org.cyanogenmod.theme.author"
    android:value="Your Name" />

These two entries are required for the Theme Engine to recognize your APK as a theme.

Assets

Theme assets should be placed into the directory assets/ with the following structure:

assets/
     ├──alarms/
     │          └──foo.{ mp3, ogg, wav, ... }
     ├──bootanimation/
     │          └──bootanimation.zip
     ├──fonts/
     │          ├──foo.ttf
     │          ├──{ ... }
     │          └──fonts.xml
     ├──icons/
     │          └──res/
     │                    ├──drawable-{ hdpi, xhdpi, ... }/
     │                    │          ├──foo.png
     │                    │          └──{ ... }
     │                    └──xml/
     │                              └──appfilter.xml
     ├──images/
     │          ├──lockscreen_preview.jpg
     │          ├──styles_preview.jpg
     │          └──wallpaper_preview.jpg
     ├──lockscreen/
     │          └──foo.{ jpg, png, webp, ... }
     ├──notifications/
     │          └──foo.{ mp3, wav, ... }
     ├──overlays/
     │         ├──foo.package.name/
     │         │            └──res/
     │         │                     ├──drawable-{ hdpi, xhdpi, ... }/
     │         │                     │            ├──some_resource.{ jpg, png, ... }
     │         │                     │            └──{ ... }
     │         │                     ├──{ ... }
     │         │                     ├──drawable/
     │         │                     │            ├──some_resource.xml
     │         │                     │            └──{ ... }
     │         │                     └──values/
     │         │                                   ├──colors.xml
     │         │                                   └──styles.xml
     │         ├──{ ... }
     │         └──common/
     │                       └──res/
     │                                ├──drawable-{ hdpi, xhdpi, ... }/
     │                                │            ├──some_resource.{ jpg, png, ... }
     │                                │            └──{ ... }
     │                                ├──{ ... }
     │                                ├──drawable/
     │                                │            ├──some_resource.xml
     │                                │            └──{ ... }
     │                                └──values/
     │                                              ├──colors.xml
     │                                              └──styles.xml
     ├──ringtones/
     │         └──foo.{ mp3, ogg, wav, ... }
     └──wallpapers/
                └──foo.{ jpg, png, ... }

Directory Description
alarms/
ringtones/
notifications/
Each of these directories should contain a single audio file to be set as the respective system sound.
lockscreen/
wallpapers/
Each of these directories should contain a single image file to be used as the respective wallpaper (lockscreen or home screen). Support for providing multiple wallpaper options in a single theme may be implemented in the future.
bootanimation/ This directory should contain a single, standard format multi-part boot animation zip file. For help creating boot animations, visit this thread on XDA: http://forum.xda-developers.com/showthread.php?t=1852621
images/ This directory should contain three images, to be displayed in the Theme Chooser:

All 3 images must be 600px wide by 1080px tall.

lockscreen_preview.jpg must be a cropped version of your lockscreen wallpaper.

wallpaper_preview.jpg must be a cropped version of your home screen wallpaper.

style_preview.jpg must be a screenshot displaying an actual example of your theme's overlay style in-use.
icons/ This directory uses the de-facto standard format for icon theming that's been in use for some time among Launchers. Icons are placed in DPI-named directories and are then referenced in xml/appfilters.xml.

Dont forget to put everything inside icons/res/

To learn more about how to set up the file structure for icons and how to theme icons in Android, see the ICONS section of this thread on XDA: http://forum.xda-developers.com/showthread.php?t=1649891
overlays/ Contains drawables and values for each package or system component to be themed. Drawables and components within XMLs are a 1-to-1 replacement for elements defined in installed packages.

Additionally contains a common/ directory which is used to define assets that can be reused across multiple applications. To reference an item from common/, preface an element's src= with @*common: