body information ⭐
This commit is contained in:
@@ -4,7 +4,6 @@ import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
@@ -13,20 +12,21 @@ import android.os.RemoteException;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.akexorcist.roundcornerprogressbar.IconRoundCornerProgressBar;
|
||||
import com.akexorcist.roundcornerprogressbar.RoundCornerProgressBar;
|
||||
import com.example.ninefourone.nutritionmaster.R;
|
||||
import com.example.ninefourone.nutritionmaster.base.BaseFragment;
|
||||
import com.example.ninefourone.nutritionmaster.utils.ChartDrawer;
|
||||
import com.github.mikephil.charting.charts.LineChart;
|
||||
import com.github.mikephil.charting.data.Entry;
|
||||
import com.today.step.lib.ISportStepInterface;
|
||||
import com.today.step.lib.TodayStepManager;
|
||||
import com.today.step.lib.TodayStepService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.OnClick;
|
||||
import butterknife.Unbinder;
|
||||
import me.itangqi.waveloadingview.WaveLoadingView;
|
||||
|
||||
@@ -42,6 +42,10 @@ public class BodyInformationFragment extends BaseFragment {
|
||||
TextView stepTextView;
|
||||
@BindView(R.id.waveLoadingView)
|
||||
WaveLoadingView waveLoadingView;
|
||||
@BindView(R.id.weight_line_chart)
|
||||
LineChart weightLineChart;
|
||||
@BindView(R.id.step_line_chart)
|
||||
LineChart stepLineChart;
|
||||
|
||||
private int stepCount = 0;
|
||||
private static final int REFRESH_STEP_WHAT = 0;
|
||||
@@ -62,6 +66,7 @@ public class BodyInformationFragment extends BaseFragment {
|
||||
@Override
|
||||
public void initView(Bundle state) {
|
||||
initStepCounter();
|
||||
initChart();
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +120,7 @@ public class BodyInformationFragment extends BaseFragment {
|
||||
* 改变记步UI中的数字
|
||||
*/
|
||||
private void updateStepCount() {
|
||||
stepTextView.setText(stepCount + "步");
|
||||
stepTextView.setText(stepCount + "");
|
||||
}
|
||||
|
||||
|
||||
@@ -149,4 +154,24 @@ public class BodyInformationFragment extends BaseFragment {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 初始化表格
|
||||
*/
|
||||
private void initChart() {
|
||||
ArrayList<Entry> weightPointValues = new ArrayList<>();
|
||||
for (int i = 1; i < 15; i++) {
|
||||
int y = (int) (Math.random() * 20);
|
||||
weightPointValues.add(new Entry(i, y));
|
||||
}
|
||||
ChartDrawer.initSingleLineChart(weightLineChart, weightPointValues, "体重");
|
||||
|
||||
ArrayList<Entry> stepPointValues = new ArrayList<>();
|
||||
for (int i = 1; i < 15; i++) {
|
||||
int y = (int) (Math.random() * 20);
|
||||
stepPointValues.add(new Entry(i, y));
|
||||
}
|
||||
ChartDrawer.initSingleLineChart(stepLineChart, stepPointValues, "步数");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,15 +1,26 @@
|
||||
package com.example.ninefourone.nutritionmaster.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
|
||||
import com.example.ninefourone.nutritionmaster.R;
|
||||
import com.github.mikephil.charting.animation.Easing;
|
||||
import com.github.mikephil.charting.charts.LineChart;
|
||||
import com.github.mikephil.charting.components.AxisBase;
|
||||
import com.github.mikephil.charting.components.Description;
|
||||
import com.github.mikephil.charting.components.Legend;
|
||||
import com.github.mikephil.charting.components.XAxis;
|
||||
import com.github.mikephil.charting.components.YAxis;
|
||||
import com.github.mikephil.charting.data.Entry;
|
||||
import com.github.mikephil.charting.data.LineData;
|
||||
import com.github.mikephil.charting.data.LineDataSet;
|
||||
import com.github.mikephil.charting.formatter.IAxisValueFormatter;
|
||||
import com.github.mikephil.charting.formatter.IndexAxisValueFormatter;
|
||||
import com.github.mikephil.charting.interfaces.datasets.ILineDataSet;
|
||||
import com.orhanobut.logger.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by ScorpioMiku on 2018/8/30.
|
||||
@@ -19,33 +30,174 @@ public class ChartDrawer {
|
||||
|
||||
/**
|
||||
* 创建一条折线
|
||||
*
|
||||
* @param index
|
||||
* @param datas
|
||||
* @param linename
|
||||
* @return
|
||||
*/
|
||||
public LineData initSingleLineChart(String[] index, float[] datas, String linename) {
|
||||
if (index.length != datas.length) {
|
||||
MessageUtils.MakeToast("index长度与datas长度不符");
|
||||
return null;
|
||||
} else {
|
||||
ArrayList<String> xValues = new ArrayList<>();
|
||||
for (int i = 0; i < datas.length; i++) {
|
||||
xValues.add(index[i] + "");
|
||||
}
|
||||
ArrayList<Entry> yValues = new ArrayList<>();
|
||||
for (int i = 0; i < datas.length; i++) {
|
||||
yValues.add(new Entry(datas[i], i));
|
||||
}
|
||||
LineDataSet dataSet = new LineDataSet(yValues, linename);
|
||||
dataSet.setLineWidth(1.75f);
|
||||
dataSet.setColor(R.color.colorPrimary);
|
||||
public static void initSingleLineChart(LineChart mLineChart, ArrayList<Entry> pointValues, String linename) {
|
||||
// if (index.length != datas.length) {
|
||||
// MessageUtils.MakeToast("index长度与datas长度不符");
|
||||
// Logger.d("长度不符");
|
||||
// return;
|
||||
// } else {
|
||||
// ArrayList<String> xValues = new ArrayList<>();
|
||||
// for (int i = 0; i < datas.length; i++) {
|
||||
// xValues.add(index[i] + "");
|
||||
// }
|
||||
// ArrayList<Entry> pointValues = new ArrayList<>();
|
||||
// for (int i = 0; i < datas.length; i++) {
|
||||
// pointValues.add(new Entry(datas[i], i));
|
||||
// }
|
||||
// LineDataSet dataSet = new LineDataSet(pointValues, linename);
|
||||
// dataSet.setLineWidth(1.75f);
|
||||
// dataSet.setColor(R.color.colorPrimary);
|
||||
//
|
||||
// ArrayList<ILineDataSet> dataSetArrayList = new ArrayList<>();
|
||||
// dataSetArrayList.add(dataSet);
|
||||
//
|
||||
// LineData lineData = new LineData(dataSetArrayList);
|
||||
|
||||
ArrayList<ILineDataSet> dataSetArrayList = new ArrayList<>();
|
||||
dataSetArrayList.add(dataSet);
|
||||
//表格属性
|
||||
// lineChart.setDrawBorders(false);
|
||||
// lineChart.setDrawGridBackground(false); //表格颜色
|
||||
// lineChart.setGridBackgroundColor(Color.GRAY & 0x70FFFFFF); //表格的颜色,设置一个透明度
|
||||
// lineChart.setTouchEnabled(true); //可点击
|
||||
// lineChart.setDragEnabled(true); //可拖拽
|
||||
// lineChart.setScaleEnabled(true); //可缩放
|
||||
// lineChart.setPinchZoom(false);
|
||||
// lineChart.setBackgroundColor(Color.WHITE); //设置背景颜色
|
||||
//
|
||||
// lineChart.setData(lineData);
|
||||
//
|
||||
// Legend mLegend = lineChart.getLegend(); //设置标示,就是那个一组y的value的
|
||||
// mLegend.setForm(Legend.LegendForm.SQUARE); //样式
|
||||
// mLegend.setFormSize(6f); //字体
|
||||
// mLegend.setTextColor(Color.GRAY); //颜色
|
||||
// lineChart.setVisibleXRange(0, 4); //x轴可显示的坐标范围
|
||||
// XAxis xAxis = lineChart.getXAxis(); //x轴的标示
|
||||
// xAxis.setPosition(XAxis.XAxisPosition.BOTTOM); //x轴位置
|
||||
// xAxis.setTextColor(Color.GRAY); //字体的颜色
|
||||
// xAxis.setTextSize(10f); //字体大小
|
||||
// xAxis.setGridColor(Color.GRAY);//网格线颜色
|
||||
// xAxis.setDrawGridLines(false); //不显示网格线
|
||||
// YAxis axisLeft = lineChart.getAxisLeft(); //y轴左边标示
|
||||
// YAxis axisRight = lineChart.getAxisRight(); //y轴右边标示
|
||||
// axisLeft.setTextColor(Color.GRAY); //字体颜色
|
||||
// axisLeft.setTextSize(10f); //字体大小
|
||||
// //axisLeft.setAxisMaxValue(800f); //最大值
|
||||
// axisLeft.setLabelCount(5, true); //显示格数
|
||||
// axisLeft.setGridColor(Color.GRAY); //网格线颜色
|
||||
//
|
||||
// axisRight.setDrawAxisLine(false);
|
||||
// axisRight.setDrawGridLines(false);
|
||||
// axisRight.setDrawLabels(false);
|
||||
//
|
||||
// //设置动画效果
|
||||
// lineChart.animateY(2000, Easing.EasingOption.Linear);
|
||||
// lineChart.animateX(2000, Easing.EasingOption.Linear);
|
||||
// lineChart.invalidate();
|
||||
mLineChart.setNoDataText("没有数据喔~~");
|
||||
//设置是否绘制chart边框的线
|
||||
mLineChart.setDrawBorders(true);
|
||||
//设置chart边框线颜色
|
||||
mLineChart.setBorderColor(Color.GRAY);
|
||||
//设置chart边框线宽度
|
||||
mLineChart.setBorderWidth(1f);
|
||||
//设置chart是否可以触摸
|
||||
mLineChart.setTouchEnabled(true);
|
||||
//设置是否可以拖拽
|
||||
mLineChart.setDragEnabled(true);
|
||||
//设置是否可以缩放 x和y,默认true
|
||||
mLineChart.setScaleEnabled(false);
|
||||
//设置是否可以通过双击屏幕放大图表。默认是true
|
||||
mLineChart.setDoubleTapToZoomEnabled(false);
|
||||
//设置chart动画
|
||||
mLineChart.animateXY(1000, 1000);
|
||||
|
||||
LineData lineData = new LineData(dataSetArrayList);
|
||||
return lineData;
|
||||
//=========================设置图例=========================
|
||||
// 像"□ xxx"就是图例
|
||||
Legend legend = mLineChart.getLegend();
|
||||
legend.setEnabled(false);
|
||||
|
||||
|
||||
//=======================设置X轴显示效果==================
|
||||
XAxis xAxis = mLineChart.getXAxis();
|
||||
//是否启用X轴
|
||||
xAxis.setEnabled(true);
|
||||
//是否绘制X轴线
|
||||
xAxis.setDrawAxisLine(true);
|
||||
//设置X轴上每个竖线是否显示
|
||||
xAxis.setDrawGridLines(true);
|
||||
//设置是否绘制X轴上的对应值(标签)
|
||||
xAxis.setDrawLabels(true);
|
||||
//设置X轴显示位置
|
||||
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
|
||||
//设置竖线为虚线样式
|
||||
// xAxis.enableGridDashedLine(10f, 10f, 0f);
|
||||
//设置x轴标签数
|
||||
xAxis.setLabelCount(8,false);
|
||||
xAxis.setTextSize(5);
|
||||
//图表第一个和最后一个label数据不超出左边和右边的Y轴
|
||||
// xAxis.setAvoidFirstLastClipping(true);
|
||||
xAxis.setDrawGridLines(false);//设置x轴上每个点对应的线
|
||||
|
||||
//修改横轴
|
||||
//准备好每个点对应的x轴数值
|
||||
List<String> list = new ArrayList<>();
|
||||
for (int i = 0; i < pointValues.size(); i++) {
|
||||
list.add(String.valueOf(i+1).concat("号"));
|
||||
}
|
||||
xAxis.setValueFormatter(new IndexAxisValueFormatter(list));
|
||||
|
||||
|
||||
YAxis rightAxis = mLineChart.getAxisRight();
|
||||
rightAxis.setDrawAxisLine(false);
|
||||
rightAxis.setDrawGridLines(false);
|
||||
rightAxis.setEnabled(false);
|
||||
YAxis leftAxis = mLineChart.getAxisLeft();
|
||||
leftAxis.setEnabled(false);
|
||||
leftAxis.setDrawAxisLine(false);
|
||||
|
||||
//点构成的某条线
|
||||
LineDataSet lineDataSet = new LineDataSet(pointValues, "体重");
|
||||
//设置该线的颜色
|
||||
lineDataSet.setColor(R.color.color_bar_background);
|
||||
//设置每个点的颜色
|
||||
lineDataSet.setCircleColor(0xff0171c9);
|
||||
//设置该线的宽度
|
||||
lineDataSet.setLineWidth(0f);
|
||||
|
||||
//设置每个坐标点的圆大小
|
||||
//lineDataSet.setCircleRadius(1f);
|
||||
//设置是否画圆
|
||||
lineDataSet.setDrawCircles(false);
|
||||
// 设置平滑曲线模式
|
||||
// lineDataSet.setMode(LineDataSet.Mode.CUBIC_BEZIER);
|
||||
//设置线一面部分是否填充颜色
|
||||
lineDataSet.setDrawFilled(true);
|
||||
//设置填充的颜色
|
||||
lineDataSet.setFillColor(0x20A0FF);
|
||||
//设置是否显示点的坐标值
|
||||
lineDataSet.setDrawValues(false);
|
||||
|
||||
|
||||
//隐藏x轴描述
|
||||
Description description = new Description();
|
||||
description.setEnabled(false);
|
||||
mLineChart.setDescription(description);
|
||||
mLineChart.setDrawBorders(false);
|
||||
//线的集合(可单条或多条线)
|
||||
List<ILineDataSet> dataSets = new ArrayList<>();
|
||||
dataSets.add(lineDataSet);
|
||||
//把要画的所有线(线的集合)添加到LineData里
|
||||
LineData lineData = new LineData(dataSets);
|
||||
//把最终的数据setData
|
||||
mLineChart.setData(lineData);
|
||||
mLineChart.invalidate();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
BIN
app/src/main/res/drawable/body_bg.png
Normal file
BIN
app/src/main/res/drawable/body_bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 68 KiB |
5
app/src/main/res/drawable/ic_infor_weight.xml
Normal file
5
app/src/main/res/drawable/ic_infor_weight.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:viewportHeight="1024.0"
|
||||
android:viewportWidth="1024.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#20A0FF" android:pathData="M512,998.4c-268.8,0 -486.4,-217.6 -486.4,-486.4S243.2,25.6 512,25.6s486.4,217.6 486.4,486.4 -217.6,486.4 -486.4,486.4zM512,55.8c-251.9,0 -456.2,204.3 -456.2,456.2 0,251.9 204.3,456.2 456.2,456.2 251.9,0 456.2,-204.3 456.2,-456.2 0,-251.9 -204.3,-456.2 -456.2,-456.2z"/>
|
||||
<path android:fillColor="#20A0FF" android:pathData="M815.1,499.7h-37.4v-1h-20.5c-10.2,0 -18.4,-8.2 -18.4,-18.4s8.2,-18.4 18.4,-18.4h20.5c-2.6,-33.8 -11.3,-66 -25.6,-95.2l-17.4,10.2c-3.1,1.5 -6.1,2.6 -9.2,2.6 -6.7,0 -12.8,-3.1 -16.4,-9.2 -5.1,-8.7 -2,-20.5 6.7,-25.6l17.4,-9.7c-18.4,-27.1 -42,-50.2 -69.1,-68.6l-10.2,17.4c-3.6,6.1 -9.7,9.2 -16.4,9.2 -3.1,0 -6.1,-1 -9.2,-2.6 -8.7,-5.1 -11.8,-16.4 -6.7,-25.6l10.2,-17.4c-29.2,-14.3 -61.4,-23 -95.7,-25.6v23c0,10.2 -8.2,18.4 -18.4,18.4s-18.4,-8.2 -18.4,-18.4v-23c-33.3,2.6 -65,11.3 -93.7,25.1l10.2,17.9c5.1,8.7 2,20 -6.7,25.6 -3.1,1.5 -6.1,2.6 -9.2,2.6 -6.7,0 -12.8,-3.1 -16.4,-9.2l-10.2,-17.9c-27.6,18.4 -51.2,42 -69.6,69.1l18.4,10.8c8.7,5.1 11.8,16.4 6.7,25.6 -3.6,6.1 -9.7,9.2 -16.4,9.2 -3.1,0 -6.1,-1 -9.2,-2.6l-18.4,-10.8c-14.3,29.2 -23.6,61.4 -26.1,95.2h20.5c10.2,0 18.4,8.2 18.4,18.4s-8.2,18.4 -18.4,18.4h-21v1.5h-37.4c-0.5,-7.2 -0.5,-13.8 -0.5,-20.5 0,-163.3 133.6,-296.4 298,-296.4s298,133.1 298,296.4c0,6.7 -0.5,13.3 -1,19.5zM324.1,641.5c5.1,-2 11.8,1.5 14.8,7.2 3.1,5.6 1.5,11.8 -3.6,13.8 -5.1,2 -11.8,-1.5 -14.8,-7.2 -3.1,-6.1 -1.5,-12.3 3.6,-13.8zM382,563.2c7.7,-2.6 17.4,2 22,10.8 4.6,8.7 2.6,17.9 -5.1,20.5s-17.4,-2 -22,-10.8c-4.6,-8.7 -2.6,-17.4 5.1,-20.5zM351.7,637.4c-6.1,2 -14.3,-1.5 -18.4,-8.7 -4.1,-7.2 -2,-14.8 4.1,-16.9 6.1,-2 14.3,1.5 18.4,8.7 4.1,7.2 2,14.8 -4.1,16.9zM357.4,587.8c7.7,-2.6 17.4,2 22,10.8 4.6,8.7 2.6,17.9 -5.1,20.5s-17.4,-2 -22,-10.8c-4.6,-8.7 -2,-17.9 5.1,-20.5zM410.6,576.5c-5.1,-10.8 -2.6,-22.5 5.1,-26.1 8.2,-3.6 18.4,2.6 23.6,13.3 5.1,10.8 2.6,22.5 -5.1,26.1 -8.2,3.6 -18.4,-2.6 -23.6,-13.3zM420.9,603.1c30.2,1 36.4,36.4 36.4,36.4 0.5,10.2 3.6,26.6 -6.1,42.5 -9.7,15.9 -25.6,79.4 12.3,109.6 37.9,29.7 20.5,62 12.3,72.7 -13.3,17.9 -67.6,14.3 -73.2,-24.1 -11.8,-82.4 -33.3,-85.5 -48.6,-109.6 -3.1,-4.6 -15.9,-42 -6.1,-60.9 14.8,-27.6 43,-67.1 73.2,-66.6zM517.6,443.4c6.7,0 12.8,2 18.4,5.1l101.4,-58.4c8.7,-5.1 20.5,-2 25.6,6.7 5.1,8.7 2,20 -6.7,25.1l-100.9,57.9c0,20.5 -16.9,36.9 -37.4,36.9s-37.4,-16.4 -37.4,-36.9c-0.5,-19.5 16.4,-36.4 36.9,-36.4zM572.4,591.4c-8.2,-3.6 -10.2,-14.8 -5.1,-25.6s15.4,-16.9 23.6,-13.3c8.2,3.6 10.2,14.8 5.1,25.6 -5.1,10.2 -15.4,16.4 -23.6,13.3zM543.7,792.6c37.9,-29.7 21.5,-93.2 12.3,-109.1 -9.7,-15.9 -6.1,-32.3 -6.1,-42.5 0,0 6.1,-35.8 36.4,-36.4 30.2,-1 57.9,38.9 72.2,66.6 9.7,18.4 -3.1,55.8 -6.1,60.4 -15.4,24.1 -36.9,26.6 -48.1,109.1 -5.6,38.4 -58.9,42 -72.2,24.1 -8.7,-10.2 -26.1,-42.5 11.8,-72.2zM668.2,612.9c6.1,2 8.2,9.7 4.1,16.9s-12.3,11.3 -18.4,8.7c-6.1,-2 -8.2,-9.7 -4.1,-16.9s12.3,-10.8 18.4,-8.7zM607.2,596c-7.2,-2.6 -9.7,-11.8 -5.1,-20.5 4.6,-8.7 14.3,-13.3 22,-10.8 7.2,2.6 9.7,11.8 5.1,20.5 -4.6,8.7 -14.3,13.3 -22,10.8zM648.7,588.8c7.2,2.6 9.7,11.8 5.1,20.5 -4.6,8.7 -14.3,13.3 -22,10.8 -7.2,-2.6 -9.7,-11.8 -5.1,-20.5 4.6,-8.7 14.3,-13.3 22,-10.8zM682,642.6c5.1,2 6.7,7.7 3.1,13.8 -3.1,5.6 -9.7,8.7 -14.3,7.2 -5.1,-2 -6.7,-7.7 -3.1,-13.8 2.6,-5.6 9.2,-8.7 14.3,-7.2z"/>
|
||||
</vector>
|
||||
5
app/src/main/res/drawable/ic_power.xml
Normal file
5
app/src/main/res/drawable/ic_power.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:viewportHeight="1024.0"
|
||||
android:viewportWidth="1024.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#ff5b20" android:pathData="M826.3,128.6c-50.8,176.8 -184.4,77.2 -341.4,253.9 -157,176.7 -48.6,375.6 -48.6,375.6l-92.8,75.2 78.9,57.4 91.2,-68.6c311.7,94.5 439.9,-150.4 439.9,-150.4 166.6,-347.3 -127.3,-543.2 -127.3,-543.2zM648.8,647.9C534.7,756.7 430.9,830.3 430.9,830.3l-6.8,-8.1c123.8,-92.8 214.1,-166.8 276.1,-244.4 -11.9,-15.4 -37.8,-64.6 -29,-197.8l7.9,1.3s-11.2,106.6 18.9,166.8c0,0 8.1,14.9 18.3,8.8 126.1,-158.3 133,-284.2 133,-284.2h8.1c-13.4,126.6 -90.8,245.3 -176.3,340.3l0.4,-0.2c-17.8,20.2 -10.1,29.9 -10.1,29.9 85.8,27.7 224.2,-45.5 224.2,-45.5l4.4,6.6c-139.6,75 -226.6,51.2 -251.3,44.2z"/>
|
||||
<path android:fillColor="#f54e4b" android:pathData="M678.2,902.6a421.9,421.9 0,0 1,-164.2 33.2C280.1,935.8 90,745.7 90,512c0,-233.7 190.2,-423.8 423.8,-423.8 58.3,0 113.6,11.9 164.2,33.2l53.4,-53.4c-65.7,-32.3 -139.6,-50.6 -217.6,-50.6C241,17.4 19.2,239.2 19.2,512c0,272.8 221.8,494.6 494.6,494.6 78,0 151.9,-18.3 217.6,-50.6l-53.2,-53.4z"/>
|
||||
</vector>
|
||||
4
app/src/main/res/drawable/ic_step.xml
Normal file
4
app/src/main/res/drawable/ic_step.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<vector android:height="24dp" android:viewportHeight="1024.0"
|
||||
android:viewportWidth="1024.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#35f9e9" android:pathData="M893.3,219c-66.7,94.3 -156.1,105.2 -252.2,47.6 -6.5,-3.9 -35.6,-20 -42,-23.9 -154.7,-92.6 -309.2,-56.3 -412.8,90 -44,62.2 57.8,121.2 101.3,59.7 53.5,-75.6 121.6,-97.5 196,-73.5 -38.1,66.7 -71.4,133.1 -118.5,227.3 -47,94.2 -150.9,169.5 -250.7,110.6 -72,-42.4 -136.9,61.9 -65.1,104.2 136.2,80.3 296,31 377.5,-73.4 2.8,1.5 5.8,2.9 9.1,4.1 66.6,23.4 153.9,85.7 180.5,107.8 26.6,22.1 72.3,134.6 99.4,191.2 32.9,68.6 139.2,18.6 106.2,-50.3 -30.8,-64.1 -82.4,-192.2 -122.7,-224.6 -32.3,-26 -95,-74.3 -148.2,-101.8 36,-70.3 73.5,-139.9 112.9,-208.2 125.8,38.9 245.3,-6.9 330.4,-127.2C1038.7,216.4 936.9,157.4 893.3,219zM702.2,252.7c64.2,0 116.2,-52.5 116.2,-117.2 0,-64.7 -52,-117.2 -116.2,-117.2C638,18.3 586,70.8 586,135.5 586,200.2 638,252.7 702.2,252.7z"/>
|
||||
</vector>
|
||||
@@ -1,34 +1,335 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<ScrollView 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"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
android:overScrollMode="never"
|
||||
android:scrollbars="none
|
||||
">
|
||||
|
||||
<me.itangqi.waveloadingview.WaveLoadingView
|
||||
android:id="@+id/waveLoadingView"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
app:wlv_borderColor="@color/colorAccent"
|
||||
app:wlv_borderWidth="3dp"
|
||||
app:wlv_progressValue="40"
|
||||
app:wlv_round_rectangle="true"
|
||||
app:wlv_shapeType="circle"
|
||||
app:wlv_titleCenter="今日卡路里值"
|
||||
app:wlv_titleCenterColor="@android:color/white"
|
||||
app:wlv_titleCenterSize="18sp"
|
||||
app:wlv_titleCenterStrokeColor="@android:color/holo_blue_dark"
|
||||
app:wlv_titleCenterStrokeWidth="3dp"
|
||||
app:wlv_triangle_direction="north"
|
||||
app:wlv_waveAmplitude="70"
|
||||
app:wlv_waveColor="@color/colorAccent" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/step_text_view"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="30dp"
|
||||
android:textColor="#4d4a4a" />
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="180dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/body_bg" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/infor_layout_height"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/infor_image_height"
|
||||
android:layout_height="@dimen/infor_image_height"
|
||||
|
||||
android:src="@drawable/ic_power" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="3"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="3"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="能量记录"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="还可以再吃"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="1804"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:text="千卡"
|
||||
android:textSize="10sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<me.itangqi.waveloadingview.WaveLoadingView
|
||||
android:id="@+id/waveLoadingView"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
app:wlv_borderColor="#ff5b20"
|
||||
app:wlv_borderWidth="3dp"
|
||||
app:wlv_progressValue="40"
|
||||
app:wlv_round_rectangle="true"
|
||||
app:wlv_shapeType="circle"
|
||||
app:wlv_titleCenter="今日卡路里"
|
||||
app:wlv_titleCenterColor="@android:color/white"
|
||||
app:wlv_titleCenterSize="10sp"
|
||||
app:wlv_titleCenterStrokeColor="#f52121"
|
||||
app:wlv_titleCenterStrokeWidth="3dp"
|
||||
app:wlv_triangle_direction="north"
|
||||
app:wlv_waveAmplitude="70"
|
||||
app:wlv_waveColor="#f54e4b" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.1dp"
|
||||
android:background="@color/place_holder" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/infor_layout_height"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/infor_image_height"
|
||||
android:layout_height="@dimen/infor_image_height"
|
||||
android:src="@drawable/ic_infor_weight" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="3"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="3"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="体重记录"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="1804"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:text="公斤"
|
||||
android:textSize="10sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<com.github.mikephil.charting.charts.LineChart
|
||||
android:id="@+id/weight_line_chart"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/infor_chart_height">
|
||||
|
||||
</com.github.mikephil.charting.charts.LineChart>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.1dp"
|
||||
android:background="@color/place_holder" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/infor_layout_height"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/infor_image_height"
|
||||
android:layout_height="@dimen/infor_image_height"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@drawable/ic_step" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="3"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="3"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="今日步数"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/step_text_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="1804"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:text="步"
|
||||
android:textSize="10sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<com.github.mikephil.charting.charts.LineChart
|
||||
android:id="@+id/step_line_chart"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/infor_chart_height">
|
||||
|
||||
</com.github.mikephil.charting.charts.LineChart>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.1dp"
|
||||
android:background="@color/place_holder" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
@@ -1,15 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<color name="colorPrimary">#FF03A9F4</color>
|
||||
<color name="colorPrimaryDark">#ff0171c9</color>
|
||||
<color name="colorPrimary">#25d43c</color>
|
||||
<color name="colorPrimaryDark">#17a346</color>
|
||||
<color name="colorAccent">#FF00E5FF</color>
|
||||
<color name="colorControlNormal">#FF78909C</color>
|
||||
<color name="colorControlActivated">#FF03A9F4</color>
|
||||
<color name="colorSwitchThumbNormal">#FF78909C</color>
|
||||
|
||||
|
||||
<color name="bar_open">#045ca1</color>
|
||||
<color name="bar_open">#17a346</color>
|
||||
<color name="place_holder">#b3b3b3</color>
|
||||
<color name="color_bar_background">#e6e5e5</color>
|
||||
<color name="color_bar_deeper">#52ec2f</color>
|
||||
|
||||
@@ -12,4 +12,10 @@
|
||||
<dimen name="bt_height">36dp</dimen>
|
||||
|
||||
|
||||
<dimen name="infor_layout_height">120dp</dimen>
|
||||
<dimen name="infor_image_height">35dp</dimen>
|
||||
<dimen name="infor_chart_height">90dp</dimen>
|
||||
<dimen name="infor_chart_width">200dp</dimen>
|
||||
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user