mercredi 19 août 2015

[Guide][Add own action bar, background, etc in any app]



Hi Guys, This is a guide to add own theme action bar, background, list separators, etc) in any system/user apps like settings, contacts, mms , etc. Which doesn't have own theme , they are controlled by framework-res.apk :p
I have used it in Kitkat and Jellybean, not sure about other versions :silly:


Let's start :D

Requirements -
Apktool
Text editor
Patience :cool:

ADD OWN ACTION BAR

1. Decompile the app in which you wanna add your action bar. I'll take settings.apk

2. Open androidmanifest.xml
Search for <application
And scroll down, u'll find android:theme
In my Androidmanifest it is "android:theme="@style/Theme.Settings" it is different in all apps. Copy the theme that is Theme.Settings in my app.

3. Now open styles.xml and search whatever you copied. In my case it is "Theme.Settings"

4. Now add the following Red color highlighted lines.


Code:


    <style name="Theme.Settings" parent="@android:style/Theme.Holo">
        <item name="android:actionBarStyle">@style/Widget.Holo.Light.ActionBar.Solid.Inverse</item>


5. Add the following codes below before </resources>





Code:


    <style name="Widget.Holo.Light.ActionBar.Solid.Inverse" parent="@android:style/Widget.DeviceDefault.Light.ActionBar.Solid.Inverse">
        <item name="android:background">@drawable/ab_solid_dark_holo</item>
        <item name="android:displayOptions">showTitle</item>
        <item name="android:titleTextStyle">@style/TextAppearance.Holo.Widget.ActionBar.Title.Inverse</item>
        <item name="android:backgroundSplit">@drawable/ab_bottom_solid_dark_holo</item>
    </style>
    <style name="TextAppearance.Holo.Widget.ActionBar.Title.Inverse" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title.Inverse">
        <item name="android:icon">@android:color/transparent</item>
        <item name="android:textSize">17.0dip</item>
        <item name="android:textStyle">bold</item>
        <item name="android:textColor">#ffffffff</item>
    </style>






6. Now copy ur desired pngs in drawable-hdpi and change their their name to ab_solid_dark_holo and ab_bottom_solid_dark_holo

- ab_solid_dark_holo is for action bar and ab_bottom_solid_dark_holo for bottom action bar.

- <item name="android:icon">@android:color/transparent</item> is for making ur apps's icon transparent, if you wanna make it visible then don't add this line.. :D


7. If u don't wanna add pngs and copy following red color highlighed codes to drawables.xml , u'll get it in values folder.


Code:


<?xml version="1.0" encoding="utf-8"?>
<resources>
<item type="drawable" name="ab_solid_dark_holo">#00000000</item>
    <item type="drawable" name="ab_bottom_solid_dark_holo">#00000000</item>

</resources>



- If u don't have drawables.xml then create it in values folder and copy all lines... :good:


I'll add more when I will get time..

Hit thanks if this guide is useful for you :D



Aucun commentaire:

Enregistrer un commentaire