{ final Book book; protected AbsPageAdapter(@NonNull Book book) { this.book = book; } public final PageContainer getPage(int position) { // ϖʔδͷฒͼΛస return getPageInternal(getCount() - position - 1); } public abstract int getCount(); public abstract PageContainer getPageInternal(int position); }
List<Page> pageList = new ArrayList<>(); // লུ Book book = new Book(Align.Left, pageList); AbsPageAdapter pageAdapter; if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { pageAdapter = new DoublePageAdapter(book); } else { pageAdapter = new SinglePageAdapter(book); } return pageAdapter; }