Autocomplete/Autofill Edit Text Android - android

I am looking to achieve the functionality of an AutocompleteTextView but slightly different. Instead of getting a drop-down list with suggestions i want it to complete the sentence for me.
For example: i type abc and i get completed, with the rest of the text in grey: abc1#etc.etc and then click a button to keep this text or keep writing to filter this even further.
Do you think is is achievable somehow?
I have looked my problem up so far but all the answers i found involved a drop-down list, perhaps i haven't looked deep enough.

Why don't you try to implement a custom view?
Basically, you need to the same things that the AutoCompleteTextView does but instead of displaying N elements into the drop down list you have to add the first option to your EditText.
Have a look at:
TextWatcher in order to see how detect the user input and progress
You can then play with indexes and spannables in order to keep track of the data input by the user and the data that you are suggesting.
One thing that I don't like about this idea is the fact that if you have got:
Germans
Germany
...
You need to type a lot of letters without the possibility to choose something different from the solution that you are providing.

use below example ... i think help you...
http://teamandroid4u.blogspot.in/2012/06/autocompletetextview-example.html

Related

Android, display items as tags in a list

Sorry for the basic question, but after a long time searching, I still don't know what to call this...
What do you call the list of items to display like this picture, (the addresses in the to section), each item is in a tag, and they will fill up the screen according to the screen size and content of the item.
I want to search about how to do this in the best way, but I'm not sure what to search for. What are these "tags" called?
Thanks so much.
What you are looking for is known as Chips . This component represent complex entities in small blocks, such as a contact/email address etc.
I'm attaching a Material design link where you can explore detailed information about them, their types and behaviour.
You can use below libraries to achive it.
https://github.com/pchmn/MaterialChipsInput
https://github.com/klinker41/android-chips

Turn Words Inside an EditText Into a Contact Icon

I'm not quite sure what to even call this. Rather than plain text editing I'd like to implement the same system here, so when a user types in other users' names followed by a space the name is replaced with a view like below. What are the basic steps to get this effect?
They are called chips.
Here are some libraries that might do the trick:
https://github.com/DoodleScheduling/android-material-chips
https://github.com/klinker41/android-chips

Adding Search Functionality To My Apps Android

I want to add search functionality into my apps, and also I did some research (http://developer.android.com/training/search/index.html) but I don't want to use database/sql. I want it to be something like this (http://www.androidhive.info/2012/09/android-adding-search-functionality-to-listview/) where you put all your search terms in a list of strings.
Question:
How do I implement the function where you click one of those search terms in listview, and the strings of the search term clicked will show up. Or is there any alternative way I can do this?
Comments are appreciated
Probably this might help you..see here
I think you should implement a new adapter rather than using ArrayAdapter. I don't know whether it is possible to do that using ArrayAdapter also.

xml for dropdown text

I have used this forum when I didn't know how to do something, but now I have decided to begin participating in it.
I would like to know how could I do a dropdown text (maybe it has a specific name and that's why I don't find any results on the internet). I mean, I have some tags in the screen (About, Company, Contact, ...). Each of these tags has a down arrow on the right side, and when I click it, it has to display (and hide if it's clicked again).
Here are the links with the images of what I want to do.
http://i45.tinypic.com/4fzoso.png
http://i47.tinypic.com/2u5886q.png
Thank you in advance!
You should use an ExpandableListView component.
There is a tutorial for it here.
Finally I did it with ImageViews and TextViews using the property android:visibility. Now that it's a static version is working properly. I hope that it continues working well when taking the information from the DB

What is the difference between text field types

I am new to android. I was stuck on a problem but I finally solved it.
I was using a TextField instead of CompleteTextViewField so whats the difference between these two and when should I use each one of them?
Thanks
Neither of those classes you mention (TextField, CompleteTextViewField) exist. Do you mean EditText and AutoCompleteTextView? I think the documentation explains it pretty well:
[AutoCompleteTextView is] An editable text view that shows completion suggestions automatically while the user is typing. The list of suggestions is displayed in a drop down menu from which the user can choose an item to replace the content of the edit box with.
That is, use it rather than a normal EditText if you have a set of common autocompletions for what gets entered in the box. The docs also link to a full sample that shows how to populate that list of suggestions with an Adapter.

Categories

Resources