MultiAutoCompleteTextView not showing keyboard suggestions - android

I'm using MultiAutoCompleteTextView in my app. It's an awesome control in Android API. But there are a few issues I'm facing. One, the most annoying is, that on my Nexus 5, it doesnot shows keyboard suggestions. On Xperia Z, shows keyboard suggestions though. Unable to find the cause. Can anybody help/guide me about it? Here the XML of my MultiAutoCompleteTextView.
<MultiAutoCompleteTextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:hint="Post a question, idea or update"
android:gravity="top"
android:textColorHint="#9e9e9e"
android:textColor="#000000"
android:textSize="15sp"
android:padding="10dp"
android:background="#null" />

I have looked into the source code and found this in AutoCompleteTextView
// Always turn on the auto complete input type flag, since it
// makes no sense to use this widget without it.
int inputType = getInputType();
if ((inputType&EditorInfo.TYPE_MASK_CLASS)
== EditorInfo.TYPE_CLASS_TEXT) {
inputType |= EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE;
setRawInputType(inputType);
}
And in the javaDoc page of the InputType, TYPE_TEXT_FLAG_AUTO_COMPLETE defined as.
Flag for TYPE_CLASS_TEXT: the text editor (which means the application) is performing auto-completion of the text being entered based on its own semantics, which it will present to the user as they type.
It means that you have your own semantics for completion, which means that it is logical for the keyboard to disable its suggestions.
I think when you change the inputType with setInputType() method programatically you can disable this behaviour and get the keyboard suggestions.
You can try this:
mAutoCompletetextView.setInputType(EditText.TYPE_CLASS_TEXT | EditText.TYPE_TEXT_FLAG_AUTO_CORRECT);

Related

Remove the underline when typing word in EditText

I know, the question has already been asked many times on this forum, but no answer worked for me...
When I write in one of my EditTexts, the word being written is underlined, and I would like it not to be underlined... I've already seen answers like "You have to change the android:background", or "You have to put the textNoSuggestions attribute in android:inputType"... But I've already done all that - see the code just below - (and I even keep them by default) and it doesn't work.
A really huge thank you to everyone who will take the time to answer this question!
XML EditText :
<EditText
android:id="#+id/editP1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_margin="4dp"
android:autofillHints="username"
android:background="#drawable/background_card"
android:gravity="center_horizontal"
android:hint="#string/player_name"
android:imeOptions="flagNoFullscreen"
android:inputType="textFilter|textNoSuggestions"
android:maxLength="12"
android:padding="4dp"
android:textSize="25sp" />
<!-- The ' android:imeOptions = "flagNoFullscreen" ' was only necessary to show the underline word since my app is always in landscape mode -->
Pictures :
As outlined at Android edittext is underlined when typing, this may be a function of the keyboard in use, rather than the EditText. Without knowing which specific solutions you've tried and have failed (you say no answer worked for you, but don't list things you tried) it is hard to offer a specific suggestion, but I'd suggest the
android:inputType="textVisiblePassword|textNoSuggestions"
option and see if that works. The password should typically prevent the keyboard from suggesting things (since no suggestions are typically useful for passwords).

Android: How to remove customize keyboard button from keyboard?

Please find below the screenshot wherein the circular box shows the customize button option.
XMl Code:
<EditText
android:id="#+id/et_cost_per_mile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:hint="Cost Per Mile(₤)"
android:inputType="numberSigned"
/>
All I want to remove :: button from keyboard.
You have change input type like..
android:inputType="phone"
You can not. This is your android keyboard app and you cant change it. The keyboard settings can be modified in the android settings. But obviously it depends on the user, not the developer.
The only way I think it will allow you to do that is that you include in your app a fake numeric keypad as a layer (Similar to the keyboard that appears when you have to type the pin of the app of your bank). However, I don't think this is worth it. With...
android:inputType = "numberSigned"
you are already blocking the user from entering letters or other characters, even if they change their keyboard.

cwac RichEditText not working

It appears trivial even on the 'Usage' section here
My edit text appears just the same, when i type on it everything appears as usual, when i select text everything is still normal. No "FORMAT" entry on the action mode. What am I doing wrong??
My layout:
<com.commonsware.cwac.richedit.RichEditText
android:id="#+id/editTextSermon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:hint="#string/type_the_sermon_here"
android:lines="10"
android:imeOptions="flagNoExtractUi"
android:inputType="textMultiLine">
<requestFocus/>
</com.commonsware.cwac.richedit.RichEditText>
In my activity:
sermonText = (RichEditText) findViewById(R.id.editTextSermon);
sermonText.enableActionModes(true);
From the documentation that is all I need to do, or is it?
On a side note part of the documentation reads like this:
On its own, by default, RichEditText provides one means of users applying formatting: the standard Ctrl-B for bold, Ctrl-I for italics, and Ctrl-U for underline work if there is a selection.
I've never seen a 'Control' button on an android keyboard. Whats going on? I just want to be able to bold, italicize and underline my text.

How to reliably disable autosuggest on EditText?

I am trying to disable autosuggest on this EditText, but all the methods outlined don't work with the Japanese IME keyboard and Swype. Is there a way to make it work correctly?
So far, I've tried everything in all kinds of combinations to no avail. Although all solutions work perfectly fine with the default keyboard, users report they still get autosuggest. This is a word game that needs word starting with certain letters, so I really need it.
<EditText
android:id="#+id/txtWord"
android:background="#drawable/textbox_bg"
android:layout_margin="5dp"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="right|center_vertical"
android:layout_weight="1"
android:singleLine="true"
android:inputType="textFilter|textNoSuggestions|textVisiblePassword"
android:imeOptions="actionNone"
>
<requestFocus />
</EditText>
Everything supplied to attributes like android:inputType are suggestions to the IME, not commands. Some IMEs will honor them, some will not. Hence, you are going to need to design your game such that either you do not care about the suggestions or you do not use an EditText widget.
InputType.TYPE_NULL or 'none' (check the System level attributes for specifics) should work in most cases, but as Mr Murphy says, they're just hints, so may not work (and presumably you can't OR is it anything else).
You can use this :
android:inputType="textNoSuggestions"
android:privateImeOptions="nm"

With "inputType" set to "textFilter", android still reserves screen space for suggestions?

developing an android app here using API 7. I have an EditText that we use to filter down the list beneath it, so we set the inputType to textFilter so Android wouldn't suggest words or auto-complete.
However, when the user types a character they see the popup box in which they're doing the search shrink. It is clearly getting smaller to make room for the suggestion bar, even though the suggestion bar doesn't actually show.
Using textNoSuggestions instead appears to have the same result. Here is the snippet for the input box:
<EditText
android:id="#+id/search_edit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:singleLine="true"
android:inputType="textFilter"
android:background="#null"/>
Has anyone experienced and overcome this behavior? It doesn't repro on SenseUI, but probably because SenseUI floats the suggestion bar instead of claiming screen real estate for it.
Try textNoSuggestions. I'm not sure what textFilter does, I was hoping to use it to limit input to 0-9 and A-F for a hex keyboard, but found this instead.
The only thing that works consistently in my experience is textVisiblePassword. This both prevents autocorrection and doesn't change the size of the field. Very annoying.

Categories

Resources