From de4a540efee75970a7ff7949ada2304c786b1da8 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 14 Jul 2016 00:56:37 +0200 Subject: Fix whitespace and indentation. --- .../app/src/main/res/layout/activity_doc_view.xml | 16 +-- .../app/src/main/res/layout/activity_main.xml | 7 +- .../example/app/src/main/res/layout/choose_doc.xml | 48 ++++--- .../app/src/main/res/layout/picker_entry.xml | 38 +++--- .../example/app/src/main/res/values/colors.xml | 2 +- .../example/app/src/main/res/values/styles.xml | 10 +- .../example/mupdf/src/main/AndroidManifest.xml | 24 ++-- .../example/mupdf/src/main/res/values/strings.xml | 2 +- platform/android/viewer/AndroidManifest.xml | 4 +- platform/android/viewer/ClassStructure.txt | 5 - platform/android/viewer/ReadMe.txt | 4 +- platform/android/viewer/build.gradle | 109 ++++++++------- platform/android/viewer/build.xml | 151 ++++++++++----------- platform/android/viewer/jni/Android.mk | 6 +- platform/android/viewer/jni/Core.mk | 6 +- platform/android/viewer/res/values/styles.xml | 6 +- .../com/artifex/mupdfdemo/ChoosePDFActivity.java | 1 - .../viewer/src/com/artifex/mupdfdemo/Deque.java | 2 - .../src/com/artifex/mupdfdemo/MuPDFPageView.java | 1 - .../viewer/src/com/artifex/mupdfdemo/PageView.java | 1 - .../src/com/artifex/mupdfdemo/ReaderView.java | 2 +- 21 files changed, 209 insertions(+), 236 deletions(-) (limited to 'platform/android') diff --git a/platform/android/example/app/src/main/res/layout/activity_doc_view.xml b/platform/android/example/app/src/main/res/layout/activity_doc_view.xml index 7f5ece24..36761615 100644 --- a/platform/android/example/app/src/main/res/layout/activity_doc_view.xml +++ b/platform/android/example/app/src/main/res/layout/activity_doc_view.xml @@ -1,13 +1,13 @@ + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> - - + + diff --git a/platform/android/example/app/src/main/res/layout/activity_main.xml b/platform/android/example/app/src/main/res/layout/activity_main.xml index 24f3d6ba..3d1efc88 100644 --- a/platform/android/example/app/src/main/res/layout/activity_main.xml +++ b/platform/android/example/app/src/main/res/layout/activity_main.xml @@ -1,6 +1,5 @@ - - \ No newline at end of file + android:layout_width="match_parent" + android:layout_height="match_parent"> + diff --git a/platform/android/example/app/src/main/res/layout/choose_doc.xml b/platform/android/example/app/src/main/res/layout/choose_doc.xml index 48e63b8c..bbccc496 100644 --- a/platform/android/example/app/src/main/res/layout/choose_doc.xml +++ b/platform/android/example/app/src/main/res/layout/choose_doc.xml @@ -1,32 +1,30 @@ + android:layout_width="match_parent" + android:layout_height="match_parent"> - + - + - - - - - + + + diff --git a/platform/android/example/app/src/main/res/layout/picker_entry.xml b/platform/android/example/app/src/main/res/layout/picker_entry.xml index 98ede7d6..5dead12f 100644 --- a/platform/android/example/app/src/main/res/layout/picker_entry.xml +++ b/platform/android/example/app/src/main/res/layout/picker_entry.xml @@ -1,25 +1,25 @@ + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingLeft="4dp" > - + - + diff --git a/platform/android/example/app/src/main/res/values/colors.xml b/platform/android/example/app/src/main/res/values/colors.xml index b8acf28a..47c6eb22 100644 --- a/platform/android/example/app/src/main/res/values/colors.xml +++ b/platform/android/example/app/src/main/res/values/colors.xml @@ -1,4 +1,4 @@ - #FFFFFFFF + #FFFFFFFF diff --git a/platform/android/example/app/src/main/res/values/styles.xml b/platform/android/example/app/src/main/res/values/styles.xml index 3d804574..97e54a45 100644 --- a/platform/android/example/app/src/main/res/values/styles.xml +++ b/platform/android/example/app/src/main/res/values/styles.xml @@ -1,8 +1,6 @@ - - - - - \ No newline at end of file + + + diff --git a/platform/android/example/mupdf/src/main/AndroidManifest.xml b/platform/android/example/mupdf/src/main/AndroidManifest.xml index af5dbc58..4065d7fd 100644 --- a/platform/android/example/mupdf/src/main/AndroidManifest.xml +++ b/platform/android/example/mupdf/src/main/AndroidManifest.xml @@ -1,16 +1,10 @@ - - - package="com.artifex.mupdf.fitz"> - - - - - - - - + + + + + + diff --git a/platform/android/example/mupdf/src/main/res/values/strings.xml b/platform/android/example/mupdf/src/main/res/values/strings.xml index 0f541156..28af5d41 100644 --- a/platform/android/example/mupdf/src/main/res/values/strings.xml +++ b/platform/android/example/mupdf/src/main/res/values/strings.xml @@ -1,3 +1,3 @@ - mupdf + mupdf 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"> @@ -99,4 +99,4 @@ android:label="@string/print"> - + 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 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - + + + 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 @@ - + 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 extends Queue { */ E peek(); - // *** Stack methods *** /** @@ -488,7 +487,6 @@ public interface Deque extends Queue { */ 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 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(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()) -- cgit v1.2.3