[Android Themes] asdfasdfvful:
I'd like to make a thread that shows the complete process of making an icon pack for noobs. I call this a "root thread" because I'm not really explaining all the processes, but amassing all the data from other threads and posts and putting it here. Most of what I do write will be the errors that I have come across and how to fix it.

Firstly, I'd like to bring to your attention some useful tools/sites:

Icon Request Tool: Allows users to send you activity names, as well as the icons

Png2xml: Adds all of the png files in the same folder into a drawable.xml file and an icon_pack.xml file in alphabetical order

My dropbox folder, which contains all the stock icons I have downloaded (this may lag as there are thousands of images). You may use this, but I recommend you work with the request tool and go from there as it makes app filters easier.

A xml duplicate line removing site

Setting Up Your Project - Read me first

This is going to be a complete guide on how to set up your project with no errors. I will be using the1dynasty's template from April 2014, but the concept is the same for all projects. If you still have errors after doing all this, DO NOT continue until it is fixed.

1. Import your project - Make sure you are importing android code. It is also recommended that you copy the project into your workplace to stay organized

2. Add support library - as you should see, your project has errors. Right click on it, go to android tools, then add support library. Accept the conditions and add it.

3. If required, add extra libraries - as of now, this template requires actionbarsherlock. Firstly, you'll need to download that and do the 2 steps above. When in the android menu, make sure you check "is library" so you can add it. I would also recommend that you change the target name of all projects to the latest android version (android 4.4.2 for now). Then press apply and okay. Now, with the current template, you can add actionbarsherlock. Another way to add libraries is to copy a .jar file into the libs folder, but we don't need to worry about that now. This should git rid of the errors.

4. Rename application package - this is when you change the project to your needs. Again, right click on the project, go to android tools, and then rename application package. Please remember the original package name (your.icons.name.here in my case). Then, change it to the one you want (com.pitchedapps.icons in my case). Accept all the refractor changes and press finish.

5. Refractoring - you can probably see that in the src folder, the source packages still have your.icons.name.here in them. They need to each be done manually. You can right click on them, then go to refractor, then name, or press shift + alt + r. Change the original package name (your.icons.name.here) to your new package name (com.pitchedapps.icons) for each source package with it. The "view" package will remain as "view". If you are feeling masterful, you could also refractor the main project folder (last screenshot in this section). I renamed mine as "Pitched Apps Icons"

6. Rename everything else - for every project, it is inevitable that the previous two methods will not cover everything. This is why you do a full file search for the original package name. You can get to this panel with "ctrl + h". Please note to search in files and not java, and to search in enclosing projects (make sure you are selecting a file within the project so that you aren't searching in a different one). You can also search in a workplace set and manually select the project. You will get results like so. Next, just change the package names to your new one. I recommend putting them in find/replace (ctrl + f) so you don't accidentally mistype it

If you have no errors, then congratulations! You can now move on in making your icon pack :)

Setting Up Your Project

First, off, you can decide whether you want a plain icon pack, a theme maker or a full on app with interface.

The1dynasty made a really good template which can be found here. (has interface and everything). He also has a complete tutorial on making the template on youtube. If you have questions, post in his google + page. XDA user Blaze has also modified the pack to contain alex's request tool. Thread is here

If, however, you are looking for something simpler, look at this thread for Apex themes here. To make this compatible with other launchers, add the following code to the manifest (right above </manifest>)

<intent-filter>
<action android:name="org.adw.launcher.THEMES" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="org.adw.launcher.icons.ACTION_PICK_ICON" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="com.anddoes.launcher.THEME" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="com.teslacoilsw.launcher.THEME" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="com.fede.launcher.THEME_ICONPACK" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="com.tsf.shell.themes" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="ginlemon.smartlauncher.THEMES" />
<action android:name="ginlemon.smartlauncher.BUBBLESTYLE" />
<action android:name="ginlemon.smartlauncher.BUBBLEICONS" />
<action android:name="ginlemon.smartlauncher.CLOCKS" />
<action android:name="ginlemon.smartlauncher.CLOCKFONTS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="org.adw.launcher.THEMES" />
<action android:name="mobi.bbase.ahome.THEME" />
<action android:name="com.rogro.GDE.THEME.1" />
<action android:name="com.android.dxtop.launcher.THEME" />
<category android:name="com.fede.launcher.THEME_ICONPACK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="org.adw.launcher.icons.ACTION_PICK_ICON" />
<action android:name="mobi.bbase.ahome.THEME" />
<action android:name="com.rogro.GDE.THEME.1" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="cdproductions.crazyicons.TWO" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="com.daeva112.manager.MAIN" />
<category android:name="com.daeva112.manager.THEME" />
</intent-filter>
<intent-filter>
<action android:name="com.gau.go.launcherex.theme" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

You are now all set!

The Drawables

Obviously speaking, the important parts in an icon pack include the drawables, and these three files: drawable.xml, icon_pack.xml, appfilter.xml

Firstly, looking at the drawables, you will notice multiple folders. The one I'm going to focus on is drawable-xxhdpi, one of the folders you can put your icons in. The icon sizes go as follow

mdpi 160dpi 48px * 48px
hdpi 240dpi 72px * 72px
xhdpi 320dpi 96px * 96px
xxhdpi 480dpi 144px * 144px
xxxhdpi 640dpi 192px * 192px

You do not need to make icons for every size, as it will automatically be resized to fit devices. However, if you want hd apps, try to look at at least xxhdpi

Here is a link to my dropbox, where I keep all the stock icons (xxxhdpi). This (and the xml's) take the longest time to do, so it's just my way of giving back and thanking those that helped me. More info on xml's in the section below

Drawable Errors

If you are making all the drawables yourself, just know that there can be no capital letters (or ".") in your file name. If you have that, you will get many errors and eclipse won't generate a r.java file for you.

There is however an easy fix for those using windows. Simply go to the folder containing your images, hold shift, right click, and press run command window here. Then paste this code (ctrl v won't work, right click and press paste)

for /f "Tokens=*" %f in ('dir /l/b/a-d') do (rename "%f" "%f")

Xml files

Drawable.xml - this is a list of all the icons in your app. It allows users to manually select the icon they want for a certain app through the launcher. As the launcher will display the icons in the same order as drawable.xml, this is best done alphabetically

Iconpack.xml - also written as icon_pack.xml in some templates - this tells the icon pack which drawables (icons) are currently available

The good thing about the two xml's above is that they are very easy to make. Simply put this java application in the folder with all the icons and run it, and it will make the files. Do this every time you make new icons! Again, make sure that your template uses iconpack.xml and not icon_pack.xml (like the apex template). To solve this, either rename your xml each time or search the project for icon_pack and change it to iconpack

Appfilter.xml - this one contains all the activities, and is what allows the app to automatically associated each app with its corresponding icons. Unfortunately, this must be done manually (or with the help of a tool). As mentioned in the beginning, here is a tool I made (source thanks to Alex R3conn3r to help you with this. It'll make an appfilter for you, so use it as reference.

As you can see, both appfilter and drawable are located in the assets and xml folders, and iconpack is in the values folder. Simply put, replace all your old xml's with your new ones in all three folders so that you support all the launchers. (To add more detail, xml is for most standard launchers, ie apex, nova etc), and assets is for go. Furthermore, if you use an icon request tool that filters out prethemed icons, it needs to look at an appfilter in assets)

Getting help from your users

***Easiest way is to implement alex's icon request tool. ***

This is mainly for the appfilter file. Finding the activities can be a very treacherous task, especially when there are many activities for each app. Two good manual sources are

http://activities.droidicon.com/

http://activities.tundem.com/

But you can also rely on apps like QuickShortcutMaker

An even more automatic alternative is Icon Helper, which I will write a guide on once I figure out how to use it

There is now a template that has an icon helper built into it (thread is here). Credits go to the1dynasty for his template, alex for his icon request tool, tung for the idea (he made icon helper), and blaze for doing the impossible and putting it all together :)

How to search in a whole project

Select the appropriate project (select any file in that project) and press ctrl + H. Then, do the following (underlined in blue)

In the example, I searched for "your.icons.name.here", which is the original package name for the1dynasty's pack. What I would recommend is that you search for the original package name and rename it to your pack, then search for ".com" to find the emails, and also whatever link or specific keyword you need to change

Editing strings

Most of the strings will be in the values folder (strings, strings_app, strings_dev, etc). It is just up to you to look through all of them. Some may also be hidden in java, so be sure to look there too! (try searching)

Info for the1dynasty's template

* FAQ - Read me first if you are new

Before doing anything, you must download actionbarsherlock (may be removed in future), and add support libraries to the project by right clicking and going to android tools --> add support library

To change the activity name (default is your.icons.name.here), you must:

Rename the application package - right click the project, go to android tools, and press rename package name (ie to com.asdfasdfvful.icons).

Rename the src package folders - (shortcut is alt + shift + R) - change all the "your.icons.name.here" to match your package name (so your.icons.name.here.util becomes com.asdfasdfvful.icons.util)

Do the ctrl + h thing as mentioned above (scroll up to blue title)

Drawables CANNOT start with numbers or contain special characters. Add the a letter (ie "a" to retain the order) and change the characters so eclipse does not explode

Drawable and app filter need to be in xml to support launchers like Nova, and assets for the request tool and the launchers like go. Icon_pack.xml should be in the values folder. Furthermore, if your icons are not theming, check the app drawer first. Often times, if you manually set an icon for an app, it will not change automatically after further updates (to change that, readd the app to your screen from the app drawer)

* Where is...? And a bunch of other small facts

How to I remove the title from the action bar?

Go to src, the Activity package folder, and then MainActivity.java. Or you can search for "setDisplayShowTitleEnabled". Change that to false. As for setDisplayShowHomeEnabled, that is for the icon.​

How do I change the actionbar color?

Go to res/xhdpi/ab_transparent.9.png and modify that to your liking. You may also want to change the white50 in res/values/colors.xml​

How do I change between listview and gridview?

Go to res/layout/gridview_behind (or search for "android:numColumns". Change the number (1 for list, 2, 3, whatever for gridview)​

* Adding and removing cards

Go into src/fragments/mainfragment.java, and you will see two parts, both of which for phones and tablets

You will see something like

listOfStuff.add(new AdapterItem(getResources().getString (R.string.title_app),
getResources().getString (R.string.desc_app), 0));
listOfStuff.add(new AdapterItem(getResources().getString (R.string.title_request),
getResources().getString (R.string.desc_request), 1));
listOfStuff.add(new AdapterItem(getResources().getString (R.string.title_production),
getResources().getString (R.string.desc_production), 2));
listOfStuff.add(new AdapterItem(getResources().getString (R.string.title_apply),
getResources().getString (R.string.desc_apply), 3));
listOfStuff.add(new AdapterItem(getResources().getString (R.string.title_walls),
getResources().getString (R.string.desc_walls), 4));
listOfStuff.add(new AdapterItem(getResources().getString (R.string.title_xda),
getResources().getString (R.string.desc_xda), 5));

This is what tells the app what to show for each card. To change the name, icon, or description of any card, simply refer it to a different string or change the original string. To add a new card, just copy one of them, and paste it. Change the two R.string and the number before the "));"

The next part will look something like this

switch (position) {
case 0:
Intent pitchedplay = new Intent(Intent.ACTION_VIEW).setData(Uri.parse
("https://play.google.com/store/apps/developer?id=Pitched+Apps"));
startActivity(pitchedplay);
break;
case 1:
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setComponent(new ComponentName("com.pitchedapps.icons.raging.shadows","com.pitchedapps.icons.raging.shadows.RequestActivity"));
startActivity(intent);
break;
case 2:
Intent production = new Intent(Intent.ACTION_VIEW).setData(Uri.parse
("http://goo.gl/OoIxqC"));
startActivity(production);
break;
case 3:
Intent launcher = new Intent(getSherlockActivity(), LauncherMain.class);
startActivity(launcher);
break;
case 4
Intent wall = new Intent(getSherlockActivity(), Wallpaper.class);
startActivity(wall);
break;
case 5:
Intent xda = new Intent(Intent.ACTION_VIEW).setData(Uri.parse
("http://xdaforums.com/showthread.php?t=2669405"));
startActivity(xda);
break;

This gives each card its own function. You can reorder them as you like, but make sure the case number matches the first code. To add another function for a card, copy a case, change the number, the intent name, the start activity name (same as intent name) and the function.

* Adding removing buttons in the overflow menu

Go to activity/mainactivity.java or search for

public boolean onOptionsItemSelected(MenuItem item)

Remove, rearrange, or add buttons as you please. Keep in mind that adding requires that you add the appropriate id's, so it's not for absolute beginners.

* Removing the oss pop up

Search for the following

This code checks if MY OSS is installed on first run.

To see which files contain the code. Then remove everything up to the "}" before "@ Override" as shown:

/******************************************************************************
** This code checks if MY OSS is installed on first run. If it is installed **
** you get a dialog that says you're awesome and the user hits OK to remove **
** that dialog. If it is NOT installed, the user is prompted to install it. **
** You can remove this section if you're not checking for apps on first run **
******************************************************************************/
public void onStart() {
super.onStart();
boolean installed = isAppInstalled("app.the1dynasty.oss");

// Checking if installed and if its the first run
if (installed) {
boolean firstrunOSS = getSharedPreferences("PREFERENCE", MODE_PRIVATE)
.getBoolean("firstrunOSS", true);
if (firstrunOSS){

/*
* Installed dialog
* Check res/values/strings.xml to change text to whatever you want the Alert to say
*/
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setTitle(getResources().getString (R.string.alert_start_title));
alert.setMessage(getResources().getString (R.string.alert_start_desc));
alert.setIcon(R.drawable.alert_pass);
alert.setPositiveButton(getResources().getString (R.string.ok), null).show ();

// Save the state so this dialog doesn't run again
getSharedPreferences("PREFERENCE", MODE_PRIVATE)
.edit()
.putBoolean("firstrunOSS", false) /* You can change this to another name */
.commit();
}
}

/*
* Not Installed dialog
* Check res/values/strings.xml to change text to whatever you want the Alert to say
*/
else {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(getResources().getString (R.string.error_start_title));
builder.setMessage(getResources().getString (R.string.error_start_desc));
builder.setIcon(R.drawable.alert_fail);
builder.setNeutralButton(getResources().getString (R.string.later), new OnClickListener(){
[MENTION=439709]override[/MENTION]
public void onClick(DialogInterface arg0, int arg1) {
}
});

// Change line 88 with the URL to YOUR app
builder.setPositiveButton(getResources().getString (R.string.get), new OnClickListener(){
[MENTION=439709]override[/MENTION]
public void onClick(DialogInterface arg0, int arg1) {
Intent share = new Intent(Intent.ACTION_VIEW).setData(Uri.parse
("market://details?id=app.the1dynasty.oss"));
startActivity(share);
}
});
builder.show();
}
}

* Adding wallpapers

Go to drawable_nodpi and add your wallpaper in the same format (wall_# & wall_#_small with dimensions 215x179)

Go to res/values/array.xml and add more lines for wallpapers (or just copy paste this) Note that you can add more than you actually have

<?xml version="1.0" encoding="utf-8" ?>

<resources>

<string-array name="wallpaperlist">
<item>wall_1</item>
<item>wall_2</item>
<item>wall_3</item>
<item>wall_4</item>
<item>wall_5</item>
<item>wall_6</item>
<item>wall_7</item>
<item>wall_8</item>
<item>wall_9</item>
</string-array>

<!-- Provide a list of wallpaers -->
<string-array name="wallpapers" translatable="true">
<item>wall_1</item>
<item>wall_2</item>
<item>wall_3</item>
<item>wall_4</item>
<item>wall_5</item>
<item>wall_6</item>
<item>wall_7</item>
<item>wall_8</item>
<item>wall_9</item>
</string-array>

<string-array name="extra_wallpapers">
</string-array>

<!-- This wallpaper will be used when a user applies the theme -->
<string name="default_wallpaper">wall_1</string>

<string-array name="dock_pack" translatable="false">
<item>dock_0002</item>
<item>dock_0003</item>
<item>dock_0004</item>
</string-array>

</resources>

You can also search the project for "wall_", and you will come across some other files. Some of them allow you to select the default wallpaper, so just change the # to the one you want.

Check out my icon pack!