android MultiAutoCompleteTextView - displaying custom views in it - java

I'm implementing MultiAutoCompleteTextView with email contact suggestions. What i want to have is to display contact badges in the MultiAutoCompleteTextView content instead of strings. The Gmail Android app does it.
Basically I Want what is shown in the drop down to be shown in the MultiAutoCompleteTextView (contact photo, name and email) after i typed in/selected the contact.
Is it possible?

Google does this via using a custom ImageSpan. I just implemented this successfully for one of my apps. You should look at RecipientEditTextView.java to see how they do it. Essentially they create a drawable via Canvas and assign that drawable to a custom ImageSpan. I cannot post any code since ... well there is a ton, however you should get a good idea looking thru the source.

Related

Recyclerview in a recyclerview activity

using firebase-ui and some coding I have set up my code to work like this:
1) it retrieves data from firebase (image, text and so on), then it passes them to another activity.
2) the new activity receives datas like strings and shows them.
Just to give you an idea I am looking forward to building a streaming app. What I want to do is to show an episode list via recyclerview.
What I am doing right now is a nested scroll view and a copy-paste script to pass up to 26 episodes, but this is not a really good method and I would like to have some suggestions in order to go forward in the best way and solve this problem.
this is a screenshot of the app: https://imgur.com/a/vgBnZTA I am just passing strings to the 2nd activity, then i check if it is not a null string, if it is i hide the layout, otherwise it shows, but it is just a copypaste of code. I hope i was clear enough
Thanks everyone for your support

How to get the uri of the images stored in the phone and return them in a String[]

I am trying to create a custom gallery with a single select option. I've used the code provided by google docs to create a GridView that contains the images contained in drawable.
Now I want to change it by making the GridView show all the images stored in the phone.
To get all images from the phone you need to query the android.provider.MediaStore
First make sure you have the AndroidPermission.READ_EXTERNAL_STORAGE, then get the thumbnails for the grid.
Here is a simple way to do this:
HERE
Hope this helps.

Android - Can you 'auto create' layouts while app is running?

I'm trying to create a scrollabe friends list. I'm grabbing the information for each friend off of a text file (profile pic, name, age, etc.)
So in my prototype I used different nested layouts to create one single friend entry. And to fill the list I just copied the most parent layout of my first friend and changed or adjusted the profile pic and the other text information.
What if, while the app is running, I need to update my friendslist and add another friend to the list.
How do you realise something like that?
Go for a recycler view or a scrollable list view to make a list and dynamic. You can check slidenerd's video tutorial on youtube. They are really helpful for a beginner to start any kind of app.

Animate newly added items to my listview?

I have a adapter that displays the SMS / MMS messages on the phone. I am trying to animate a new message being either sent or received. Instead of the message item just appearing in the list I want to animate a new message into the listview. Here is a video of something similar to what I am wanting to accomplish
Listview Animation Video
I know that I could apply the animation into the getView() method of the adapter, but I want to only animate the new messages. Anyone know of a possible way for me to do this? Thanks!
You can do that using Layout Transitions. This link also may help you.
But this class is available only on API Level 11+, so if you want to provide compatibility to earlier android API Levels, you have to try something different.

Android: Set selected icon in GridView

I'm trying to find a way to store the name of an icon in my database, then use that name to let a user select an icon from an ImageView. I've found various guides on ImageViews and Galleries, but none that show how to get/set the selected image by name. The list of available images won't change, but what's that best way to implement this?
check this tutorial, it can give you an Idea of how to do it:
http://www.firstdroid.com/2011/02/06/android-tutorial-gridview-with-icon-and-text/
Good luck.
Adrian.

Categories