diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-07-14 00:56:37 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-07-14 01:04:27 +0200 |
commit | de4a540efee75970a7ff7949ada2304c786b1da8 (patch) | |
tree | 0d9375e02015f20f7290a4423dd9731bfff3ebd2 /platform/android/viewer | |
parent | b8aeced92d5a3576e9bc5fbd87656dc97e380c52 (diff) | |
download | mupdf-de4a540efee75970a7ff7949ada2304c786b1da8.tar.xz |
Fix whitespace and indentation.
Diffstat (limited to 'platform/android/viewer')
-rw-r--r-- | platform/android/viewer/AndroidManifest.xml | 4 | ||||
-rw-r--r-- | platform/android/viewer/ClassStructure.txt | 5 | ||||
-rw-r--r-- | platform/android/viewer/ReadMe.txt | 4 | ||||
-rw-r--r-- | platform/android/viewer/build.gradle | 109 | ||||
-rw-r--r-- | platform/android/viewer/build.xml | 151 | ||||
-rw-r--r-- | platform/android/viewer/jni/Android.mk | 6 | ||||
-rw-r--r-- | platform/android/viewer/jni/Core.mk | 6 | ||||
-rw-r--r-- | platform/android/viewer/res/values/styles.xml | 6 | ||||
-rw-r--r-- | platform/android/viewer/src/com/artifex/mupdfdemo/ChoosePDFActivity.java | 1 | ||||
-rw-r--r-- | platform/android/viewer/src/com/artifex/mupdfdemo/Deque.java | 2 | ||||
-rw-r--r-- | platform/android/viewer/src/com/artifex/mupdfdemo/MuPDFPageView.java | 1 | ||||
-rw-r--r-- | platform/android/viewer/src/com/artifex/mupdfdemo/PageView.java | 1 | ||||
-rw-r--r-- | platform/android/viewer/src/com/artifex/mupdfdemo/ReaderView.java | 2 |
13 files changed, 141 insertions, 157 deletions
diff --git a/platform/android/viewer/AndroidManifest.xml b/platform/android/viewer/AndroidManifest.xml index 29c20f84..78dcce1d 100644 --- a/platform/android/viewer/AndroidManifest.xml +++ b/platform/android/viewer/AndroidManifest.xml @@ -3,7 +3,7 @@ package="com.artifex.mupdfdemo" android:versionCode="50" android:versionName="@string/version" - android:debuggable="false" + android:debuggable="false" android:installLocation="auto"> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.INTERNET" /> @@ -99,4 +99,4 @@ android:label="@string/print"> </activity> </application> -</manifest> +</manifest> diff --git a/platform/android/viewer/ClassStructure.txt b/platform/android/viewer/ClassStructure.txt index 39939674..ff1f9409 100644 --- a/platform/android/viewer/ClassStructure.txt +++ b/platform/android/viewer/ClassStructure.txt @@ -5,7 +5,6 @@ MuPDFActivity is the main activity used when displaying and interacting with a document. This class is responsible for creating the view hierarchy and the menus. - Main view classes ~~~~~~~~~~~~~~~~~ @@ -83,7 +82,6 @@ appearances, can take on their correct size immediately. (The determining of page size is not a completely trivial operation and is performed on a background thread, as is all interaction with the core MuPDF library). - C library wrapper ~~~~~~~~~~~~~~~~~ @@ -98,7 +96,6 @@ and because even the fast methods have to be synchronised with the slower methods, (almost) all methods should be called in the background. There are a few non synchronised ones that have special purposes. - Link handling ~~~~~~~~~~~~~ There are three types of PDF links, each entailing different information and @@ -178,10 +175,8 @@ PrintDialogActivity ~~~~~~~~~~~~~~~~~~~ This activity allows the user to print documents via Google Cloud Print. - Copied system classes ~~~~~~~~~~~~~~~~~~~~~ AsyncTask has had improvements made to it since issuing at the lowest android API level we support, and so we include the improved version as part of the MuPDF app. We also include Deque and ArrayDeque, which are used my AsyncTask. - diff --git a/platform/android/viewer/ReadMe.txt b/platform/android/viewer/ReadMe.txt index 550d16dc..b2e5eb1e 100644 --- a/platform/android/viewer/ReadMe.txt +++ b/platform/android/viewer/ReadMe.txt @@ -20,11 +20,11 @@ will show you the install location. The Android Studio SDK unpacked as: - C:\Users\UserName\AppData\Local\Android\sdk + C:\Users\UserName\AppData\Local\Android\sdk on Windows. On MacOS it installed in: - /Users/UserName/Library/Android/sdk + /Users/UserName/Library/Android/sdk In the 'SDK Plaforms' tab, ensure that at least API 16 is downloaded. I have a selection of later APIs too (17, 19, 22), diff --git a/platform/android/viewer/build.gradle b/platform/android/viewer/build.gradle index 1bd5313b..1736e939 100644 --- a/platform/android/viewer/build.gradle +++ b/platform/android/viewer/build.gradle @@ -1,89 +1,86 @@ import org.apache.tools.ant.taskdefs.condition.Os buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:1.2.3' - } + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.2.3' + } } allprojects { - repositories { - jcenter() - } + repositories { + jcenter() + } } apply plugin: 'com.android.application' dependencies { - compile fileTree(dir: 'libs', include: '*.so') + compile fileTree(dir: 'libs', include: '*.so') } android { + compileSdkVersion 17 + buildToolsVersion '21.1.2' - compileSdkVersion 17 - buildToolsVersion '21.1.2' - - /* this stops gradle from making it's own Android.mk file */ + /* this stops gradle from making it's own Android.mk file */ sourceSets.main.jni.srcDirs = [] - - sourceSets { - main { - manifest { - srcFile 'AndroidManifest.xml' - } - java { - srcDir 'src' - exclude 'com/artifex/mupdf/fitz/AndroidDrawDevice.java' - } - res { - srcDir 'res' - } - assets { - srcDir 'assets' - } - resources { - srcDir 'src' - } - jniLibs { - srcDir 'libs' - } - } - } - /* This is important, it will run lint checks but won't abort build */ - lintOptions { - abortOnError false - } - + sourceSets { + main { + manifest { + srcFile 'AndroidManifest.xml' + } + java { + srcDir 'src' + exclude 'com/artifex/mupdf/fitz/AndroidDrawDevice.java' + } + res { + srcDir 'res' + } + assets { + srcDir 'assets' + } + resources { + srcDir 'src' + } + jniLibs { + srcDir 'libs' + } + } + } + + /* This is important, it will run lint checks but won't abort build */ + lintOptions { + abortOnError false + } } -/* This defines the path to Android's ndk-build. */ +/* This defines the path to Android's ndk-build. */ def ndkBuildPath = plugins.getPlugin('com.android.application').sdkHandler.getNdkFolder().absolutePath + File.separator + 'ndk-build' if (Os.isFamily(Os.FAMILY_WINDOWS)) { - ndkBuildPath +='.cmd' + ndkBuildPath +='.cmd' } -/* This task builds the native part */ +/* This task builds the native part */ task buildNative(type: Exec,description: 'Compile JNI source via NDK') { - println('executing buildNative') - commandLine ndkBuildPath, '-C', file('.').absolutePath, ' FZ_ENABLE_GPRF=1' - //'NDK_PROJECT_PATH=build','APP_BUILD_SCRIPT=src/main/jni/Android.mk'//force using appropriate Makefile + println('executing buildNative') + commandLine ndkBuildPath, '-C', file('.').absolutePath, ' FZ_ENABLE_GPRF=1' + //'NDK_PROJECT_PATH=build','APP_BUILD_SCRIPT=src/main/jni/Android.mk'//force using appropriate Makefile } -/* This task cleans the native part */ +/* This task cleans the native part */ task cleanNative(type: Exec, description: 'Clean JNI object files') { - println('executing cleanNative') - commandLine ndkBuildPath, '-C', file('.').absolutePath, 'clean' + println('executing cleanNative') + commandLine ndkBuildPath, '-C', file('.').absolutePath, 'clean' } -/* cleaning should also include cleaning native */ +/* cleaning should also include cleaning native */ clean.dependsOn 'cleanNative' -/* building should include native */ +/* building should include native */ tasks.withType(JavaCompile){ - compileTask -> compileTask.dependsOn buildNative + compileTask -> compileTask.dependsOn buildNative } - diff --git a/platform/android/viewer/build.xml b/platform/android/viewer/build.xml index 7cb2cdf8..627346bc 100644 --- a/platform/android/viewer/build.xml +++ b/platform/android/viewer/build.xml @@ -1,85 +1,82 @@ <?xml version="1.0" encoding="UTF-8"?> <project name="MuPDF" default="help"> - <!-- The local.properties file is created and updated by the 'android' tool. - It contains the path to the SDK. It should *NOT* be checked into - Version Control Systems. --> - <loadproperties srcFile="local.properties" /> - - <!-- The ant.properties file can be created by you. It is only edited by the - 'android' tool to add properties to it. - This is the place to change some Ant specific build properties. - Here are some properties you may want to change/update: - - source.dir - The name of the source directory. Default is 'src'. - out.dir - The name of the output directory. Default is 'bin'. - - For other overridable properties, look at the beginning of the rules - files in the SDK, at tools/ant/build.xml - - Properties related to the SDK location or the project target should - be updated using the 'android' tool with the 'update' action. - - This file is an integral part of the build system for your - application and should be checked into Version Control Systems. - - --> - <property file="ant.properties" /> - - <!-- The project.properties file is created and updated by the 'android' - tool, as well as ADT. - - This contains project specific properties such as project target, and library - dependencies. Lower level build properties are stored in ant.properties - (or in .classpath for Eclipse projects). - - This file is an integral part of the build system for your - application and should be checked into Version Control Systems. --> - <loadproperties srcFile="project.properties" /> - - <!-- quick check on sdk.dir --> - <fail - message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'" - unless="sdk.dir" - /> - - -<!-- extension targets. Uncomment the ones where you want to do custom work - in between standard targets --> + <!-- + The local.properties file is created and updated by the 'android' tool. + It contains the path to the SDK. It should *NOT* be checked into + Version Control Systems. + --> + <loadproperties srcFile="local.properties" /> + + <!-- + The ant.properties file can be created by you. It is only edited by the + 'android' tool to add properties to it. + This is the place to change some Ant specific build properties. + Here are some properties you may want to change/update: + + source.dir + The name of the source directory. Default is 'src'. + out.dir + The name of the output directory. Default is 'bin'. + + For other overridable properties, look at the beginning of the rules + files in the SDK, at tools/ant/build.xml + + Properties related to the SDK location or the project target should + be updated using the 'android' tool with the 'update' action. + + This file is an integral part of the build system for your + application and should be checked into Version Control Systems. + --> + <property file="ant.properties" /> + + <!-- + The project.properties file is created and updated by the 'android' + tool, as well as ADT. + + This contains project specific properties such as project target, and library + dependencies. Lower level build properties are stored in ant.properties + (or in .classpath for Eclipse projects). + + This file is an integral part of the build system for your + application and should be checked into Version Control Systems. + --> + <loadproperties srcFile="project.properties" /> + + <!-- quick check on sdk.dir --> + <fail + message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'" + unless="sdk.dir" + /> + +<!-- extension targets. Uncomment the ones where you want to do custom work in between standard targets --> <!-- - <target name="-pre-build"> - </target> - <target name="-pre-compile"> - </target> - - /* This is typically used for code obfuscation. - Compiled code location: ${out.classes.absolute.dir} - If this is not done in place, override ${out.dex.input.absolute.dir} */ - <target name="-post-compile"> - </target> + <target name="-pre-build"> + </target> + <target name="-pre-compile"> + </target> + <target name="-post-compile"> + </target> --> - <!-- Import the actual build file. - - To customize existing targets, there are two options: - - Customize only one target: - - copy/paste the target into this file, *before* the - <import> task. - - customize it to your needs. - - Customize the whole content of build.xml - - copy/paste the content of the rules files (minus the top node) - into this file, replacing the <import> task. - - customize to your needs. - - *********************** - ****** IMPORTANT ****** - *********************** - In all cases you must update the value of version-tag below to read 'custom' instead of an integer, - in order to avoid having your file be overridden by tools such as "android update project" - --> - <!-- version-tag: 1 --> - <import file="${sdk.dir}/tools/ant/build.xml" /> + <!-- Import the actual build file. + + To customize existing targets, there are two options: + - Customize only one target: + - copy/paste the target into this file, *before* the <import> task. + - customize it to your needs. + - Customize the whole content of build.xml + - copy/paste the content of the rules files (minus the top node) + into this file, replacing the <import> task. + - customize to your needs. + + *********************** + ****** IMPORTANT ****** + *********************** + In all cases you must update the value of version-tag below to read 'custom' instead of an integer, + in order to avoid having your file be overridden by tools such as "android update project" + --> + <!-- version-tag: 1 --> + <import file="${sdk.dir}/tools/ant/build.xml" /> </project> diff --git a/platform/android/viewer/jni/Android.mk b/platform/android/viewer/jni/Android.mk index 2f5adf48..0a1dbf38 100644 --- a/platform/android/viewer/jni/Android.mk +++ b/platform/android/viewer/jni/Android.mk @@ -19,7 +19,7 @@ LOCAL_C_INCLUDES := \ $(MUPDF_ROOT)/source/pdf \ $(MUPDF_ROOT)/platform/java LOCAL_CFLAGS := -DHAVE_ANDROID -LOCAL_MODULE := mupdf_java +LOCAL_MODULE := mupdf_java LOCAL_SRC_FILES := \ mupdf.c \ @@ -34,9 +34,9 @@ ifdef SUPPORT_GPROOF LOCAL_CFLAGS += -DSUPPORT_GPROOF endif -LOCAL_LDLIBS := -lm -llog -ljnigraphics +LOCAL_LDLIBS := -lm -llog -ljnigraphics ifdef SSL_BUILD -LOCAL_LDLIBS += -L$(MUPDF_ROOT)/thirdparty/openssl/android -lcrypto -lssl +LOCAL_LDLIBS += -L$(MUPDF_ROOT)/thirdparty/openssl/android -lcrypto -lssl endif include $(BUILD_SHARED_LIBRARY) diff --git a/platform/android/viewer/jni/Core.mk b/platform/android/viewer/jni/Core.mk index 7371a33d..7a0913b4 100644 --- a/platform/android/viewer/jni/Core.mk +++ b/platform/android/viewer/jni/Core.mk @@ -2,7 +2,7 @@ LOCAL_PATH := $(call my-dir) ifdef SUPPORT_GPROOF include $(CLEAR_VARS) -LOCAL_MODULE := gsso +LOCAL_MODULE := gsso LOCAL_SRC_FILES := libgs.so include $(PREBUILT_SHARED_LIBRARY) endif @@ -58,7 +58,7 @@ ifdef SSL_BUILD LOCAL_C_INCLUDES += $(MY_ROOT)/thirdparty/openssl/include endif -LOCAL_MODULE := mupdfcore +LOCAL_MODULE := mupdfcore LOCAL_SRC_FILES := \ $(wildcard $(MY_ROOT)/source/fitz/*.c) \ $(wildcard $(MY_ROOT)/source/pdf/*.c) \ @@ -72,7 +72,7 @@ LOCAL_SRC_FILES := \ ifdef SUPPORT_GPROOF LOCAL_SHARED_LIBRARIES := gsso endif -LOCAL_LDLIBS := -lm -llog -ljnigraphics +LOCAL_LDLIBS := -lm -llog -ljnigraphics LOCAL_SRC_FILES := $(addprefix ../, $(LOCAL_SRC_FILES)) diff --git a/platform/android/viewer/res/values/styles.xml b/platform/android/viewer/res/values/styles.xml index ade851dd..e1d118a9 100644 --- a/platform/android/viewer/res/values/styles.xml +++ b/platform/android/viewer/res/values/styles.xml @@ -1,5 +1,5 @@ <resources> - <style name="AppBaseTheme" parent="@android:style/Theme.NoTitleBar.Fullscreen"> - <item name="android:windowBackground">@drawable/tiled_background</item> - </style> + <style name="AppBaseTheme" parent="@android:style/Theme.NoTitleBar.Fullscreen"> + <item name="android:windowBackground">@drawable/tiled_background</item> + </style> </resources> diff --git a/platform/android/viewer/src/com/artifex/mupdfdemo/ChoosePDFActivity.java b/platform/android/viewer/src/com/artifex/mupdfdemo/ChoosePDFActivity.java index f6068bac..ca384015 100644 --- a/platform/android/viewer/src/com/artifex/mupdfdemo/ChoosePDFActivity.java +++ b/platform/android/viewer/src/com/artifex/mupdfdemo/ChoosePDFActivity.java @@ -44,7 +44,6 @@ public class ChoosePDFActivity extends ListActivity { mPurpose = PICK_KEY_FILE.equals(getIntent().getAction()) ? Purpose.PickKeyFile : Purpose.PickPDF; - String storageState = Environment.getExternalStorageState(); if (!Environment.MEDIA_MOUNTED.equals(storageState) diff --git a/platform/android/viewer/src/com/artifex/mupdfdemo/Deque.java b/platform/android/viewer/src/com/artifex/mupdfdemo/Deque.java index 4bb176b2..ad17bcc0 100644 --- a/platform/android/viewer/src/com/artifex/mupdfdemo/Deque.java +++ b/platform/android/viewer/src/com/artifex/mupdfdemo/Deque.java @@ -452,7 +452,6 @@ public interface Deque<E> extends Queue<E> { */ E peek(); - // *** Stack methods *** /** @@ -488,7 +487,6 @@ public interface Deque<E> extends Queue<E> { */ E pop(); - // *** Collection methods *** /** diff --git a/platform/android/viewer/src/com/artifex/mupdfdemo/MuPDFPageView.java b/platform/android/viewer/src/com/artifex/mupdfdemo/MuPDFPageView.java index ff6b6bbb..bca0254f 100644 --- a/platform/android/viewer/src/com/artifex/mupdfdemo/MuPDFPageView.java +++ b/platform/android/viewer/src/com/artifex/mupdfdemo/MuPDFPageView.java @@ -553,7 +553,6 @@ public class MuPDFPageView extends PageView implements MuPDFView { return true; } - @Override protected CancellableTaskDefinition<Void, Void> getDrawPageTask(final Bitmap bm, final int sizeX, final int sizeY, final int patchX, final int patchY, final int patchWidth, final int patchHeight) { diff --git a/platform/android/viewer/src/com/artifex/mupdfdemo/PageView.java b/platform/android/viewer/src/com/artifex/mupdfdemo/PageView.java index 2ee407cb..c897f414 100644 --- a/platform/android/viewer/src/com/artifex/mupdfdemo/PageView.java +++ b/platform/android/viewer/src/com/artifex/mupdfdemo/PageView.java @@ -656,7 +656,6 @@ public abstract class PageView extends ViewGroup { mDrawPatch = null; } - // Render the page in the background mDrawEntire = new CancellableAsyncTask<Void, Void>(getUpdatePageTask(mEntireBm, mSize.x, mSize.y, 0, 0, mSize.x, mSize.y)) { diff --git a/platform/android/viewer/src/com/artifex/mupdfdemo/ReaderView.java b/platform/android/viewer/src/com/artifex/mupdfdemo/ReaderView.java index 65d8f665..f91efa41 100644 --- a/platform/android/viewer/src/com/artifex/mupdfdemo/ReaderView.java +++ b/platform/android/viewer/src/com/artifex/mupdfdemo/ReaderView.java @@ -80,7 +80,7 @@ public class ReaderView public ReaderView(Context context, AttributeSet attrs) { super(context, attrs); - + // "Edit mode" means when the View is being displayed in the Android GUI editor. (this class // is instantiated in the IDE, so we need to be a bit careful what we do). if (isInEditMode()) |