Change Soft Keyboard layout - android

i would like to know how can i change the layout of the EditText and the "Done" button! Thanks!
PS. This Soft Keyboard has been changed to include Keys i need from the Sample provided by android sdk.

You can try creating your own layout and showing it on Edittext instead.

Related

How to implement an onScreen Keyboard in Android?

The default keyboard of android covers the EditText in my app UI. So i need to implement my on keyboard. Just like a keyboard in Regular Calculator app. Which is the best way to implement it? Is there any library available?
Custom keyboard
This link has everything required to create custom keyboard
In order to do not hide your edittext under the keyboard, you need to add the following line inside your Manifest file, under your activity section.
<activity
android:windowSoftInputMode="adjustPan"
...
...
Moreover, depending on your needs you can have the numeric keypad or the common keyboard shown. But this is more than what you asked.

Android Scrollview doesn't scroll when keyboard appears onClick of EditText

I've been through n number of solutions for this problem and tried them all but nothing helped.
I have an EditText and onClick of it, a custom keyboard appears but the EditText doesn't comes up above the keyboard.
I have tried putting:
android:windowSoftInputMode="stateAlwaysHidden|adjustPan|adjustResize"
in my Manifest file.
I read somewhere that its a bug and it does not work in FULLSCREEN mode so I removed fullscreen mode from my manifest. Again didn't work.
Please help scrolling my EditText up :D
P.S: Please don't answer for android's default keyboard. I am using my own custom keyboard.
In scrollView use the following code:
in XML:
android:fillViewport="true"
OR
in Java:
setFillViewport(true);
You have to use a translate animation, to move the Edit-text or the entire view above the keyboard along with the Y-axis.
As you are using a custom keyboard,no other way seems to be possible.

How to enter special characters in an EditText in Android?

Is there any way to input special characters (which are not present in the default soft keyboard ,eg. theta) in an Android EditText?
Thanks..
Well as per your need, I would like to suggest to create a custom keyboard because the stock keyboard which comes with the device may not have the special characters you need.
You can refer the following tutorial to create a custom keyboard
http://www.fampennings.nl/maarten/android/09keyboard/index.htm
or you can see this search result which may serve your purpose,
https://github.com/search?q=android+custom+keyboard&ref=cmdform
And from below site you can get the list of Unicode characters which Android supports,
http://en.wikipedia.org/wiki/List_of_Unicode_characters
http://unicode-table.com/en/#0026
Note: Writing the whole code to create a custom keyboard is beyond the scope of this answer, so I mentioned the reference link.
What you are going to do is to create a custom keyboard. First thing you want is to hide the default keyboard when an EditText is focused:
getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
Now, you must create a custom layout (RelativeLayout or Multiple LinearLayouts this is your desire), create and set text to the buttons that you want to show. Make this keyboard view setVisibility(View.INVISIBLE) or setVisibility(View.GONE), and whenever your EditText is focused, make it setVisibility(View.VISIBLE).
After keyboard is visible, programming the rest is up to you it is practically easy.
If you also need a guide, here is an example.

How to disable Android Soft Keyboard for a particular activity?

I have an activity with one EditText where I need to input numbers only.
Now, I have defined the Input Type for my EditText to be number only and have drawn up a pretty keypad for my user to use, however I also need to make sure the soft keyboard doesn't pop up for my user when they click on the EditText.
I have tried hiding the keyboard through the manifest by adding
android:windowSoftInputMode="stateAlwaysHidden"
in my Manifest for the particular activity, but this doesn't work for me because as soon as the user clicks on the EditText the keyboard appears again.
I've tried doing the same programmatically like so
activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
but that doesn't work either. Keyboard appears when the user clicks on the EditText.
The only thing that worked was setting InputType to null for the EditText like so:
EditText.setInputType(InputType.TYPE_NULL);
but I cannot use this because it will allow users who have a keyboard attached to their device to input letters and other symbols in the EditText field, while I want everyone to specifically use only the keypad to enter data in the field.
I should also mention that I am currently testing my app under android 2.1, but I would like my solution to work across all versions. Any help would be appreciated. Thanks in advance.
Just thought it might be possible to extend EditText and handle the access to the softkeyboard through there and came across this question which has a very elegant solution to my problem.
Just followed the steps and this handled the softkeyboard perfectly for me. Hope it helps others that come across this issue.
In Whichever Edittext you need to disable the soft keyboard, add attribute in xml of that edit text.
<EditText android:id=".."
..
android:focusable="false" />
It will stop the execution of soft keyboard.
Use the android:windowSoftInputMode="stateHidden" in your activity in manifest file. This will work. Don't use the android:focusable="false" for EditText unless if you are not willing to input the text. If you want to give input then remove that property for the edittext in the layout file.
You can try this. It is working for me:
getWindow().setFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM,
WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
If you are using for example ViewGroup it allows you to block the soft keyboard using this method:
view.setDescendantFocusability(view.FOCUS_BLOCK_DESCENDANTS);
Thanks to this the view will get focus before any of its descendants.
you can use This Code:
<EditText
.
.
android:enabled="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:inputType="numberPassword" />

Specifying virtual keyboard type for EditText in XML

I'm creating a ListActivity. In each list item I have a View I've created which contains a RatingBar and an EditText. In the screenshot at the bottom, you can see the virtual keyboard contains a returnline key and no "Done" key. I would like to specify a different style of keyboard to use (and hopefully retain the spell checking bar). I would like my virtual keyboard to have a "Done" key instead of a return key. Can I set the style of virtual keyboard I'm wanting in the EditText's XML? If so, how?
Thanks for your help
Try android:imeOptions or TextView#setImeOptions(). Check the docs.
It would appear
android:inputType="textImeMultiLine|textAutoCorrect"
does mostly what I want. It only allows me to have my EditText be 1 row, though.

Categories

Resources