├── .classpath ├── .project ├── .settings └── org.eclipse.jdt.core.prefs ├── AndroidManifest.xml ├── README.md ├── bin ├── AndroidManifest.xml ├── MIRing.apk ├── classes.dex ├── dexedLibs │ └── android-support-v4-8baefda25e8776be85b27172f037f89f.jar ├── res │ └── crunch │ │ ├── drawable-hdpi │ │ └── ic_launcher.png │ │ ├── drawable-mdpi │ │ └── ic_launcher.png │ │ ├── drawable-xhdpi │ │ ├── btn_dynamic_detail_prev_disabled.png │ │ ├── ic_grey_heart.png │ │ ├── ic_indicator_prev.png │ │ ├── ic_indicator_prev_light_2.png │ │ ├── ic_launcher.png │ │ ├── run_heart_icon.png │ │ └── run_popup_heart.png │ │ └── drawable-xxhdpi │ │ └── ic_launcher.png └── resources.ap_ ├── ic_launcher-web.png ├── libs └── android-support-v4.jar ├── proguard-project.txt ├── project.properties ├── res ├── drawable-hdpi │ └── ic_launcher.png ├── drawable-mdpi │ └── ic_launcher.png ├── drawable-xhdpi │ ├── btn_dynamic_detail_prev_disabled.png │ ├── ic_grey_heart.png │ ├── ic_indicator_prev.png │ ├── ic_indicator_prev_light_2.png │ ├── ic_launcher.png │ ├── run_heart_icon.png │ └── run_popup_heart.png ├── drawable-xxhdpi │ └── ic_launcher.png ├── drawable │ ├── btn_gray_corner.xml │ ├── btn_translucent_corner.xml │ └── selector_btn_bg.xml ├── layout │ └── activity_main.xml ├── menu │ └── main.xml └── values │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml └── src └── com └── xd └── miring ├── MainActivity.java └── RingView.java /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | MIRing 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 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 3 | org.eclipse.jdt.core.compiler.compliance=1.6 4 | org.eclipse.jdt.core.compiler.source=1.6 5 | -------------------------------------------------------------------------------- /AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 模拟小米手环 心率检测动画实现 2 | ==== 3 | 4 | 用正弦曲线模拟心率图

5 | 用`canvas.drawPath` 代替 `canvas.drawPoint` 提升性能 6 | 7 | 效果图如下
8 | 9 | 10 | ![心率动画](http://img2.tbcdn.cn/L1/461/1/e6a8a77db9e846c0ae0b9a4b980156fde5a40e05.gif) 11 | -------------------------------------------------------------------------------- /bin/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /bin/MIRing.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/bin/MIRing.apk -------------------------------------------------------------------------------- /bin/classes.dex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/bin/classes.dex -------------------------------------------------------------------------------- /bin/dexedLibs/android-support-v4-8baefda25e8776be85b27172f037f89f.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/bin/dexedLibs/android-support-v4-8baefda25e8776be85b27172f037f89f.jar -------------------------------------------------------------------------------- /bin/res/crunch/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/bin/res/crunch/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/res/crunch/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/bin/res/crunch/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/res/crunch/drawable-xhdpi/btn_dynamic_detail_prev_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/bin/res/crunch/drawable-xhdpi/btn_dynamic_detail_prev_disabled.png -------------------------------------------------------------------------------- /bin/res/crunch/drawable-xhdpi/ic_grey_heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/bin/res/crunch/drawable-xhdpi/ic_grey_heart.png -------------------------------------------------------------------------------- /bin/res/crunch/drawable-xhdpi/ic_indicator_prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/bin/res/crunch/drawable-xhdpi/ic_indicator_prev.png -------------------------------------------------------------------------------- /bin/res/crunch/drawable-xhdpi/ic_indicator_prev_light_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/bin/res/crunch/drawable-xhdpi/ic_indicator_prev_light_2.png -------------------------------------------------------------------------------- /bin/res/crunch/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/bin/res/crunch/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/res/crunch/drawable-xhdpi/run_heart_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/bin/res/crunch/drawable-xhdpi/run_heart_icon.png -------------------------------------------------------------------------------- /bin/res/crunch/drawable-xhdpi/run_popup_heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/bin/res/crunch/drawable-xhdpi/run_popup_heart.png -------------------------------------------------------------------------------- /bin/res/crunch/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/bin/res/crunch/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/resources.ap_: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/bin/resources.ap_ -------------------------------------------------------------------------------- /ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/ic_launcher-web.png -------------------------------------------------------------------------------- /libs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/libs/android-support-v4.jar -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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-22 15 | -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/btn_dynamic_detail_prev_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/res/drawable-xhdpi/btn_dynamic_detail_prev_disabled.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_grey_heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/res/drawable-xhdpi/ic_grey_heart.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_indicator_prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/res/drawable-xhdpi/ic_indicator_prev.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_indicator_prev_light_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/res/drawable-xhdpi/ic_indicator_prev_light_2.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/run_heart_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/res/drawable-xhdpi/run_heart_icon.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/run_popup_heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/res/drawable-xhdpi/run_popup_heart.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable/btn_gray_corner.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /res/drawable/btn_translucent_corner.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /res/drawable/selector_btn_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 14 | 19 | 20 | 28 | 29 | 30 | 34 | 35 | 41 | 42 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #D95238 5 | #333333 6 | #666666 7 | #999999 8 | 9 | #E48674 10 | #E48674 11 | 12 | #10000000 13 | 14 | #FFFFFF 15 | #EAAD7E 16 | 17 | -------------------------------------------------------------------------------- /res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 16dp 6 | 7 | 8 | -------------------------------------------------------------------------------- /res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | MIRing 5 | Hello world! 6 | Settings 7 | 8 | 9 | -------------------------------------------------------------------------------- /res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/com/xd/miring/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.xd.miring; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | import android.view.View.OnClickListener; 7 | /** 8 | * create by feijie.xfj 9 | * 2015-11-22 10 | * */ 11 | public class MainActivity extends Activity { 12 | 13 | RingView mringView; 14 | @Override 15 | protected void onCreate(Bundle savedInstanceState) { 16 | super.onCreate(savedInstanceState); 17 | setContentView(R.layout.activity_main); 18 | mringView =(RingView) findViewById(R.id.ringView); 19 | findViewById(R.id.startHeartBeatTest).setOnClickListener(new OnClickListener() { 20 | @Override 21 | public void onClick(View v) { 22 | mringView.startAnim(); 23 | } 24 | }); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/com/xd/miring/RingView.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xueerfei/MIRing/950652640ca6d34ebf891e2d8027c1f0a186d8dd/src/com/xd/miring/RingView.java --------------------------------------------------------------------------------