mardi 11 août 2015

[Guide] Add "Coloricker" in Settings



In this guide , I will tell "How to add Colorpicker" in Settings. :)
Tested this on 4.2 and 4.4

REQUIREMENTS :
1. Brain
2. Apktool
3. Notepad ++
4. Knowledge on How to Decompile/Recompile the apk


Lets start ,

1. Decompile your Settings.apk and merge the file (given below).


2. Now open strings.xml and add these lines above </resources>.

PHP Code:







<string name="dialog_color_picker">Color Picker</string>

    <
string name="press_color_to_apply">Press on color below to apply</string>

    <
string name="arrow_right">&#8594;</string>

    
<string name="arrow_down">&#8595;</string>

    
<string name="hex">Hex:</string>

    <
string name="hex_hint">\#ff000000</string>

    
<string name="set">Set</string










3. Now open ids.xml and add these lines above </resources>.

PHP Code:







<item type="id" name="hex">false</item>

    <
item type="id" name="enter">false</item>

    <
item type="id" name="white_panel">false</item>

    <
item type="id" name="black_panel">false</item>

    <
item type="id" name="cyan_panel">false</item>

    <
item type="id" name="red_panel">false</item>

    <
item type="id" name="green_panel">false</item>

    <
item type="id" name="yellow_panel">false</item>

    <
item type="id" name="old_color_panel">false</item>

    <
item type="id" name="new_color_panel">false</item>

    <
item type="id" name="reset">false</item>

    <
item type="id" name="color_picker_view">false</item>

    <
item type="id" name="ics_color">false</item>

    <
item type="id" name="color_panel_view">false</item










4. Now Recompile your Settings.apk , Sign it and then again Decompile it.


5. Now go to smali/net/margaritov/preference/colorpicker and open the "ColorPickerDialog.smali". Then replace the id with the id present in public.xml of your Settings.apk





0x7f0400bb

PHP Code:







<public type="layout" name="dialog_color_picker" 









0x7f0b09ba

PHP Code:







 <public type="string" name="dialog_color_picker" 









0x7f08028a

PHP Code:







<public type="id" name="color_picker_view" 









0x7f080288

PHP Code:







<public type="id" name="old_color_panel" 









0x7f080289

PHP Code:







<public type="id" name="new_color_panel" 









Do this with other same id

0x7f080282

PHP Code:







<public type="id" name="white_panel" 









0x7f080283

PHP Code:







<public type="id" name="black_panel" 









0x7f080284

PHP Code:







<public type="id" name="cyan_panel" 









0x7f080285

PHP Code:







<public type="id" name="red_panel" 









0x7f080286

PHP Code:







<public type="id" name="green_panel" 









0x7f080287

PHP Code:







<public type="id" name="yellow_panel" 









0x7f080280

PHP Code:







<public type="id" name="hex" 









0x7f080281

PHP Code:







<public type="id" name="enter" 














Important Information :
If you are having colorpicker , but its having old ui and want to use this then first follow the guide and then go to that option layout xml and change the path of the colorpicker to the line given below.

PHP Code:







net.margaritov.preference.colorpicker.ColorPickerPreference 










Special Thanks To :
1. Cyanogenmod
2. XDA







Aucun commentaire:

Enregistrer un commentaire