title: Reverse direction of swiping in viewpager for Arabic language
body: <p>Yesterday, I posted a question about the PagerAdapter and how to achieve it when using database. I managed to sorted it out, however, I do not want the viewpager  to swipe/scroll left I want the opposite (swipe to right). The following is my code:</p>
  
  <pre><code>public class ScrollViewTest6 extends ActionBarAppActivity {
  
      private ViewPager awesomePager;
      private static int NUM_AWESOME_VIEWS;
      private Context cxt;
      private AwesomePagerAdapter awesomeAdapter;
      TextView tv;
      int _id;
      int row_numbers;
      int row_position;      
      private DataAdapter mySQLiteAdapter;
      private Cursor cursor;
  
  
      /** Called when the activity is first created. */
  @SuppressWarnings("deprecation")
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
      cxt = this;
  
      awesomeAdapter = new AwesomePagerAdapter(awesomeAdapter);
      awesomePager = (ViewPager) findViewById(R.id.awesomepager);
      awesomePager.setAdapter(awesomeAdapter);
  
      mySQLiteAdapter = new DataAdapter(this);
      mySQLiteAdapter.createDatabase();
      mySQLiteAdapter.open();
  
     Bundle extras = getIntent().getExtras();
     if (extras == null) {
         return;
     }
  
     _id = extras.getInt("id");
     row_numbers = extras.getInt("row_num");
     row_position = extras.getInt("row_pos");
  
  
     NUM_AWESOME_VIEWS = row_numbers;
  
     awesomePager.setCurrentItem(row_position);
  
     cursor = mySQLiteAdapter.get_AllColumns(); 
     this.startManagingCursor(cursor);
  
  
      this.awesomePager.setOnPageChangeListener(new ViewPager.OnPageChangeListener()
      {
          @Override
          public void onPageScrollStateChanged(int arg0) {
        }
  
          @Override
          public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels){
        }
  
          @Override
          public void onPageSelected(int position){
        }
  
      });
  }
  
  private class AwesomePagerAdapter extends PagerAdapter{
  
      public AwesomePagerAdapter(PagerAdapter fm) {
         }
  
  
      @Override
      public int getCount() {
        return NUM_AWESOME_VIEWS;
        }
  
  
  
      @Override
      public int getItemPosition(Object object) {return POSITION_NONE;}
              @Override
              public Object instantiateItem(ViewGroup collection, int position) {
  
                  LayoutInflater inflater = (LayoutInflater)cxt.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                  View layout = inflater.inflate(R.layout.mylayout, null);
                  TextView Title = (TextView)layout.findViewById(R.id.title);
  
  
                  if (cursor != null ) {
                      if  (cursor.moveToPosition(position)) {                         
                          //do {
                              //cursor.moveToPosition(position);
                              String text = cursor.getString(
                                  cursor.getColumnIndexOrThrow(DataAdapter.KEY_Title));
  
                              Title.setText(text);    
                      }
                  }                       
  
                  ((ViewPager) collection).addView(layout,0);
                   return layout;
              }
  
  
              @Override
              public void destroyItem(View collection, int position, Object view) {
                      ((ViewPager) collection).removeView((View) view);
              }
  
              @Override
              public boolean isViewFromObject(View view, Object object) {
                      return view==((View)object);
              }
  
              @Override
              public void finishUpdate(View arg0) {
              }
  
  
              @Override
              public void restoreState(Parcelable arg0, ClassLoader arg1) {
              }
  
              @Override
              public Parcelable saveState() {
                  return null;
              }
  
              @Override
              public void startUpdate(View arg0) {
              }
  
          }
  }
  </code></pre>
  
  <p>I know some people suggest using 
  setCurrentItem(int); //Last page</p>
  
  <p>But that conflicts with the listview order.</p>
  
  <p>e.g. Listview: </p>
  
  <p>1</p>
  
  <p>2</p>
  
  <p>3</p>
  
  <p>when we use the line above it shows  1 &lt;- 2 &lt;- 3 (starting from 3)</p>
  
  <p>and I want 3 &lt;- 2 &lt;- 1 (starting from 1)</p>