I want to create something similar to the Instagram search bar for messages, where I can add recipients as chips just pressing to the some user item from the suggestions list. My problem is the position of the cursor in the MultiAutoCompleteTextView. When I add last token, I want the text scroll a bit left to give area for the cursor to allow the user to type and see what he is typing. But in my case my cursor is on the border of the screen. It is not very convenient and looks not very good. The first image is the my implementation using https://github.com/splitwise/TokenAutoComplete library. The second image is from the Instagram. Please, tell me any possible solutions how can I scroll text inside MultiAutoCompleteTextView programmatically?
Related
My row in list that has editText in it, beside other things. If I set android:focusableInTouchMode="false" on editText, I am able to select my entire row, highlight it, get data I need, but I no longer can edit my editText, because keyboard doesn't pop up. If I set android:focusableInTouchMode="true", then I can edit editText, but i can't click on entire row, highlight it, get data. How can I achieve both?
ListView isn't adapted for inputs. It keeps in memory only visible items + 2. So even if you will achieve the that what you want, all your edits will dessapear after every time, your EditText leaves the screen.
Take a look at RecyclerView view documentation. This class is better adapted to this kind of stuff.
UPD
Actually, there is a tutorial exactly for foucsable EditTexts in ListView. But as you see, it was relevant for 2011.
I am working on a UI where I have a list view. Each row has 2 information. One is Product name and the other is product ID stacked one over other. So each row has 2 lines of data.
What i want to do with this:
Once a user clicks on each row, it will further expand and show one input and one spinner. So it is basically for putting in Quantity and unit of measure.
Please let me know if this is achievable and if I can refer to some example.
What I need is more like
Taskos To Do List | Task List
https://play.google.com/store/apps/details?id=com.taskos&hl=en
All i need is that the category will not be expandable. Only the items will be expandable. All i need is an example of such app and then I can take it forward.
I think it could be done... you would need to put the extra widgets in your row layout, populate them and hide them upon list creation, then in your onListItemCLick you could unhide them.
Note I have no idea if this would work, but it seems reasonable that it might and it's what I would try and do to achieve the goal.
listView cannot be expanded. however you can use an expandablelistView
But the kind of functionality you want cannot be done this way(I guess.).
You can use
registerForContextMenu("your list View");
to register your list view
onCreateContextMenu
for the kind of action you want to be performed in your case its dialog with EditText and Spinner to have input from user
In my Android app, I have this screen where the top part is a search box kind of thing and below it there is a ListView. Now the requirement is that when a user starts typing something in the search box I have push up items from the list view which match that pattern.
I have thought of using Auto Complete TextView, but that does not help because the items displayed must be in the list view itself where they can be clicked. They just need to be pushed up the list when they match the pattern of text typed in the Search box above.
How to achieve this ?
Please Help.
use addTextChangedListener in EditText to get user interactin with EditText and update the ListVIew using notifyDataSetChanged();. Try to use Handler
I'm writing an app and I have a ListView, which items are ImageView and TextView.
I'd like to determine whether user have clicked the icon or the text to handle diferrent actions for each case. I want to achieve similar effect like in stock contacts app.
First question: How to achieve the effect wich I've mentioned above?
Second question: In the stock contacts app when we click on a photo, a fancy bubble with some actions inside appears. How is it called? Where to get it from?
Thanks.
(edit)
ok, i've found something according to my second question:
How to make a fancy transparent menu like the "share menu" in Android gallery?
The answer on your first question: you should attach onClickListeners to each of your row's views in your Adapter's getView() method. This should do it.
So, basically I have a custom View that contains a ListView with a custom Adapter that has the ability to read in information from the network (dumbed down HTML) and display it on a row by row basis.
All of this works, but I need the text that is read in to be parsed as HTML which contains links that can be tapped on and launched in browser.
I managed to do this by:
text.setText(Html.fromHtml(textBuffer), TextView.BufferType.SPANNABLE);
text.setMovementMethod(LinkMovementMethod.getInstance());
Works great, any links in the text are displayed as links and can be tapped.
This is a side effect of now making it so the rest of the rows in the ListView cannot be tapped (or tapped and held). Basically, all the rows are non-selectable now.
Is there any way to achieve both of what I need?
thanks!
Try setting text.setFocusable(false). By removing focus from the EditText, events will be passed onto the ListView or other items.
When you put an item that is focusable inside a ListView, it automatically makes the ListView not focusable. This is the behavior you are seeing.
To make them both focusable, I believe you can adjust the descendantFocusability property of the ListView.
See this question for a similar problem.