1. Download our Official Android App: Forums for Android!

Apps Scroll pictures horizontally - how to?

Discussion in 'Android Development' started by ac4android, Mar 23, 2016.

  1. ac4android

    ac4android Well-Known Member
    Thread Starter
    Rank:
    None
    Points:
    53
    Posts:
    198
    Joined:
    Nov 3, 2015

    Nov 3, 2015
    198
    29
    53
    Hi.

    I'd like to scroll horizontally pictures of a dozen pizzas and pasta on menu

    Can you please point me in the right direction.
     

    Advertisement

  2. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,291
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,291
    10,398
    1,988
    Male
    Software developer
    South West of England
  3. ac4android

    ac4android Well-Known Member
    Thread Starter
    Rank:
    None
    Points:
    53
    Posts:
    198
    Joined:
    Nov 3, 2015

    Nov 3, 2015
    198
    29
    53
    Yes and thx, that's in the direction I am heading.

    If I have 30-40 images, is it the best thing to put them inside drawables though? But then, where else could I put them where they will have minimal impact on client Android?

    And what if I have new images? Should I to put them in database for download to SQLite?
     
  4. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,291
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,291
    10,398
    1,988
    Male
    Software developer
    South West of England
    Well if you want to put them in a scrolling list then I think you will have to hold the images in memory as drawables. How big are they?
     
  5. ac4android

    ac4android Well-Known Member
    Thread Starter
    Rank:
    None
    Points:
    53
    Posts:
    198
    Joined:
    Nov 3, 2015

    Nov 3, 2015
    198
    29
    53
    How do I create a folder under res/layout or res/mipmap to hold .png-images for a horizontally scrollable images? Must be do-able, I see a lot of that on twitter.com

    I've tried under drawable, mipmap and layout. None would accept a sub-dir. I need to have something like the ic_launcher to launch a series of images

    Also, I need to have a "<" and ">" to left and right to he;p user scroll the images.

    UPDATE:
    Yes, I can create the sub-folder under Project instead of Android.
    But how do I load several images into the subfolder? The Android method allows for one and only one image:
    Code (Text):
    1.  
    2. imageView.setImageBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher));
    3.  
    In the above example, Android when and launched the images in ic_launcher, each in a different subdir and each with a different resolution, one after the other

    I just want to create a sub-dir with a list of .png images that I can display and scroll, this is an example:

    UPDATE: Thanks. Got it working :)
     

    Attached Files:

    #5 ac4android, Mar 26, 2016
    Last edited: Mar 27, 2016

Share This Page

Loading...