Welcome to the New XDA-Developers Portal!

You may recall that a few weeks ago, we opened up the XDA-2015 forum themesto intrepid users … more

An Android Enthusiast’s Apple iPhone 6 Challenge

The media has gone batty again over Apple “revolutionizing” smartphones. … more

Sony to Extend its AOSP Program to Other Devices

Sony will be offering its users the possibility to use AOSP ROMs as an alternative to the … more

Project Ara: Modified Android L and Hot Swapping

Project Ara is a very exciting topic–both for hardware and software enthusiasts. The … more
Post Reply

[MOD] Inverted Full Screen KeyBoard/Text edit(Landscape)

3rd May 2014, 02:47 PM   |  #1  
Gunthermic's Avatar
OP Recognized Contributor / Themer
Thanks Meter: 8,870
 
3,074 posts
Join Date:Joined: Mar 2011
Donate to Me
More
Finally tracked this one down, and just have to share this...

This Mod was found by @EMSpilot and @Gunthermic.. emspilot found the routine, and from there we figured the rest.. Give him a big kudos..

This is a MOD for Dev's to incorperate, this is NOT an End User MOD.

I have broken this down to each part of the inversion for those that want complete control over the Full Screen KeyBoard Layout.

1. Text Color
2. Cusor Color
3. BackGround Color
4. HighLight Color

What:
Framework.jar
framework-res.apk

Decompile Framework.jar file

Add/Change
Subtract/Delete


Go to:
smali\android\inputmethodservice\InputMethodServic e.smali

Search for:

.method startExtractingText(Z)V

Look for this code:
1. Text Color:
Code:
iget-object v8, v2, Landroid/view/inputmethod/EditorInfo;->hintText:Ljava/lang/CharSequence;

    invoke-virtual {v1, v8}, Landroid/inputmethodservice/ExtractEditText;->setHint(Ljava/lang/CharSequence;)V
Right under that is:

Code:
    const/4 v8, 0x0

    const/4 v9, 0x0

    const/4 v10, 0x0

    invoke-static {v8, v9, v10}, Landroid/graphics/Color;->rgb(III)I

    move-result v8

    invoke-static {v8}, Landroid/content/res/ColorStateList;->valueOf(I)Landroid/content/res/ColorStateList;
The above code controls the text coloring on the Text Box. You have two options:

You can change the v8, v9, v10 which is the RGB value (0x0) is Black in this case and change them to -0x1 for each one to make text color white.

The second option you can do if you want a special color without having to figure out RGB color coding is to add:

const v8, smali colorcode (for example -0xCC9934(DarkHorse Blue)) below move-result v8.. like so...

invoke-static {v8, v9, v10}, Landroid/graphics/Color;->rgb(III)I

Code:
    move-result v8

    const v8, -0xCC9934

    invoke-static {v8}, Landroid/content/res/ColorStateList;->valueOf(I)Landroid/content/res/ColorStateList;
Okay the next three items are much easier:

Right under the code for Text Coloring is the rest of the Inversion and other Changes

Code:
 
    invoke-virtual {v1, v8}, Landroid/inputmethodservice/ExtractEditText;->setTextColor(Landroid/content/res/ColorStateList;)V

    const/high16 v8, -0x100 # Cusor Color

    invoke-virtual {v1, v8}, Landroid/inputmethodservice/ExtractEditText;->setCursorColor(I)V

    .line 3261
    const/4 v8, -0x1 #Background Color

    invoke-virtual {v1, v8}, Landroid/inputmethodservice/ExtractEditText;->setBackgroundColor(I)V

    .line 3265
    const v8, -0x86350e #HighLight Cusor Color

    invoke-virtual {v1, v8}, Landroid/inputmethodservice/ExtractEditText;->setHighlightColor(I)V
Code Changes: An Example of my changes

Code:
    invoke-virtual {v1, v8}, Landroid/inputmethodservice/ExtractEditText;->setTextColor(Landroid/content/res/ColorStateList;)V

    const v8, -0x100 #Cusor Color(Yellow)

    invoke-virtual {v1, v8}, Landroid/inputmethodservice/ExtractEditText;->setCursorColor(I)V

    const v8, -0x1000000 #BackGround(Black)

    invoke-virtual {v1, v8}, Landroid/inputmethodservice/ExtractEditText;->setBackgroundColor(I)V

    const v8, -0xCC9934 #HighLight Cusor Color.(DarkHorse Blue)

    invoke-virtual {v1, v8}, Landroid/inputmethodservice/ExtractEditText;->setHighlightColor(I)V
Okay Save that. One more Item that needs to be done complete the Inversion!!!

framework/res/layout/input_method_extract_view.xml

Line 5 needs to be changed to complete the inversion(makes the black appear around the Send button)

Code:
    <FrameLayout android:id="@id/inputExtractAccessories" android:background="#ff000000" android:layout_width="wrap_content" android:layout_height="fill_parent" android:paddingStart="8.0dip" android:paddingEnd="8.0dip">
        <android.inputmethodservice.ExtractButton android:layout_gravity="center" android:id="@id/inputExtractAction" android:layout_width="wrap_content" android:layout_height="wrap_content" />
        <android.inputmethodservice.ExtractButton android:layout_gravity="center" android:id="@id/inputExtractEditButton" android:visibility="invisible" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/extract_edit_menu_button" />
    </FrameLayout>
Save and Compile framework.jar and framework-res.apk..

Score!!!!
Attached Thumbnails
Click image for larger version

Name:	FullScreenInvert.png
Views:	355
Size:	134.2 KB
ID:	2723349  
Last edited by Gunthermic; 3rd May 2014 at 03:40 PM.
The Following 3 Users Say Thank You to Gunthermic For This Useful Post: [ View ]
3rd May 2014, 04:24 PM   |  #2  
kdizzleh85's Avatar
Senior Member
Seattle
Thanks Meter: 647
 
1,142 posts
Join Date:Joined: Jun 2012
Thanks again for this. Works perfectly
3rd May 2014, 05:00 PM   |  #3  
cbucz24's Avatar
Recognized Themer
Flag Central Florida
Thanks Meter: 2,326
 
2,285 posts
Join Date:Joined: Jan 2011
Donate to Me
More
Looks interesting @Gunthermic.

Curious question though, isn't it easier to just change the xml file and png images in the SamsungIME.apk?

Or am I missing what else this is doing?

Sent from my SM-G900T using Tapatalk 2
3rd May 2014, 05:23 PM   |  #4  
Gunthermic's Avatar
OP Recognized Contributor / Themer
Thanks Meter: 8,870
 
3,074 posts
Join Date:Joined: Mar 2011
Donate to Me
More
Quote:
Originally Posted by cbucz24

Looks interesting @Gunthermic.

Curious question though, isn't it easier to just change the xml file and png images in the SamsungIME.apk?

Or am I missing what else this is doing?

Sent from my SM-G900T using Tapatalk 2

Sure. Tell me what u changed in samsungime that gets this same thing. I will gladly take thread down if there is a better way... Never found one.

If ya dont know and just asking. Then I say from my knowledge samsungime woild pull from framework jar file..

Sent from my SCH-I545 using Xparent BlueTapatalk 2
3rd May 2014, 08:23 PM   |  #5  
cbucz24's Avatar
Recognized Themer
Flag Central Florida
Thanks Meter: 2,326
 
2,285 posts
Join Date:Joined: Jan 2011
Donate to Me
More
Quote:
Originally Posted by Gunthermic

Sure. Tell me what u changed in samsungime that gets this same thing. I will gladly take thread down if there is a better way... Never found one.

If ya dont know and just asking. Then I say from my knowledge samsungime woild pull from framework jar file..

Sent from my SCH-I545 using Xparent BlueTapatalk 2

OK well, before I get too far into things. Where does this change take effect in the system?

I edited the SamsungIME.apk to change things there. And i edited individual apks and changed things there too.

Here I changed the text colors to everything except the suggestion text.
Click image for larger version

Name:	uploadfromtaptalk1399144835277.jpg
Views:	162
Size:	120.2 KB
ID:	2723843

Link up a pic where the text is changed so I can see if I changed it in the same place with an xml if ya don't mind.

An I hope you didn't take offense to my question. We've talked before, I've used your work and you definitely do a great job!
I was just curious about what this exactly did, and if I could help you then yay me for helping someone as good as you

Sent from my SM-G900T using Tapatalk 2
3rd May 2014, 10:32 PM   |  #6  
Gunthermic's Avatar
OP Recognized Contributor / Themer
Thanks Meter: 8,870
 
3,074 posts
Join Date:Joined: Mar 2011
Donate to Me
More
Quote:
Originally Posted by cbucz24

OK well, before I get too far into things. Where does this change take effect in the system?

I edited the SamsungIME.apk to change things there. And i edited individual apks and changed things there too.

Here I changed the text colors to everything except the suggestion text.
Attachment 2723843

Link up a pic where the text is changed so I can see if I changed it in the same place with an xml if ya don't mind.

An I hope you didn't take offense to my question. We've talked before, I've used your work and you definitely do a great job!
I was just curious about what this exactly did, and if I could help you then yay me for helping someone as good as you

Sent from my SM-G900T using Tapatalk 2

Pix was posted in OP sir.

This mod is for landscape and is the text box. Not keyboard layout.

No, no offense taken.. yes we have talked before kind sir

Sent from my SCH-I545 using Xparent BlueTapatalk 2
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Verizon Galaxy Note 3 Android Development by ThreadRank