diff options
author | Fred Ross-Perry <fross-perry@conceptuamath.com> | 2016-08-22 19:30:58 -0700 |
---|---|---|
committer | fred ross-perry <fredross-perry@Fred-Ross-Perrys-Computer.local> | 2016-09-14 08:53:32 -0700 |
commit | e18d11b63af0ca8a302f23b32ffc24578c830989 (patch) | |
tree | cf6b213cb8f5e1cb1d8ecf11c98fabe8e7caaa53 /platform/android/example | |
parent | 7d42acddc4f03e7e99d7012ead554ea7fa93c1d0 (diff) | |
download | mupdf-e18d11b63af0ca8a302f23b32ffc24578c830989.tar.xz |
Android example - add button for toggling annotations.
Diffstat (limited to 'platform/android/example')
3 files changed, 22 insertions, 4 deletions
diff --git a/platform/android/example/mupdf/src/main/java/com/artifex/mupdf/android/DocActivityView.java b/platform/android/example/mupdf/src/main/java/com/artifex/mupdf/android/DocActivityView.java index 6a2cca11..e56ed43d 100644 --- a/platform/android/example/mupdf/src/main/java/com/artifex/mupdf/android/DocActivityView.java +++ b/platform/android/example/mupdf/src/main/java/com/artifex/mupdf/android/DocActivityView.java @@ -55,6 +55,7 @@ public class DocActivityView extends FrameLayout implements TabHost.OnTabChangeL private ImageButton mPrintButton; private ImageButton mShareButton; private ImageButton mOpenInButton; + private ImageButton mToggleAnnotButton; public DocActivityView(Context context) { @@ -352,6 +353,10 @@ public class DocActivityView extends FrameLayout implements TabHost.OnTabChangeL mSearchPreviousButton = (ImageButton)findViewById(R.id.search_previous_button); mSearchPreviousButton.setOnClickListener(this); + mToggleAnnotButton = (ImageButton)findViewById(R.id.show_annot_button); + mToggleAnnotButton.setOnClickListener(this); + + mDoc = new Document(path); if (mDoc.needsPassword()) @@ -501,6 +506,8 @@ public class DocActivityView extends FrameLayout implements TabHost.OnTabChangeL onShareButton(); if (v == mOpenInButton) onOpenInButton(); + if (v == mToggleAnnotButton) + onToggleAnnotButton(); } public void onSearchNextButton() @@ -635,6 +642,11 @@ public class DocActivityView extends FrameLayout implements TabHost.OnTabChangeL Toast.makeText(getContext(),"onOpenInButton", Toast.LENGTH_SHORT).show(); } + private void onToggleAnnotButton() + { + mDocView.toggleAnnotations(); + } + private OnDoneListener mDoneListener = null; public void setOnDoneListener(OnDoneListener l) {mDoneListener = l;} public interface OnDoneListener diff --git a/platform/android/example/mupdf/src/main/res/drawable/icon_toggle_annotations.xml b/platform/android/example/mupdf/src/main/res/drawable/icon_toggle_annotations.xml new file mode 100644 index 00000000..0474cd95 --- /dev/null +++ b/platform/android/example/mupdf/src/main/res/drawable/icon_toggle_annotations.xml @@ -0,0 +1,4 @@ +<vector android:height="50dp" android:viewportHeight="24.0" + android:viewportWidth="24.0" android:width="50dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="#FF000000" android:pathData="M22,9.24l-7.19,-0.62L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21 12,17.27 18.18,21l-1.63,-7.03L22,9.24zM12,15.4V6.1l1.71,4.04 4.38,0.38 -3.32,2.88 1,4.28L12,15.4z"/> +</vector> diff --git a/platform/android/example/mupdf/src/main/res/layout/annotate_toolbar.xml b/platform/android/example/mupdf/src/main/res/layout/annotate_toolbar.xml index e0d8ecb4..767a27b0 100644 --- a/platform/android/example/mupdf/src/main/res/layout/annotate_toolbar.xml +++ b/platform/android/example/mupdf/src/main/res/layout/annotate_toolbar.xml @@ -18,7 +18,9 @@ <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" - android:orientation="vertical"> + android:orientation="vertical" + android:paddingLeft="10dp" + android:paddingRight="10dp"> <ImageButton android:layout_width="wrap_content" @@ -26,8 +28,8 @@ android:scaleType="fitXY" android:layout_centerVertical="true" android:background="@drawable/toolbar_button" - android:id="@+id/save_button" - android:src="@drawable/icon_save" /> + android:id="@+id/show_annot_button" + android:src="@drawable/icon_toggle_annotations" /> <TextView android:layout_width="match_parent" @@ -35,7 +37,7 @@ android:gravity="center" android:textColor="@color/black" android:textSize="11sp" - android:text="SAVE"/> + android:text="TOGGLE"/> </LinearLayout> <!--a divider--> |