# SOLVED! custom_background_dialer from templatebread



## philosophics

So I've been racking my brain for the past 3 days while losing hair in the process about trying to get my Dialer and Contacts screen have a transparent background.
Using Templatebread and even tried pushing the custom_background_dialer the old school way. Nothing is working the way I want it to.

Can someone please help me out here? Some screenshots of the problems I have...








And this is what happens when I type in a number...









Again, if anyone could help me out, it would be greatly appreciated. Also, let me know if you need anymore information.

This is one of the biggest obstacles I have from releasing this theme to the masses!

-

SOLVED!

I fused MrDSL's MIXER theme with my templatebread.
So far, I have 2 people to thank. MrDSL and Haxzamatic. Unfortunately, Haxzamatic has been MIA since May so he won't know for quite some time.

I will use this thread to post my theme when it's ready for an alpha release.  But I won't be as fast as the rest of these guys/gals. So don't get too excited...


----------



## jharlin

I also have been trying to get this to work with no luck. Besides using his theme, what else did you do to solve it?


----------



## JsinLegacy

Its very simple to change the dialer bg to be transparent or any image you so choose. I will just mention how to do it in the theme engine because I assume that is what you will be working with.

Anyways, if you decompile the contacts.apk and go into the values folder you will see the styles.xml. Open that up in whatever you choose, text pad, notepad, or Dreamweaver. Look at the first "set" of lines, what you want is there. So basically you are looking for this.



Code:


<style name="DialtactsTheme" parent="@android:style/Theme"><br />
<item name="android:windowNoTitle">true</item><br />
<item name="android:windowContentOverlay">@null</item>

now that you have that you want to edit is so that you can add a custom background to the dialer. Now you can make the background whatever you choose, any image, so we are going to have to add that as well, but that will be touched on in a minute. Just a note though, adding the custom background is the best option vs full transparency due to the fact that you can quickly adjust the transparency level if you need to. It is possible to make the dialer bg fully transparent without adding a custom background image. Anyways, lets move on. Now that we have the lines we need to edit lets do that.

The first line in that text you want to just add ".Wallpaper" at the end where is says /Theme. Please note the period applied between /Theme and Wallpaper. Now the last line you can just delete, we no longer really need that. As for the second line we won't be touching that at all so just ignore it. Now you need to add a line, I typically place it in between the two lines that are left but you can add to the end if you so choose.

The line will be set up similar to the other two. So go ahead and start it off with <item name="android:windowBackground">(this is where you place the location of the image you want to use)</item>

Once you complete that you're new set of lines should be similar to this:



Code:


<style name="DialtactsTheme" parent="@android:style/Theme.Wallpaper"><br />
<item name="android:windowBackground">@drawable/custom_background_dialer</item><br />
<item name="android:windowNoTitle">true</item>

Note: I typically name the image I want to use "custom_background_dialer" but you are more than welcome to name it whatever you want, just remember it needs to be lowercase.

With your new set of lines you want to navigate to the values folder in the theme engine (decompiled (Windows) also or building from source). Whichever you so choose. Once there you want to open up the styles.xml and paste the new set of lines into that styles.xml. Just make sure it is between the <resources> </resources> .. You can save the xml now. Also, to make sure you add your background image to the appropriate folder, typically drawable-hdpi-finger folder.

Now you need to redirect the theme engine to call to these new items instead of using stock. So you need to navigate to the xml folder in the theme engine and find com_android_contacts.xml. With this open you are now going to add the lines to call to the image and the edit you made to the styles.xml. This is easy to do, you can already see how all the lines are set up so you will just set these new ones up the same way. If you look a the current list of lines you will notice they all pretty much point to drawables (<item name="drawable) & )@drawable/) but for the edit to the styles.xml just change where it says drawable to "style" and then "@style" and then "DialtactsTheme" after both.

Note: the quotations are not needed once you begin the @ portion of the line. So it should look like this when you are done.



Code:


<item name="style/DialtactsTheme">@style/DialtactsTheme</item>

now depending on what you are working with the line for custom_background_dialer is possibly already added. If you changed the name of it just edit the portions of the line that say custom_background_dialer to whatever the new name is. If the line is added than then that means the image is as well, so go edit that to the new name also. Just don't mess with the portion that says com_android_contacts_

Now just save that xml and you are pretty much good to go. This will allow you to have a custom image as a bg in your dialer.  YAY!!!!

As a side task though to fully complete it. You need to pull the call_background.xml from the decompiled contacts and place it into the drawable folder. After you do this you will need to edit it as well and then redirect the contacts app. So after the edit you need to go into the com_android_contacts.xml located in the xml folder and add the line calling to this xml. Just set it up like the others.

Note: if you do not do this you will have black boxes that show up on the right side when you scroll through the other tabs on the dialer.

When you open it, it should look like this:



Code:


<item android:state_window_focused="false" android:drawable="@android:color/transparent" /><br />
<item android:state_focused="false" android:state_pressed="true" android:drawable="@android:drawable/no_tile_128" /><br />
<item android:state_focused="false" android:state_pressed="false" android:drawable="@android:drawable/screen_background_dark" />

basically you are just going to edit the very end of each line so that they look similar to this:



Code:


<item android:state_window_focused="false" android:drawable="@color/transparent" /><br />
<item android:state_focused="false" android:state_pressed="true" android:drawable="@color/transparent" /><br />
<item android:state_focused="false" android:state_pressed="false" android:drawable="@color/transparent" />

Once you complete this you can just save the xml. Now navigate to the colors.xml in the values folder and add a new color line. Its possible this line is already added as well, just listing this in case it is not.

Should look like:



Code:


<color name="transparent">#00000000</color>

This is the end of it all... now you can just compile and swap the image out until you find the one you like. The image for the dialer to fit is typically 480x800 but you can always play around with it.


----------



## jharlin

I followed the guide posted above but when I push my compiled Contacts.apk to my phone, the Contacts and Phone apks no longer exist. Anyone have an answer as to what's going on?


----------



## JsinLegacy

jharlin said:


> I followed the guide posted above but when I push my compiled Contacts.apk to my phone, the Contacts and Phone apks no longer exist. Anyone have an answer as to what's going on?


I just saw this are you still having issues or did you get it working...? sorry it has been so long to respond.

Also, I posted this for the theme engine ... did you just filter those parts out? Because its even easier if you are just doing contacts by itself


----------



## jackstraw

Nice tutorial jsin, adding to favs


----------



## jharlin

JsinLegacy said:


> I just saw this are you still having issues or did you get it working...? sorry it has been so long to respond.
> 
> Also, I posted this for the theme engine ... did you just filter those parts out? Because its even easier if you are just doing contacts by itself


Yes, I'm still having problems. I filtered out the theme engine parts. When I push my updated contacts.apk the contacts and phone apks disappear.

EDIT: Here is a link to the Contacts.apk I'm trying to push to my phone.

http://www.mediafire.com/?b1ou1nsf1zsjlcr


----------



## JsinLegacy

jharlin said:


> Yes, I'm still having problems. I filtered out the theme engine parts. When I push my updated contacts.apk the contacts and phone apks disappear.
> 
> EDIT: Here is a link to the Contacts.apk I'm trying to push to my phone.
> 
> http://www.mediafire...b1ou1nsf1zsjlcr


Soon as I get on my laptop I will take a look. What ROM is it for?


----------



## jharlin

JsinLegacy said:


> Soon as I get on my laptop I will take a look. What ROM is it for?


CM 7.1 Thanks bro!!


----------



## JsinLegacy

just to let you know I did not forget about this.. I just got side tracked making some wallpapers...


----------



## jharlin

JsinLegacy said:


> just to let you know I did not forget about this.. I just got side tracked making some wallpapers...


No problems. Take your time bro.


----------



## JsinLegacy

can you post how your styles.xml looks...? I have tried this a few times and am not having any issues with it working.


----------



## jharlin

JsinLegacy said:


> can you post how your styles.xml looks...? I have tried this a few times and am not having any issues with it working.





Code:


<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<resources><br />
    <style name="DialtactsTheme" parent="@android:style/Theme.Wallpaper"><br />
	    <item name="android:windowBackground">@drawable/custom_background_dialer</item><br />
	    <item name="android:windowNoTitle">true</item><br />
    </style><br />
    <style name="ContactsSearchTheme" parent="@android:style/Theme.Translucent.NoTitleBar"><br />
	    <item name="android:windowAnimationStyle">@style/ContactsSearchAnimation</item><br />
    </style><br />
    <style name="MinusButton"><br />
	    <item name="android:background">@drawable/btn_circle</item><br />
	    <item name="android:src">@drawable/ic_btn_round_minus</item><br />
	    <item name="android:contentDescription">@string/description_minus_button</item><br />
    </style><br />
    <style name="PlusButton"><br />
	    <item name="android:background">@drawable/btn_circle</item><br />
	    <item name="android:src">@drawable/ic_btn_round_plus</item><br />
	    <item name="android:contentDescription">@string/description_plus_button</item><br />
    </style><br />
    <style name="MoreButton"><br />
	    <item name="android:background">@drawable/btn_circle</item><br />
	    <item name="android:src">@drawable/ic_btn_round_more</item><br />
    </style><br />
    <style name="LessButton"><br />
	    <item name="android:background">@drawable/btn_circle</item><br />
	    <item name="android:src">@drawable/ic_btn_round_less</item><br />
    </style><br />
    <style name="TallTitleBarTheme" parent="@android:style/Theme.NoTitleBar"><br />
	    <item name="android:windowContentOverlay">@null</item><br />
    </style><br />
    <style name="BackgroundOnly"><br />
	    <item name="android:windowBackground">@null</item><br />
	    <item name="android:windowNoTitle">true</item><br />
	    <item name="android:windowIsFloating">true</item><br />
	    <item name="android:windowContentOverlay">@null</item><br />
	    <item name="android:windowAnimationStyle">@null</item><br />
	    <item name="android:windowNoDisplay">true</item><br />
    </style><br />
    <style name="FullyTranslucent" parent="@android:style/Theme.Translucent.NoTitleBar"><br />
	    <item name="android:windowContentOverlay">@null</item><br />
    </style><br />
    <style name="FullyTranslucent.QuickContact" parent="@style/FullyTranslucent"><br />
	    <item name="android:windowAnimationStyle">@style/DummyAnimation</item><br />
    </style><br />
    <style name="QuickContact"><br />
	    <item name="android:windowBackground">@android:color/transparent</item><br />
	    <item name="android:windowFrame">@null</item><br />
	    <item name="android:windowIsFloating">true</item><br />
	    <item name="android:windowContentOverlay">@null</item><br />
    </style><br />
    <style name="QuickContactAboveAnimation"><br />
	    <item name="android:windowEnterAnimation">@anim/quickcontact_above_enter</item><br />
	    <item name="android:windowExitAnimation">@anim/quickcontact_above_exit</item><br />
    </style><br />
    <style name="QuickContactBelowAnimation"><br />
	    <item name="android:windowEnterAnimation">@anim/quickcontact_below_enter</item><br />
	    <item name="android:windowExitAnimation">@anim/quickcontact_below_exit</item><br />
    </style><br />
    <style name="ContactsSearchAnimation"><br />
	    <item name="android:windowEnterAnimation">@anim/search_bar_enter</item><br />
	    <item name="android:windowExitAnimation">@anim/search_bar_exit</item><br />
    </style><br />
    <style name="DummyAnimation"><br />
	    <item name="android:windowExitAnimation">@anim/dummy_animation</item><br />
    </style><br />
</resources><br />


----------



## JsinLegacy

sorry its taken so long... I get side tracked easily ... 
everything you have looks right ...
try leaving the line

<item name="android:windowContentOverlay">@null</item>
in there and see if it makes a difference ...


----------



## Alexia

It sounds more like your using APKtool 1.4... And i am rather sure APKtool 1.4 doesnt like images being added... Try 1.3


----------



## jharlin

I am actually using 1.3.1

Sent from my T-Mobile G2 using RootzWiki


----------



## jharlin

Edit: I just created a theme with the theme chooser for the stuff I couldn't get working. Thanks for everyones help!!!

Anyone have anything else to try? Nothing has worked so far.

Sent from my T-Mobile G2 using RootzWiki


----------

