├── README.md
├── ECGDemo
├── ic_launcher-web.png
├── libs
│ └── android-support-v4.jar
├── .settings
│ └── org.eclipse.core.resources.prefs
├── res
│ ├── drawable-hdpi
│ │ └── ic_launcher.png
│ ├── drawable-mdpi
│ │ └── ic_launcher.png
│ ├── drawable-xhdpi
│ │ └── ic_launcher.png
│ ├── drawable-xxhdpi
│ │ └── ic_launcher.png
│ ├── values
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ ├── attrs.xml
│ │ └── styles.xml
│ ├── values-v11
│ │ └── styles.xml
│ ├── menu
│ │ └── main.xml
│ ├── values-w820dp
│ │ └── dimens.xml
│ ├── values-v14
│ │ └── styles.xml
│ └── layout
│ │ ├── activity_main.xml
│ │ └── fragment_main.xml
├── src
│ └── com
│ │ └── mao
│ │ └── ECG
│ │ ├── MainActivity.java
│ │ └── ECGView.java
├── .classpath
├── project.properties
├── proguard-project.txt
├── .project
└── AndroidManifest.xml
└── .gitignore
/README.md:
--------------------------------------------------------------------------------
1 | # ECGView
2 | 心电图 electrocardiogram view
3 |
--------------------------------------------------------------------------------
/ECGDemo/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/idmaoning/ECGView/HEAD/ECGDemo/ic_launcher-web.png
--------------------------------------------------------------------------------
/ECGDemo/libs/android-support-v4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/idmaoning/ECGView/HEAD/ECGDemo/libs/android-support-v4.jar
--------------------------------------------------------------------------------
/ECGDemo/.settings/org.eclipse.core.resources.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | encoding//src/com/mao/ECG/ECGView.java=UTF-8
3 |
--------------------------------------------------------------------------------
/ECGDemo/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/idmaoning/ECGView/HEAD/ECGDemo/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ECGDemo/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/idmaoning/ECGView/HEAD/ECGDemo/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ECGDemo/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/idmaoning/ECGView/HEAD/ECGDemo/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ECGDemo/src/com/mao/ECG/MainActivity.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/idmaoning/ECGView/HEAD/ECGDemo/src/com/mao/ECG/MainActivity.java
--------------------------------------------------------------------------------
/ECGDemo/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/idmaoning/ECGView/HEAD/ECGDemo/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ECGDemo/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 16dp
5 | 16dp
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ECGDemo/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CardioTest
5 | Hello world!
6 | Settings
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ECGDemo/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/ECGDemo/res/menu/main.xml:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/ECGDemo/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 | 64dp
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ECGDemo/res/values-v14/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/ECGDemo/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/ECGDemo/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Built application files
2 | *.apk
3 | *.ap_
4 |
5 | # Files for the Dalvik VM
6 | *.dex
7 |
8 | # Java class files
9 | *.class
10 |
11 | # Generated files
12 | bin/
13 | gen/
14 |
15 | # Gradle files
16 | .gradle/
17 | build/
18 |
19 | # Local configuration file (sdk path, etc)
20 | local.properties
21 |
22 | # Proguard folder generated by Eclipse
23 | proguard/
24 |
25 | # Log Files
26 | *.log
27 |
28 | # Android Studio Navigation editor temp files
29 | .navigation/
30 |
31 | # Android Studio captures folder
32 | captures/
33 |
--------------------------------------------------------------------------------
/ECGDemo/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-19
15 | android.library.reference.1=../appcompat_v7
16 |
--------------------------------------------------------------------------------
/ECGDemo/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
8 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/ECGDemo/res/layout/fragment_main.xml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/ECGDemo/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
14 |
15 |
16 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/ECGDemo/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/ECGDemo/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | ELGDemo
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/ECGDemo/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
16 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/ECGDemo/src/com/mao/ECG/ECGView.java:
--------------------------------------------------------------------------------
1 | package com.mao.ECG;
2 |
3 | import java.util.ArrayList;
4 | import java.util.HashMap;
5 | import java.util.List;
6 | import java.util.Map;
7 | import android.content.Context;
8 | import android.content.res.TypedArray;
9 | import android.graphics.Canvas;
10 | import android.graphics.Color;
11 | import android.graphics.Paint;
12 | import android.graphics.PaintFlagsDrawFilter;
13 | import android.os.Handler;
14 | import android.os.Looper;
15 | import android.text.TextPaint;
16 | import android.util.AttributeSet;
17 | import android.view.View;
18 | import android.widget.Toast;
19 |
20 | /**
21 | * @author maoning 2016/4/12
22 | */
23 | public class ECGView extends View {
24 | private final static String X_KEY = "Xpos";
25 | private final static String Y_KEY = "Ypos";
26 | private final static int LOW_ALARM = 0;
27 | private final static int HIGH_ALARM = 1;
28 | private int _backLineColor;
29 | private int _titleColor;
30 | private int _pointerLineColor;
31 | private int _titleSize;
32 | private int _XYTextSize;
33 | // 屏幕上的数量
34 | private int _PointMaxAmount;
35 | private float _XUnitLength;
36 | // 当前加入点
37 | private int _CurP = 0;
38 | private int _RemovedPointNum = 0;
39 | private int _EveryNPointBold = 1;
40 | // 是否是第第一次加载背景
41 | private Boolean _isfristDrawBackGround = true;
42 | // 上下左右缩进
43 | private int _LeftIndent = 100;
44 | private int _RightIndent = 100;
45 | private int _BottomIndent = 100;
46 | private int _TopIndent = 100;
47 | private float _CurX = _LeftIndent + 4;
48 | private float _CurY = _TopIndent;
49 | // 设置每_EveryNPointRefresh个点刷新电图
50 | private int _EveryNPointRefresh = 1;
51 | private float _MaxYNumber;
52 | private int _Height;
53 | private int _Width;
54 | private float _EffectiveHeight = 1;// 有效高度
55 | private float _EffectiveWidth = 1;// 有效宽度
56 | private float _EveryOneValue = 1;// 每个格子的�?
57 | private int _LatticeWidth = 1;
58 | private List