basically what am doing is am querying some data from firebase and inside these data is a URL for an image of a specific item. Now since its a query i could get different result form the firebase where i can get 4 images or sometime maybe 1 image.
And i want to display the images in a grid layout ( similar to that of Instagram posts) where the user can click on an image and it shows the user some details about that item. This is the part where am stuck at.. i dont know how to do it since i have a variable number of images.
if there is a way, please help
you can use the Recyclerview and provide the model with those details. It will automatically create those many rows in list.
Here you can follow this to do this.
Related
I am working on a "users" activity that show online users in a chat application, to show them I am using a ListView and every item contains the profil photo, the name and an extra textview about the online user.I am storing images in FirebaseStorage.
the problem is that when I scroll the items aren't stable and some images of other users are shown in the wrong item, and I have to wait around 2 seconds until the view becomes stable.
what if I used RecyclerView ? will it change and solve this issue ? I need your suggestions.
thanks in advance.
Whenever you scroll up and down, these views are getting re-drawed with wrong options so always specify both if-else conditions cause listview doesn't know the previous state/conditions/values of our widgets.
I want to use a single layout for displaying different information.
Ihave a list view. When the user selects a item from the list view it should open the layout for that list item. List view contains the name and image of the entity.In the layout it should display all the other information. This single layout has to be used for displaying the information for all the entity of the list view as per the users selection.
Bst way to picturize it is the google play store. we have a list and according to our choice the same layout is used for displaying the information for all applications..
in the list view,layout the data will be fetched from internet.
pls help..
You are basically looking for a master detail flow i guess ...
Check THIS LINK which is exactly similar to what you want ... I think the selected answer here applies to you to your question too.
You just need to do it throught your java code i dont know what exactly you want to change so i cant provide a code but you may easly find some in this website. From a quick search i found this : Editing data in a List View item and it seems to be what you want.
I have the following requirements.
I am displaying 10 items in a ListView in which each List item displays 2 text views & one thumbnail image . I have coded to display the images asynchronously , since I need to fetch the images using url. The data for the list item is being fetched from server. In the response , I get the information whether any more pages are available for display.
After the user scrolls to the 10 items , I need to call the webservice to fetch the next 10 list of items from the server . When the user scrolls to the 10 th element of the first page , a small progress dialog is displayed at the end of the screen & information is fetched from the server & the view is updated . Also if the user scrolls up , new call to the webservice is not made to the server & the display contains all the list items.
I received few suggestions but am unable to implement the pagination .
Kindly help as I am stuck on this problem for more than 3 weeks.
You might try my EndlessAdapter and see if either it can solve your problem directly or give you ideas of how to implement your own take on the concept.
I would like to improve the load of my activities in my Android app.
Every activity is either a GridView, a List or a Gallery.
My questions is : How can I load only what's displayed ?
Let's say I have to display a list of 500 songs (The same with a grid of 500 pictures), and each cell includes the Thumbnail, title and lenght.
How can I know which one is currently displayed ?
I don't know if I made myself clear, if not please jut let me know.
I think you should have a look at Lazy List Loading Example.
I am new to android. I want to display the list of images using the ListView. The images which are displayed are decided at runtime according to server response. and also i want to embedd some text on this image(like match scoring chip). the number of images are not fix. Can anybody help me here?
I would read the 6 parts to this series. It will show you how to create your own custom listview rows to accomplish what you are asking for:
http://www.androidguys.com/2008/07/14/fancy-listviews-part-one/