I am making an app for teachers and students: student will see some task and he needs to write correct answer. The problem is that, if student write incorrectly (for example "moondaI" instead of "moonday") keyboard will show to user a tip - it will show that "moondaI" is written incorrectly.
How can I disable this feature inside of my app? If you know, it would be nice if you send me some tutorial
from here: https://developer.android.com/reference/android/text/InputType.html#TYPE_TEXT_FLAG_NO_SUGGESTIONS
https://developer.android.com/reference/android/widget/TextView.html#attr_android:inputType
setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS) in your Activity/Fragment
or in xml:
android:inputType="textNoSuggestions"
Further explanation comes from the official documentation here: https://developer.android.com/training/keyboard-input/style.html
The android:inputType attribute allows you to specify various behaviors for the input method. Most importantly, if your text field is intended for basic text input (such as for a text message), you should enable auto spelling correction with the "textAutoCorrect" value.
You can combine different behaviors and input method styles with the android:inputType attribute.
Apparently you can also do it at the device level, thought not tried myself:
From the Home screen, select the app drawer, then select “Settings“.
Tap “System“. (Skip this step on some versions)
Select “Language & keyboard“.
Select “Virtual keyboard“.
Choose the keyboard you are using. It’s normally named “Android“, “Google“, “gboard“, “Swype“,etc.
Select “Text correction“.
Enable or disable the options you want:
Auto-correction
Auto capitalization
Double-space period
Show suggestion strip
Next-word suggestions
Reference
Related
I'm currently working on a custom key binding mod for Minecraft. Although irrelevant, it gives some context. I'm planning to show a UI with all the buttons on their keyboard where they can click to assign macros to said key, although I don't want to be biased towards one particular keyboard button layout.
Looking at a website called switchandclick they show the differences between ISO and ANSI. ISO which I'm using has a key between left shift and Z, as well as having the return/enter key 2 keys tall rather than 1, with the missing key moved above right shift.
Here is the image from said site:
However, even if ISO is the layout used in Sweden where I live, I'm aware some users may be from different parts of the world, and ANSI is probably more common in America, so I don't want to show an ISO keyboard for ANSI users and vice versa.
I've looked around at various sources, but all I can find when looking for a solution is websites showing the differences between the layouts, rather than showing how to detect them.
So how would I go about detecting if the user has an ANSI or ISO keyboard? Pure Java is preferred but LWJGL 3 is the graphics api in use if that helps with finding a solution. I'm also running Java 17 in case that makes it easier.
As mentioned by #Abra in a comment to the question, there's no way to do that programmatically as there's no protocol between the keyboard controller and the keyboard driver that helps distinguish the layout of the keyboard.
Only option here is to either guess/predict the layout, let the user choose the layout, or simply use the same layout assumed by Windows in osk.exe.
Original answer on this post
I've one seen on an application for iPhone an interesting idea which consists of showing a list of options when we click on an area for text edition. For example, imagine I have a field called "City" (EditText) which I am suposed to enter the name of the city. When clicking on the EditText, a list automatically shows up with a few city suggestions (e.g. defined by the programmer) which can be selected. If the user doesn't like the suggestions, he writes the city himself and this city can be saved for this list for future.
I want to programme this on my App for android. I need that, when clicking on the EditText for introducing the data, a list automatically shows up with some suggestions defined by me (Programmer). However, I don't know how this can be done. I've googled but maybe it's hard to find the correct keywords to find a similar topic.
The idea is that the user should use the names already written in the list in 90% of the time and just write himself the new ones when it's necessary. Something like a dropdown list but with possibility of writing new stuff instantly without specific option.
How can this be achieved?
You Need Something Like View in android Named as
AutoTextComplete
Examples How to use this :
help
Best of luck
You can consider focus changed listener for Edittext,
when focus is gained you can show a context menu to choose data from.
What is the purpose of onSearchRequested()? I am referring to here: http://developer.android.com/reference/android/app/Activity.html#onSearchRequested%28%29
The following is stated: "You can override this function to force global search, e.g. in response to a dedicated search key, or to block search entirely (by simply returning false)." Specifically, what does the bolded piece mean? Does it not mean that we are able to disable this button? I just had a heated discussion at: Android - How to disable Search button, how to implement onSearchRequested()?
As you can see, Phil is suggesting that I have to go the other route. My questions are: can JUST this function be used to disable the search button completely? Can just this function be used without having to disable this button from the dialog builder? What did google meant with the above quoted statement? Thank you for your time.
You should be able to disable the search button using it, i would think google mean that you can block someone trying to search from within your app( IE skipping a progress dialog)
but since most android phones don't come with search buttons anymore, its not a very used function.
and yes you should be able to disable it on the fly without going through the dialog builder.
Swift
I have a pretty annoying issue with text highlighting on my EL statements.
I have scrolled through every field in the Options/Fonts&Colors/Syntax Control Panel three times, paying extra attention to the Expression Language options and I can not find the parameter that controls the white background of the whole ${initParam.productImagePath} expression statement.
Try looking under Fonts&Color -> Syntax. Then select the language and check all the color settings there.
UPDATE
I would add that sometimes the settings are inherited... it can be really hard to find which setting controls the color.
You can save the color settings exporting ("Export" button) then change every setting under "Expression Language" just to see if it changes.
Also, you can look through all colors in all languages and tabs until you find the color that matches the one you are seeing in the editor.
I'm guessing you may have done all this already, but I want to be sure I give the most complete answer I know of just in case.
Did you also check the entries in the Fonts&Colors Highlighting-Tab?
Your image shows that the white expression is not in the current selected line, so my guess is that you have enabled "highlight Search" (small Editor Toolbar). Another guess: if you are using the jVi Plugin, there's another highlight search parameter in jVi's settings dialog.
I need to modify popup menus using CNF. I already read documentation about using action providers and about using "allowsPlatformContribution" to restrict options that are platform contributions. I already used some of these concepts sucessfully to add/remove popup options. But there is one thing I need to do and I don't know how:
Related to PLATFORM CONTRIBUTIONS, I mean declared by org.eclipse.ui.popupMenus (in my case they are standard options: "Validate", "Run As", "Debug As", "Profile As",
"Team", "Compare With", "Restore from Local History...", "Java EE Tools", "Source", "Configure") I just want to show two of them: "Team" and "Compare With" (with all their suboptions).
If using "allowsPlatformContribution=false", then ALL options are removed !. The only idea I have right know is to set this to false and to create an actionProvider for each of both options I need to show, but it seems a bit hard, because I have to add all the suboptions
in it (invoking the appropriate Eclipse action) !. Is that a good way to solve my problem ?. There is another way easier and better ?... I hope so.
Please help. Thanks a lot.
Rosa.
You can use Activities to show/hide elements in the user interface (including menus).
What you have to do is create an Activity and bind it to the UI element. Then, when you enable/disable your activity the platform will automatically show/hide the element bind to it.
For more details on the exact implementation, check out this page:
Eclipse Activities – Hide / Display certain UI elements