summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorPaul Gardiner <paulg.artifex@glidos.net>2013-02-04 12:48:44 +0000
committerPaul Gardiner <paulg.artifex@glidos.net>2013-02-04 12:48:44 +0000
commit05f86ac0cfd2dca99e27120a5e35db6cba703eec (patch)
treeffa6eaf83f5c5bf180884792cdd9e7438c620581 /android
parente7aa801e31b29bae1d22554becb2bde96578d313 (diff)
downloadmupdf-05f86ac0cfd2dca99e27120a5e35db6cba703eec.tar.xz
Android: add button for reflow
Diffstat (limited to 'android')
-rw-r--r--android/res/drawable-ldpi/ic_reflow.pngbin0 -> 962 bytes
-rw-r--r--android/res/drawable-mdpi/ic_reflow.pngbin0 -> 1255 bytes
-rw-r--r--android/res/layout/buttons.xml12
-rw-r--r--android/src/com/artifex/mupdfdemo/MuPDFActivity.java11
4 files changed, 21 insertions, 2 deletions
diff --git a/android/res/drawable-ldpi/ic_reflow.png b/android/res/drawable-ldpi/ic_reflow.png
new file mode 100644
index 00000000..5be6372b
--- /dev/null
+++ b/android/res/drawable-ldpi/ic_reflow.png
Binary files differ
diff --git a/android/res/drawable-mdpi/ic_reflow.png b/android/res/drawable-mdpi/ic_reflow.png
new file mode 100644
index 00000000..c6b72be9
--- /dev/null
+++ b/android/res/drawable-mdpi/ic_reflow.png
Binary files differ
diff --git a/android/res/layout/buttons.xml b/android/res/layout/buttons.xml
index 6764dfd1..2d5732f1 100644
--- a/android/res/layout/buttons.xml
+++ b/android/res/layout/buttons.xml
@@ -55,12 +55,22 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
- android:layout_toLeftOf="@+id/searchButton"
+ android:layout_toLeftOf="@+id/reflowButton"
android:contentDescription="@string/search_document"
android:background="@drawable/button"
android:src="@drawable/ic_list" />
<ImageButton
+ android:id="@+id/reflowButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerVertical="true"
+ android:layout_toLeftOf="@+id/searchButton"
+ android:contentDescription="@string/search_document"
+ android:background="@drawable/button"
+ android:src="@drawable/ic_reflow" />
+
+ <ImageButton
android:id="@+id/searchButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
diff --git a/android/src/com/artifex/mupdfdemo/MuPDFActivity.java b/android/src/com/artifex/mupdfdemo/MuPDFActivity.java
index 61b24170..f627cc0f 100644
--- a/android/src/com/artifex/mupdfdemo/MuPDFActivity.java
+++ b/android/src/com/artifex/mupdfdemo/MuPDFActivity.java
@@ -17,6 +17,7 @@ import android.content.SharedPreferences;
import android.content.res.Resources;
import android.database.Cursor;
import android.graphics.Color;
+import android.graphics.PorterDuff;
import android.graphics.RectF;
import android.net.Uri;
import android.os.Bundle;
@@ -103,6 +104,7 @@ public class MuPDFActivity extends Activity
private TextView mPageNumberView;
private TextView mInfoView;
private ImageButton mSearchButton;
+ private ImageButton mReflowButton;
private ImageButton mSelectButton;
private ImageButton mCancelSelectButton;
private ImageButton mCopySelectButton;
@@ -590,7 +592,13 @@ public class MuPDFActivity extends Activity
// Activate the search-preparing button
mSearchButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
- //searchModeOn();
+ searchModeOn();
+ }
+ });
+
+ // Activate the reflow button
+ mReflowButton.setOnClickListener(new View.OnClickListener() {
+ public void onClick(View v) {
toggleReflow();
}
});
@@ -963,6 +971,7 @@ public class MuPDFActivity extends Activity
mPageNumberView = (TextView)mButtonsView.findViewById(R.id.pageNumber);
mInfoView = (TextView)mButtonsView.findViewById(R.id.info);
mSearchButton = (ImageButton)mButtonsView.findViewById(R.id.searchButton);
+ mReflowButton = (ImageButton)mButtonsView.findViewById(R.id.reflowButton);
mSelectButton = (ImageButton)mButtonsView.findViewById(R.id.selectButton);
mCancelSelectButton = (ImageButton)mButtonsView.findViewById(R.id.cancelSelectButton);
mCopySelectButton = (ImageButton)mButtonsView.findViewById(R.id.copySelectButton);