Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6005499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:24:21+00:00 2026-05-23T01:24:21+00:00

I want to use an Android Gallery but draw the items from right to

  • 0

I want to use an Android Gallery but draw the items from right to left (the writing direction in Hebrew)
The Gallery items represent chapters in a book written in Hebrew, so that the item order is important

Android draws them in the opposite direction like this (the first item is chosen)
1 2 3 4 5

instead of this
5 4 3 2 1

I already tried overriding these methods in my Gallery class
(none of them changed the drawing order):

@Override
public int getChildDrawingOrder(int childCount, int i) {
    return getChildDrawingOrder(childCount, childCount - i+1)
}

I know from Debugging that the getChildDrawingOrder was visited
I tried a couple of variations of this, but non of them worked

I also tried

@Override
public void onDraw(Canvas canvas) {
    canvas.save();
    canvas.rotate(180, getWidth()/2, getHeight()/2);
    super.onDraw(canvas);
    canvas.restore();
}

I’ll be happy if anyone can help me with this
I can’t get this right

Thank you Very Much
Oron

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T01:24:22+00:00Added an answer on May 23, 2026 at 1:24 am

    Feed the Gallery with images using an ImageAdapter class and load the images in reverse order e.g.

    gallery = (Gallery) findViewById(R.id.gallery);
    Integer[] mImageIds = new Integer[] {                   
        R.drawable.chapter_5_image,
        R.drawable.chapter_4_image,
        R.drawable.chapter_3_image,             
        R.drawable.chapter_2_image,
        R.drawable.chapter_1_image};
        imageAdapter = new ImageAdapter(this, mImageIds);
        gallery.setAdapter(imageAdapter);
    

    The ImageAdapter class should extend android.widget.BaseAdapter – there are plent of example around showing how to implement an adapter of this type.

    Also, set the initial selection in the gallery as follows:

    gallery.setSelection(4, true);
    

    This should position the gallery to show the Chapter 1 image.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use an SDK in android, but I don't want that SDK
I'm writing simple filter in Android and want to use ExpandableListAdapter with check boxes.
I want to use following selector drawable for android gallery image will it work
I want to create simple application like android image gallery but I don't want
I want to set the Image to be Selected from the Android Gallery. I
I want to use com.google.android.maps.MapView, but can't figure out how to download the library
For setting the Single Line in EditText we use android:singleLine=true but I want to
I want to create a picture chooser from gallery. I use code intent =
I have an image located at: http://ww2.sinaimg.cn/bmiddle/8c9772a0jw1dm10273empj.jpg I want use android gallery app to
Desired Outcome I want to have Vertical List with custom items on the left/right

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.