6

I am using harism android page curl.It works brilliantly. My app works in landscape mode and I want to start with an open book. As I am working in landscape mode the framework automatically set

SHOW_TWO_PAGES

property.

Now when the app begins on right side I can see PAGE0.PNG, which is my first page of the book, and on left side its blank space.

Instead I want PAGE0.PNG on left hand side and PAGE1.PNG on right hand side. How can I accomplish this?

Kara
  • 6,115
  • 16
  • 50
  • 57
Zach
  • 9,989
  • 19
  • 70
  • 107
  • I'm not sure but if will try to call `setCurrentIndex(1)` from https://github.com/harism/android_page_curl/blob/master/src/fi/harism/curl/CurlView.java. But this probably won't solve your issue completely since user can try to flip back – Eugen Martynov Aug 26 '13 at 13:21

1 Answers1

1

This can be done by adding, mCurlView.setCurrentIndex(1); to the SizeChangedObserver class in the CurlActivity.

See this,

private class SizeChangedObserver implements CurlView.SizeChangedObserver {
    @Override
    public void onSizeChanged(int w, int h) {
        if (w > h) {
            mCurlView.setViewMode(CurlView.SHOW_TWO_PAGES);
            mCurlView.setMargins(.1f, .05f, .1f, .05f);
            mCurlView.setCurrentIndex(1);  //--- Add this line.. 
        } else {
            mCurlView.setViewMode(CurlView.SHOW_ONE_PAGE);
            mCurlView.setMargins(.1f, .1f, .1f, .1f);
        }
    }
}
Andro Selva
  • 53,910
  • 52
  • 193
  • 240