[tut] twitter & facebook widget text color

Discussion in 'Android Themes' started by CorCor67, Nov 29, 2010.

  1. CorCor67
    Offline

    CorCor67 Premium Member Premium Member Developer

    Joined:
    May 2, 2010
    Messages:
    438
    Likes Received:
    2
    Trophy Points:
    0
    I know I wasn't able to find this information back when I first started this stuff. I had found a thread on here with vague pointers on where to look. Most folks themeing have probably delt with this already but figured someone new may find it useful.

    This is information intended to be used at your own risk. Neither I, DroidForums.net, or anyone on here will be responsible if you decide to try this and something happens.

    At the moment we're just going to run through Twitter, I'll get to facebook soon...

    Things you need:

    apkmanager: Apk Manager 4.9 - Makes Modifying Ur Apk A Breeze (Windows/Linux) - xda-developers
    (note: link for linux says 4.3, this is actually 4.7)

    some sort of text editor, preferably one meant for working with xml because they make it easier to read by using different colors

    and of course facebook and twitter apks, pull them from your phone
    _________________________________________________________

    I'm not going to go into detail on setting up apkmanager, I'm assuming you can figure it out or find the answer to get it going.

    (NOTE: While we have the apk decompiled is a perfect time to edit those .9.pngs if you do it before you decompile you will probably get errors from apkmanager, if youve alredy done them just use a fresh apk and put your png edits in after this is done)

    To start we need to decompile the apk, drop the apk into the folder named "place-apk-here-for-modding" should be option 9. A new folder named "out" should be made in your apkmanager directory (I think it's "projects" in the windows version but I will be refering to it as out.)

    You can just go to the xmls and edit the text colors individually with hex codes but were going to keep our xmls pretty by making one extra quick edit.



    In the "out" folder navigate to res/values/ and find colors.xml then open it with your text editor. You will find a bunch of hex codes with names
    Code:
        <color name="solid_white">#ffffffff</color>
        <color name="solid_black">#ff000000</color>
        <color name="clear">#00000000</color>
        <color name="login_font_color">#ff707070</color>
        <color name="text_color">#ff424242</color>
        <color name="gray_color">#ff888888</color>
        <color name="link_color">#ff2377bb</color>
        <color name="link_disabled">#ff808080</color>
        <color name="tab_text_selected_color">#ff666666</color>
        <color name="tab_text_not_selected_color">#ff2377bb</color>
        <color name="title_text_color">#ff424242</color>
        <color name="blue_text_color">#ff3399ff</color>
        <color name="settings_text_color">#ff333333</color>
        <color name="settings_header_color">#ff336699</color>
        <color name="warning_color">#ffffcc00</color>
        <color name="section_shadow_color">#ff888888</color>
        <color name="tweet_entity">#ff888888</color>
    this is the file the xml's pull the color codes from, rather than filling it up dozens of xml files with a bunch of numbers making it difficult to read they can say (android:textColor="@color/solid_black") and get black text.

    For my use I have a plain black widget background, so I want white text with a light gray for secondary colors (for less important info like time) You can see my white is already included "solid_white", but the gray they use is darker than what I'm looking for. So I added the following line
    Code:
    <color name="light_gray">#ffc0c0c0</color>
    as of now here is my colors.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <resources>
        <color name="solid_white">#ffffffff</color>
        <color name="solid_black">#ff000000</color>
        <color name="clear">#00000000</color>
        <color name="login_font_color">#ff707070</color>
        <color name="text_color">#ff424242</color>
        <color name="gray_color">#ff888888</color>
        <color name="light_gray">#ffc0c0c0</color>
        <color name="link_color">#ff2377bb</color>
        <color name="link_disabled">#ff808080</color>
        <color name="tab_text_selected_color">#ff666666</color>
        <color name="tab_text_not_selected_color">#ff2377bb</color>
        <color name="title_text_color">#ff424242</color>
        <color name="blue_text_color">#ff3399ff</color>
        <color name="settings_text_color">#ff333333</color>
        <color name="settings_header_color">#ff336699</color>
        <color name="warning_color">#ffffcc00</color>
        <color name="section_shadow_color">#ff888888</color>
        <color name="tweet_entity">#ff888888</color>
    </resources>
    Now save colors.xml and we can move on.

    now we need to navigate to res/layout/ here we have 2 xml files to edit
    widget_clear_large_view.xml
    widget_clear_small_view.xml

    Open them both up and find the text
    Code:
    android:textColor="@color/solid_black"
    should be in each one twice. This is where I want my white text, so I simply change
    Code:
    android:textColor="@color/solid_black"
    to
    Code:
    android:textColor="@color/solid_white"
    After modifying the 4 lines we can save both and move on.

    Now we have to go to res/layout-land and find the following files
    widget_large_view.xml
    widget_small_view.xml

    in both of these files you will find one instance of
    Code:
    android:textColor="@color/text_color"
    and two of
    Code:
    android:textColor="@color/gray_color"
    here I just change "text_color" to read "solid_white" and "gray_color" to read "light_gray"
    (note: if you forgot to save the colors.xml where we added our "light_gray" the apk will fail to compile when finished)
    Now we can save and move on to our last folder

    res/layout-port, this ones the same as the last one, just repeat what you did in layout-land here, the xmls are named the same.

    Don't forget to save, the go back to apkmanager and compile the apk, sign it, and install on your phone.

    tip: use Ctrl+F to search the xml for "textColor" to make them easier to find

    end result
    [​IMG]
  2. CorCor67
    Offline

    CorCor67 Premium Member Premium Member Developer

    Joined:
    May 2, 2010
    Messages:
    438
    Likes Received:
    2
    Trophy Points:
    0
    facebook coming soon to here
  3. RafficaX
    Offline

    RafficaX Premium Member Premium Member Developer

    Joined:
    Aug 2, 2010
    Messages:
    605
    Likes Received:
    0
    Trophy Points:
    0
    anyword on facebook? bc this for twittter made things so easy and awesome! thx!
  4. CorCor67
    Offline

    CorCor67 Premium Member Premium Member Developer

    Joined:
    May 2, 2010
    Messages:
    438
    Likes Received:
    2
    Trophy Points:
    0
    Ya sorry its taking so long got busy themeing some other apps but I am temporarly laid off from work for the winter and FB shouldn't be too far off, I'm pushing a few other projects to help someone out, think I'm about 2 apks away from facebook and id rather write it while I'm doing it (less chance of me screwing it up) :)
  5. jacampb2
    Offline

    jacampb2 New Member

    Joined:
    May 18, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Midland, Mi
    I know this is a fairly old thread, but it is where I started on this so hopefully it is the best place for my question.

    I have been trying for the last 4 hours to get this to work right for me on the meridian audio player app. I have had good results on changing the text color of my widget, but the problem is, it screws up the formatting in the app itself. Initially, I only changed the hex value in res/values/colors.xml for the AppWidgetText and recompiled it. On doing so, the widget text is right, but the formatting on the top of the app Now Playing window gets all screwed up. Bellow you can see a screen shot of what happens. The stars in the now playing window are supposed to be small and up in the right hand corner.

    I have tried adding an additional color to the colors.xml and changing the widgetControl.xml to point to that one instead. It works, but same results. I edited the widgetControl.xml to use a specific hex color instead of pointing to the global string, again, same results.

    I honestly don't know what I could be doing to cause this. I have started over with a non modified APK every try, the weird part is, nothing in the now playing screen changes to the new color, so I have a hard time believing it is just the color change doing it.

    In anyone wants to take a look at the APK and see what I have done wrong, it would be much appreciated.

    Here are the pics:

    [​IMG]

    [​IMG]

    Thanks,
    Jason
Search tags for this page

change facebook for android color

,

color fonts for fb and twitter

,

old twitter widget html code

,

text color code for share facebook