Skip to content

Commit

Permalink
添加生命周期管理
Browse files Browse the repository at this point in the history
  • Loading branch information
longqingzhao committed Mar 15, 2019
1 parent 3aec48d commit b5fe1ad
Show file tree
Hide file tree
Showing 14 changed files with 92 additions and 233 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ app/libs/
/autosize
/electrocardiogram
/libDEMO4Oximeter_BLE
/app
132 changes: 0 additions & 132 deletions app/src/main/java/zlq/com/myapplication/ArrayQueue.java

This file was deleted.

9 changes: 5 additions & 4 deletions app/src/main/java/zlq/com/myapplication/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.zhaogege.ecgviewlibrary.ArrayQueue;
import com.zhaogege.ecgviewlibrary.ECGPathWaveView;

import java.util.Random;

public class MainActivity extends AppCompatActivity {
Expand All @@ -20,7 +23,7 @@ public class MainActivity extends AppCompatActivity {
final Runnable runnable = new Runnable() {
@Override
public void run() {
arrayQueue.pop( random.nextDouble() * 100);
arrayQueue.pop(random.nextDouble() * 100);
ecgScrollView.drawXLine();
handler.postDelayed(runnable, 10);
}
Expand All @@ -31,8 +34,6 @@ public void run() {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);


}

@Override
Expand All @@ -45,8 +46,8 @@ protected void onResume() {
ecgScrollView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
handler.removeCallbacks(null);
handler.postDelayed(runnable, 20);
handler.post(runnable);
/* for (int i = 0; i < 50; i++) {
arrayQueue.pop(i * xj);
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
android:layout_height="match_parent"
tools:context=".MainActivity">

<zlq.com.myapplication.ECGPathWaveView
<com.zhaogege.ecgviewlibrary.ECGPathWaveView
android:id="@+id/ecg_view"
android:layout_width="0dp"
android:layout_height="0dp"
Expand Down
21 changes: 0 additions & 21 deletions app/src/main/res/values/attrs.xml

This file was deleted.

1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<resources>
<string name="app_name">My Application</string>
<string name="button">Button</string>
</resources>
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ buildscript {
repositories {
google()
jcenter()

}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
Expand All @@ -18,7 +17,7 @@ allprojects {
repositories {
google()
jcenter()

maven { url 'https://jitpack.io' }
}
}

Expand Down
8 changes: 0 additions & 8 deletions ecgviewlibrary/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ android {
targetSdkVersion 28
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}

buildTypes {
Expand All @@ -22,9 +19,4 @@ android {
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package zlq.com.myapplication;
package com.zhaogege.ecgviewlibrary;

import android.util.Log;

Expand Down Expand Up @@ -84,6 +84,13 @@ private void selectEnd() {
}
}

public void clear() {
addLength = 0;
cursor = -1;
end = 0;
start = 0;
}


/**
* 查询
Expand Down
Loading

0 comments on commit b5fe1ad

Please sign in to comment.