Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

How do you add comments using piccasso?

How do you add comments using piccasso? Is there a way to do it so when you tap on it the picture will show a title and the user can add a description and other users can comment like on Instagram?

4 Answers

The Picasso library is only used for downloading and caching images. Any other features would have to use a different library or have your own custom code.

Thanks Danial,

Do you know how I would add a comment feature in an app or create a photo stream like instagram?

I can quickly describe it at a high level for you that will hopefully point you in the right direction, but you are going to need to read a lot of references to fully understand how to create those features.

To get the interaction you described in the original post, if you are using ListView and ListActivity, then you can override onListItemClick(), then show an AlertDialog with a custom view by AlertDialog.Builder.setView().

To make a simple one-column photo stream like Instagram, then the easiest way is to create a custom ArrayAdapter for the ListView, and you'll have to create a custom XML layout. There are tutorials online for "How to create a custom ListView".

The above is probably what you would want to use for a quick implementation that you can see results from. But, Google also recently released something like a ListView called a RecyclerView, which makes some things easier and some things harder. So, eventually you might want to learn about that also: https://developer.android.com/training/material/lists-cards.html

For more details than what I provided, I just found this Treehouse forum thread that talks about it: https://teamtreehouse.com/forum/custom-listview-course

So I can request the photo that has been uploaded to the parse backend and display it on the app like Instagram has it on its single column phitostream? I thought in the tutorials stated you were unable to do that.

I don't recall any tutorial that says you can't load the photos in a column or list. Parse API even offers some tools to make that easier, like ParseQueryAdapter.

I just finished Treehouse's "Build a Self-Destructing Message Android App" and it describes loading images in a list and grid.

Oh oops I mist of miss heard. Thanks for your help so far Daniel. So I would create an array adapter and then in an XML create one where it displays an image in the middle of the screen and a texview below it to display the comments?

Yep, that sounds good!

In the XML if you drag and drop the list view in there wouldn't it display the image as a small icon? Will the custom adapter grab the image and make it so it covers 3/4 of the page while The other 1/4 is where the comment goes?

Ah OK. I am on the ribbit app but I am only at the fragment section so still I'm the beganing of it. I will probably understand it more once I get further into the lesson