phonegap android edittext is hidden behind virtual keyboard - android

I am developing an android phonegap app. i created a popup using HTML, which contains two edit fields for "username" and "password". when these fields receives focus, the soft keyboard appears and hides immediately. Can anybody say why it behaves like this.
Thanks in advance

it must be losing focus right after too for some other reason I would suspect.

Try to add android:windowSoftInputMode="adjustResize" on your Android manifest file.That worked for me.
It's a late answer but will be helpful for someone else.

Related

Stop keyboard from popping in a Cordova app

I have an app that, in a specific view uses a custom numeric keypad. The problem is the native keyboard keeps popping in the inputs on that view. How can I prevent that? I changed the inputs to read-only, and it seems to work, but without the cursor there is no way the user will know where he is editing. My app is initially an android-only app.
I need to use the native keyboard in other views, like the login view, as the password isn't numeric only.
Is there a way to prevent the native keyboard to open in a specific view? Or if I need to leave the readonly format, how can I "mask" the css to help the user?
I have a variable that is responsible for changing the ng-model attr value.
I thought of editing the css in the $watch of that variable, but how can I do that?
Thanks in advance!
This may help you.
Put this inside the Activities where you don't want the keyboard to be displayed.
<activity android:windowSoftInputMode="stateHidden" ...>
You can't prevent keyboard show as I know, but you can simulate the behaviour.
Use ionic keyboard plugin, and when the field is focused, just do cordova.plugins.Keyboard.close();

Android Custom Keyboard with unusual symbols

Hi guys i am wonder whether it is possible to create a custom keyboard in Android such as the once attached with this question. Any ideas and clue would be very much appreciated. Hoping for better response. Thanks in Advance.
I've wondered about that in the past and I ended up using a custom View, assigning the active EditText element to it, hiding the system keyboard and changing the content when a button is pressed.

Titanium Textfield on TableView not getting focused

I am having few text fields inside the table view, while clicking on the text fields it is not getting focused(in Android platform). I have seen some questions regarding the same issue, but those suggestions not worked for me. I am using Titanium 1.7.5, Android 2.2
I resolved this problem in Android to set the Edit Text Property:
android:imeOptions="actionSearch"
If it is not working on Mobile Device, I have another solution for it:
android:imeOptions="actionNext"
android:selectAllOnFocus="true"
I had the same issue, and some steps you should keep in mind:
Don't add a focus event to the field, this will overwrite the build-in one
Add the event singletap and fire the focus event on that field
mytextfield.addEventListener('singletap',function(){ mytextfield.focus(); });
This should do the trick, at least, it did for me.
textfields did not act identically on every device while gaining the focus. you should have a look at the softKeyboardOnFocus-property. it can have the following value:
Titanium.UI.Android.SOFT_KEYBOARD_DEFAULT_ON_FOCUS
Titanium.UI.Android.SOFT_KEYBOARD_HIDE_ON_FOCUS
Titanium.UI.Android.SOFT_KEYBOARD_SHOW_ON_FOCUS
maybe it helps to set the property to SOFT_KEYBOARD_SHOW_ON_FOCUS. this requests to show soft keyboard on focus. keep in mind that android can override this.

edittext not showing the typed text in android

In my android application i am using a simple login page.
The issue is that when testing in android htc wildfire,the user could not see the text typed till he press back or done
I would like the user to view his text while typing itself.
'
Could anyone please let me know how to resolve this?
Please share your valuable suggestions.
Thanks in advance :)
Looks like your problem is this:
When user clicks in the EditText to type, the keyboard pops up and hides the EditText, thus the user can't see what he's typing
For this, you can put that EditText into a ScrollView so that when keyboard pops-up, Android scrolls the EditText up. This way,the user can see what he's typing.
Well I don't know whether it will help you or not. but am sharing because some other may be benifited. I got the same issue in my Kindle tablet.
And I have solved this just by adding the simple attribute to the edittext.
<EditText
.........
android:textCursorDrawable="#drawable/Black"
/>
And its done. Now it will show each character you types.
If it helps you, I will suggest you to write the above attribute everytime you declare an edittext, even though this issue doesn't occur.

How to disable displaying "suggestions" on the Soft Keyboard

I want to turn off displaying "Suggested Words" on the soft/virtual keyboard when someone is using my application (only on certain Activities). For the default Android keyboard, this can be found under 'Settings' (under Word Suggestion Settings).
Is there a way to disable it only within your application, without requiring the user to manually go and do it? I basically want the user to type words without providing any hints.
Thanks!
When developing for 2.0+, the supposed way is setting android:inputType="textNoSuggestions" (ref).
Unfortunately, suggestions are still shown on HTC Desire 2.2 (and probably other HTC Sense devices as well).
Using android:inputType="textVisiblePassword"will not help as well as the software keyboard by HTC won't allow you to switch languages.
So I stick to android:inputType="textFilter" to disable suggestions.
You can disable suggestions on the Soft Keyboard by adding the following line in the xml -
android:inputType="textNoSuggestions"
However according to this article, it may or may not be supported by the IME (the keyboard).
If this issue occurs, the below method works for sure -
android:inputType="textNoSuggestions|textVisiblePassword"
This works for me with the stock keyboard, even on HTC with 2.2
final EditText et = (EditText) findViewById(R.id.SearchText);
et.setInputType(et.getInputType()
| EditorInfo.TYPE_TEXT_FLAG_NO_SUGGESTIONS
| EditorInfo.TYPE_TEXT_VARIATION_FILTER);
On my 6P running Nougat, nothing worked. While it is empty the suggestion bar stays up because it has the microphone icon on the right side.
In order to get rid of that, I used fingerup's suggestion in one of the comments and it worked!
So I decided to write an actual answer so people don't miss it.
To recap here's what I've used:
android:inputType="textNoSuggestions|textFilter|textVisiblePassword"
android:privateImeOptions="nm"
inputType="textNoSuggestions|textFilter|textVisiblePassword" prevents suggestions, and privateImeOptions="nm" (stands for "no microphone") prevents the bar from showing up because it still would since the mic button is in it.
So it is necessary to use both attributes because if all you do is specify no mic then the bar still shows up with recommendations.
Thx again to fingerup for mentioning the nm trick. ;)
There are two ways that I know of to disable the auto-complete. One way is through the XML by setting the android:inputType="textVisiblePassword" in the layout xml.
The other way is through code such as the following
EdtiText editTextBox = findViewById(R.id.myEditTextView);
editTextBox.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
I was facing the same issue on Samsung devices using:
android:inputType="textNoSuggestions|textFilter|textVisiblePassword"
only after setting the inputType to password and visiblePassword worked for me:
android:inputType="textPassword|textVisiblePassword"
android:inputType="textPhonetic" hides soft keyboard suggestions on Android 1.6.
hope this works for you,
editText.setInputType(InputType.TYPE_CLASS_TEXT|InputType.TYPE_TEXT_FLAG_CAP_SENTENCES|InputType.TYPE_TEXT_FLAG_MULTI_LINE|InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
If you are using InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS in activity, it will work fine.
In case of DialogFragment, you should place InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS at
onActivityCreated() handler as below :-
#Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
EditText editTextUsername = (EditText)dialogView.findViewById(R.id.txtUsername);
editTextUsername.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
}

Categories

Resources