Stop Your Screen From Turning Off with KeepItOn

We all know the feeling of reading a news article orrather longdocument, when our screen … more

The XDA LG QPair Developer Challenge Voting Has Begun!

It seems like it was just yesterday that weannounced that we had paired up with LGto … more

Major Update for the Sony Smartwatch 2 Brings DND and More

With the wearables landscape now dominated by Android Wear and Pebble, its … more

How to Root Android Wear 5.0.1 Lollipop Devices – XDA TV

The Lollipop update for Android Wear devices has hit the market and people are … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP Gunthermic

3rd May 2014, 03:47 PM   |  #1  
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:	396
Size:	134.2 KB
ID:	2723349  
Last edited by Gunthermic; 3rd May 2014 at 04:40 PM.
The Following 3 Users Say Thank You to Gunthermic For This Useful Post: [ View ]
3rd May 2014, 05:24 PM   |  #2  
kdizzleh85's Avatar
Senior Member
Seattle
Thanks Meter: 667
 
1,194 posts
Join Date:Joined: Jun 2012
More
Thanks again for this. Works perfectly
3rd May 2014, 06:00 PM   |  #3  
cbucz24's Avatar
Recognized Themer
Flag Central Florida
Thanks Meter: 2,589
 
2,415 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, 06:23 PM   |  #4  
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, 09:23 PM   |  #5  
cbucz24's Avatar
Recognized Themer
Flag Central Florida
Thanks Meter: 2,589
 
2,415 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:	195
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, 11:32 PM   |  #6  
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