summaryrefslogtreecommitdiff
path: root/platform/android/src/com/artifex/mupdfdemo/MuPDFReflowAdapter.java
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2013-06-19 15:29:44 +0200
committerTor Andersson <tor.andersson@artifex.com>2013-06-20 16:45:35 +0200
commit0a927854a10e1e6b9770a81e2e1d9f3093631757 (patch)
tree3d65d820d9fdba2d0d394d99c36290c851b78ca0 /platform/android/src/com/artifex/mupdfdemo/MuPDFReflowAdapter.java
parent1ae8f19179c5f0f8c6352b3c7855465325d5449a (diff)
downloadmupdf-0a927854a10e1e6b9770a81e2e1d9f3093631757.tar.xz
Rearrange source files.
Diffstat (limited to 'platform/android/src/com/artifex/mupdfdemo/MuPDFReflowAdapter.java')
-rw-r--r--platform/android/src/com/artifex/mupdfdemo/MuPDFReflowAdapter.java43
1 files changed, 43 insertions, 0 deletions
diff --git a/platform/android/src/com/artifex/mupdfdemo/MuPDFReflowAdapter.java b/platform/android/src/com/artifex/mupdfdemo/MuPDFReflowAdapter.java
new file mode 100644
index 00000000..48625a7e
--- /dev/null
+++ b/platform/android/src/com/artifex/mupdfdemo/MuPDFReflowAdapter.java
@@ -0,0 +1,43 @@
+package com.artifex.mupdfdemo;
+
+import android.content.Context;
+import android.graphics.Point;
+import android.graphics.PointF;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+
+public class MuPDFReflowAdapter extends BaseAdapter {
+ private final Context mContext;
+ private final MuPDFCore mCore;
+
+ public MuPDFReflowAdapter(Context c, MuPDFCore core) {
+ mContext = c;
+ mCore = core;
+ }
+
+ public int getCount() {
+ return mCore.countPages();
+ }
+
+ public Object getItem(int arg0) {
+ return null;
+ }
+
+ public long getItemId(int arg0) {
+ return 0;
+ }
+
+ public View getView(int position, View convertView, ViewGroup parent) {
+ final MuPDFReflowView reflowView;
+ if (convertView == null) {
+ reflowView = new MuPDFReflowView(mContext, mCore, new Point(parent.getWidth(), parent.getHeight()));
+ } else {
+ reflowView = (MuPDFReflowView) convertView;
+ }
+
+ reflowView.setPage(position, new PointF());
+
+ return reflowView;
+ }
+}