In my application i have a AutoCompleteTextView within which the user inserts a series of tags to categorize an element. I would like to make sure that every time the user inserts a tag and makes a space, the tag he inserted was put inside a badge like these:
How can i achieve this?
Yes , First of all these text inside badge as you said is known as Chips , and you can acheive this by MaterialChipLayout
https://github.com/pchmn/MaterialChipsInput
follow this after adding this into your build , it will solve your problem.
Related
Hi I am developing an android app and I want to add a similar component that I found in another app this is the structure:
So I want to make something like this but I can't figure out what components of xml android to use I was thinking of a CardView with a ListView inside or use a table layout instead but I dont know if that's the right choice because it has to be dynamic, when I tap the + button I have to add a new row or when I tap the - the last row has to disappear also the weight and reps elements are text field's for the user to input data. What's the best way to achieve this?
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
I dread designing UI for Android apps, and I have been searching and trying every possible combination of things to get this the way I want it, but I just cannot seem to get it right.
I want to have a simple Android app that has a text field and a send button next to each other on the bottom of the screen (I already have this correct), and I also want a functional chat area filling the rest of the screen above.
It obviously needs to be scrollable, and I would like to be able to add a new line to the bottom of the chat by doing something like chatBox.add(username, text).
This is the type of view I am looking for:
<bob> my name is bob
<bill> hi bob, my name is bill!
<bob> we are having an awesome conversation, bill
<bill> both of our names start with a b
<bob> how right you are
I had made such app. For chat window I used listView. ListView has stackFromBottom mode. So the last added messages will be on the bottom of ListView. Also I created custom Adapter extending ArrayAdapter, so it is easy to add new messages.
Here is a nice example, how to use listView with adapter and add new items.
Leonisdos is right, you shoud use listView. Do you know the app Irssi-ConnectBot ? I think you should have a look in its source code to have many good examples.
Here the code.google project of Irssi-connectbot (and the github)
Wrap a TextView in a ScrollView. Use append() on the TextView and fullScroll(View.FOCUS_DOWN) on the ScrollView when you append new chat entries.
For longer chats, Leonidos' ListView approach is more efficient, but I thought I'd mention this one.
I was wondering if this can be implemented in android.
So there are basically two text views one is the name / other is the "open" .
The name can extend more than one line and the "open" should be placed adjacently .
One way is to dynamically break the name text view into two and place "open" next to it. But I don't find it good solution . any direct way to implement it ?
You may set the following to your TextView:
android:drawableRight="#drawable/your_image"
You could create ListView and use
setCompoundDrawablesWithIntrinsicBounds in the layout for your Adapter. Create a Boolean to show when a pizza joint is open and when to show the Drawable.
Something like this:
if (isOpen){
yourTextView.setCompoundDrawablesWithIntrinsicBounds(0,0,0, drawable);
}
Of course, this would require you to make an "open" image, but the way I see it, this would be the easiest way.
Just a thought .
It can be done via setting text using textView.setText(Html.fromHtml(styledText));
friends,
i want to perform functionality same like stackoverflow tags as we do normally creating a question separated by commas in android.
i know we have auto complete text view in android any one suggest me can i use it for multi selection?
or any useful way to achieve this?
any help would be appreciated.
it can be achieve through two ways
i devised my own machanism so may b you people have better approach than me please share too.
1) simple
2) advance
1) in simple we can use autocomplete text view and only use single tag with hard coded values which is limitation.
2) i have used a popup page with a Edittext and add button on top and listview with checkboxes below it.
fixed items i have already loaded into list view with checkboxes so that i could select multiple tags.
and in case of if i want to add my custom tag then i use that edit text above list view and store it in temporary data and
then finally using bundle i show selected values where i want seperated by commas.
thats it.