├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── styles.xml │ │ │ │ ├── colors.xml │ │ │ │ └── dimens.xml │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ └── layout │ │ │ │ └── activity_main.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── liuqingwei │ │ │ └── demo │ │ │ └── MainActivity.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── liuqingwei │ │ │ └── electrocardiogram │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── liuqingwei │ │ └── electrocardiogram │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── library ├── .gitignore ├── src │ └── main │ │ ├── res │ │ └── values │ │ │ └── strings.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── liuqingwei │ │ └── library │ │ └── electrocardiogram │ │ ├── Renderer.java │ │ └── ChartView.java ├── build.gradle └── proguard-rules.pro ├── settings.gradle ├── images ├── drawHo.png ├── drawTime.png ├── drawVertical.png └── SiatChartEngine.zip ├── .idea ├── copyright │ └── profiles_settings.xml ├── markdown-navigator │ └── profiles_settings.xml ├── vcs.xml ├── modules.xml ├── runConfigurations.xml ├── gradle.xml ├── compiler.xml └── misc.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── .travis.yml ├── README.md ├── gradle.properties ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /library/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':library' 2 | -------------------------------------------------------------------------------- /images/drawHo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteoral/Electrocardiogram/HEAD/images/drawHo.png -------------------------------------------------------------------------------- /images/drawTime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteoral/Electrocardiogram/HEAD/images/drawTime.png -------------------------------------------------------------------------------- /images/drawVertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteoral/Electrocardiogram/HEAD/images/drawVertical.png -------------------------------------------------------------------------------- /images/SiatChartEngine.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteoral/Electrocardiogram/HEAD/images/SiatChartEngine.zip -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /library/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Library 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Electrocardiogram 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteoral/Electrocardiogram/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.idea/markdown-navigator/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteoral/Electrocardiogram/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteoral/Electrocardiogram/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteoral/Electrocardiogram/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteoral/Electrocardiogram/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meteoral/Electrocardiogram/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | TestActivity* -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | android: 3 | components: 4 | - build-tools-25.0.2 5 | - android-18 6 | - extra 7 | licenses: 8 | - 'android-sdk-preview-license-52d11cd2' 9 | - 'android-sdk-license-.+' 10 | - 'google-gdk-license-.+' -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /library/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/test/java/com/liuqingwei/electrocardiogram/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.liuqingwei.electrocardiogram; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /library/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 21 5 | buildToolsVersion "25.0.2" 6 | 7 | defaultConfig { 8 | minSdkVersion 15 9 | targetSdkVersion 21 10 | versionCode 1 11 | versionName "1.0" 12 | 13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 14 | 15 | } 16 | buildTypes { 17 | release { 18 | minifyEnabled false 19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 20 | } 21 | } 22 | } 23 | 24 | dependencies { 25 | compile fileTree(dir: 'libs', include: ['*.jar']) 26 | } 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 心电图绘制扩展 for Android 2 | =============== 3 | ## 简介 4 | Electrocardiogram 是智能家居项目所做的图形库扩展,由原来健康一家的绘制图形需要十几秒到现在绘制心电图只需200ms的时间,大大提高了绘制效率. 5 | 6 | 1. 绘制时间: 7 | ![image](https://github.com/meteoral/Electrocardiogram/raw/master/images/drawTime.png "绘制时间") 8 | 2. 竖向排版时显示效果 9 | ![image](https://github.com/meteoral/Electrocardiogram/raw/master/images/drawVertical.png "竖向排版时显示效果") 10 | 3. 横向排版时的显示效果 11 | ![image](https://github.com/meteoral/Electrocardiogram/raw/master/images/drawHo.png "横向排版时的显示效果") 12 | 13 | ## 演示Android包 14 | Eclipse演示程序下载 15 | ![演示包下载](https://github.com/meteoral/Electrocardiogram/raw/master/images/SiatChartEngine.zip) 16 | ## 联系我 17 | Meteoral: mail@liuqingwei.com 18 | QQ: 120599662 19 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/meteoral/source/android-sdk-macosx/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /library/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/meteoral/source/android-sdk-macosx/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 13 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/liuqingwei/electrocardiogram/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.liuqingwei.electrocardiogram; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.liuqingwei.electrocardiogram", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 21 5 | buildToolsVersion "25.0.2" 6 | defaultConfig { 7 | applicationId "com.liuqingwei.electrocardiogram" 8 | minSdkVersion 15 9 | targetSdkVersion 21 10 | versionCode 1 11 | versionName "1.0" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | compile project(':library') 25 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 26 | exclude group: 'com.android.support', module: 'support-annotations' 27 | }) 28 | testCompile 'junit:junit:4.12' 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/liuqingwei/demo/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.liuqingwei.demo; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.widget.LinearLayout; 6 | 7 | import com.liuqingwei.library.electrocardiogram.ChartView; 8 | import com.liuqingwei.electrocardiogram.R; 9 | import com.liuqingwei.library.electrocardiogram.Renderer; 10 | 11 | public class MainActivity extends Activity { 12 | 13 | @Override 14 | protected void onCreate(Bundle savedInstanceState) { 15 | super.onCreate(savedInstanceState); 16 | setContentView(R.layout.activity_main); 17 | init(); 18 | } 19 | private void init() { 20 | LinearLayout layout=(LinearLayout) findViewById(R.id.root); 21 | Renderer renderer = new Renderer(); 22 | renderer.setECGShowLabel(true); 23 | renderer.setECGChartLabel("这是测试的心电图"); 24 | renderer.setECGLineStep(1); 25 | renderer.setECGScrollable(true); 26 | 27 | ChartView view=new ChartView(this,renderer); 28 | view.setMinimumHeight(400); 29 | view.setMinimumWidth(500); 30 | 31 | //通知view组件重绘 32 | // view.invalidate(); 33 | layout.addView(view); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /library/src/main/java/com/liuqingwei/library/electrocardiogram/Renderer.java: -------------------------------------------------------------------------------- 1 | package com.liuqingwei.library.electrocardiogram; 2 | 3 | import android.graphics.Color; 4 | import android.graphics.Typeface; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * 心率图渲染器类 10 | * Created by Meteoral.Liu On MacOS 11 | * User: Meteoral 12 | * Date: 14-10-10 13 | * WebSite: http://www.liuqingwei.com 14 | * QQ: 120599662 15 | */ 16 | public class Renderer implements Serializable{ 17 | /** 表格标题 */ 18 | private String ECGChartLabel = ""; 19 | /** 是否显示标题 */ 20 | private boolean ECGShowLabel = false; 21 | /** 表格字体 */ 22 | private float ECGChartTextSize = 24; 23 | /** 没有颜色值 */ 24 | public int NO_COLOR = 0; 25 | /** 默认字体颜色 */ 26 | private int TextColor = Color.BLACK; 27 | /** 建立一个普通的字体样式 */ 28 | private static final Typeface REGULAR_TEXT_FONT = Typeface 29 | .create(Typeface.SERIF, Typeface.NORMAL); 30 | /** 字体名 */ 31 | private String ECGTextTypefaceName = REGULAR_TEXT_FONT.toString(); 32 | /** 字体样式 */ 33 | private int ECGTextTypefaceStyle = Typeface.NORMAL; 34 | /** 字体typeface */ 35 | private Typeface ECGTextTypeface; 36 | /** 表格的背景颜色 */ 37 | private int ECGBackgroundColor = 0xFFF0F0F0; 38 | /** 坐标轴是否可见 */ 39 | private boolean ECGShowAxes = true; 40 | /** 坐标轴颜色 */ 41 | private int ECGAxesColor = Color.RED; 42 | /** 坐标标签是否可见 */ 43 | private int ECGLineStep = 1; 44 | /** 设置表格是否可滑动翻页 */ 45 | private boolean ECGScrollable = true; 46 | 47 | /** 48 | * 获取表格标题 49 | * @return 返回表格标题 50 | */ 51 | public String getECGChartLabel() { 52 | return ECGChartLabel; 53 | } 54 | 55 | public void setTextColor(int textColor) { 56 | TextColor = textColor; 57 | } 58 | 59 | public int getTextColor() { 60 | return TextColor; 61 | } 62 | 63 | /** 64 | * 设置表格标题 65 | * @param ECGChartLabel 字符串 表格标题 66 | */ 67 | public void setECGChartLabel(String ECGChartLabel) { 68 | this.ECGChartLabel = ECGChartLabel; 69 | } 70 | 71 | /** 72 | * 获取表格标题字体大小 73 | * @return 返回表格标题字体大小 74 | */ 75 | public float getECGChartTextSize() { 76 | return ECGChartTextSize; 77 | } 78 | 79 | /** 80 | * 设置表格标题字体大小 81 | * @param ECGChartTextSize 字体大小 82 | */ 83 | public void setECGChartTextSize(float ECGChartTextSize) { 84 | this.ECGChartTextSize = ECGChartTextSize; 85 | } 86 | 87 | /** 88 | * 获取表格标题字体样式 89 | * @return 返回表格标题字体样式 90 | */ 91 | public static Typeface getRegularTextFont() { 92 | return REGULAR_TEXT_FONT; 93 | } 94 | 95 | /** 96 | * 获取表格标题字体样式名称 97 | * @return 返回样式名称 98 | */ 99 | public String getECGTextTypefaceName() { 100 | return ECGTextTypefaceName; 101 | } 102 | 103 | /** 104 | * 设置表格标题字体样式 105 | * @param ECGTextTypefaceName 字体样式名 106 | */ 107 | public void setECGTextTypefaceName(String ECGTextTypefaceName) { 108 | this.ECGTextTypefaceName = ECGTextTypefaceName; 109 | } 110 | 111 | /** 112 | * 获取表格FaceStyle 113 | * @return FaceStyle 114 | */ 115 | public int getECGTextTypefaceStyle() { 116 | return ECGTextTypefaceStyle; 117 | } 118 | 119 | /** 120 | * 设置表格FaceStyle 121 | * @param ECGTextTypefaceStyle Facestyle属性 122 | */ 123 | public void setECGTextTypefaceStyle(int ECGTextTypefaceStyle) { 124 | this.ECGTextTypefaceStyle = ECGTextTypefaceStyle; 125 | } 126 | 127 | /** 128 | * 获取表格背景横纵轴直线的颜色 129 | * @return 返回颜色值 130 | */ 131 | public int getECGAxesColor() { 132 | return ECGAxesColor; 133 | } 134 | 135 | /** 136 | * 设置表格背景横纵轴直线的颜色 137 | * @param ECGAxesColor 需设置的颜色值 138 | */ 139 | public void setECGAxesColor(int ECGAxesColor) { 140 | this.ECGAxesColor = ECGAxesColor; 141 | } 142 | 143 | /** 144 | * 获取表格主背景色 145 | * @return 返回背景色值 146 | */ 147 | public int getECGBackgroundColor() { 148 | return ECGBackgroundColor; 149 | } 150 | 151 | /** 152 | * 设置表格主背景色 153 | * @param ECGBackgroundColor 需设置的背景色值 154 | */ 155 | public void setECGBackgroundColor(int ECGBackgroundColor) { 156 | this.ECGBackgroundColor = ECGBackgroundColor; 157 | } 158 | 159 | /** 160 | * 获取字体Tyepface 161 | * @return 字体的Tyepface 162 | */ 163 | public Typeface getECGTextTypeface() { 164 | return ECGTextTypeface; 165 | } 166 | 167 | /** 168 | * 设置字体的Typeface 169 | * @param ECGTextTypeface 字体Typeface 170 | */ 171 | public void setECGTextTypeface(Typeface ECGTextTypeface) { 172 | this.ECGTextTypeface = ECGTextTypeface; 173 | } 174 | 175 | /** 176 | * 是否显示背景的横纵轴 177 | * @return true显示,false不显示 178 | */ 179 | public boolean isECGShowAxes() { 180 | return ECGShowAxes; 181 | } 182 | 183 | /** 184 | * 设置是否显示背景的横纵轴 185 | * @param ECGShowAxes true显示,false不显示 186 | */ 187 | public void setECGShowAxes(boolean ECGShowAxes) { 188 | this.ECGShowAxes = ECGShowAxes; 189 | } 190 | 191 | /** 192 | * 获取表格中数据的步进值 193 | * @return 步进值大小 194 | */ 195 | public int getECGLineStep() { 196 | return ECGLineStep; 197 | } 198 | 199 | /** 200 | * 设置表格中数据的步进值 201 | * 步进值越大,表格中数据绘制越快,绘制的质量越低 202 | * 步进值越小,表格中数据绘制越慢,绘制越精细 203 | * @param ECGLineStep 步进值,最小为1.最大为10 204 | */ 205 | public void setECGLineStep(int ECGLineStep) { 206 | if(ECGLineStep<1) ECGLineStep=1; 207 | if(ECGLineStep>10) ECGLineStep=10; 208 | this.ECGLineStep = ECGLineStep; 209 | } 210 | 211 | /** 212 | * 查询表格是否可以左右滑动加载数据 213 | * @return true可滑动加载,false不可滑动加载 214 | */ 215 | public boolean isECGScrollable() { 216 | return ECGScrollable; 217 | } 218 | 219 | /** 220 | * 设置表格左右滑动加载数据开关 221 | * @param ECGScrollable true可滑动加载数据,false不可滑动加载数据 222 | */ 223 | public void setECGScrollable(boolean ECGScrollable) { 224 | this.ECGScrollable = ECGScrollable; 225 | } 226 | 227 | /** 228 | * 是否显示表格的标题 229 | * @return true显示表格标题,false不显示表格标题 230 | */ 231 | public boolean isECGShowLabel() { 232 | return ECGShowLabel; 233 | } 234 | 235 | /** 236 | * 设置是否显示表格的标题 237 | * @param ECGShowLabel true显示表格标题,false不显示表格标题 238 | */ 239 | public void setECGShowLabel(boolean ECGShowLabel) { 240 | this.ECGShowLabel = ECGShowLabel; 241 | } 242 | } 243 | -------------------------------------------------------------------------------- /library/src/main/java/com/liuqingwei/library/electrocardiogram/ChartView.java: -------------------------------------------------------------------------------- 1 | package com.liuqingwei.library.electrocardiogram; 2 | 3 | import android.content.Context; 4 | import android.graphics.Canvas; 5 | import android.graphics.Color; 6 | import android.graphics.Paint; 7 | import android.graphics.Path; 8 | import android.graphics.Rect; 9 | import android.graphics.RectF; 10 | import android.util.AttributeSet; 11 | import android.util.Log; 12 | import android.view.MotionEvent; 13 | import android.view.View; 14 | import android.widget.Toast; 15 | 16 | /** 17 | * 图像绘制类 18 | * Created by Meteoral.Liu On MacOS 19 | * User: Meteoral 20 | * WebSite: http://www.liuqingwei.com 21 | * QQ: 120599662 22 | */ 23 | public class ChartView extends View{ 24 | 25 | /** 获取当前页的数据 */ 26 | public static final int GET_THIS_PAGE = 0; 27 | /** 获取上一页的数据 */ 28 | public static final int GET_PRE_PAGE = 1; 29 | /** 获取下一页的数据 */ 30 | public static final int GET_NEXT_PAGE = 2; 31 | /** 控件的宽 */ 32 | private int width; 33 | /** 控件的高 */ 34 | private int height; 35 | /** 渲染配置器 */ 36 | private Renderer render; 37 | /** 控件的Rect */ 38 | private Rect rect; 39 | /** 控件Context */ 40 | private Context con; 41 | /** 绘制路径 */ 42 | private Path path; 43 | /** 滑动事件横向坐标 */ 44 | private float eventX; 45 | /** 数据集 */ 46 | private float[] drawData; 47 | /** 数据集中是否存在数据 */ 48 | private boolean hasData; 49 | 50 | public ChartView(Context context) { 51 | super(context); 52 | con = context; 53 | render = new Renderer(); 54 | } 55 | public ChartView(Context context, AttributeSet attrs){ 56 | super(context,attrs); 57 | con = context; 58 | render = new Renderer(); 59 | } 60 | public ChartView(Context context,AttributeSet attrs, int defStyleAttr){ 61 | super(context,attrs,defStyleAttr); 62 | con = context; 63 | render = new Renderer(); 64 | } 65 | public ChartView(Context context, Renderer renderer) { 66 | super(context); 67 | con = context; 68 | render = renderer; 69 | } 70 | public void setRender(Renderer render) { 71 | this.render = render; 72 | } 73 | 74 | @Override 75 | public void onSizeChanged (int w, int h, int oldw, int oldh) { 76 | super.onSizeChanged(w, h, oldw, oldh); 77 | width = getMeasuredWidth(); 78 | height = getMeasuredHeight(); 79 | } 80 | @Override 81 | protected void onDraw(Canvas canvas) { 82 | super.onDraw(canvas); 83 | DrawBackgroud(canvas); 84 | if(drawData==null) { 85 | getDrawData(GET_THIS_PAGE); 86 | } 87 | if(hasData) { 88 | DrawChart(canvas); 89 | } 90 | } 91 | 92 | 93 | /** 94 | * 绘制心率图的背景 95 | * 整个屏幕表示6秒内的心电图 96 | * @param canvas 画布 97 | */ 98 | public void DrawBackgroud(Canvas canvas) 99 | { 100 | /* 创建背景色画笔 */ 101 | Paint background = new Paint(); 102 | background.setColor(render.getECGBackgroundColor());//设置心率图灰色背景 103 | Paint backP = new Paint(); 104 | backP.setColor(render.getECGAxesColor()); 105 | backP.setAlpha(100); 106 | rect = canvas.getClipBounds(); 107 | canvas.drawRect(0, 0, width, height, background); 108 | /* 是否绘制横纵轴 */ 109 | if(render.isECGShowAxes()) { 110 | /* 通常采用25mm/s纸速记录,1小格=1mm=0.04秒。纵坐标电压1小格=1mm=0.1mv 111 | * 心电图每小格40ms 一屏幕显示6秒的数据,则: 112 | * 6000/40 = 屏幕横向共150个小格 113 | * 150个小格平均分布在width宽上 114 | * 横纵grid的步距 */ 115 | final int gridStep = width / 150; 116 | /* 绘制竖向的红色grid */ 117 | for (int k = 0; k < width / gridStep; k++) { 118 | if (k % 5 == 0) {//每隔5个格子粗体显示 119 | backP.setStrokeWidth(2); 120 | canvas.drawLine(k * gridStep, 0, k * gridStep, height, backP); 121 | } else { 122 | backP.setStrokeWidth(1); 123 | canvas.drawLine(k * gridStep, 0, k * gridStep, height, backP); 124 | } 125 | } 126 | /* 绘制横向的红色grid */ 127 | for (int g = 0; g < height / gridStep; g++) { 128 | if (g % 5 == 0) { 129 | backP.setStrokeWidth(2); 130 | canvas.drawLine(0, g * gridStep, width, g * gridStep, backP); 131 | } else { 132 | backP.setStrokeWidth(1); 133 | canvas.drawLine(0, g * gridStep, width, g * gridStep, backP); 134 | } 135 | } 136 | } 137 | /* 是否绘制Label标签 */ 138 | if (render.isECGShowLabel()) { 139 | Paint labelPaint = new Paint(); 140 | labelPaint.setColor(render.getTextColor()); 141 | labelPaint.setTypeface(render.getECGTextTypeface()); 142 | labelPaint.setTextSize(render.getECGChartTextSize()); 143 | labelPaint.setTextAlign(Paint.Align.CENTER); 144 | canvas.drawText(render.getECGChartLabel(), width / 2, height - 10, labelPaint); 145 | } 146 | } 147 | 148 | /** 149 | * 绘制曲线 150 | * @param canvas 画布 151 | */ 152 | public void DrawChart(Canvas canvas) 153 | { 154 | Paint p = new Paint(); 155 | canvas.saveLayerAlpha(new RectF(rect), 0xFF, Canvas.MATRIX_SAVE_FLAG); 156 | p.setColor(Color.BLACK); 157 | p.setStrokeWidth(3); 158 | canvas.translate(0,height/2); // move to the center line of the canvas. 159 | canvas.drawLines(drawData,p); 160 | } 161 | 162 | public void DrawChartT(Canvas canvas){ 163 | Paint p = new Paint(); 164 | canvas.saveLayerAlpha(new RectF(rect), 0xFF, Canvas.MATRIX_SAVE_FLAG); 165 | p.setColor(Color.BLACK); 166 | p.setStrokeWidth(3); 167 | canvas.translate(0,height/2); // move to the center line of the canvas. 168 | canvas.drawLines(drawData,p); 169 | } 170 | 171 | /** 172 | * 发送请求得到Json类型的数据 173 | * @param dataType 获取方式(本页、上一页、下一页) 174 | * Date from https://archive.ics.uci.edu/ml/datasets/MHEALTH+Dataset 175 | * @return true有数据,false无数据 176 | */ 177 | public boolean getDrawData(int dataType) 178 | { 179 | int hz = 50; 180 | int totalData = hz * 6; 181 | float[] data = { -0.087912f,-0.10884f,-0.10047f,0.071167f,1.0633f,-0.07954f,-0.63632f,-0.28885f,-0.041863f,0.0083726f,0.083726f,0.10047f,0.16745f,0.23443f,0.3056f,0.35165f,0.427f,0.42282f,0.32234f,0.17582f,0.012559f,-0.050235f,-0.066981f,-0.092098f,-0.092098f,-0.092098f,-0.087912f,-0.07954f,-0.066981f,-0.075353f,-0.083726f,-0.096285f,-0.087912f,-0.087912f,-0.092098f,-0.10466f,-0.087912f,-0.087912f,-0.092098f,-0.087912f,-0.087912f,-0.07954f,-0.066981f,-0.075353f,-0.083726f,-0.096285f,0.020931f,-0.041863f,-0.062794f,-0.075353f,-0.092098f,-0.03349f,0.83307f,0.94192f,-0.61957f,-0.43119f,-0.046049f,0.041863f,0.16327f,0.15908f,0.2428f,0.31397f,0.41026f,0.49398f,0.59027f,0.59027f,0.50235f,0.30141f,0.13396f,0.016745f,-0.037677f,-0.041863f,-0.041863f,-0.03349f,-0.03349f,-0.025118f,-0.037677f,-0.03349f,-0.046049f,-0.025118f,-0.058608f,-0.058608f,-0.062794f,-0.058608f,-0.066981f,-0.062794f,-0.058608f,-0.083726f,-0.071167f,-0.066981f,-0.071167f,-0.071167f,-0.041863f,0f,-0.050235f,-0.07954f,-0.07954f,-0.062794f,0.11722f,0.99215f,0.012559f,-0.71586f,-0.33909f,-0.041863f,0.012559f,0.07954f,0.12977f,0.20094f,0.28885f,0.37258f,0.46886f,0.51073f,0.51073f,0.41026f,0.20931f,0.075353f,-0.016745f,-0.062794f,-0.075353f,-0.075353f,-0.071167f,-0.046049f,0.012559f,-0.058608f,-0.054422f,-0.050235f,-0.062794f,-0.066981f,-0.066981f,-0.066981f,-0.020931f,-0.054422f,-0.071167f,-0.075353f,-0.066981f,-0.075353f,-0.062794f,-0.037677f,-0.050235f,-0.041863f,0.0083726f,-0.029304f,-0.062794f,-0.07954f,-0.046049f,-0.016745f,0.9461f,0.75353f,-0.67818f,-0.41444f,-0.037677f,-0.0041863f,0.058608f,0.12559f,0.18001f,0.27211f,0.38095f,0.44375f,0.51073f,0.49817f,0.41444f,0.26374f,0.13815f,0.029304f,-0.025118f,-0.046049f,-0.058608f,-0.054422f,-0.03349f,-0.050235f,-0.041863f,-0.054422f,-0.062794f,-0.075353f,-0.075353f,-0.10884f,-0.075353f,-0.087912f,-0.087912f,-0.096285f,-0.087912f,-0.087912f,-0.10884f,-0.11303f,-0.10047f,-0.092098f,-0.10884f,-0.0083726f,-0.020931f,-0.07954f,-0.10466f,-0.11303f,-0.07954f,0.15489f,1.0215f,-0.3977f,-0.71167f,-0.32653f,-0.046049f,0.016745f,0.07954f,0.15489f,0.22187f,0.31397f,0.41026f,0.50654f,0.54003f,0.56934f,0.41444f,0.23443f,0.071167f,-0.012559f,-0.046049f,-0.066981f,-0.062794f,-0.062794f,-0.041863f,-0.050235f,-0.066981f,-0.071167f,-0.066981f,-0.096285f,-0.092098f,-0.092098f,-0.083726f,-0.083726f,-0.083726f,-0.07954f,-0.083726f,-0.087912f,-0.087912f,-0.087912f,-0.075353f,-0.066981f,-0.07954f,-0.0083726f,-0.0083726f,-0.07954f,-0.075353f,-0.092098f,-0.075353f,0.071167f,0.98796f,0.012559f,-0.7033f,-0.32653f,-0.041863f,0.020931f,0.087912f,0.12559f,0.19257f,0.25536f,0.3349f,0.43537f,0.44375f,0.46468f,0.3349f,0.17582f,0.03349f,-0.025118f,-0.054422f,-0.092098f,-0.083726f,-0.07954f,-0.037677f,-0.016745f,-0.03349f,-0.029304f,-0.037677f,-0.062794f,-0.041863f,-0.046049f,-0.029304f,-0.03349f,-0.020931f,-0.03349f,-0.012559f,-0.016745f,-0.020931f,-0.029304f,-0.029304f,-0.0083726f,-0.029304f,-0.03349f,-0.041863f,0.071167f,0.0083726f,-0.029304f,-0.046049f,-0.012559f,-0.0083726f,0.7033f,1.4401f,-0.41026f,-0.41863f,-0.12559f,0.012559f,0.071167f,0.1214f,0.1842f,0.27211f,0.34328f,0.43537f,0.51073f,0.5484f,0.53585f,0.38095f,0.20931f,0.071167f,0f,-0.020931f,-0.037677f,-0.03349f,-0.012559f,-0.025118f,-0.016745f,-0.0083726f,-0.037677f,-0.046049f,-0.071167f,-0.071167f,-0.066981f,-0.087912f,-0.087912f,-0.087912f,-0.10047f,-0.087912f,-0.096285f,-0.083726f,-0.07954f,-0.087912f,-0.087912f,0.029304f,-0.025118f,-0.071167f,-0.10884f,-0.10466f,-0.062794f,0.56934f,1.147f,-0.70748f,-0.60283f,-0.16745f,0.029304f,0.075353f,0.16327f,0.22187f,0.30141f,0.40188f,0.49817f,0.59445f,0.59445f,0.52747f,0.36839f,0.14233f,0.012559f,-0.037677f,-0.058608f,-0.062794f,-0.058608f,-0.025118f,-0.029304f,-0.025118f,-0.041863f,-0.037677f,-0.066981f,-0.066981f,-0.075353f,-0.062794f,-0.066981f,-0.087912f,-0.062794f,-0.10466f,-0.07954f,-0.071167f,-0.07954f,-0.066981f,-0.071167f,0.029304f,-0.012559f,-0.083726f,-0.062794f,-0.096285f,-0.066981f,0.28048f,1.0256f,-0.4898f,-0.66143f,-0.23443f,0.012559f,0.075353f,0.096285f,0.17582f,0.23862f,0.31816f,0.38932f,0.48561f,0.51491f,0.51073f,0.35583f,0.1842f,0.058608f,-0.029304f,-0.050235f,-0.041863f,-0.071167f,-0.062794f,-0.071167f,-0.054422f,-0.029304f,-0.062794f,-0.066981f,-0.083726f,-0.10047f,-0.087912f,-0.087912f,-0.062794f,-0.075353f,-0.087912f,-0.07954f,-0.092098f,-0.075353f,-0.062794f,-0.075353f,-0.054422f,0.0083726f,-0.050235f,-0.083726f,-0.10466f,-0.087912f,-0.025118f,0.89168f,0.26792f,-0.73679f,-0.40188f,-0.07954f,-0.012559f,0.046049f,0.11722f,0.15908f,0.23862f,0.32653f,0.3349f,0.38932f,0.38095f,0.32653f,0.18838f,0.066981f,-0.037677f,-0.037677f,-0.058608f,-0.071167f,-0.054422f,-0.03349f,-0.025118f,-0.037677f,-0.041863f,-0.037677f,-0.075353f,-0.083726f,-0.10047f,-0.10466f,-0.096285f,-0.096285f,-0.096285f,-0.07954f,-0.075353f,-0.071167f,-0.071167f,-0.092098f,-0.071167f,-0.016745f,-0.071167f,-0.07954f,-0.087912f,-0.07954f,0.0083726f,1.0424f,0.28048f,-0.56096f,-0.30141f,-0.037677f,0.0083726f,0.046049f,0.07954f,0.13815f,0.18838f,0.2428f,0.26374f,0.31397f,0.31397f,0.24699f,0.14652f,0.07954f,0f,-0.016745f,-0.037677f,-0.050235f,-0.041863f,-0.029304f,-0.046049f,-0.041863f,-0.041863f,-0.066981f,-0.058608f,-0.03349f,-0.071167f,-0.071167f,-0.071167f,-0.066981f,-0.058608f,-0.075353f,-0.07954f,-0.07954f,-0.066981f,-0.083726f,0.029304f,-0.020931f,-0.046049f,-0.083726f,-0.066981f,-0.03349f,0.89587f,1.0005f,-0.61957f,-0.42282f,-0.062794f,0.016745f,0.058608f,0.092098f,0.15908f,0.23862f,0.30979f,0.38095f,0.42282f,0.43537f,0.39351f,0.2428f,0.096285f,0.0041863f,-0.050235f,-0.071167f,-0.041863f,-0.071167f,-0.062794f,-0.071167f,-0.062794f,-0.087912f,-0.07954f,-0.092098f,-0.07954f,-0.10047f,-0.083726f,-0.07954f,-0.092098f,-0.087912f,-0.07954f,-0.075353f,-0.071167f,-0.050235f,0.0083726f,-0.041863f,-0.071167f,-0.092098f,-0.071167f,0.025118f,0.96285f,-0.020931f,-0.71586f,-0.34746f,-0.025118f,0.046049f,0.10466f,0.17582f,0.2763f,0.3056f,0.38514f,0.46468f,0.47305f,0.46049f,0.36002f,0.19676f,0.058608f,-0.025118f,-0.041863f,-0.054422f,-0.054422f,-0.041863f,-0.046049f,-0.037677f,-0.03349f,-0.046049f,-0.071167f,-0.083726f,-0.083726f,-0.087912f,-0.087912f,-0.083726f,-0.087912f,-0.037677f,-0.071167f,-0.071167f,-0.058608f,-0.10466f,0.03349f,-0.012559f,-0.066981f,-0.07954f,-0.087912f,-0.03349f,0.56096f,1.2224f,-0.55259f,-0.54003f,-0.15071f,-0.012559f,0.046049f,0.12559f,0.17582f,0.25955f,0.31816f,0.38932f,0.46049f,0.47305f,0.41863f,0.3056f,0.14233f,0.029304f,-0.016745f,-0.050235f,-0.050235f,-0.058608f,-0.054422f,-0.037677f,-0.046049f,-0.058608f,-0.07954f,-0.071167f,-0.066981f,-0.07954f,-0.058608f,-0.071167f,-0.066981f,-0.075353f,-0.075353f,-0.075353f,-0.071167f,-0.071167f,-0.054422f,-0.062794f,0.012559f,-0.037677f,-0.071167f,-0.075353f,-0.062794f,-0.012559f,0.93354f,0.55678f,-0.69492f,-0.3977f,-0.046049f,0.020931f,0.066981f,0.12977f,0.18838f,0.26792f,0.34746f,0.41026f,0.45631f,0.43537f,0.41863f,0.23862f,0.10047f,0.016745f,-0.03349f,-0.029304f,-0.041863f,-0.016745f,0f,-0.012559f,0.0041863f,-0.0083726f,-0.012559f,-0.016745f,-0.037677f,-0.037677f,-0.029304f,-0.037677f,-0.03349f,-0.03349f,-0.03349f,-0.029304f,-0.046049f,-0.041863f,-0.050235f,-0.03349f,0.037677f,-0.03349f,-0.050235f,-0.025118f,-0.046049f,0f,0.96285f,0.3977f,-0.68655f,-0.3977f,-0.016745f,0.029304f,0.071167f,0.12559f,0.18001f,0.26792f,0.34746f,0.43537f,0.50654f,0.51073f,0.42282f,0.24699f,0.07954f,-0.0041863f,-0.058608f,-0.092098f,-0.092098f,-0.071167f,-0.054422f,-0.050235f,-0.050235f,-0.058608f,-0.058608f,-0.071167f,-0.07954f,-0.07954f,-0.096285f,-0.083726f,-0.075353f,-0.083726f,-0.075353f,-0.075353f,-0.062794f,-0.07954f,-0.0083726f,0.0083726f,-0.058608f,-0.087912f,-0.066981f,-0.075353f,0.1214f,1.0089f,-0.3349f,-0.74935f,-0.29304f,-0.0083726f,0.054422f,0.10047f,0.17582f,0.27211f,0.33072f,0.41444f,0.48561f,0.48561f,0.43119f,0.3349f,0.16327f,0.050235f,-0.020931f,-0.050235f,-0.054422f,-0.058608f,-0.050235f,-0.050235f,-0.058608f,-0.046049f,-0.0041863f,-0.066981f,-0.054422f,-0.087912f,-0.071167f,-0.087912f,-0.087912f,-0.075353f,-0.07954f,-0.058608f,-0.054422f,-0.071167f,-0.062794f,-0.096285f,0f,-0.016745f,-0.071167f,-0.096285f,-0.075353f,-0.062794f,0.2135f,1.0842f,-0.37258f,-0.67399f,-0.24699f,0.012559f,0.071167f,0.11303f,0.17582f,0.23443f,0.33072f,0.44793f,0.50235f,0.57771f,0.56096f,0.42282f,0.21769f,0.050235f,-0.041863f,-0.083726f,-0.10047f,-0.096285f,-0.07954f,-0.083726f,-0.062794f,-0.087912f,-0.07954f,-0.092098f,-0.10466f,-0.10466f,-0.11303f,-0.10884f,-0.11303f,-0.13396f,-0.11722f,-0.10884f,-0.1214f,-0.096285f,-0.11303f,0.016745f,-0.03349f,-0.083726f,-0.10466f,-0.10466f,-0.087912f,0.49817f,1.0675f,-0.75353f,-0.66562f,-0.22606f,-0.025118f,0.041863f,0.07954f,0.17582f,0.27211f,0.34746f,0.45212f,0.52747f,0.58189f,0.5191f,0.31816f,0.12977f,0.029304f,-0.03349f,-0.054422f,-0.092098f,-0.062794f,-0.050235f,-0.050235f,-0.016745f,-0.03349f,-0.03349f,-0.054422f,-0.046049f,-0.041863f,-0.03349f,-0.037677f,-0.03349f,-0.046049f,-0.050235f,-0.041863f,-0.041863f,-0.03349f,-0.020931f,-0.020931f,0.0041863f,-0.025118f,0.087912f,0.020931f,0f,-0.029304f,-0.012559f,0.029304f,0.84563f,1.3187f,-0.60283f,-0.44375f,-0.025118f,0.092098f,0.13396f,0.19257f,0.24699f,0.34746f,0.43956f,0.56934f,0.60701f,0.62794f,0.59027f,0.3977f,0.20931f,0.083726f,0.0083726f,-0.016745f,-0.0083726f,-0.012559f,0f,0.0041863f,0.0041863f,-0.0083726f,-0.0083726f,0.0041863f,-0.029304f,-0.03349f,-0.03349f,-0.050235f,-0.050235f,-0.046049f,-0.046049f,-0.054422f,-0.058608f,-0.046049f,-0.037677f,-0.037677f,-0.054422f,0.046049f,-0.020931f,-0.046049f,-0.058608f,-0.050235f,-0.025118f,0.74097f,1.1219f,-0.72004f,-0.52747f,-0.050235f,0.03349f,0.087912f,0.16327f,0.22606f,0.29723f,0.40188f,0.48142f,0.55259f,0.56096f,0.47305f,0.29723f,0.10884f,-0.012559f,-0.054422f,-0.087912f,-0.096285f,-0.083726f,-0.092098f,-0.046049f,-0.058608f,-0.058608f,-0.041863f,-0.087912f,-0.083726f,-0.087912f,-0.083726f,-0.087912f,-0.087912f,-0.087912f,-0.083726f,-0.096285f,-0.083726f,-0.10466f,-0.096285f,-0.096285f,-0.10047f,-0.096285f,-0.075353f,-0.050235f,-0.07954f,0.046049f,0f,-0.041863f,-0.075353f,-0.058608f,-0.046049f,0.47305f,1.1722f,-0.52329f,-0.50654f,-0.13815f,0.025118f,0.10466f,0.11722f,0.18001f,0.2428f,0.3056f,0.3977f,0.46468f,0.4898f,0.46886f,0.35583f,0.20513f,0.087912f,0.016745f,-0.020931f,-0.03349f,-0.041863f,-0.016745f,-0.025118f,-0.0041863f,0.03349f,-0.0083726f,-0.0083726f,-0.012559f,-0.020931f,-0.029304f,-0.03349f,-0.041863f,-0.020931f,-0.029304f,-0.016745f,-0.012559f,-0.025118f,-0.025118f,-0.0041863f,-0.0041863f }; 182 | for(int i = 0;i width / 4) { 207 | getDrawData(GET_PRE_PAGE); 208 | if (hasData) { 209 | Toast.makeText(con, "上一页", Toast.LENGTH_SHORT).show(); 210 | } else { 211 | // setPage(getPage() + 1); 212 | } 213 | } else if (event.getX() - eventX > width / 4) { 214 | getDrawData(GET_NEXT_PAGE); 215 | if (hasData) { 216 | Toast.makeText(con, "下一页", Toast.LENGTH_SHORT).show(); 217 | } else { 218 | // setPage(getPage() - 1); 219 | } 220 | } 221 | break; 222 | } 223 | } 224 | return true; 225 | } 226 | 227 | } 228 | --------------------------------------------------------------------------------