heart rate
This commit is contained in:
@@ -67,8 +67,8 @@ public class OldPeopleMainActivity extends BaseActivity {
|
||||
private String curHeartRate;
|
||||
private String[] heartRates = new String[6];
|
||||
private String sleepType;
|
||||
private String bloodPressureShrink;
|
||||
private String bloodPressureDiastole;
|
||||
private String bloodPressureShrink = "0";
|
||||
private String bloodPressureDiastole = "0";
|
||||
private String oxygen;
|
||||
|
||||
private BottomNavigationView.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener;
|
||||
@@ -418,9 +418,7 @@ public class OldPeopleMainActivity extends BaseActivity {
|
||||
public void onReceiveSensorData(int arg0, int arg1, int arg2, int arg3,
|
||||
int arg4) throws RemoteException {
|
||||
LogUtils.logd("onReceiveSensorData" + "result:" + arg0 + " , " + arg1 + " , " + arg2 + " , " + arg3 + " , " + arg4);
|
||||
if (arg2 != 0) {
|
||||
LogUtils.shortToast("测量成功");
|
||||
}
|
||||
|
||||
curHeartRate = arg0 + "";
|
||||
bloodPressureShrink = arg1 + "";
|
||||
bloodPressureDiastole = arg2 + "";
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.os.Handler;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.github.mikephil.charting.charts.LineChart;
|
||||
@@ -13,6 +14,7 @@ import com.scorpiomiku.oldpeoplehome.R;
|
||||
import com.scorpiomiku.oldpeoplehome.base.BaseFragment;
|
||||
import com.scorpiomiku.oldpeoplehome.modules.oldpeople.activity.OldPeopleMainActivity;
|
||||
import com.scorpiomiku.oldpeoplehome.utils.ChartUtils;
|
||||
import com.scorpiomiku.oldpeoplehome.utils.LogUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -42,7 +44,9 @@ public class HeartRateFragment extends BaseFragment {
|
||||
TextView systolic;
|
||||
@BindView(R.id.oxy)
|
||||
TextView oxy;
|
||||
|
||||
@BindView(R.id.progress_bar)
|
||||
RelativeLayout progressBar;
|
||||
private Boolean loading = false;
|
||||
|
||||
@Override
|
||||
protected Handler initHandle() {
|
||||
@@ -111,9 +115,20 @@ public class HeartRateFragment extends BaseFragment {
|
||||
* @param heart
|
||||
*/
|
||||
public void changeText(String heart, String systolic, String diastolic, String oxy) {
|
||||
// LogUtils.loge(this.systolic.getText().toString() + ";" + systolic + ";" + (systolic.equals(this.systolic.getText().toString())));
|
||||
if (systolic.equals(this.systolic.getText().toString())) {
|
||||
if (!loading) {
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
loading = false;
|
||||
progressBar.setVisibility(View.GONE);
|
||||
}
|
||||
heartRateText.setText(heart);
|
||||
this.diastolic.setText(diastolic);
|
||||
this.systolic.setText(systolic);
|
||||
this.oxy.setText(oxy);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,322 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:background="@color/heart_rate_bg"
|
||||
app:contentInsetStart="0dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="2019-8-18"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</android.support.v7.widget.Toolbar>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/heart_rate_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:layout_gravity="center">
|
||||
|
||||
<me.itangqi.waveloadingview.WaveLoadingView
|
||||
android:id="@+id/waveLoadingView"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:layout_gravity="center"
|
||||
app:wlv_borderColor="#e155ab"
|
||||
app:wlv_borderWidth="8dp"
|
||||
app:wlv_progressValue="0"
|
||||
app:wlv_round_rectangle="true"
|
||||
app:wlv_shapeType="circle"
|
||||
app:wlv_titleCenter=""
|
||||
app:wlv_titleCenterColor="@android:color/white"
|
||||
app:wlv_titleCenterSize="15sp"
|
||||
app:wlv_titleCenterStrokeColor="#d4409b"
|
||||
app:wlv_titleCenterStrokeWidth="3dp"
|
||||
app:wlv_triangle_direction="north"
|
||||
app:wlv_waveAmplitude="70"
|
||||
app:wlv_waveColor="#ba2983" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="140dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:src="@drawable/ic_heart" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/heart_rate_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="00:00"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="30sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="BPM"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginTop="10dp"
|
||||
app:cardCornerRadius="12.5dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white_text"
|
||||
android:orientation="vertical"
|
||||
android:padding="1dp">
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:cardCornerRadius="12dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/begin"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/heart_rate_bg"
|
||||
android:gravity="center"
|
||||
android:text="开始"
|
||||
android:textColor="@color/white_text"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.2"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_margin="10dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:src="@drawable/ic_bloodpressure" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="血压(收缩压)"
|
||||
android:textColor="@color/heart_rate_bg"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/diastolic"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
android:textColor="#c42e8a"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:gravity="center"
|
||||
android:text="mmHg"
|
||||
android:textColor="@color/heart_rate_bg"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_margin="10dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:src="@drawable/ic_bloodpressure" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="血压(舒张压)"
|
||||
android:textColor="@color/heart_rate_bg"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/systolic"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
android:textColor="#c42e8a"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:gravity="center"
|
||||
android:text="mmHg"
|
||||
android:textColor="@color/heart_rate_bg"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_margin="10dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:src="@drawable/ic_oxy" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="血氧"
|
||||
android:textColor="@color/heart_rate_bg"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/oxy"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
android:textColor="#c42e8a"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:gravity="center"
|
||||
android:text="HbO2"
|
||||
android:textColor="@color/heart_rate_bg"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.2"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.github.mikephil.charting.charts.LineChart
|
||||
android:id="@+id/chart"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
</com.github.mikephil.charting.charts.LineChart>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/progress_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="0.9"
|
||||
android:background="@color/place_holder"
|
||||
android:visibility="invisible">
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:indeterminateTintMode="src_atop"
|
||||
android:indeterminateTint="@color/environment_bg" />
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -305,4 +305,16 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ProgressBar
|
||||
|
||||
android:id="@+id/progress_bar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:alpha="0.6"
|
||||
android:indeterminateTint="@color/environment_bg"
|
||||
android:indeterminateTintMode="src_atop"
|
||||
tools:ignore="UnusedAttribute" />
|
||||
<!--</RelativeLayout>-->
|
||||
</RelativeLayout>
|
||||
Reference in New Issue
Block a user