diff options
28 files changed, 1125 insertions, 1128 deletions
diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index f91ccd83..631028e5 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -1,87 +1,87 @@ <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.artifex.mupdfdemo" - android:versionCode="2" - android:versionName="@string/version" - android:installLocation="auto"> - <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> - <uses-permission android:name="android.permission.INTERNET" /> - <supports-screens - android:smallScreens="true" - android:normalScreens="true" - android:largeScreens="true" - android:anyDensity="true" /> - <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="11"/> - <application - android:label="@string/app_name" - android:icon="@drawable/icon" - android:debuggable="true" - android:hardwareAccelerated="true"> - <activity - android:name="ChoosePDFActivity" - android:theme="@android:style/Theme.Light" - android:label="@string/app_name"> - <intent-filter> - <action android:name="android.intent.action.MAIN"/> - <category android:name="android.intent.category.LAUNCHER"/> - </intent-filter> - </activity> - <activity - android:name="MuPDFActivity" - android:theme="@style/AppBaseTheme" - android:label="@string/app_name"> - <intent-filter> - <action android:name="android.intent.action.VIEW"/> - <category android:name="android.intent.category.DEFAULT"/> - <data android:mimeType="application/vnd.ms-xpsdocument"/> - </intent-filter> - <intent-filter> - <action android:name="android.intent.action.VIEW"/> - <category android:name="android.intent.category.DEFAULT"/> - <data android:mimeType="application/pdf"/> - </intent-filter> - <intent-filter> - <action android:name="android.intent.action.VIEW"/> - <category android:name="android.intent.category.DEFAULT"/> - <data android:mimeType="application/x-cbz"/> - </intent-filter> - <intent-filter> - <action android:name="android.intent.action.VIEW"/> - <category android:name="android.intent.category.DEFAULT"/> - <category android:name="android.intent.category.BROWSABLE"/> - <data android:scheme="file"/> - <data android:mimeType="*/*"/> - <data android:pathPattern=".*\\.xps"/> - <data android:host="*"/> - </intent-filter> - <intent-filter> - <action android:name="android.intent.action.VIEW"/> - <category android:name="android.intent.category.DEFAULT"/> - <category android:name="android.intent.category.BROWSABLE"/> - <data android:scheme="file"/> - <data android:mimeType="*/*"/> - <data android:pathPattern=".*\\.pdf"/> - <data android:host="*"/> - </intent-filter> - <intent-filter> - <action android:name="android.intent.action.VIEW"/> - <category android:name="android.intent.category.DEFAULT"/> - <category android:name="android.intent.category.BROWSABLE"/> - <data android:scheme="file"/> - <data android:mimeType="*/*"/> - <data android:pathPattern=".*\\.cbz"/> - <data android:host="*"/> - </intent-filter> - </activity> - <activity - android:name="OutlineActivity" - android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen" - android:label="@string/outline_title"> - </activity> - <activity - android:name="PrintDialogActivity" - android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen" - android:label="@string/print"> - </activity> - </application> + package="com.artifex.mupdfdemo" + android:versionCode="2" + android:versionName="@string/version" + android:installLocation="auto"> + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> + <uses-permission android:name="android.permission.INTERNET" /> + <supports-screens + android:smallScreens="true" + android:normalScreens="true" + android:largeScreens="true" + android:anyDensity="true" /> + <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="11"/> + <application + android:label="@string/app_name" + android:icon="@drawable/icon" + android:debuggable="true" + android:hardwareAccelerated="true"> + <activity + android:name="ChoosePDFActivity" + android:theme="@android:style/Theme.Light" + android:label="@string/app_name"> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER"/> + </intent-filter> + </activity> + <activity + android:name="MuPDFActivity" + android:theme="@style/AppBaseTheme" + android:label="@string/app_name"> + <intent-filter> + <action android:name="android.intent.action.VIEW"/> + <category android:name="android.intent.category.DEFAULT"/> + <data android:mimeType="application/vnd.ms-xpsdocument"/> + </intent-filter> + <intent-filter> + <action android:name="android.intent.action.VIEW"/> + <category android:name="android.intent.category.DEFAULT"/> + <data android:mimeType="application/pdf"/> + </intent-filter> + <intent-filter> + <action android:name="android.intent.action.VIEW"/> + <category android:name="android.intent.category.DEFAULT"/> + <data android:mimeType="application/x-cbz"/> + </intent-filter> + <intent-filter> + <action android:name="android.intent.action.VIEW"/> + <category android:name="android.intent.category.DEFAULT"/> + <category android:name="android.intent.category.BROWSABLE"/> + <data android:scheme="file"/> + <data android:mimeType="*/*"/> + <data android:pathPattern=".*\\.xps"/> + <data android:host="*"/> + </intent-filter> + <intent-filter> + <action android:name="android.intent.action.VIEW"/> + <category android:name="android.intent.category.DEFAULT"/> + <category android:name="android.intent.category.BROWSABLE"/> + <data android:scheme="file"/> + <data android:mimeType="*/*"/> + <data android:pathPattern=".*\\.pdf"/> + <data android:host="*"/> + </intent-filter> + <intent-filter> + <action android:name="android.intent.action.VIEW"/> + <category android:name="android.intent.category.DEFAULT"/> + <category android:name="android.intent.category.BROWSABLE"/> + <data android:scheme="file"/> + <data android:mimeType="*/*"/> + <data android:pathPattern=".*\\.cbz"/> + <data android:host="*"/> + </intent-filter> + </activity> + <activity + android:name="OutlineActivity" + android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen" + android:label="@string/outline_title"> + </activity> + <activity + android:name="PrintDialogActivity" + android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen" + android:label="@string/print"> + </activity> + </application> </manifest> diff --git a/android/ReadMe.txt b/android/ReadMe.txt index 5120fc6b..17e60e73 100644 --- a/android/ReadMe.txt +++ b/android/ReadMe.txt @@ -70,7 +70,7 @@ in the entries as follows: CPU/ABI: ARM (armeabi) (If this option exists) SD card: Size: 1024MiB Skin: Resolution: 480x756 (756 just fits my macbook screen, but 800 may - be 'more standard') + be 'more standard') Click 'Create AVD' (on old versions you may have to wait for a minute or so while it is prepared. Now you can exit the GUI. @@ -186,13 +186,13 @@ Forms support To build with PDF forms support, the only change is to the ndk-build stage. Run: - V8_BUILD=yes ndk-build + V8_BUILD=yes ndk-build The build will need v8 headers and libraries to be present in the thirdparty directory. The files assumed are: - thirdparty/v8-3.9/android/libv8_base.a - thirdparty/v8-3.9/android/libv8_snapshot.a - thirdparty/v8-3.9/include/v8.h - thirdparty/v8-3.9/include/v8stdint.h + thirdparty/v8-3.9/android/libv8_base.a + thirdparty/v8-3.9/android/libv8_snapshot.a + thirdparty/v8-3.9/include/v8.h + thirdparty/v8-3.9/include/v8stdint.h diff --git a/android/jni/mupdf.c b/android/jni/mupdf.c index 86e932cd..47196840 100644 --- a/android/jni/mupdf.c +++ b/android/jni/mupdf.c @@ -129,7 +129,7 @@ static void drop_changed_rects(fz_context *ctx, rect_node **nodePtr) static void drop_page_cache(globals *glo, page_cache *pc) { - fz_context *ctx = glo->ctx; + fz_context *ctx = glo->ctx; fz_document *doc = glo->doc; LOGI("Drop page %d", pc->number); @@ -261,9 +261,9 @@ JNIEXPORT jlong JNICALL JNI_FN(MuPDFCore_openFile)(JNIEnv * env, jobject thiz, jstring jfilename) { const char *filename; - globals *glo; + globals *glo; fz_context *ctx; - jclass clazz; + jclass clazz; #ifdef NDK_PROFILER monstartup("libmupdf.so"); @@ -332,10 +332,10 @@ JNI_FN(MuPDFCore_openFile)(JNIEnv * env, jobject thiz, jstring jfilename) static int bufferStreamRead(fz_stream *stream, unsigned char *buf, int len) { - globals *glo = (globals *)stream->state; - JNIEnv *env = glo->env; - jbyteArray array = (jbyteArray)(void *)((*env)->GetObjectField(env, glo->thiz, buffer_fid)); - int arrayLength = (*env)->GetArrayLength(env, array); + globals *glo = (globals *)stream->state; + JNIEnv *env = glo->env; + jbyteArray array = (jbyteArray)(void *)((*env)->GetObjectField(env, glo->thiz, buffer_fid)); + int arrayLength = (*env)->GetArrayLength(env, array); if (stream->pos > arrayLength) stream->pos = arrayLength; @@ -356,10 +356,10 @@ static void bufferStreamClose(fz_context *ctx, void *state) static void bufferStreamSeek(fz_stream *stream, int offset, int whence) { - globals *glo = (globals *)stream->state; - JNIEnv *env = glo->env; - jbyteArray array = (jbyteArray)(void *)((*env)->GetObjectField(env, glo->thiz, buffer_fid)); - int arrayLength = (*env)->GetArrayLength(env, array); + globals *glo = (globals *)stream->state; + JNIEnv *env = glo->env; + jbyteArray array = (jbyteArray)(void *)((*env)->GetObjectField(env, glo->thiz, buffer_fid)); + int arrayLength = (*env)->GetArrayLength(env, array); (*env)->DeleteLocalRef(env, array); @@ -382,9 +382,9 @@ static void bufferStreamSeek(fz_stream *stream, int offset, int whence) JNIEXPORT jlong JNICALL JNI_FN(MuPDFCore_openBuffer)(JNIEnv * env, jobject thiz) { - globals *glo; + globals *glo; fz_context *ctx; - jclass clazz; + jclass clazz; fz_stream *stream; #ifdef NDK_PROFILER @@ -1032,8 +1032,8 @@ JNIEXPORT jboolean JNICALL JNI_FN(MuPDFCore_authenticatePasswordInternal)(JNIEnv *env, jobject thiz, jstring password) { const char *pw; - int result; - globals *glo = get_globals(env, thiz); + int result; + globals *glo = get_globals(env, thiz); pw = (*env)->GetStringUTFChars(env, password, NULL); if (pw == NULL) @@ -1047,7 +1047,7 @@ JNI_FN(MuPDFCore_authenticatePasswordInternal)(JNIEnv *env, jobject thiz, jstrin JNIEXPORT jboolean JNICALL JNI_FN(MuPDFCore_hasOutlineInternal)(JNIEnv * env, jobject thiz) { - globals *glo = get_globals(env, thiz); + globals *glo = get_globals(env, thiz); fz_outline *outline = fz_load_outline(glo->doc); fz_free_outline(glo->ctx, outline); @@ -1057,14 +1057,14 @@ JNI_FN(MuPDFCore_hasOutlineInternal)(JNIEnv * env, jobject thiz) JNIEXPORT jobjectArray JNICALL JNI_FN(MuPDFCore_getOutlineInternal)(JNIEnv * env, jobject thiz) { - jclass olClass; - jmethodID ctor; - jobjectArray arr; - jobject ol; - fz_outline *outline; - int nItems; - globals *glo = get_globals(env, thiz); - jobjectArray ret; + jclass olClass; + jmethodID ctor; + jobjectArray arr; + jobject ol; + fz_outline *outline; + int nItems; + globals *glo = get_globals(env, thiz); + jobjectArray ret; olClass = (*env)->FindClass(env, PACKAGENAME "/OutlineItem"); if (olClass == NULL) return NULL; @@ -1090,24 +1090,24 @@ JNI_FN(MuPDFCore_getOutlineInternal)(JNIEnv * env, jobject thiz) JNIEXPORT jobjectArray JNICALL JNI_FN(MuPDFCore_searchPage)(JNIEnv * env, jobject thiz, jstring jtext) { - jclass rectClass; - jmethodID ctor; - jobjectArray arr; - jobject rect; + jclass rectClass; + jmethodID ctor; + jobjectArray arr; + jobject rect; fz_text_sheet *sheet = NULL; - fz_text_page *text = NULL; - fz_device *dev = NULL; - float zoom; - fz_matrix ctm; - int pos; - int len; - int i, n; - int hit_count = 0; - const char *str; - globals *glo = get_globals(env, thiz); - fz_context *ctx = glo->ctx; - fz_document *doc = glo->doc; - page_cache *pc = &glo->pages[glo->current]; + fz_text_page *text = NULL; + fz_device *dev = NULL; + float zoom; + fz_matrix ctm; + int pos; + int len; + int i, n; + int hit_count = 0; + const char *str; + globals *glo = get_globals(env, thiz); + fz_context *ctx = glo->ctx; + fz_document *doc = glo->doc; + page_cache *pc = &glo->pages[glo->current]; rectClass = (*env)->FindClass(env, "android/graphics/RectF"); if (rectClass == NULL) return NULL; @@ -1133,7 +1133,7 @@ JNI_FN(MuPDFCore_searchPage)(JNIEnv * env, jobject thiz, jstring jtext) fz_transform_rect(&mbrect, &ctm); sheet = fz_new_text_sheet(ctx); text = fz_new_text_page(ctx, &mbrect); - dev = fz_new_text_device(ctx, sheet, text); + dev = fz_new_text_device(ctx, sheet, text); fz_run_page(doc, pc->page, dev, &ctm, NULL); fz_free_device(dev); dev = NULL; @@ -1205,7 +1205,7 @@ JNI_FN(MuPDFCore_text)(JNIEnv * env, jobject thiz) jobjectArray barr = NULL; fz_text_sheet *sheet = NULL; fz_text_page *text = NULL; - fz_device *dev = NULL; + fz_device *dev = NULL; float zoom; fz_matrix ctm; globals *glo = get_globals(env, thiz); @@ -1239,7 +1239,7 @@ JNI_FN(MuPDFCore_text)(JNIEnv * env, jobject thiz) fz_transform_rect(&mbrect, &ctm); sheet = fz_new_text_sheet(ctx); text = fz_new_text_page(ctx, &mbrect); - dev = fz_new_text_device(ctx, sheet, text); + dev = fz_new_text_device(ctx, sheet, text); fz_run_page(doc, pc->page, dev, &ctm, NULL); fz_free_device(dev); dev = NULL; @@ -1324,7 +1324,7 @@ JNI_FN(MuPDFCore_textAsHtml)(JNIEnv * env, jobject thiz) { fz_text_sheet *sheet = NULL; fz_text_page *text = NULL; - fz_device *dev = NULL; + fz_device *dev = NULL; fz_matrix ctm; globals *glo = get_globals(env, thiz); fz_context *ctx = glo->ctx; @@ -1348,7 +1348,7 @@ JNI_FN(MuPDFCore_textAsHtml)(JNIEnv * env, jobject thiz) fz_transform_rect(&mbrect, &ctm); sheet = fz_new_text_sheet(ctx); text = fz_new_text_page(ctx, &mbrect); - dev = fz_new_text_device(ctx, sheet, text); + dev = fz_new_text_device(ctx, sheet, text); fz_run_page(doc, pc->page, dev, &ctm, NULL); fz_free_device(dev); dev = NULL; @@ -1611,13 +1611,13 @@ JNI_FN(MuPDFCore_deleteAnnotationInternal)(JNIEnv * env, jobject thiz, int annot fz_try(ctx) { - annot = fz_first_annot(glo->doc, pc->page); - for (i = 0; i < annot_index && annot; i++) - annot = fz_next_annot(glo->doc, annot); + annot = fz_first_annot(glo->doc, pc->page); + for (i = 0; i < annot_index && annot; i++) + annot = fz_next_annot(glo->doc, annot); - if (annot) + if (annot) { - fz_delete_annot(idoc, pc->page, annot); + fz_delete_annot(idoc, pc->page, annot); dump_annotation_display_lists(glo); } } @@ -1676,22 +1676,22 @@ JNI_FN(MuPDFCore_destroying)(JNIEnv * env, jobject thiz) JNIEXPORT jobjectArray JNICALL JNI_FN(MuPDFCore_getPageLinksInternal)(JNIEnv * env, jobject thiz, int pageNumber) { - jclass linkInfoClass; - jclass linkInfoInternalClass; - jclass linkInfoExternalClass; - jclass linkInfoRemoteClass; - jmethodID ctorInternal; - jmethodID ctorExternal; - jmethodID ctorRemote; + jclass linkInfoClass; + jclass linkInfoInternalClass; + jclass linkInfoExternalClass; + jclass linkInfoRemoteClass; + jmethodID ctorInternal; + jmethodID ctorExternal; + jmethodID ctorRemote; jobjectArray arr; - jobject linkInfo; - fz_matrix ctm; - float zoom; - fz_link *list; - fz_link *link; - int count; - page_cache *pc; - globals *glo = get_globals(env, thiz); + jobject linkInfo; + fz_matrix ctm; + float zoom; + fz_link *list; + fz_link *link; + int count; + page_cache *pc; + globals *glo = get_globals(env, thiz); linkInfoClass = (*env)->FindClass(env, PACKAGENAME "/LinkInfo"); if (linkInfoClass == NULL) return NULL; @@ -1791,17 +1791,17 @@ JNI_FN(MuPDFCore_getPageLinksInternal)(JNIEnv * env, jobject thiz, int pageNumbe JNIEXPORT jobjectArray JNICALL JNI_FN(MuPDFCore_getWidgetAreasInternal)(JNIEnv * env, jobject thiz, int pageNumber) { - jclass rectFClass; - jmethodID ctor; + jclass rectFClass; + jmethodID ctor; jobjectArray arr; - jobject rectF; + jobject rectF; fz_interactive *idoc; fz_widget *widget; - fz_matrix ctm; - float zoom; - int count; - page_cache *pc; - globals *glo = get_globals(env, thiz); + fz_matrix ctm; + float zoom; + int count; + page_cache *pc; + globals *glo = get_globals(env, thiz); rectFClass = (*env)->FindClass(env, "android/graphics/RectF"); if (rectFClass == NULL) return NULL; diff --git a/android/res/animator/info.xml b/android/res/animator/info.xml index cd7bff28..9085a9ee 100644 --- a/android/res/animator/info.xml +++ b/android/res/animator/info.xml @@ -1,20 +1,20 @@ <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" - android:ordering="sequentially" > + android:ordering="sequentially" > - <objectAnimator - android:propertyName="alpha" - android:valueFrom="0.0" - android:valueTo="1.0" - android:duration="200" /> + <objectAnimator + android:propertyName="alpha" + android:valueFrom="0.0" + android:valueTo="1.0" + android:duration="200" /> - <objectAnimator - android:propertyName="alpha" - android:valueTo="1.0" - android:duration="800" /> + <objectAnimator + android:propertyName="alpha" + android:valueTo="1.0" + android:duration="800" /> - <objectAnimator - android:propertyName="alpha" - android:valueTo="0.0" - android:duration="400" /> -</set>
\ No newline at end of file + <objectAnimator + android:propertyName="alpha" + android:valueTo="0.0" + android:duration="400" /> +</set> diff --git a/android/res/drawable/busy.xml b/android/res/drawable/busy.xml index 5ac0ce76..f7f42a44 100644 --- a/android/res/drawable/busy.xml +++ b/android/res/drawable/busy.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="rectangle"> - <corners android:radius="12dp" /> - <padding android:left="16dp" - android:right="16dp" - android:top="16dp" - android:bottom="16dp" /> - <solid android:color="@color/busy_indicator" /> + android:shape="rectangle"> + <corners android:radius="12dp" /> + <padding android:left="16dp" + android:right="16dp" + android:top="16dp" + android:bottom="16dp" /> + <solid android:color="@color/busy_indicator" /> </shape> diff --git a/android/res/drawable/button.xml b/android/res/drawable/button.xml index 3b87ccb6..0a9bcd51 100644 --- a/android/res/drawable/button.xml +++ b/android/res/drawable/button.xml @@ -1,23 +1,23 @@ <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_pressed="true"> - <shape> - <solid android:color="@color/button_pressed" /> - <padding android:left="8dp" android:top="8dp" android:right="8dp" android:bottom="8dp" /> - </shape> - </item> - <item android:state_focused="true"> - <shape> - <solid android:color="@color/button_normal" /> - <stroke android:width="4dp" android:color="@color/button_pressed" /> - <padding android:left="8dp" android:top="8dp" android:right="8dp" android:bottom="8dp" /> - </shape> - </item> - <item> - <shape> - <solid android:color="@color/button_normal" /> - <padding android:left="8dp" android:top="8dp" android:right="8dp" android:bottom="8dp" /> - </shape> - </item> + <item android:state_pressed="true"> + <shape> + <solid android:color="@color/button_pressed" /> + <padding android:left="8dp" android:top="8dp" android:right="8dp" android:bottom="8dp" /> + </shape> + </item> + <item android:state_focused="true"> + <shape> + <solid android:color="@color/button_normal" /> + <stroke android:width="4dp" android:color="@color/button_pressed" /> + <padding android:left="8dp" android:top="8dp" android:right="8dp" android:bottom="8dp" /> + </shape> + </item> + <item> + <shape> + <solid android:color="@color/button_normal" /> + <padding android:left="8dp" android:top="8dp" android:right="8dp" android:bottom="8dp" /> + </shape> + </item> </selector> diff --git a/android/res/drawable/page_num.xml b/android/res/drawable/page_num.xml index 533579e1..8d50df85 100644 --- a/android/res/drawable/page_num.xml +++ b/android/res/drawable/page_num.xml @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="utf-8"?> -<shape xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="rectangle"> - <padding android:left="8dp" - android:right="8dp" - android:top="1dp" - android:bottom="2dp" /> - <solid android:color="@color/page_indicator" /> +<shape xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + <padding android:left="8dp" + android:right="8dp" + android:top="1dp" + android:bottom="2dp" /> + <solid android:color="@color/page_indicator" /> </shape> diff --git a/android/res/drawable/search.xml b/android/res/drawable/search.xml index d689c465..4fc58830 100644 --- a/android/res/drawable/search.xml +++ b/android/res/drawable/search.xml @@ -1,37 +1,37 @@ <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_pressed="true"> - <shape android:shape="rectangle"> - <solid android:color="@color/text_pressed" /> - <stroke android:width="4dp" android:color="@color/text_border_pressed" /> - <padding - android:left="12dp" - android:right="12dp" - android:top="8dp" - android:bottom="8dp" /> - </shape> - </item> - <item android:state_focused="true"> - <shape> - <solid android:color="@color/text_normal" /> - <stroke android:width="4dp" android:color="@color/text_border_focused" /> - <padding - android:left="12dp" - android:right="12dp" - android:top="8dp" - android:bottom="8dp" /> - </shape> - </item> - <item> - <shape> - <solid android:color="@color/text_normal" /> - <stroke android:width="4dp" android:color="@color/text_border_normal" /> - <padding - android:left="12dp" - android:right="12dp" - android:top="8dp" - android:bottom="8dp" /> - </shape> - </item> + <item android:state_pressed="true"> + <shape android:shape="rectangle"> + <solid android:color="@color/text_pressed" /> + <stroke android:width="4dp" android:color="@color/text_border_pressed" /> + <padding + android:left="12dp" + android:right="12dp" + android:top="8dp" + android:bottom="8dp" /> + </shape> + </item> + <item android:state_focused="true"> + <shape> + <solid android:color="@color/text_normal" /> + <stroke android:width="4dp" android:color="@color/text_border_focused" /> + <padding + android:left="12dp" + android:right="12dp" + android:top="8dp" + android:bottom="8dp" /> + </shape> + </item> + <item> + <shape> + <solid android:color="@color/text_normal" /> + <stroke android:width="4dp" android:color="@color/text_border_normal" /> + <padding + android:left="12dp" + android:right="12dp" + android:top="8dp" + android:bottom="8dp" /> + </shape> + </item> </selector> diff --git a/android/res/drawable/seek_progress.xml b/android/res/drawable/seek_progress.xml index 2722ed07..328139c2 100644 --- a/android/res/drawable/seek_progress.xml +++ b/android/res/drawable/seek_progress.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="line" > - <stroke android:width="6dp" android:color="@color/seek_progress" /> + android:shape="line" > + <stroke android:width="6dp" android:color="@color/seek_progress" /> </shape> diff --git a/android/res/drawable/seek_thumb.xml b/android/res/drawable/seek_thumb.xml index 518aa588..e3a9bad4 100644 --- a/android/res/drawable/seek_thumb.xml +++ b/android/res/drawable/seek_thumb.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="oval" > - <size android:width="28dp" android:height="28dp" /> - <solid android:color="@color/seek_thumb" /> + android:shape="oval" > + <size android:width="28dp" android:height="28dp" /> + <solid android:color="@color/seek_thumb" /> </shape> diff --git a/android/res/drawable/tiled_background.xml b/android/res/drawable/tiled_background.xml index a8233975..60e08f3c 100644 --- a/android/res/drawable/tiled_background.xml +++ b/android/res/drawable/tiled_background.xml @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> <bitmap xmlns:android="http://schemas.android.com/apk/res/android" - android:src="@drawable/darkdenim3" - android:tileMode="repeat" /> + android:src="@drawable/darkdenim3" + android:tileMode="repeat" /> diff --git a/android/res/layout/buttons.xml b/android/res/layout/buttons.xml index 3659b3e9..5d082578 100644 --- a/android/res/layout/buttons.xml +++ b/android/res/layout/buttons.xml @@ -1,371 +1,371 @@ <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" > + android:layout_width="match_parent" + android:layout_height="match_parent" > - <ViewAnimator - android:id="@+id/switcher" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentTop="true" - android:layout_centerHorizontal="true" > + <ViewAnimator + android:id="@+id/switcher" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentTop="true" + android:layout_centerHorizontal="true" > - <RelativeLayout + <RelativeLayout android:id="@+id/topBar0Main" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:background="@color/toolbar" > - - <TextView - android:id="@+id/docNameText" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_toLeftOf="@+id/linkButton" - android:layout_alignParentLeft="true" - android:paddingLeft="16dp" - android:singleLine="true" - android:textColor="#FFFFFF" - android:textStyle="bold" - android:textAppearance="?android:attr/textAppearanceMedium" /> - - <ImageButton - android:id="@+id/linkButton" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_toLeftOf="@+id/reflowButton" - android:contentDescription="@string/toggle_links" - android:background="@drawable/button" - android:src="@drawable/ic_link" /> - - <ImageButton - android:id="@+id/reflowButton" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_toLeftOf="@+id/outlineButton" - android:contentDescription="@string/search_document" - android:background="@drawable/button" - android:src="@drawable/ic_reflow" /> - - <ImageButton - android:id="@+id/outlineButton" - 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_list" /> - - <ImageButton - android:id="@+id/searchButton" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_toLeftOf="@+id/moreButton" - android:contentDescription="@string/search_document" - android:background="@drawable/button" - android:src="@drawable/ic_magnifying_glass" /> - - <ImageButton - android:id="@+id/moreButton" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_alignParentRight="true" - android:contentDescription="@string/more" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/toolbar" > + + <TextView + android:id="@+id/docNameText" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_toLeftOf="@+id/linkButton" + android:layout_alignParentLeft="true" + android:paddingLeft="16dp" + android:singleLine="true" + android:textColor="#FFFFFF" + android:textStyle="bold" + android:textAppearance="?android:attr/textAppearanceMedium" /> + + <ImageButton + android:id="@+id/linkButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_toLeftOf="@+id/reflowButton" + android:contentDescription="@string/toggle_links" + android:background="@drawable/button" + android:src="@drawable/ic_link" /> + + <ImageButton + android:id="@+id/reflowButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_toLeftOf="@+id/outlineButton" + android:contentDescription="@string/search_document" + android:background="@drawable/button" + android:src="@drawable/ic_reflow" /> + + <ImageButton + android:id="@+id/outlineButton" + 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_list" /> + + <ImageButton + android:id="@+id/searchButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_toLeftOf="@+id/moreButton" + android:contentDescription="@string/search_document" + android:background="@drawable/button" + android:src="@drawable/ic_magnifying_glass" /> + + <ImageButton + android:id="@+id/moreButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_alignParentRight="true" + android:contentDescription="@string/more" android:background="@drawable/button" android:onClick="OnMoreButtonClick" - android:src="@drawable/ic_more" /> - - </RelativeLayout> - - <RelativeLayout - android:id="@+id/topBar1Search" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:background="@color/toolbar" > - - <ImageButton - android:id="@+id/cancelSearch" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_alignParentLeft="true" - android:contentDescription="@string/cancel" - android:background="@drawable/button" - android:onClick="OnCancelSearchButtonClick" - android:src="@drawable/ic_cancel" /> - - <EditText - android:id="@+id/searchText" - android:background="@drawable/search" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_toRightOf="@+id/cancelSearch" - android:layout_toLeftOf="@+id/searchBack" - android:inputType="text" - android:hint="@string/search" - android:singleLine="true" /> - - <ImageButton - android:id="@+id/searchBack" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_toLeftOf="@+id/searchForward" - android:contentDescription="@string/search_backwards" - android:background="@drawable/button" - android:src="@drawable/ic_arrow_left" /> - - <ImageButton - android:id="@+id/searchForward" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_alignParentRight="true" - android:contentDescription="@string/search_forwards" - android:background="@drawable/button" - android:src="@drawable/ic_arrow_right" /> - - </RelativeLayout> - - <RelativeLayout - android:id="@+id/topBar2Annot" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:background="@color/toolbar" > - - <ImageButton - android:id="@+id/cancelAnnotButton" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_alignParentLeft="true" - android:contentDescription="@string/cancel" - android:background="@drawable/button" - android:onClick="OnCancelAnnotButtonClick" - android:src="@drawable/ic_cancel" /> - - <ImageButton - android:id="@+id/highlightButton" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_toLeftOf="@+id/underlineButton" - android:contentDescription="@string/highlight" - android:background="@drawable/button" - android:onClick="OnHighlightButtonClick" - android:src="@drawable/ic_highlight" /> - - <ImageButton - android:id="@+id/underlineButton" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_toLeftOf="@+id/strikeOutButton" - android:contentDescription="@string/underline" - android:background="@drawable/button" - android:onClick="OnUnderlineButtonClick" - android:src="@drawable/ic_underline" /> - - <ImageButton - android:id="@+id/strikeOutButton" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_toLeftOf="@+id/inkButton" - android:contentDescription="@string/strike_out" - android:background="@drawable/button" - android:onClick="OnStrikeOutButtonClick" - android:src="@drawable/ic_strike" /> - - <ImageButton - android:id="@+id/inkButton" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_alignParentRight="true" - android:contentDescription="@string/ink" - android:background="@drawable/button" - android:onClick="OnInkButtonClick" - android:src="@drawable/ic_pen" /> - - </RelativeLayout> - - <RelativeLayout - android:id="@+id/topBar3Delete" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:background="@color/toolbar" > - - <ImageButton - android:id="@+id/cancelDeleteButton" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_alignParentLeft="true" - android:contentDescription="@string/cancel" - android:background="@drawable/button" - android:onClick="OnCancelDeleteButtonClick" - android:src="@drawable/ic_cancel" /> - - <ImageButton - android:id="@+id/deleteButton" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_alignParentRight="true" - android:contentDescription="@string/delete" - android:background="@drawable/button" - android:onClick="OnDeleteButtonClick" - android:src="@drawable/ic_trash" /> - - </RelativeLayout> - - <RelativeLayout - android:id="@+id/topBar4More" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:background="@color/toolbar" > - - <ImageButton - android:id="@+id/cancelMoreButton" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_alignParentLeft="true" - android:contentDescription="@string/cancel" - android:background="@drawable/button" - android:onClick="OnCancelMoreButtonClick" - android:src="@drawable/ic_cancel" /> - - <ImageButton - android:id="@+id/printButton" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_toLeftOf="@+id/copyTextButton" - android:contentDescription="@string/print" - android:background="@drawable/button" - android:onClick="OnPrintButtonClick" - android:src="@drawable/ic_print" /> - - <ImageButton - android:id="@+id/copyTextButton" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_toLeftOf="@+id/editAnnotButton" - android:layout_alignWithParentIfMissing="true" - android:contentDescription="@string/copy_text_to_the_clipboard" - android:background="@drawable/button" - android:onClick="OnCopyTextButtonClick" - android:src="@drawable/ic_clipboard" /> - - <ImageButton - android:id="@+id/editAnnotButton" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_alignParentRight="true" - android:contentDescription="@string/edit_annotations" - android:background="@drawable/button" - android:onClick="OnEditAnnotButtonClick" - android:src="@drawable/ic_annotation" /> - </RelativeLayout> - - <RelativeLayout - android:id="@+id/topBar5Accept" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:background="@color/toolbar" > - - <ImageButton - android:id="@+id/cancelAcceptButton" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_alignParentLeft="true" - android:contentDescription="@string/cancel" - android:background="@drawable/button" - android:onClick="OnCancelAcceptButtonClick" - android:src="@drawable/ic_cancel" /> - - <TextView - android:id="@+id/annotType" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_toRightOf="@+id/cancelAcceptButton" - android:layout_toLeftOf="@+id/acceptButton" - android:gravity="center" - android:singleLine="true" - android:textColor="#FFFFFF" - android:textStyle="bold" - android:textAppearance="?android:attr/textAppearanceMedium" /> - - <ImageButton - android:id="@+id/acceptButton" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_alignParentRight="true" - android:contentDescription="@string/accept" - android:background="@drawable/button" - android:onClick="OnAcceptButtonClick" - android:src="@drawable/ic_check" /> - </RelativeLayout> - </ViewAnimator> - - <RelativeLayout - android:id="@+id/lowerButtons" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_alignParentBottom="true" - android:layout_centerHorizontal="true" > - - <SeekBar - android:id="@+id/pageSlider" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_alignParentBottom="true" - android:layout_centerHorizontal="true" - android:layout_margin="0dp" - android:thumb="@drawable/seek_thumb" - android:progressDrawable="@drawable/seek_progress" - android:paddingLeft="16dp" - android:paddingRight="16dp" - android:paddingTop="12dp" - android:paddingBottom="8dp" - android:background="@color/toolbar" - /> - - <TextView - android:id="@+id/pageNumber" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_above="@+id/pageSlider" - android:layout_centerHorizontal="true" - android:layout_marginBottom="16dp" - android:background="@drawable/page_num" - android:textColor="#FFFFFF" - android:textAppearance="?android:attr/textAppearanceMedium" /> - - </RelativeLayout> - - <TextView - android:id="@+id/info" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_above="@+id/pageSlider" - android:layout_centerHorizontal="true" - android:layout_centerVertical="true" - android:background="@drawable/page_num" - android:textAppearance="?android:attr/textAppearanceMedium" - android:textColor="#FFFFFF" /> + android:src="@drawable/ic_more" /> + + </RelativeLayout> + + <RelativeLayout + android:id="@+id/topBar1Search" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/toolbar" > + + <ImageButton + android:id="@+id/cancelSearch" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_alignParentLeft="true" + android:contentDescription="@string/cancel" + android:background="@drawable/button" + android:onClick="OnCancelSearchButtonClick" + android:src="@drawable/ic_cancel" /> + + <EditText + android:id="@+id/searchText" + android:background="@drawable/search" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_toRightOf="@+id/cancelSearch" + android:layout_toLeftOf="@+id/searchBack" + android:inputType="text" + android:hint="@string/search" + android:singleLine="true" /> + + <ImageButton + android:id="@+id/searchBack" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_toLeftOf="@+id/searchForward" + android:contentDescription="@string/search_backwards" + android:background="@drawable/button" + android:src="@drawable/ic_arrow_left" /> + + <ImageButton + android:id="@+id/searchForward" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_alignParentRight="true" + android:contentDescription="@string/search_forwards" + android:background="@drawable/button" + android:src="@drawable/ic_arrow_right" /> + + </RelativeLayout> + + <RelativeLayout + android:id="@+id/topBar2Annot" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/toolbar" > + + <ImageButton + android:id="@+id/cancelAnnotButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_alignParentLeft="true" + android:contentDescription="@string/cancel" + android:background="@drawable/button" + android:onClick="OnCancelAnnotButtonClick" + android:src="@drawable/ic_cancel" /> + + <ImageButton + android:id="@+id/highlightButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_toLeftOf="@+id/underlineButton" + android:contentDescription="@string/highlight" + android:background="@drawable/button" + android:onClick="OnHighlightButtonClick" + android:src="@drawable/ic_highlight" /> + + <ImageButton + android:id="@+id/underlineButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_toLeftOf="@+id/strikeOutButton" + android:contentDescription="@string/underline" + android:background="@drawable/button" + android:onClick="OnUnderlineButtonClick" + android:src="@drawable/ic_underline" /> + + <ImageButton + android:id="@+id/strikeOutButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_toLeftOf="@+id/inkButton" + android:contentDescription="@string/strike_out" + android:background="@drawable/button" + android:onClick="OnStrikeOutButtonClick" + android:src="@drawable/ic_strike" /> + + <ImageButton + android:id="@+id/inkButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_alignParentRight="true" + android:contentDescription="@string/ink" + android:background="@drawable/button" + android:onClick="OnInkButtonClick" + android:src="@drawable/ic_pen" /> + + </RelativeLayout> + + <RelativeLayout + android:id="@+id/topBar3Delete" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/toolbar" > + + <ImageButton + android:id="@+id/cancelDeleteButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_alignParentLeft="true" + android:contentDescription="@string/cancel" + android:background="@drawable/button" + android:onClick="OnCancelDeleteButtonClick" + android:src="@drawable/ic_cancel" /> + + <ImageButton + android:id="@+id/deleteButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_alignParentRight="true" + android:contentDescription="@string/delete" + android:background="@drawable/button" + android:onClick="OnDeleteButtonClick" + android:src="@drawable/ic_trash" /> + + </RelativeLayout> + + <RelativeLayout + android:id="@+id/topBar4More" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/toolbar" > + + <ImageButton + android:id="@+id/cancelMoreButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_alignParentLeft="true" + android:contentDescription="@string/cancel" + android:background="@drawable/button" + android:onClick="OnCancelMoreButtonClick" + android:src="@drawable/ic_cancel" /> + + <ImageButton + android:id="@+id/printButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_toLeftOf="@+id/copyTextButton" + android:contentDescription="@string/print" + android:background="@drawable/button" + android:onClick="OnPrintButtonClick" + android:src="@drawable/ic_print" /> + + <ImageButton + android:id="@+id/copyTextButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_toLeftOf="@+id/editAnnotButton" + android:layout_alignWithParentIfMissing="true" + android:contentDescription="@string/copy_text_to_the_clipboard" + android:background="@drawable/button" + android:onClick="OnCopyTextButtonClick" + android:src="@drawable/ic_clipboard" /> + + <ImageButton + android:id="@+id/editAnnotButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_alignParentRight="true" + android:contentDescription="@string/edit_annotations" + android:background="@drawable/button" + android:onClick="OnEditAnnotButtonClick" + android:src="@drawable/ic_annotation" /> + </RelativeLayout> + + <RelativeLayout + android:id="@+id/topBar5Accept" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/toolbar" > + + <ImageButton + android:id="@+id/cancelAcceptButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_alignParentLeft="true" + android:contentDescription="@string/cancel" + android:background="@drawable/button" + android:onClick="OnCancelAcceptButtonClick" + android:src="@drawable/ic_cancel" /> + + <TextView + android:id="@+id/annotType" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_toRightOf="@+id/cancelAcceptButton" + android:layout_toLeftOf="@+id/acceptButton" + android:gravity="center" + android:singleLine="true" + android:textColor="#FFFFFF" + android:textStyle="bold" + android:textAppearance="?android:attr/textAppearanceMedium" /> + + <ImageButton + android:id="@+id/acceptButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_alignParentRight="true" + android:contentDescription="@string/accept" + android:background="@drawable/button" + android:onClick="OnAcceptButtonClick" + android:src="@drawable/ic_check" /> + </RelativeLayout> + </ViewAnimator> + + <RelativeLayout + android:id="@+id/lowerButtons" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignParentBottom="true" + android:layout_centerHorizontal="true" > + + <SeekBar + android:id="@+id/pageSlider" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignParentBottom="true" + android:layout_centerHorizontal="true" + android:layout_margin="0dp" + android:thumb="@drawable/seek_thumb" + android:progressDrawable="@drawable/seek_progress" + android:paddingLeft="16dp" + android:paddingRight="16dp" + android:paddingTop="12dp" + android:paddingBottom="8dp" + android:background="@color/toolbar" + /> + + <TextView + android:id="@+id/pageNumber" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_above="@+id/pageSlider" + android:layout_centerHorizontal="true" + android:layout_marginBottom="16dp" + android:background="@drawable/page_num" + android:textColor="#FFFFFF" + android:textAppearance="?android:attr/textAppearanceMedium" /> + + </RelativeLayout> + + <TextView + android:id="@+id/info" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_above="@+id/pageSlider" + android:layout_centerHorizontal="true" + android:layout_centerVertical="true" + android:background="@drawable/page_num" + android:textAppearance="?android:attr/textAppearanceMedium" + android:textColor="#FFFFFF" /> </RelativeLayout> diff --git a/android/res/layout/main.xml b/android/res/layout/main.xml index 6ae2638d..50b4746b 100644 --- a/android/res/layout/main.xml +++ b/android/res/layout/main.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="vertical" - android:layout_width="fill_parent" - android:layout_height="fill_parent" /> + android:orientation="vertical" + android:layout_width="fill_parent" + android:layout_height="fill_parent" /> diff --git a/android/res/layout/outline_entry.xml b/android/res/layout/outline_entry.xml index e0a23db5..ea7912e4 100644 --- a/android/res/layout/outline_entry.xml +++ b/android/res/layout/outline_entry.xml @@ -1,27 +1,27 @@ <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="wrap_content" > + android:layout_width="match_parent" + android:layout_height="wrap_content" > - <TextView - android:id="@+id/title" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentLeft="true" - android:layout_toLeftOf="@+id/page" - android:singleLine="true" - android:layout_centerVertical="true" - android:paddingLeft="8dp" - android:textAppearance="?android:attr/textAppearanceMedium" /> + <TextView + android:id="@+id/title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentLeft="true" + android:layout_toLeftOf="@+id/page" + android:singleLine="true" + android:layout_centerVertical="true" + android:paddingLeft="8dp" + android:textAppearance="?android:attr/textAppearanceMedium" /> - <TextView - android:id="@+id/page" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignBaseline="@+id/title" - android:layout_alignBottom="@+id/title" - android:layout_alignParentRight="true" - android:paddingRight="8dp" - android:textAppearance="?android:attr/textAppearanceMedium" /> + <TextView + android:id="@+id/page" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignBaseline="@+id/title" + android:layout_alignBottom="@+id/title" + android:layout_alignParentRight="true" + android:paddingRight="8dp" + android:textAppearance="?android:attr/textAppearanceMedium" /> </RelativeLayout> diff --git a/android/res/layout/picker_entry.xml b/android/res/layout/picker_entry.xml index fe4b580c..673a4724 100644 --- a/android/res/layout/picker_entry.xml +++ b/android/res/layout/picker_entry.xml @@ -1,25 +1,25 @@ <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:paddingLeft="8dp" > + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingLeft="8dp" > - <ImageView - android:id="@+id/icon" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_alignParentLeft="true" /> + <ImageView + android:id="@+id/icon" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_alignParentLeft="true" /> - <TextView - android:id="@+id/name" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_toRightOf="@+id/icon" - android:paddingBottom="8dp" - android:paddingLeft="12dp" - android:paddingRight="12dp" - android:paddingTop="8dp" - android:textAppearance="?android:attr/textAppearanceLarge" /> + <TextView + android:id="@+id/name" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_toRightOf="@+id/icon" + android:paddingBottom="8dp" + android:paddingLeft="12dp" + android:paddingRight="12dp" + android:paddingTop="8dp" + android:textAppearance="?android:attr/textAppearanceLarge" /> </RelativeLayout> diff --git a/android/res/layout/print_dialog.xml b/android/res/layout/print_dialog.xml index a95840f3..1d54d22f 100644 --- a/android/res/layout/print_dialog.xml +++ b/android/res/layout/print_dialog.xml @@ -1,9 +1,9 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="fill_parent" - android:layout_height="fill_parent"> - <WebView android:id="@+id/webview" - android:layout_width="fill_parent" - android:layout_height="fill_parent"/> + android:layout_width="fill_parent" + android:layout_height="fill_parent"> + <WebView android:id="@+id/webview" + android:layout_width="fill_parent" + android:layout_height="fill_parent"/> </RelativeLayout> diff --git a/android/res/layout/textentry.xml b/android/res/layout/textentry.xml index 0ac4b44d..08823df8 100644 --- a/android/res/layout/textentry.xml +++ b/android/res/layout/textentry.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <EditText xmlns:android="http://schemas.android.com/apk/res/android" - android:singleLine="false" - android:minLines="3" - android:inputType="textMultiLine" - android:layout_width="match_parent" - android:layout_height="wrap_content" > -</EditText>
\ No newline at end of file + android:singleLine="false" + android:minLines="3" + android:inputType="textMultiLine" + android:layout_width="match_parent" + android:layout_height="wrap_content" > +</EditText> diff --git a/android/res/values-da/strings.xml b/android/res/values-da/strings.xml index a70c05cc..b7de1fdc 100644 --- a/android/res/values-da/strings.xml +++ b/android/res/values-da/strings.xml @@ -26,7 +26,7 @@ <string name="leaving_reflow_mode">Forlader konverteringstilstand</string> <string name="more">Mere</string> <string name="no">Nej</string> - <string name="no_further_occurrences_found">Der blev ikke fundet flere tilfælde</string> + <string name="no_further_occurrences_found">Der blev ikke fundet flere tilfælde</string> <string name="no_media_hint">Deles lagermediet med en PC, kan det gøre det utilgængeligt</string> <string name="no_media_warning">Lagermedie ikke fundet</string> <string name="no_text_selected">Ingen tekst valgt</string> diff --git a/android/res/values/colors.xml b/android/res/values/colors.xml index 1a02ca21..ecd1519d 100644 --- a/android/res/values/colors.xml +++ b/android/res/values/colors.xml @@ -1,16 +1,16 @@ <?xml version="1.0" encoding="utf-8"?> <resources> - <color name="canvas">#404040</color> - <color name="toolbar">#C0000000</color> - <color name="page_indicator">#C0202020</color> - <color name="busy_indicator">#C0202020</color> - <color name="button_normal">#00000000</color> - <color name="button_pressed">#FF2572AC</color> - <color name="text_normal">#FFFFFF</color> - <color name="text_pressed">#FFFFFF</color> - <color name="text_border_normal">#000000</color> - <color name="text_border_pressed">#2572AC</color> - <color name="text_border_focused">#000000</color> - <color name="seek_thumb">#2572AC</color> - <color name="seek_progress">#FFFFFF</color> + <color name="canvas">#404040</color> + <color name="toolbar">#C0000000</color> + <color name="page_indicator">#C0202020</color> + <color name="busy_indicator">#C0202020</color> + <color name="button_normal">#00000000</color> + <color name="button_pressed">#FF2572AC</color> + <color name="text_normal">#FFFFFF</color> + <color name="text_pressed">#FFFFFF</color> + <color name="text_border_normal">#000000</color> + <color name="text_border_pressed">#2572AC</color> + <color name="text_border_focused">#000000</color> + <color name="seek_thumb">#2572AC</color> + <color name="seek_progress">#FFFFFF</color> </resources> diff --git a/android/res/values/strings.xml b/android/res/values/strings.xml index 2fb655ab..a3f353d7 100644 --- a/android/res/values/strings.xml +++ b/android/res/values/strings.xml @@ -1,55 +1,55 @@ <?xml version="1.0" encoding="utf-8"?> <resources> - <string name="app_name">MuPDF</string> - <string name="version">1.2</string> - <string name="no_media_warning">Storage media not present</string> - <string name="no_media_hint">Sharing the storage media with a PC can make it inaccessible</string> - <string name="cancel">Cancel</string> - <string name="search_backwards">Search backwards</string> - <string name="search_forwards">Search forwards</string> - <string name="search_document">Search document</string> - <string name="picker_title_App_Ver_Dir">%1$s %2$s: %3$s</string> - <string name="outline_title">Table of Contents</string> - <string name="enter_password">Enter password</string> - <string name="text_not_found">Text not found</string> - <string name="searching_">Searching…</string> - <string name="toggle_links">Highlight and enable links</string> - <string name="no_further_occurrences_found">No further occurrences found</string> - <string name="select">Select</string> - <string name="search">Search</string> - <string name="copy">Copy</string> - <string name="strike_out">Strike-out</string> - <string name="delete">Delete</string> - <string name="highlight">Highlight</string> - <string name="underline">Underline</string> - <string name="edit_annotations">Edit annotations</string> - <string name="ink">Ink</string> - <string name="save">Save</string> - <string name="print">Print</string> - <string name="dismiss">Dismiss</string> - <string name="parent_directory">[Up one level]</string> - <string name="yes">Yes</string> - <string name="no">No</string> - <string name="entering_reflow_mode">Entering reflow mode</string> - <string name="leaving_reflow_mode">Leaving reflow mode</string> - <string name="print_failed">Print failed</string> - <string name="select_text">Select text</string> - <string name="copied_to_clipboard">Copied to clipboard</string> - <string name="no_text_selected">No text selected</string> - <string name="draw_annotation">Draw annotation</string> - <string name="nothing_to_save">Nothing to save</string> - <string name="document_has_changes_save_them_">Document has changes. Save them?</string> - <string name="cannot_open_document">Cannot open document</string> - <string name="cannot_open_document_Reason">Cannot open document: %1$s</string> - <string name="cannot_open_file_Path">Cannot open file: %1$s</string> - <string name="cannot_open_buffer">Cannot open buffer</string> - <string name="fill_out_text_field">Fill out text field</string> - <string name="okay">Okay</string> - <string name="choose_value">Choose value</string> - <string name="not_supported">Not supported</string> - <string name="copy_text_to_the_clipboard">Copy text to the clipboard</string> - <string name="more">More</string> - <string name="accept">Accept</string> - <string name="copy_text">copy text</string> - <string name="format_currently_not_supported">Format currently not supported</string> + <string name="app_name">MuPDF</string> + <string name="version">1.2</string> + <string name="no_media_warning">Storage media not present</string> + <string name="no_media_hint">Sharing the storage media with a PC can make it inaccessible</string> + <string name="cancel">Cancel</string> + <string name="search_backwards">Search backwards</string> + <string name="search_forwards">Search forwards</string> + <string name="search_document">Search document</string> + <string name="picker_title_App_Ver_Dir">%1$s %2$s: %3$s</string> + <string name="outline_title">Table of Contents</string> + <string name="enter_password">Enter password</string> + <string name="text_not_found">Text not found</string> + <string name="searching_">Searching…</string> + <string name="toggle_links">Highlight and enable links</string> + <string name="no_further_occurrences_found">No further occurrences found</string> + <string name="select">Select</string> + <string name="search">Search</string> + <string name="copy">Copy</string> + <string name="strike_out">Strike-out</string> + <string name="delete">Delete</string> + <string name="highlight">Highlight</string> + <string name="underline">Underline</string> + <string name="edit_annotations">Edit annotations</string> + <string name="ink">Ink</string> + <string name="save">Save</string> + <string name="print">Print</string> + <string name="dismiss">Dismiss</string> + <string name="parent_directory">[Up one level]</string> + <string name="yes">Yes</string> + <string name="no">No</string> + <string name="entering_reflow_mode">Entering reflow mode</string> + <string name="leaving_reflow_mode">Leaving reflow mode</string> + <string name="print_failed">Print failed</string> + <string name="select_text">Select text</string> + <string name="copied_to_clipboard">Copied to clipboard</string> + <string name="no_text_selected">No text selected</string> + <string name="draw_annotation">Draw annotation</string> + <string name="nothing_to_save">Nothing to save</string> + <string name="document_has_changes_save_them_">Document has changes. Save them?</string> + <string name="cannot_open_document">Cannot open document</string> + <string name="cannot_open_document_Reason">Cannot open document: %1$s</string> + <string name="cannot_open_file_Path">Cannot open file: %1$s</string> + <string name="cannot_open_buffer">Cannot open buffer</string> + <string name="fill_out_text_field">Fill out text field</string> + <string name="okay">Okay</string> + <string name="choose_value">Choose value</string> + <string name="not_supported">Not supported</string> + <string name="copy_text_to_the_clipboard">Copy text to the clipboard</string> + <string name="more">More</string> + <string name="accept">Accept</string> + <string name="copy_text">copy text</string> + <string name="format_currently_not_supported">Format currently not supported</string> </resources> diff --git a/android/src/com/artifex/mupdfdemo/MuPDFActivity.java b/android/src/com/artifex/mupdfdemo/MuPDFActivity.java index 3133fc17..31ccc916 100644 --- a/android/src/com/artifex/mupdfdemo/MuPDFActivity.java +++ b/android/src/com/artifex/mupdfdemo/MuPDFActivity.java @@ -241,7 +241,6 @@ public class MuPDFActivity extends Activity { super.onCreate(savedInstanceState); - mAlertBuilder = new AlertDialog.Builder(this); if (core == null) { @@ -359,7 +358,6 @@ public class MuPDFActivity extends Activity alert.show(); } - public void createUI(Bundle savedInstanceState) { if (core == null) return; diff --git a/android/src/com/artifex/mupdfdemo/OutlineActivity.java b/android/src/com/artifex/mupdfdemo/OutlineActivity.java index bd1b19ba..52b0d410 100644 --- a/android/src/com/artifex/mupdfdemo/OutlineActivity.java +++ b/android/src/com/artifex/mupdfdemo/OutlineActivity.java @@ -7,17 +7,18 @@ import android.widget.ListView; public class OutlineActivity extends ListActivity { OutlineItem mItems[]; + /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); + super.onCreate(savedInstanceState); - mItems = OutlineActivityData.get().items; - setListAdapter(new OutlineAdapter(getLayoutInflater(),mItems)); - // Restore the position within the list from last viewing - getListView().setSelection(OutlineActivityData.get().position); - getListView().setDividerHeight(0); - setResult(-1); + mItems = OutlineActivityData.get().items; + setListAdapter(new OutlineAdapter(getLayoutInflater(),mItems)); + // Restore the position within the list from last viewing + getListView().setSelection(OutlineActivityData.get().position); + getListView().setDividerHeight(0); + setResult(-1); } @Override diff --git a/android/src/com/artifex/mupdfdemo/PrintDialogActivity.java b/android/src/com/artifex/mupdfdemo/PrintDialogActivity.java index bcef1cbd..d96322d5 100644 --- a/android/src/com/artifex/mupdfdemo/PrintDialogActivity.java +++ b/android/src/com/artifex/mupdfdemo/PrintDialogActivity.java @@ -14,132 +14,132 @@ import android.webkit.WebView; import android.webkit.WebViewClient; public class PrintDialogActivity extends Activity { - private static final String PRINT_DIALOG_URL = "https://www.google.com/cloudprint/dialog.html"; - private static final String JS_INTERFACE = "AndroidPrintDialog"; - private static final String CONTENT_TRANSFER_ENCODING = "base64"; - - private static final String ZXING_URL = "http://zxing.appspot.com"; - private static final int ZXING_SCAN_REQUEST = 65743; - - /** - * Post message that is sent by Print Dialog web page when the printing dialog - * needs to be closed. - */ - private static final String CLOSE_POST_MESSAGE_NAME = "cp-dialog-on-close"; - - /** - * Web view element to show the printing dialog in. - */ - private WebView dialogWebView; - - /** - * Intent that started the action. - */ - Intent cloudPrintIntent; - - private int resultCode; - - @Override - public void onCreate(Bundle icicle) { - super.onCreate(icicle); - - resultCode = RESULT_OK; - setContentView(R.layout.print_dialog); - dialogWebView = (WebView) findViewById(R.id.webview); - cloudPrintIntent = this.getIntent(); - - WebSettings settings = dialogWebView.getSettings(); - settings.setJavaScriptEnabled(true); - - dialogWebView.setWebViewClient(new PrintDialogWebClient()); - dialogWebView.addJavascriptInterface( - new PrintDialogJavaScriptInterface(), JS_INTERFACE); - - dialogWebView.loadUrl(PRINT_DIALOG_URL); - } - - @Override - public void onActivityResult(int requestCode, int resultCode, Intent intent) { - if (requestCode == ZXING_SCAN_REQUEST && resultCode == RESULT_OK) { - dialogWebView.loadUrl(intent.getStringExtra("SCAN_RESULT")); - } - } - - final class PrintDialogJavaScriptInterface { - public String getType() { - return cloudPrintIntent.getType(); - } - - public String getTitle() { - return cloudPrintIntent.getExtras().getString("title"); - } - - public String getContent() { - try { - ContentResolver contentResolver = getContentResolver(); - InputStream is = contentResolver.openInputStream(cloudPrintIntent.getData()); - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - - byte[] buffer = new byte[4096]; - int n = is.read(buffer); - while (n >= 0) { - baos.write(buffer, 0, n); - n = is.read(buffer); - } - is.close(); - baos.flush(); - - return Base64.encodeToString(baos.toByteArray(), Base64.DEFAULT); - } catch (Throwable e) { - resultCode = RESULT_CANCELED; - setResult(resultCode); - finish(); - e.printStackTrace(); - } - return ""; - } - - public String getEncoding() { - return CONTENT_TRANSFER_ENCODING; - } - - public void onPostMessage(String message) { - if (message.startsWith(CLOSE_POST_MESSAGE_NAME)) { - setResult(resultCode); - finish(); - } - } - } - - private final class PrintDialogWebClient extends WebViewClient { - @Override - public boolean shouldOverrideUrlLoading(WebView view, String url) { - if (url.startsWith(ZXING_URL)) { - Intent intentScan = new Intent("com.google.zxing.client.android.SCAN"); - intentScan.putExtra("SCAN_MODE", "QR_CODE_MODE"); - try { - startActivityForResult(intentScan, ZXING_SCAN_REQUEST); - } catch (ActivityNotFoundException error) { - view.loadUrl(url); - } - } else { - view.loadUrl(url); - } - return false; - } - - @Override - public void onPageFinished(WebView view, String url) { - if (PRINT_DIALOG_URL.equals(url)) { - // Submit print document. - view.loadUrl("javascript:printDialog.setPrintDocument(printDialog.createPrintDocument(" - + "window." + JS_INTERFACE + ".getType(),window." + JS_INTERFACE + ".getTitle()," - + "window." + JS_INTERFACE + ".getContent(),window." + JS_INTERFACE + ".getEncoding()))"); - - // Add post messages listener. - view.loadUrl("javascript:window.addEventListener('message'," - + "function(evt){window." + JS_INTERFACE + ".onPostMessage(evt.data)}, false)"); - } - } - } + private static final String PRINT_DIALOG_URL = "https://www.google.com/cloudprint/dialog.html"; + private static final String JS_INTERFACE = "AndroidPrintDialog"; + private static final String CONTENT_TRANSFER_ENCODING = "base64"; + + private static final String ZXING_URL = "http://zxing.appspot.com"; + private static final int ZXING_SCAN_REQUEST = 65743; + + /** + * Post message that is sent by Print Dialog web page when the printing dialog + * needs to be closed. + */ + private static final String CLOSE_POST_MESSAGE_NAME = "cp-dialog-on-close"; + + /** + * Web view element to show the printing dialog in. + */ + private WebView dialogWebView; + + /** + * Intent that started the action. + */ + Intent cloudPrintIntent; + + private int resultCode; + + @Override + public void onCreate(Bundle icicle) { + super.onCreate(icicle); + + resultCode = RESULT_OK; + setContentView(R.layout.print_dialog); + dialogWebView = (WebView) findViewById(R.id.webview); + cloudPrintIntent = this.getIntent(); + + WebSettings settings = dialogWebView.getSettings(); + settings.setJavaScriptEnabled(true); + + dialogWebView.setWebViewClient(new PrintDialogWebClient()); + dialogWebView.addJavascriptInterface( + new PrintDialogJavaScriptInterface(), JS_INTERFACE); + + dialogWebView.loadUrl(PRINT_DIALOG_URL); + } + + @Override + public void onActivityResult(int requestCode, int resultCode, Intent intent) { + if (requestCode == ZXING_SCAN_REQUEST && resultCode == RESULT_OK) { + dialogWebView.loadUrl(intent.getStringExtra("SCAN_RESULT")); + } + } + + final class PrintDialogJavaScriptInterface { + public String getType() { + return cloudPrintIntent.getType(); + } + + public String getTitle() { + return cloudPrintIntent.getExtras().getString("title"); + } + + public String getContent() { + try { + ContentResolver contentResolver = getContentResolver(); + InputStream is = contentResolver.openInputStream(cloudPrintIntent.getData()); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + byte[] buffer = new byte[4096]; + int n = is.read(buffer); + while (n >= 0) { + baos.write(buffer, 0, n); + n = is.read(buffer); + } + is.close(); + baos.flush(); + + return Base64.encodeToString(baos.toByteArray(), Base64.DEFAULT); + } catch (Throwable e) { + resultCode = RESULT_CANCELED; + setResult(resultCode); + finish(); + e.printStackTrace(); + } + return ""; + } + + public String getEncoding() { + return CONTENT_TRANSFER_ENCODING; + } + + public void onPostMessage(String message) { + if (message.startsWith(CLOSE_POST_MESSAGE_NAME)) { + setResult(resultCode); + finish(); + } + } + } + + private final class PrintDialogWebClient extends WebViewClient { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + if (url.startsWith(ZXING_URL)) { + Intent intentScan = new Intent("com.google.zxing.client.android.SCAN"); + intentScan.putExtra("SCAN_MODE", "QR_CODE_MODE"); + try { + startActivityForResult(intentScan, ZXING_SCAN_REQUEST); + } catch (ActivityNotFoundException error) { + view.loadUrl(url); + } + } else { + view.loadUrl(url); + } + return false; + } + + @Override + public void onPageFinished(WebView view, String url) { + if (PRINT_DIALOG_URL.equals(url)) { + // Submit print document. + view.loadUrl("javascript:printDialog.setPrintDocument(printDialog.createPrintDocument(" + + "window." + JS_INTERFACE + ".getType(),window." + JS_INTERFACE + ".getTitle()," + + "window." + JS_INTERFACE + ".getContent(),window." + JS_INTERFACE + ".getEncoding()))"); + + // Add post messages listener. + view.loadUrl("javascript:window.addEventListener('message'," + + "function(evt){window." + JS_INTERFACE + ".onPostMessage(evt.data)}, false)"); + } + } + } } diff --git a/android/src/com/artifex/mupdfdemo/ReaderView.java b/android/src/com/artifex/mupdfdemo/ReaderView.java index 2c7287f4..87f250ba 100644 --- a/android/src/com/artifex/mupdfdemo/ReaderView.java +++ b/android/src/com/artifex/mupdfdemo/ReaderView.java @@ -16,10 +16,9 @@ import android.widget.Adapter; import android.widget.AdapterView; import android.widget.Scroller; -public class ReaderView extends AdapterView<Adapter> - implements GestureDetector.OnGestureListener, - ScaleGestureDetector.OnScaleGestureListener, - Runnable { +public class ReaderView + extends AdapterView<Adapter> + implements GestureDetector.OnGestureListener, ScaleGestureDetector.OnScaleGestureListener, Runnable { private static final int MOVING_DIAGONALLY = 0; private static final int MOVING_LEFT = 1; private static final int MOVING_RIGHT = 2; diff --git a/android/src/com/artifex/mupdfdemo/SearchTaskResult.java b/android/src/com/artifex/mupdfdemo/SearchTaskResult.java index b2d361c1..8fa3c3a2 100644 --- a/android/src/com/artifex/mupdfdemo/SearchTaskResult.java +++ b/android/src/com/artifex/mupdfdemo/SearchTaskResult.java @@ -22,4 +22,3 @@ public class SearchTaskResult { singleton = r; } } - diff --git a/apps/win_res.rc b/apps/win_res.rc index 499aff02..fbf6915c 100644 --- a/apps/win_res.rc +++ b/apps/win_res.rc @@ -9,7 +9,7 @@ BEGIN EDITTEXT 3, 57, 20, 140, 12, 32 DEFPUSHBUTTON "Okay", 1, 90, 40, 50, 14, 0x50010001 PUSHBUTTON "Cancel", 2, 147, 40, 50, 14, 0x50010000 - LTEXT "The file is encrypted.", 4, 10, 7, 180, 10, 0x00000 + LTEXT "The file is encrypted.", 4, 10, 7, 180, 10, 0x00000 LTEXT "Password:", 5, 17, 22, 40, 10, 0x00000 END @@ -54,10 +54,10 @@ STYLE 128 | 0x80000000 CAPTION " MuPDF: fill out form" FONT 8, "MS Shell Dlg" BEGIN - EDITTEXT 3,8,7,183,50,0x1004 - DEFPUSHBUTTON "Okay",1,89,64,50,14 - PUSHBUTTON "Cancel",2,147,64,50,14 - LTEXT "** Invalid value **",4,11,65,62,8 + EDITTEXT 3,8,7,183,50,0x1004 + DEFPUSHBUTTON "Okay",1,89,64,50,14 + PUSHBUTTON "Cancel",2,147,64,50,14 + LTEXT "** Invalid value **",4,11,65,62,8 END IDD_DLOGLIST DIALOG 50, 50, 204, 85 @@ -65,9 +65,9 @@ STYLE 128 | 0x80000000 CAPTION " MuPDF: select an item" FONT 8, "MS Shell Dlg" BEGIN - LISTBOX 3,8,7,183,50,0x210102 - DEFPUSHBUTTON "Okay",1,89,64,50,14 - PUSHBUTTON "Cancel",2,147,64,50,14 + LISTBOX 3,8,7,183,50,0x210102 + DEFPUSHBUTTON "Okay",1,89,64,50,14 + PUSHBUTTON "Cancel",2,147,64,50,14 END IDD_DLOGABOUT DIALOG 50, 50, 200, 300 diff --git a/ucdn/README b/ucdn/README index fcb97b9a..aa3e2b91 100644 --- a/ucdn/README +++ b/ucdn/README @@ -1,6 +1,6 @@ Contents of this directory are derived from UCDN: - https://github.com/grigorig/ucdn + https://github.com/grigorig/ucdn The original README follows: diff --git a/ucdn/unicodedata_db.h b/ucdn/unicodedata_db.h index 7f9f18d1..a0a4347a 100644 --- a/ucdn/unicodedata_db.h +++ b/ucdn/unicodedata_db.h @@ -1075,251 +1075,251 @@ static const MirrorPair mirror_pairs[] = { #define TOTAL_FIRST 372 #define TOTAL_LAST 56 static const Reindex nfc_first[] = { - { 60, 2, 0}, - { 65, 15, 3}, - { 82, 8, 19}, - { 97, 15, 28}, - { 114, 8, 44}, - { 168, 0, 53}, - { 194, 0, 54}, - { 196, 3, 55}, - { 202, 0, 59}, - { 207, 0, 60}, - { 212, 2, 61}, - { 216, 0, 64}, - { 220, 0, 65}, - { 226, 0, 66}, - { 228, 3, 67}, - { 234, 0, 71}, - { 239, 0, 72}, - { 244, 2, 73}, - { 248, 0, 76}, - { 252, 0, 77}, - { 258, 1, 78}, - { 274, 1, 80}, - { 332, 1, 82}, - { 346, 1, 84}, - { 352, 1, 86}, - { 360, 3, 88}, - { 383, 0, 92}, - { 416, 1, 93}, - { 431, 1, 95}, - { 439, 0, 97}, - { 490, 1, 98}, - { 550, 3, 100}, - { 558, 1, 104}, - { 658, 0, 106}, - { 913, 0, 107}, - { 917, 0, 108}, - { 919, 0, 109}, - { 921, 0, 110}, - { 927, 0, 111}, - { 929, 0, 112}, - { 933, 0, 113}, - { 937, 0, 114}, - { 940, 0, 115}, - { 942, 0, 116}, - { 945, 0, 117}, - { 949, 0, 118}, - { 951, 0, 119}, - { 953, 0, 120}, - { 959, 0, 121}, - { 961, 0, 122}, - { 965, 0, 123}, - { 969, 2, 124}, - { 974, 0, 127}, - { 978, 0, 128}, - { 1030, 0, 129}, - { 1040, 0, 130}, - { 1043, 0, 131}, - { 1045, 3, 132}, - { 1050, 0, 136}, - { 1054, 0, 137}, - { 1059, 0, 138}, - { 1063, 0, 139}, - { 1067, 0, 140}, - { 1069, 0, 141}, - { 1072, 0, 142}, - { 1075, 0, 143}, - { 1077, 3, 144}, - { 1082, 0, 148}, - { 1086, 0, 149}, - { 1091, 0, 150}, - { 1095, 0, 151}, - { 1099, 0, 152}, - { 1101, 0, 153}, - { 1110, 0, 154}, - { 1140, 1, 155}, - { 1240, 1, 157}, - { 1256, 1, 159}, - { 1575, 0, 161}, - { 1608, 0, 162}, - { 1610, 0, 163}, - { 1729, 0, 164}, - { 1746, 0, 165}, - { 1749, 0, 166}, - { 2344, 0, 167}, - { 2352, 0, 168}, - { 2355, 0, 169}, - { 2503, 0, 170}, - { 2887, 0, 171}, - { 2962, 0, 172}, - { 3014, 1, 173}, - { 3142, 0, 175}, - { 3263, 0, 176}, - { 3270, 0, 177}, - { 3274, 0, 178}, - { 3398, 1, 179}, - { 3545, 0, 181}, - { 3548, 0, 182}, - { 4133, 0, 183}, - { 6917, 0, 184}, - { 6919, 0, 185}, - { 6921, 0, 186}, - { 6923, 0, 187}, - { 6925, 0, 188}, - { 6929, 0, 189}, - { 6970, 0, 190}, - { 6972, 0, 191}, - { 6974, 1, 192}, - { 6978, 0, 194}, - { 7734, 1, 195}, - { 7770, 1, 197}, - { 7778, 1, 199}, - { 7840, 1, 201}, - { 7864, 1, 203}, - { 7884, 1, 205}, - { 7936, 17, 207}, - { 7960, 1, 225}, - { 7968, 17, 227}, - { 7992, 1, 245}, - { 8000, 1, 247}, - { 8008, 1, 249}, - { 8016, 1, 251}, - { 8025, 0, 253}, - { 8032, 16, 254}, - { 8052, 0, 271}, - { 8060, 0, 272}, - { 8118, 0, 273}, - { 8127, 0, 274}, - { 8134, 0, 275}, - { 8182, 0, 276}, - { 8190, 0, 277}, - { 8592, 0, 278}, - { 8594, 0, 279}, - { 8596, 0, 280}, - { 8656, 0, 281}, - { 8658, 0, 282}, - { 8660, 0, 283}, - { 8707, 0, 284}, - { 8712, 0, 285}, - { 8715, 0, 286}, - { 8739, 0, 287}, - { 8741, 0, 288}, - { 8764, 0, 289}, - { 8771, 0, 290}, - { 8773, 0, 291}, - { 8776, 0, 292}, - { 8781, 0, 293}, - { 8801, 0, 294}, - { 8804, 1, 295}, - { 8818, 1, 297}, - { 8822, 1, 299}, - { 8826, 3, 301}, - { 8834, 1, 305}, - { 8838, 1, 307}, - { 8849, 1, 309}, - { 8866, 0, 311}, - { 8872, 1, 312}, - { 8875, 0, 314}, - { 8882, 3, 315}, - { 12358, 0, 319}, - { 12363, 0, 320}, - { 12365, 0, 321}, - { 12367, 0, 322}, - { 12369, 0, 323}, - { 12371, 0, 324}, - { 12373, 0, 325}, - { 12375, 0, 326}, - { 12377, 0, 327}, - { 12379, 0, 328}, - { 12381, 0, 329}, - { 12383, 0, 330}, - { 12385, 0, 331}, - { 12388, 0, 332}, - { 12390, 0, 333}, - { 12392, 0, 334}, - { 12399, 0, 335}, - { 12402, 0, 336}, - { 12405, 0, 337}, - { 12408, 0, 338}, - { 12411, 0, 339}, - { 12445, 0, 340}, - { 12454, 0, 341}, - { 12459, 0, 342}, - { 12461, 0, 343}, - { 12463, 0, 344}, - { 12465, 0, 345}, - { 12467, 0, 346}, - { 12469, 0, 347}, - { 12471, 0, 348}, - { 12473, 0, 349}, - { 12475, 0, 350}, - { 12477, 0, 351}, - { 12479, 0, 352}, - { 12481, 0, 353}, - { 12484, 0, 354}, - { 12486, 0, 355}, - { 12488, 0, 356}, - { 12495, 0, 357}, - { 12498, 0, 358}, - { 12501, 0, 359}, - { 12504, 0, 360}, - { 12507, 0, 361}, - { 12527, 3, 362}, - { 12541, 0, 366}, - { 69785, 0, 367}, - { 69787, 0, 368}, - { 69797, 0, 369}, - { 69937, 1, 370}, - {0,0,0} + { 60, 2, 0}, + { 65, 15, 3}, + { 82, 8, 19}, + { 97, 15, 28}, + { 114, 8, 44}, + { 168, 0, 53}, + { 194, 0, 54}, + { 196, 3, 55}, + { 202, 0, 59}, + { 207, 0, 60}, + { 212, 2, 61}, + { 216, 0, 64}, + { 220, 0, 65}, + { 226, 0, 66}, + { 228, 3, 67}, + { 234, 0, 71}, + { 239, 0, 72}, + { 244, 2, 73}, + { 248, 0, 76}, + { 252, 0, 77}, + { 258, 1, 78}, + { 274, 1, 80}, + { 332, 1, 82}, + { 346, 1, 84}, + { 352, 1, 86}, + { 360, 3, 88}, + { 383, 0, 92}, + { 416, 1, 93}, + { 431, 1, 95}, + { 439, 0, 97}, + { 490, 1, 98}, + { 550, 3, 100}, + { 558, 1, 104}, + { 658, 0, 106}, + { 913, 0, 107}, + { 917, 0, 108}, + { 919, 0, 109}, + { 921, 0, 110}, + { 927, 0, 111}, + { 929, 0, 112}, + { 933, 0, 113}, + { 937, 0, 114}, + { 940, 0, 115}, + { 942, 0, 116}, + { 945, 0, 117}, + { 949, 0, 118}, + { 951, 0, 119}, + { 953, 0, 120}, + { 959, 0, 121}, + { 961, 0, 122}, + { 965, 0, 123}, + { 969, 2, 124}, + { 974, 0, 127}, + { 978, 0, 128}, + { 1030, 0, 129}, + { 1040, 0, 130}, + { 1043, 0, 131}, + { 1045, 3, 132}, + { 1050, 0, 136}, + { 1054, 0, 137}, + { 1059, 0, 138}, + { 1063, 0, 139}, + { 1067, 0, 140}, + { 1069, 0, 141}, + { 1072, 0, 142}, + { 1075, 0, 143}, + { 1077, 3, 144}, + { 1082, 0, 148}, + { 1086, 0, 149}, + { 1091, 0, 150}, + { 1095, 0, 151}, + { 1099, 0, 152}, + { 1101, 0, 153}, + { 1110, 0, 154}, + { 1140, 1, 155}, + { 1240, 1, 157}, + { 1256, 1, 159}, + { 1575, 0, 161}, + { 1608, 0, 162}, + { 1610, 0, 163}, + { 1729, 0, 164}, + { 1746, 0, 165}, + { 1749, 0, 166}, + { 2344, 0, 167}, + { 2352, 0, 168}, + { 2355, 0, 169}, + { 2503, 0, 170}, + { 2887, 0, 171}, + { 2962, 0, 172}, + { 3014, 1, 173}, + { 3142, 0, 175}, + { 3263, 0, 176}, + { 3270, 0, 177}, + { 3274, 0, 178}, + { 3398, 1, 179}, + { 3545, 0, 181}, + { 3548, 0, 182}, + { 4133, 0, 183}, + { 6917, 0, 184}, + { 6919, 0, 185}, + { 6921, 0, 186}, + { 6923, 0, 187}, + { 6925, 0, 188}, + { 6929, 0, 189}, + { 6970, 0, 190}, + { 6972, 0, 191}, + { 6974, 1, 192}, + { 6978, 0, 194}, + { 7734, 1, 195}, + { 7770, 1, 197}, + { 7778, 1, 199}, + { 7840, 1, 201}, + { 7864, 1, 203}, + { 7884, 1, 205}, + { 7936, 17, 207}, + { 7960, 1, 225}, + { 7968, 17, 227}, + { 7992, 1, 245}, + { 8000, 1, 247}, + { 8008, 1, 249}, + { 8016, 1, 251}, + { 8025, 0, 253}, + { 8032, 16, 254}, + { 8052, 0, 271}, + { 8060, 0, 272}, + { 8118, 0, 273}, + { 8127, 0, 274}, + { 8134, 0, 275}, + { 8182, 0, 276}, + { 8190, 0, 277}, + { 8592, 0, 278}, + { 8594, 0, 279}, + { 8596, 0, 280}, + { 8656, 0, 281}, + { 8658, 0, 282}, + { 8660, 0, 283}, + { 8707, 0, 284}, + { 8712, 0, 285}, + { 8715, 0, 286}, + { 8739, 0, 287}, + { 8741, 0, 288}, + { 8764, 0, 289}, + { 8771, 0, 290}, + { 8773, 0, 291}, + { 8776, 0, 292}, + { 8781, 0, 293}, + { 8801, 0, 294}, + { 8804, 1, 295}, + { 8818, 1, 297}, + { 8822, 1, 299}, + { 8826, 3, 301}, + { 8834, 1, 305}, + { 8838, 1, 307}, + { 8849, 1, 309}, + { 8866, 0, 311}, + { 8872, 1, 312}, + { 8875, 0, 314}, + { 8882, 3, 315}, + { 12358, 0, 319}, + { 12363, 0, 320}, + { 12365, 0, 321}, + { 12367, 0, 322}, + { 12369, 0, 323}, + { 12371, 0, 324}, + { 12373, 0, 325}, + { 12375, 0, 326}, + { 12377, 0, 327}, + { 12379, 0, 328}, + { 12381, 0, 329}, + { 12383, 0, 330}, + { 12385, 0, 331}, + { 12388, 0, 332}, + { 12390, 0, 333}, + { 12392, 0, 334}, + { 12399, 0, 335}, + { 12402, 0, 336}, + { 12405, 0, 337}, + { 12408, 0, 338}, + { 12411, 0, 339}, + { 12445, 0, 340}, + { 12454, 0, 341}, + { 12459, 0, 342}, + { 12461, 0, 343}, + { 12463, 0, 344}, + { 12465, 0, 345}, + { 12467, 0, 346}, + { 12469, 0, 347}, + { 12471, 0, 348}, + { 12473, 0, 349}, + { 12475, 0, 350}, + { 12477, 0, 351}, + { 12479, 0, 352}, + { 12481, 0, 353}, + { 12484, 0, 354}, + { 12486, 0, 355}, + { 12488, 0, 356}, + { 12495, 0, 357}, + { 12498, 0, 358}, + { 12501, 0, 359}, + { 12504, 0, 360}, + { 12507, 0, 361}, + { 12527, 3, 362}, + { 12541, 0, 366}, + { 69785, 0, 367}, + { 69787, 0, 368}, + { 69797, 0, 369}, + { 69937, 1, 370}, + {0,0,0} }; static const Reindex nfc_last[] = { - { 768, 4, 0}, - { 774, 6, 5}, - { 783, 0, 12}, - { 785, 0, 13}, - { 787, 1, 14}, - { 795, 0, 16}, - { 803, 5, 17}, - { 813, 1, 23}, - { 816, 1, 25}, - { 824, 0, 27}, - { 834, 0, 28}, - { 837, 0, 29}, - { 1619, 2, 30}, - { 2364, 0, 33}, - { 2494, 0, 34}, - { 2519, 0, 35}, - { 2878, 0, 36}, - { 2902, 1, 37}, - { 3006, 0, 39}, - { 3031, 0, 40}, - { 3158, 0, 41}, - { 3266, 0, 42}, - { 3285, 1, 43}, - { 3390, 0, 45}, - { 3415, 0, 46}, - { 3530, 0, 47}, - { 3535, 0, 48}, - { 3551, 0, 49}, - { 4142, 0, 50}, - { 6965, 0, 51}, - { 12441, 1, 52}, - { 69818, 0, 54}, - { 69927, 0, 55}, - {0,0,0} + { 768, 4, 0}, + { 774, 6, 5}, + { 783, 0, 12}, + { 785, 0, 13}, + { 787, 1, 14}, + { 795, 0, 16}, + { 803, 5, 17}, + { 813, 1, 23}, + { 816, 1, 25}, + { 824, 0, 27}, + { 834, 0, 28}, + { 837, 0, 29}, + { 1619, 2, 30}, + { 2364, 0, 33}, + { 2494, 0, 34}, + { 2519, 0, 35}, + { 2878, 0, 36}, + { 2902, 1, 37}, + { 3006, 0, 39}, + { 3031, 0, 40}, + { 3158, 0, 41}, + { 3266, 0, 42}, + { 3285, 1, 43}, + { 3390, 0, 45}, + { 3415, 0, 46}, + { 3530, 0, 47}, + { 3535, 0, 48}, + { 3551, 0, 49}, + { 4142, 0, 50}, + { 6965, 0, 51}, + { 12441, 1, 52}, + { 69818, 0, 54}, + { 69927, 0, 55}, + {0,0,0} }; #define UCDN_EAST_ASIAN_F 0 |