SoftKeys Theme Template v1.0 ################################################# License: ------------------------------------------------- /* This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want * To Public License, Version 2, as published by Sam Hocevar. See * http://sam.zoy.org/wtfpl/COPYING for more details. */ Usage instructions: ------------------------------------------------- 1.-Load the template into eclipse: 1.a-On eclipse, select new android project 1.b-On the new project screen, select "Project from existing source" and select the theme template dir. 1.c-Click finish. 2.-Modify the app packagename and path (you should change if from x.x.x to your.package.name) 2.a-On eclipse, look into your project explorer, rightclick the x.x.x package and select "Refactor->Rename..." and follow the instructions. 3.-Editing the AndroidManifest.xml: 3.a-EDIT ONLY the packagename AND versioncode/versionname to suit your needs. 3.b-If you remove/change the installLocation param, your theme could not be loaded on boot on froyo phones. 3.c-If you remove/change the "net.hoopajoo.android.SoftKeys.THEMES" intent filter and/or the "android.intent.category.DEFAULT" category, your theme won't be visible to SoftKeys users. 3.d-This template is preconfigured to NOT show on the application drawer so users don't get bloated with theme icons on their app drawers. 4.-Edit the res/values/theme_config.xml to your needs. 5.-Edit the different drawables in there. 6.-For advanced theming you can also create custom layouts 7.-Export the apk from eclipse as every other android app. Quick start: ------------------------------------------------- For simple themes you just need to create the new icons you want and name them: res/drawable/button_back.png res/drawable/button_home.png res/drawable/button_menu.png res/drawable/button_search.png res/drawable/button_settings.png res/drawable/button_exit.png for the button background: res/drawable/button_background.png How themes are applied: ------------------------------------------------- The interface is built up at runtime from chunks, using the most specific resource when available. The main interface bound to the home button is composed of the button container and the soft key buttons. For basic theming like just changing the button backgrounds and icons you can just create some drawables. Drawables for buttons are built up using the most specific resource of: Foreground icon: main_button_<button name> main_button button_<button name> button Background drawable: main_button_background_<button name> main_button_background button_background_<button name> button_background Button names are: back home menu search settings exit So for example if you wanted to make a common background for all buttons in the main window, create a main_button_background drawable (xml or png or whatever). Then if you wanted to make the home button have a different background you could create a main_button_background_home. If you used all png drawables you would have these files: res/drawable/main_button_background.png res/drawable/main_button_background_home.png For more advanced changes you can modify the padding or anything else from an xml layout by creating a layout named the same as the foreground icon, so if you wanted to do something special with the home button you could create: res/layout/main_button_home.xml This layout should contain just an imagebutton. There is a sample in the samples/ directory. If you want to change the button container background you can specify a custom 9 patch or just a background image or modify the xml, in the same was as the buttons. The naming for the button container is: main_button_container button_container You can also specify a background in the same way as a drawable without making custom xml using: main_button_container_background button_container_background For the service window popup it works the same way but everything is prefixed with service_ instead of main_, e.g. the home button in the service window is: service_button_home If you want to use the same icons for both, you can omit the prefix. So to use the same icons for home in the service window and the main window just create: res/drawable/button_home.png Then it will be used in both places. To theme the button that triggers the service popup use: service_button_popper e.g. you can make it not be the main icon by creating a png: res/drawable/service_button_popper.png