xml for dropdown text - android

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

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

Autocomplete/Autofill Edit Text 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

Android classic IRC-like chat box

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.

Alphanumeric View in Android

I am developing an Android App which gives users an option 'Browse Alphanumerically'. Using this option let users view the list of items starting with a particular letter or number. Problem is that I cannot decide how to implement screen for this, which can work properly on any screen size. Please suggest me the best solution.
Thanks.
What I got from your question is that you want to show all alphabets and numbers to the user so they can jump directly to a entries start with the selected alphabet or number. If this is so, then one solution to your problem is use the Button or ImageButton any make a key pad of all alphabet and numbers. Don't forget to make them flexible enough for different screen sizes. Cheers.
Use a list activity. There are lots of tutorials on Google's developer site. When you want to narrow the list, just assign the smaller list to the ListView. Just filter your master list, sort it, and assign it to your list adapter.
Hope this was helpful.

Categories

Resources