[MOD][GUIDE][GB] Highlighted Chooserbox

Search This thread

Sniper Killer

Senior Member
Dec 16, 2012
1,307
3,104
Tirana, Albania
Hey all!
If you have noticed, on ICS/JB there is a little transition when you click on a chooserbox. This is a nice feature which I like very much!
After doing some investigation on framework I realized that on res/drawable-mdpi there were some pngs which are needed for this feature to work.


jmw1.png

Actually this feature exists on gingerbread but there aren't enough xmls to activate it. Seems like Google has abandoned the project because of some reasons. :confused: The closest reason is this :
"Google have not implemented the full sources of it because they wanted to reserve it for future releases. [On ICS/JB]"
Why do i think so? Because @SpaceCaker has discovered many secrets whose nature is like in our case. He has discovered weather information on lockscreen, Music Player Control on Lockscreen and also some codes and smalis which are present on ICS.


[Actually, I have used custom sources rather than using google's one]

Today I gonna show you how to fully implement it on GB! :victory:

Requirments :
-APK Multi Tools
-Notepad++
-Knowledge about xmls
-Sources on attachments

- Decompile framework-res.apk

1. Go to res/drawable/list_selector_background.xml
You will see something like this :

Code:
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:drawable="@color/transparent" />
<item android:state_focused="true" android:state_enabled="false" android:state_pressed="true" android:drawable="@drawable/list_selector_background_disabled" />
<item android:state_focused="true" android:state_enabled="false" android:drawable="@drawable/[B]list_selector_background_disabled[/B]" />
[COLOR="red"]<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/list_selector_background_transition" />
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/[B]list_selector_background_transition[/B]" />[/COLOR]
<item android:state_focused="true" android:drawable="@drawable/list_selector_background_focus" />
</selector>

2. Change the 2 red lines. It will look like this :

Code:
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:drawable="@color/transparent" />
<item android:state_focused="true" android:state_enabled="false" android:state_pressed="true" android:drawable="@drawable/list_selector_background_disabled" />
<item android:state_focused="true" android:state_enabled="false" android:drawable="@drawable/list_selector_background_disabled" />
[COLOR="Red"]<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/[B]sniper_killer[/B]" />
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/[B]sniper_killer[/B]" />[/COLOR]
<item android:state_focused="true" android:drawable="@drawable/list_selector_background_focus" />
</selector>

3. Download the Highlight Chooserbox_source.zip in the attachment, extract it and put sniper_killer.xml on drawable folder.
It consists these lines :

Code:
<item android:duration="20" android:drawable="@drawable/sniper_status_bar_item_pressed_anim2" />
<item android:duration="20" android:drawable="@drawable/sniper_status_bar_item_pressed_anim2" />
<item android:duration="30" android:drawable="@drawable/sniper_status_bar_item_pressed_anim3" />
<item android:duration="30" android:drawable="@drawable/sniper_status_bar_item_pressed_anim4" />
<item android:duration="40" android:drawable="@drawable/sniper_status_bar_item_pressed_anim5" />
<item android:duration="50" android:drawable="@drawable/sniper_status_bar_item_pressed_anim6" />
<item android:duration="60" android:drawable="@drawable/sniper_status_bar_item_pressed_anim7" />
<item android:duration="60" android:drawable="@drawable/sniper_status_bar_item_pressed_anim8" />

4. Put the PNGs on res/drawable-mdpi

5. Recompile framework-res.apk and test

Proof :

[The transition changes in miliseconds making it impossible to capture.
But after tries and tries i finally managed to capture the transition :cool: ]







Credits :
-ryanfebriyadi
-Google
-Me
 
  • Like
Reactions: zhaozihanzzh

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Hey all!
    If you have noticed, on ICS/JB there is a little transition when you click on a chooserbox. This is a nice feature which I like very much!
    After doing some investigation on framework I realized that on res/drawable-mdpi there were some pngs which are needed for this feature to work.



    Actually this feature exists on gingerbread but there aren't enough xmls to activate it. Seems like Google has abandoned the project because of some reasons. :confused: The closest reason is this :
    "Google have not implemented the full sources of it because they wanted to reserve it for future releases. [On ICS/JB]"
    Why do i think so? Because @SpaceCaker has discovered many secrets whose nature is like in our case. He has discovered weather information on lockscreen, Music Player Control on Lockscreen and also some codes and smalis which are present on ICS.


    [Actually, I have used custom sources rather than using google's one]

    Today I gonna show you how to fully implement it on GB! :victory:

    Requirments :
    -APK Multi Tools
    -Notepad++
    -Knowledge about xmls
    -Sources on attachments

    - Decompile framework-res.apk

    1. Go to res/drawable/list_selector_background.xml
    You will see something like this :

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <selector
    xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_window_focused="false" android:drawable="@color/transparent" />
    <item android:state_focused="true" android:state_enabled="false" android:state_pressed="true" android:drawable="@drawable/list_selector_background_disabled" />
    <item android:state_focused="true" android:state_enabled="false" android:drawable="@drawable/[B]list_selector_background_disabled[/B]" />
    [COLOR="red"]<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/list_selector_background_transition" />
    <item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/[B]list_selector_background_transition[/B]" />[/COLOR]
    <item android:state_focused="true" android:drawable="@drawable/list_selector_background_focus" />
    </selector>

    2. Change the 2 red lines. It will look like this :

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <selector
    xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_window_focused="false" android:drawable="@color/transparent" />
    <item android:state_focused="true" android:state_enabled="false" android:state_pressed="true" android:drawable="@drawable/list_selector_background_disabled" />
    <item android:state_focused="true" android:state_enabled="false" android:drawable="@drawable/list_selector_background_disabled" />
    [COLOR="Red"]<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/[B]sniper_killer[/B]" />
    <item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/[B]sniper_killer[/B]" />[/COLOR]
    <item android:state_focused="true" android:drawable="@drawable/list_selector_background_focus" />
    </selector>

    3. Download the Highlight Chooserbox_source.zip in the attachment, extract it and put sniper_killer.xml on drawable folder.
    It consists these lines :

    Code:
    <item android:duration="20" android:drawable="@drawable/sniper_status_bar_item_pressed_anim2" />
    <item android:duration="20" android:drawable="@drawable/sniper_status_bar_item_pressed_anim2" />
    <item android:duration="30" android:drawable="@drawable/sniper_status_bar_item_pressed_anim3" />
    <item android:duration="30" android:drawable="@drawable/sniper_status_bar_item_pressed_anim4" />
    <item android:duration="40" android:drawable="@drawable/sniper_status_bar_item_pressed_anim5" />
    <item android:duration="50" android:drawable="@drawable/sniper_status_bar_item_pressed_anim6" />
    <item android:duration="60" android:drawable="@drawable/sniper_status_bar_item_pressed_anim7" />
    <item android:duration="60" android:drawable="@drawable/sniper_status_bar_item_pressed_anim8" />

    4. Put the PNGs on res/drawable-mdpi

    5. Recompile framework-res.apk and test

    Proof :

    [The transition changes in miliseconds making it impossible to capture.
    But after tries and tries i finally managed to capture the transition :cool: ]







    Credits :
    -ryanfebriyadi
    -Google
    -Me