Endless Views


Last Updated:

  1. Maxood

    Maxood New Member This Topic's Starter

    Joined:
    Sep 13, 2009
    Messages:
    3
    Likes Received:
    0
    I am developing an application in which a user keeps on scrolling
    vertically. Each view displays a single text on a drawable background.
    How can i obtain endless views?
    Is it a ListView do i have to use here? But how can i make a ListView
    not to end and keep on going forever until the application is
    terminated by the user?
    Is there an attribute or i have to do it programatically? Please
    explain.
    Hope my question is clear.Waiting for the reply.

    Maxood
     

    Advertisement
  2. Gremlyn1

    Gremlyn1 Well-Known Member

    Joined:
    Sep 10, 2009
    Messages:
    221
    Likes Received:
    1
    No idea how to do it, but why on earth would you need it to scroll infinitely?
     
  3. Maxood

    Maxood New Member This Topic's Starter

    Joined:
    Sep 13, 2009
    Messages:
    3
    Likes Received:
    0
    There are 636 facts in total. Each fact is fetched from the database randomly and displayed on the view.There are 27 drawables (background images) on which each fact will be displayed. These drawables are meant to repeat themselves randomly or sequentially.

    I need infinite scrolling as the facts and views keep on repeating them as the user scrolls vertically.
    Hope you understand my requirement. This is the layout i have made.



    Now i need to have these views repeating them. How can i do that?Thanks

    Maqsood
     
  4. Gremlyn1

    Gremlyn1 Well-Known Member

    Joined:
    Sep 10, 2009
    Messages:
    221
    Likes Received:
    1
    I'm still in my early phase of learning Java, but I would imagine it may be best to set the visual template of what you want and populate the background image and on screen data using a while that just never reaches it's conclusion.

    I would do it using someting like
    Code (Text):
    1. while (true statement) {
    2.     randomly.display.fact
    3. }
    Your 'true statement' could just be that the next fact has been called for. While it's not technically infinite (in the sense it'll just keep running and eat up your memory and crash), it just always keeps going and you can create a function to randomly select a number/id/name/fact/whatever for the data to display. Maybe include an array that is storing the last 50 or so shown facts that you can check the randomly generated fact against so that they don't repeat too often. So I can't be more help with actual code, but that's the logic I'd approach this with, hope it helps!
     
  5. gauntface

    gauntface Member

    Joined:
    Nov 2, 2009
    Messages:
    11
    Likes Received:
    0
    Have you had any luck implementing this in terms of just being able to show 600 odd entries?

    I don't require the list to loop, but need to show a vast amount of data and memory is a big factor.

    I'll let you know if I come up with / find a good solution that might be relevant to your needs.

    Matt
     

Share This Page

Loading...