Need some help!!..
I'm try to implement a list view with two images in the initial screen, after scrolling other images can be seen.
Can you suggest anyway to implement it!
Use can achieve it by creating custom adapter for list view. Have a look :-
http://www.learn2crack.com/2013/10/android-custom-listview-images-text-example.html
You need to do some updation like removing text view from custom list layout.
Related
I want a layout that will display images without knowing how many. First i thought of a ScrollView, but don't know how to add different images to it. How can that be done? Or is there any other solution?
How can that be done?
Have the ScrollView wrap around a vertical LinearLayout, into which you add your ImageView widgets.
Or is there any other solution?
ListView. GridView. RecyclerView. ViewPager. And so on.
Depending on how you want to display the images, you can also use GridView : Grid View Android Developpers
There is an example : Gridview with two columns and auto resized images
You don't need to use ScrollView or know the amount of images you're gonna show. Just use a ListView with an ArrayAdapter that binds a List of Bitmaps (images) to your ListView (each item of your ListView is an ImageView). Each time you add a new image to your list, just call notifyDataSetChanged() method of your adapter, that's gonna update your ListView.
Just google for a relevant tutorial. You're gonna see lots of examples.
I want to implement the below image in android ,
I have used Relative Layout to display content and Recycler view to display comments but I want both under one scroll while my problem is recycler view is creating another scroll.
I also thought to add a layout dynamically but in that every layout I have to implement click listener for every child , which is not good for performance
What could be the best way to implement it
You can make a ListView where row contains Comments part and add Image as a Header of that ListView.
The other way is to create a Custom Adapter and include Image and Comments as a single row of a ListView
For implementing a click event on each item you can refer to this answer
Why don't you use a ListView with custom elements in it (that look like the comments on the picture) instead of the RecyclerView
How to do a layout like this? I currently use a listActivity and I need the same experience with this kind of layout.
You can use Staggered Grid View library. Also check and Quilt View. This is what you need.
To get this effect, you should create two list views and link the scrolls of both lists.
Define a OnScrollListener on both listviews and when "onScroll()", move programatically the other list. I think if all images are cached you shouldn't have delays.
You can use Staggered Grid View library. But there you need to mention height of each image pragmatically to set height of list view. Else when you scroll to end and come back to top, the alignment of images on top will get disturbed
You have to use GridView
You can refer this or this.
How can I add Grid View to the ListView.I could able to Implement but the problem is Grid View is not Visible its full height. I want to implement just like the Dropbox Photo CustomView which I have attached below. Please guide me in correct Path.
Thanks,
Chaitanya
Using github.com/TonicArtos/StickyGridHeaders library for placing headers in gridview and refer this article http://www.programering.com/a/MjN0ITMwATU.html where is the demo as what are u expecting.
The thing is that you are not supposed to add a scrollable view into another scrollable view. Both ListView and GridView are scrollable, so that just leads to trouble. I suspect that the Dropbox app does not use a GridView, but multiple LinearLayouts, that's at least what I would do. You just can not use an adapter in that case, but need to add the layouts and elements programmatically.
In my project i have a list. this list includes thumbnail images which should be scrollable horizontally.
If i add a list inside HorizontalScrollView and inflate my list what will be output? I want to arrange all images horizontally.
How can I do that? Thanks
You can go with Gallery widget.
using Gallery would be easy for you as it is also implemented using Adapter pattern. So what you need to do is to provide Adapter implementation as you simply do for ListView as single image thumbnail.
or you can have a look at HorizontalListview