瀏覽代碼

Merge branch 'feture/simplify' into develop

cc12458 1 月之前
父節點
當前提交
38dd025f34
共有 100 個文件被更改,包括 12 次插入3958 次删除
  1. 0 26
      TYUsbSDK/src/androidTest/java/com/taiyi/tyusbsdk/ExampleInstrumentedTest.java
  2. 0 188
      TYUsbSDK/src/main/java/com/taiyi/tyusbsdk/RealTimeAmpGraphView.java
  3. 0 360
      TYUsbSDK/src/main/java/com/taiyi/tyusbsdk/RealTimeDataGraphView.java
  4. 0 97
      TYUsbSDK/src/main/java/com/taiyi/tyusbsdk/RealTimeMeasureView.java
  5. 0 17
      TYUsbSDK/src/main/java/com/taiyi/tyusbsdk/pulse/TaiyiManager.java
  6. 0 127
      TYUsbSDK/src/main/java/com/taiyi/tyusbsdk/pulse/ui/DeviceAdapter.java
  7. 0 157
      TYUsbSDK/src/main/java/com/taiyi/tyusbsdk/pulse/ui/HelpActivity.java
  8. 0 647
      TYUsbSDK/src/main/java/com/taiyi/tyusbsdk/pulse/ui/Measure3DFlowActivity.java
  9. 0 587
      TYUsbSDK/src/main/java/com/taiyi/tyusbsdk/pulse/ui/MeasureFlowActivity.java
  10. 0 597
      TYUsbSDK/src/main/java/com/taiyi/tyusbsdk/pulse/ui/MeasureHandsActivity.java
  11. 0 5
      TYUsbSDK/src/main/res/drawable/clip_source.xml
  12. 二進制
      TYUsbSDK/src/main/res/drawable/hand_left_10.png
  13. 二進制
      TYUsbSDK/src/main/res/drawable/hand_right_10.png
  14. 二進制
      TYUsbSDK/src/main/res/drawable/ic_main.png
  15. 二進制
      TYUsbSDK/src/main/res/drawable/ic_start.png
  16. 0 45
      TYUsbSDK/src/main/res/layout/activity_help.xml
  17. 0 221
      TYUsbSDK/src/main/res/layout/activity_measure_flow.xml
  18. 0 230
      TYUsbSDK/src/main/res/layout/activity_measure_hands.xml
  19. 1 1
      TYUsbSDK/src/main/res/layout/item_choose_device.xml
  20. 0 53
      TYUsbSDK/src/main/res/layout/realtime_amp_graph_view.xml
  21. 0 104
      TYUsbSDK/src/main/res/layout/realtime_data_graph_view.xml
  22. 0 181
      TYUsbSDK/src/main/res/layout/realtime_measure_view.xml
  23. 二進制
      TYUsbSDK/src/main/res/mipmap-hdpi/chart_bg.png
  24. 二進制
      TYUsbSDK/src/main/res/mipmap-hdpi/chi.png
  25. 二進制
      TYUsbSDK/src/main/res/mipmap-hdpi/cun.png
  26. 二進制
      TYUsbSDK/src/main/res/mipmap-hdpi/guan.png
  27. 二進制
      TYUsbSDK/src/main/res/mipmap-hdpi/measure_bg.png
  28. 二進制
      TYUsbSDK/src/main/res/mipmap-hdpi/measure_progress.png
  29. 二進制
      TYUsbSDK/src/main/res/mipmap-hdpi/track.png
  30. 二進制
      TYUsbSDK/src/main/res/mipmap-mdpi/chart_bg.png
  31. 二進制
      TYUsbSDK/src/main/res/mipmap-mdpi/chi.png
  32. 二進制
      TYUsbSDK/src/main/res/mipmap-mdpi/cun.png
  33. 二進制
      TYUsbSDK/src/main/res/mipmap-mdpi/guan.png
  34. 二進制
      TYUsbSDK/src/main/res/mipmap-mdpi/measure_bg.png
  35. 二進制
      TYUsbSDK/src/main/res/mipmap-mdpi/measure_progress.png
  36. 二進制
      TYUsbSDK/src/main/res/mipmap-mdpi/track.png
  37. 二進制
      TYUsbSDK/src/main/res/mipmap-xhdpi/chi.png
  38. 二進制
      TYUsbSDK/src/main/res/mipmap-xhdpi/cun.png
  39. 二進制
      TYUsbSDK/src/main/res/mipmap-xhdpi/guan.png
  40. 二進制
      TYUsbSDK/src/main/res/mipmap-xhdpi/measure_bg.png
  41. 二進制
      TYUsbSDK/src/main/res/mipmap-xhdpi/measure_progress.png
  42. 二進制
      TYUsbSDK/src/main/res/mipmap-xhdpi/track.png
  43. 二進制
      TYUsbSDK/src/main/res/mipmap-xxhdpi/chart_bg.png
  44. 二進制
      TYUsbSDK/src/main/res/mipmap-xxhdpi/chi.png
  45. 二進制
      TYUsbSDK/src/main/res/mipmap-xxhdpi/cun.png
  46. 二進制
      TYUsbSDK/src/main/res/mipmap-xxhdpi/guan.png
  47. 二進制
      TYUsbSDK/src/main/res/mipmap-xxhdpi/ic_measure_bg_top.png
  48. 二進制
      TYUsbSDK/src/main/res/mipmap-xxhdpi/measure_bg.png
  49. 二進制
      TYUsbSDK/src/main/res/mipmap-xxhdpi/measure_progress.png
  50. 二進制
      TYUsbSDK/src/main/res/mipmap-xxhdpi/track.png
  51. 二進制
      TYUsbSDK/src/main/res/mipmap-xxxhdpi/chart_bg.png
  52. 二進制
      TYUsbSDK/src/main/res/mipmap-xxxhdpi/chi.png
  53. 二進制
      TYUsbSDK/src/main/res/mipmap-xxxhdpi/cun.png
  54. 二進制
      TYUsbSDK/src/main/res/mipmap-xxxhdpi/guan.png
  55. 二進制
      TYUsbSDK/src/main/res/mipmap-xxxhdpi/measure_bg.png
  56. 二進制
      TYUsbSDK/src/main/res/mipmap-xxxhdpi/measure_progress.png
  57. 二進制
      TYUsbSDK/src/main/res/mipmap-xxxhdpi/track.png
  58. 0 17
      TYUsbSDK/src/test/java/com/taiyi/tyusbsdk/ExampleUnitTest.java
  59. 0 26
      app/src/androidTest/java/com/taiyi/usbmaidemo/ExampleInstrumentedTest.java
  60. 0 101
      app/src/main/res/layout/activity_third_device2.xml
  61. 0 101
      app/src/main/res/layout/activity_third_device3.xml
  62. 0 17
      app/src/test/java/com/taiyi/usbmaidemo/ExampleUnitTest.java
  63. 0 25
      ble/src/androidTest/java/com/taiyi/zhimai/ExampleInstrumentedTest.java
  64. 0 11
      ble/src/main/java/com/taiyi/zhimai/common/util/DialogTipsUtil.java
  65. 6 7
      ble/src/main/java/com/taiyi/zhimai/ui/activity/measure/BleMeasureFlowActivity.java
  66. 5 5
      ble/src/main/java/com/taiyi/zhimai/ui/activity/measure/Measure3Activity.java
  67. 二進制
      ble/src/main/res/drawable-xxhdpi/ic_close_violet.png
  68. 0 5
      ble/src/main/res/drawable/clip_source.xml
  69. 二進制
      ble/src/main/res/drawable/ic_main.png
  70. 二進制
      ble/src/main/res/drawable/ic_start.png
  71. 二進制
      ble/src/main/res/drawable/inflatable.gif
  72. 二進制
      ble/src/main/res/mipmap-hdpi/chart_bg.png
  73. 二進制
      ble/src/main/res/mipmap-hdpi/chi.png
  74. 二進制
      ble/src/main/res/mipmap-hdpi/cun.png
  75. 二進制
      ble/src/main/res/mipmap-hdpi/et_login_delete.png
  76. 二進制
      ble/src/main/res/mipmap-hdpi/guan.png
  77. 二進制
      ble/src/main/res/mipmap-hdpi/measure_bg.png
  78. 二進制
      ble/src/main/res/mipmap-hdpi/measure_progress.png
  79. 二進制
      ble/src/main/res/mipmap-hdpi/track.png
  80. 二進制
      ble/src/main/res/mipmap-mdpi/chart_bg.png
  81. 二進制
      ble/src/main/res/mipmap-mdpi/chi.png
  82. 二進制
      ble/src/main/res/mipmap-mdpi/cun.png
  83. 二進制
      ble/src/main/res/mipmap-mdpi/guan.png
  84. 二進制
      ble/src/main/res/mipmap-mdpi/measure_bg.png
  85. 二進制
      ble/src/main/res/mipmap-mdpi/measure_progress.png
  86. 二進制
      ble/src/main/res/mipmap-mdpi/track.png
  87. 二進制
      ble/src/main/res/mipmap-xhdpi/chi.png
  88. 二進制
      ble/src/main/res/mipmap-xhdpi/cun.png
  89. 二進制
      ble/src/main/res/mipmap-xhdpi/et_login_delete.png
  90. 二進制
      ble/src/main/res/mipmap-xhdpi/guan.png
  91. 二進制
      ble/src/main/res/mipmap-xhdpi/measure_bg.png
  92. 二進制
      ble/src/main/res/mipmap-xhdpi/measure_progress.png
  93. 二進制
      ble/src/main/res/mipmap-xhdpi/track.png
  94. 二進制
      ble/src/main/res/mipmap-xxhdpi/chart_bg.png
  95. 二進制
      ble/src/main/res/mipmap-xxhdpi/chi.png
  96. 二進制
      ble/src/main/res/mipmap-xxhdpi/cun.png
  97. 二進制
      ble/src/main/res/mipmap-xxhdpi/et_login_delete.png
  98. 二進制
      ble/src/main/res/mipmap-xxhdpi/guan.png
  99. 二進制
      ble/src/main/res/mipmap-xxhdpi/ic_measure_bg_top.png
  100. 二進制
      ble/src/main/res/mipmap-xxhdpi/measure_bg.png

+ 0 - 26
TYUsbSDK/src/androidTest/java/com/taiyi/tyusbsdk/ExampleInstrumentedTest.java

@@ -1,26 +0,0 @@
-package com.taiyi.tyusbsdk;
-
-import android.content.Context;
-
-import androidx.test.platform.app.InstrumentationRegistry;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import static org.junit.Assert.*;
-
-/**
- * Instrumented test, which will execute on an Android device.
- *
- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
- */
-@RunWith(AndroidJUnit4.class)
-public class ExampleInstrumentedTest {
-    @Test
-    public void useAppContext() {
-        // Context of the app under test.
-        Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
-        assertEquals("com.taiyi.tyusbsdk.test", appContext.getPackageName());
-    }
-}

+ 0 - 188
TYUsbSDK/src/main/java/com/taiyi/tyusbsdk/RealTimeAmpGraphView.java

@@ -1,188 +0,0 @@
-package com.taiyi.tyusbsdk;
-
-import android.content.Context;
-import android.content.res.TypedArray;
-import android.graphics.Canvas;
-import android.graphics.Color;
-import android.graphics.Paint;
-import android.graphics.Typeface;
-import android.graphics.drawable.ClipDrawable;
-import android.graphics.drawable.Drawable;
-import android.text.TextPaint;
-import android.util.AttributeSet;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.widget.ImageView;
-import android.widget.RelativeLayout;
-
-import com.github.mikephil.charting.charts.LineChart;
-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.utils.ColorTemplate;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * TODO: document your custom view class.
- */
-public class RealTimeAmpGraphView extends RelativeLayout {
-
-    private LineChart chart;
-    private ArrayList<Entry> cunValues;
-    private ArrayList<Entry> guanValues;
-    private ArrayList<Entry> chiValues;
-
-    public RealTimeAmpGraphView(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        init(context);
-    }
-
-    private void init(Context context) {
-        View layout = LayoutInflater.from(context).inflate(R.layout.realtime_amp_graph_view, this);
-
-        cunValues = new ArrayList<>();
-        guanValues = new ArrayList<>();
-        chiValues = new ArrayList<>();
-
-        chart = layout.findViewById(R.id.lineChart);
-//        chart.setOnChartValueSelectedListener(this);
-
-        // no description text
-        chart.getDescription().setEnabled(false);
-
-        // enable touch gestures
-        chart.setTouchEnabled(true);
-
-        chart.setDragDecelerationFrictionCoef(0.9f);
-
-        // enable scaling and dragging
-        chart.setDragEnabled(false);
-        chart.setScaleEnabled(true);
-        chart.setDrawGridBackground(false);
-        chart.setHighlightPerDragEnabled(false);
-
-        // if disabled, scaling can be done on x- and y-axis separately
-        chart.setPinchZoom(true);
-
-        // set an alternative background color
-        chart.setBackgroundColor(Color.WHITE);
-        chart.getAxisRight().setEnabled(false);
-
-        chart.animateX(1500);
-
-        // get the legend (only possible after setting data)
-        Legend l = chart.getLegend();
-        l.setEnabled(false);
-
-        XAxis xAxis = chart.getXAxis();
-        xAxis.setTextSize(10);
-        xAxis.setTypeface(Typeface.DEFAULT_BOLD);
-        xAxis.setTextColor(Color.parseColor("#555555"));
-        xAxis.setAxisMaximum(100f);
-        xAxis.setAxisMinimum(0f);
-        xAxis.setDrawGridLines(false);
-        xAxis.setDrawAxisLine(true);
-        xAxis.setAxisLineColor(Color.parseColor("#f6f6f6"));
-        xAxis.setAxisLineWidth(2.0f);
-        xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
-        xAxis.setLabelCount(5);
-        xAxis.setGranularity(25f);
-
-        YAxis leftAxis = chart.getAxisLeft();
-        leftAxis.setTextSize(10);
-        leftAxis.setTypeface(Typeface.DEFAULT_BOLD);
-        leftAxis.setTextColor(Color.parseColor("#555555"));
-        leftAxis.setAxisMaximum(200f);
-        leftAxis.setAxisMinimum(0f);
-        leftAxis.setDrawGridLines(true);
-        leftAxis.setGridLineWidth(2.0f);
-        leftAxis.setGridColor(Color.parseColor("#f6f6f6"));
-        leftAxis.setDrawAxisLine(false);
-        leftAxis.setGranularityEnabled(true);
-        leftAxis.setLabelCount(5);
-        leftAxis.setGranularity(50f);
-
-
-        LineDataSet set1, set2, set3;
-        set1 = new LineDataSet(cunValues, "cun");
-
-        set1.setAxisDependency(YAxis.AxisDependency.LEFT);
-        set1.setColor(Color.parseColor("#4f81bd"));
-        set1.setCircleColor(Color.parseColor("#4f81bd"));
-        set1.setLineWidth(2f);
-        set1.setCircleRadius(3f);
-        set1.setFillAlpha(65);
-        set1.setFillColor(Color.parseColor("#4f81bd"));
-        set1.setDrawCircleHole(false);
-
-        // create a dataset and give it a type
-        set2 = new LineDataSet(guanValues, "guan");
-        set2.setAxisDependency(YAxis.AxisDependency.RIGHT);
-        set2.setColor(Color.parseColor("#c0504d"));
-        set2.setCircleColor(Color.parseColor("#c0504d"));
-        set2.setLineWidth(2f);
-        set2.setCircleRadius(3f);
-        set2.setFillAlpha(65);
-        set2.setFillColor(Color.parseColor("#c0504d"));
-        set2.setDrawCircleHole(false);
-        //set2.setFillFormatter(new MyFillFormatter(900f));
-
-        set3 = new LineDataSet(chiValues, "chi");
-        set3.setAxisDependency(YAxis.AxisDependency.RIGHT);
-        set3.setColor(Color.parseColor("#9bbb5a"));
-        set3.setCircleColor(Color.parseColor("#9bbb5a"));
-        set3.setLineWidth(2f);
-        set3.setCircleRadius(3f);
-        set3.setFillAlpha(65);
-        set3.setFillColor(ColorTemplate.colorWithAlpha(Color.parseColor("#9bbb5a"), 200));
-        set3.setDrawCircleHole(false);
-
-        // create a data object with the data sets
-        LineData data = new LineData(set1, set2, set3);
-
-        data.setValueTextColor(Color.WHITE);
-        data.setValueTextSize(0f);
-
-        // set data
-        chart.setData(data);
-        chart.invalidate();
-    }
-
-    public void addData(List<Integer> indexArray, float timeSeconds) {
-        if (indexArray.size() < 4 || timeSeconds == -1) {
-            return;
-        }
-        cunValues.add(new Entry(timeSeconds, indexArray.get(1)));
-        guanValues.add(new Entry(timeSeconds, indexArray.get(2)));
-        chiValues.add(new Entry(timeSeconds, indexArray.get(3)));
-
-        LineDataSet set1, set2, set3;
-
-        if (chart.getData() != null &&
-                chart.getData().getDataSetCount() > 0) {
-            set1 = (LineDataSet) chart.getData().getDataSetByIndex(0);
-            set2 = (LineDataSet) chart.getData().getDataSetByIndex(1);
-            set3 = (LineDataSet) chart.getData().getDataSetByIndex(2);
-            set1.setValues(cunValues);
-            set2.setValues(guanValues);
-            set3.setValues(chiValues);
-            chart.getData().notifyDataChanged();
-            chart.notifyDataSetChanged();
-        }
-
-        if (indexArray.get(1) > 300 || indexArray.get(2) > 300 || indexArray.get(3) > 300) {
-            int maxY = indexArray.get(1) > indexArray.get(2) ? indexArray.get(1) : indexArray.get(2);
-            maxY = maxY > indexArray.get(3) ? maxY : indexArray.get(3);
-            chart.getAxisLeft().setAxisMaximum(maxY);
-        }
-
-        chart.invalidate();
-    }
-
-
-}

+ 0 - 360
TYUsbSDK/src/main/java/com/taiyi/tyusbsdk/RealTimeDataGraphView.java

@@ -1,360 +0,0 @@
-package com.taiyi.tyusbsdk;
-
-import android.content.Context;
-import android.graphics.Color;
-import android.os.Build;
-import android.os.Handler;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.widget.LinearLayout;
-
-import androidx.annotation.Nullable;
-
-import com.github.mikephil.charting.charts.CombinedChart;
-import com.github.mikephil.charting.charts.LineChart;
-import com.github.mikephil.charting.components.Legend;
-import com.github.mikephil.charting.data.BubbleData;
-import com.github.mikephil.charting.data.BubbleDataSet;
-import com.github.mikephil.charting.data.BubbleEntry;
-import com.github.mikephil.charting.data.CombinedData;
-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.interfaces.datasets.IBubbleDataSet;
-import com.github.mikephil.charting.interfaces.datasets.ILineDataSet;
-import com.github.mikephil.charting.utils.ColorTemplate;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
-public class RealTimeDataGraphView extends LinearLayout {
-    private final CombinedChart[] charts = new CombinedChart[3];
-    private float minTrueY = -40;
-    private float maxTrueY = 40;
-    private int maxX = 135;
-    private int lineSize = 10;
-    private float intervalY = 0;
-    private float maxRealY = 0;
-    private float minRealY = 0;
-    private List<List<Float>> chartsData = new ArrayList<>();
-    private List<String> timeArray = new ArrayList<>();
-
-    public RealTimeDataGraphView(Context context, @Nullable AttributeSet attrs) {
-        super(context, attrs);
-        init(context);
-    }
-
-    private void init(Context context) {
-        View layout = LayoutInflater.from(context).inflate(R.layout.realtime_data_graph_view, this);
-
-        charts[0] = layout.findViewById(R.id.chart1);
-        charts[1] = layout.findViewById(R.id.chart2);
-        charts[2] = layout.findViewById(R.id.chart3);
-
-        for (int i = 0; i < charts.length; i++) {
-
-            // add some transparency to the color with "& 0x90FFFFFF"
-            setupChart(charts[i]);
-        }
-
-//        timerHandler.postDelayed(timerRunnable, 2000);
-    }
-
-    private final int[] colors = new int[] {
-            Color.rgb(217, 102, 67),
-            Color.rgb(20, 144, 121),
-            Color.rgb(55, 99, 73),
-            Color.rgb(102, 199, 238),
-            Color.rgb(238, 105, 105),
-            Color.rgb(39, 109, 151),
-            Color.rgb(102, 142, 238),
-            Color.rgb(177, 102, 238),
-            Color.rgb(238, 110, 213),
-            Color.rgb(0, 141, 180)
-    };
-
-    private void setupChart(CombinedChart chart) {
-
-//        ((LineDataSet) data.getDataSetByIndex(0)).setCircleHoleColor(color);
-
-        // no description text
-        chart.getDescription().setEnabled(false);
-
-        // chart.setDrawHorizontalGrid(false);
-        //
-        // enable / disable grid background
-        chart.setDrawGridBackground(false);
-//        chart.getRenderer().getGridPaint().setGridColor(Color.WHITE & 0x70FFFFFF);
-
-        // enable touch gestures
-        chart.setTouchEnabled(false);
-
-        // enable scaling and dragging
-        chart.setDragEnabled(false);
-        chart.setScaleEnabled(false);
-
-        // if disabled, scaling can be done on x- and y-axis separately
-        chart.setPinchZoom(false);
-        chart.setDrawOrder(new CombinedChart.DrawOrder[]{
-                CombinedChart.DrawOrder.LINE, CombinedChart.DrawOrder.BUBBLE
-        });
-
-        chart.setBackgroundColor(Color.TRANSPARENT);
-
-        // set custom chart offsets (automatic offset calculation is hereby disabled)
-        chart.setViewPortOffsets(10, 0, 10, 0);
-
-        CombinedData data = new CombinedData();
-        // Add Line Data
-        ArrayList<ILineDataSet> lineDataSets = new ArrayList<>();
-        for (int i = 0; i < lineSize; i++) {
-
-            ArrayList<Entry> values = new ArrayList<>();
-
-            LineDataSet d = new LineDataSet(values, "");
-            d.setMode(LineDataSet.Mode.CUBIC_BEZIER);
-
-            int color = colors[(colors.length -1) - i % colors.length];
-            d.setDrawValues(false);
-            d.setCircleColor(Color.rgb(235, 51, 32));
-            d.setCircleHoleColor(Color.rgb(235, 51, 32));
-            d.setCircleRadius(1.5f);
-            d.setDrawCircles(false);
-            d.setColor(color);
-            d.setLineWidth(1.0f);
-            lineDataSets.add(d);
-        }
-        data.setData(new LineData(lineDataSets));
-
-        // Add Bubble Data
-        ArrayList<IBubbleDataSet> bubbleDataSets = new ArrayList<>();
-        for (int i = 0; i < lineSize; i++) {
-            ArrayList<BubbleEntry> values = new ArrayList<>();
-
-            BubbleDataSet set = new BubbleDataSet(values, "");
-            set.setColor(Color.rgb(235, 51, 32));
-            set.setDrawValues(false);
-            set.setDrawIcons(false);
-            set.setHighlightEnabled(false);
-            set.setNormalizeSizeEnabled(false);
-            bubbleDataSets.add(set);
-        }
-        data.setData(new BubbleData(bubbleDataSets));
-
-        chart.setData(data);
-
-        // get the legend (only possible after setting data)
-        Legend l = chart.getLegend();
-        l.setEnabled(false);
-
-        chart.getAxisLeft().setEnabled(false);
-        chart.getAxisLeft().setSpaceTop(40);
-        chart.getAxisLeft().setSpaceBottom(40);
-        chart.getAxisRight().setEnabled(false);
-
-        chart.getXAxis().setEnabled(false);
-        chart.getAxisLeft().setAxisMaximum((maxTrueY-minTrueY+intervalY)*lineSize);
-        chart.getAxisLeft().setAxisMinimum(0);
-
-        // animate calls invalidate()...
-        chart.animateX(1000);
-    }
-
-    public void addLinePoint(RealTimeDataItem realTimeData) {
-        timeArray.add(realTimeData.time);
-        List<Float> columnData = new ArrayList<>();
-        for (int x = 0; x < charts.length; x++) {
-            CombinedChart chart = (CombinedChart) charts[x];
-            CombinedData data = chart.getData();
-
-            if (data != null) {
-                LineData lineData = data.getLineData();
-                for (int i = 0; i < lineData.getDataSets().size(); i++) {
-                    ILineDataSet set = lineData.getDataSetByIndex(i);
-                    int realTimeDataIndex = 0;
-                    if (x == 0) {
-                        realTimeDataIndex = 1 + i * 3;
-                    } else if (x == 1) {
-                        realTimeDataIndex = 33 + i * 3;
-                    } else if (x == 2) {
-                        realTimeDataIndex = 65 + i * 3;
-                    }
-                    float realTimeDataPoint = (float) realTimeData.dataArray.get(realTimeDataIndex);
-                    if (realTimeDataPoint > maxRealY) {
-                        maxRealY = realTimeDataPoint;
-                    }
-                    if (realTimeDataPoint < minRealY) {
-                        minRealY = realTimeDataPoint;
-                    }
-                    columnData.add(Float.valueOf(realTimeDataPoint));
-                    lineData.addEntry(new Entry(set.getEntryCount(), (float) (realTimeDataPoint + (maxTrueY-minTrueY)*0.5 + intervalY*0.5 + i*(maxTrueY-minTrueY+intervalY*0.5))), i);
-                }
-
-
-                data.notifyDataChanged();
-
-                // let the chart know it's data has changed
-                chart.notifyDataSetChanged();
-
-                // limit the number of visible entries
-                chart.setVisibleXRangeMaximum(maxX);
-                // chart.setVisibleYRange(30, AxisDependency.LEFT);
-
-                // move to the latest entry
-                chart.moveViewToX(data.getLineData().getEntryCount());
-
-                // this automatically refreshes the chart (calls invalidate())
-                // chart.moveViewTo(data.getXValCount()-7, 55f,
-                // AxisDependency.LEFT);
-            }
-        }
-        chartsData.add(columnData);
-    }
-
-    public void addBubblePoint(List<Integer> indexArray) {
-        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
-            LogUtils.d("周期描点"+indexArray.stream().map(String::valueOf)
-                    .collect(Collectors.joining(",")));
-        }
-        for (int x = 0; x < charts.length; x++) {
-            CombinedChart chart = (CombinedChart) charts[x];
-            CombinedData data = chart.getData();
-
-            if (data != null) {
-                BubbleData bubbleData = data.getBubbleData();
-                LineData lineData = data.getLineData();
-
-                for (int i = 0; i < bubbleData.getDataSets().size(); i++) {
-
-                    int startBubbleTime = indexArray.get(x*2);
-                    int endBubbleTime = indexArray.get(x*2+1);
-
-//                    Log.d(TAG)
-
-                    if (startBubbleTime > 0) {
-                        int startBubbleIndex = -1;
-                        int startJIndex = (timeArray.size()-maxX-20) < 0 ? 0 : (timeArray.size()-maxX-20);
-                        for (int j = startJIndex; j < timeArray.size(); j++) {
-                            int targetTime = Integer.parseInt(timeArray.get(j));
-
-                            if (startBubbleTime == targetTime) {
-                                startBubbleIndex = j;
-                                break;
-                            }
-
-
-//                            if (startBubbleTime > targetTime && startBubbleTime < targetNextTime) {
-//                                if (startBubbleTime-targetTime > targetNextTime-startBubbleTime) {
-//                                    startBubbleIndex = j+1;
-//                                } else {
-//                                    startBubbleIndex = j;
-//                                }
-//                                break;
-//                            }
-                        }
-
-                        if (startBubbleIndex > 0) {
-                            bubbleData.addEntry(new BubbleEntry(startBubbleIndex, lineData.getDataSetByIndex(i).getEntryForIndex(startBubbleIndex).getY(), 3.0f), i);
-                        }
-
-                    }
-
-                    if (endBubbleTime > 0) {
-                        int endBubbleIndex = -1;
-                        int endJIndex = (timeArray.size()-maxX-20) < 0 ? 0 : (timeArray.size()-maxX-20);
-                        for (int j = endJIndex; j < timeArray.size(); j++) {
-                            int targetTime = Integer.parseInt(timeArray.get(j));
-
-                            if (endBubbleTime == targetTime) {
-                                endBubbleIndex = j;
-                                break;
-                            }
-
-
-//                            if (endBubbleTime > targetTime && endBubbleTime < targetNextTime) {
-//                                if (endBubbleTime-targetTime > targetNextTime-endBubbleTime) {
-//                                    endBubbleIndex = j+1;
-//                                } else {
-//                                    endBubbleIndex = j;
-//                                }
-//                                break;
-//                            }
-                        }
-
-                        if (endBubbleIndex > 0) {
-                            bubbleData.addEntry(new BubbleEntry(endBubbleIndex, lineData.getDataSetByIndex(i).getEntryForIndex(endBubbleIndex).getY(), 3.0f), i);
-                        }
-                    }
-
-
-
-
-//                    bubbleData.addEntry(new BubbleEntry(lineData.getDataSetByIndex(i).getEntryCount()-10, lineData.getDataSetByIndex(i).getEntryForIndex(lineData.getDataSetByIndex(i).getEntryCount()-10).getY(), 3.0f), i);
-//                    bubbleData.addEntry(new BubbleEntry(lineData.getDataSetByIndex(i).getEntryCount()-5, lineData.getDataSetByIndex(i).getEntryForIndex(lineData.getDataSetByIndex(i).getEntryCount()-5).getY(), 3.0f), i);
-
-                }
-            }
-
-//            data.notifyDataChanged();
-//
-//            // let the chart know it's data has changed
-//            chart.notifyDataSetChanged();
-//
-//            // limit the number of visible entries
-//            chart.setVisibleXRangeMaximum(maxX);
-//            // chart.setVisibleYRange(30, AxisDependency.LEFT);
-//
-//            // move to the latest entry
-//            chart.moveViewToX(data.getLineData().getEntryCount());
-        }
-    }
-
-    private Handler timerHandler = new Handler();
-    private Runnable timerRunnable = new Runnable() {
-        @Override
-        public void run() {
-
-/**
-            maxTrueY = maxRealY;
-            minTrueY = minRealY;
-
-            LogUtils.d("Y轴:"+String.format("maxY:%f ,minY:%f", maxTrueY,minTrueY));
-
-            for (int x = 0; x < charts.length; x++) {
-
-                // add some transparency to the color with "& 0x90FFFFFF"
-                LineChart chart = charts[x];
-                LineData data = chart.getData();
-
-                for (int i = 0; i < data.getDataSets().size(); i++) {
-                    ILineDataSet set = data.getDataSetByIndex(i);
-
-                    if (set.getEntryCount() < maxX+20) {
-                        for (int j = 0; j < set.getEntryCount(); j++) {
-                            data.removeEntry(j, i);
-                            data.addEntry(new Entry(j, (float) (chartsData.get(j).get(x*data.getDataSets().size()+i) + (maxTrueY-minTrueY)*0.5 + intervalY*0.5 + i*(maxTrueY-minTrueY+intervalY*0.5))), i);
-                        }
-                    } else {
-                        for (int j = set.getEntryCount()-(maxX+20); j < set.getEntryCount(); j++) {
-                            data.removeEntry(j, i);
-                            data.addEntry(new Entry(j, (float) (chartsData.get(j).get(x*data.getDataSets().size()+i) + (maxTrueY-minTrueY)*0.5 + intervalY*0.5 + i*(maxTrueY-minTrueY+intervalY*0.5))), i);
-                        }
-                    }
-
-
-                }
-
-                chart.invalidate();
-//                chart.getAxisLeft().setAxisMaximum((maxTrueY-minTrueY+intervalY)*lineSize);
-//                data.notifyDataChanged(); // let the data know a dataSet changed
-//                chart.notifyDataSetChanged(); // let the chart know it's data changed
-//                chart.moveViewToX(data.getEntryCount());
-            }
-            timerHandler.postDelayed(this, 2000);
- **/
-        }
-    };
-}

+ 0 - 97
TYUsbSDK/src/main/java/com/taiyi/tyusbsdk/RealTimeMeasureView.java

@@ -1,97 +0,0 @@
-package com.taiyi.tyusbsdk;
-
-import android.content.Context;
-import android.graphics.drawable.ClipDrawable;
-import android.os.CountDownTimer;
-import android.util.AttributeSet;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.RelativeLayout;
-import android.widget.TextView;
-
-public class RealTimeMeasureView extends RelativeLayout {
-
-    private ClipDrawable progressView;
-    private LinearLayout indicatorView;
-    private TextView countDownTextView;
-    private CountDownTimer countDownTimer;
-    private long beginTime = -1;
-
-    public RealTimeMeasureView(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        init(context);
-    }
-
-    private void init(Context context) {
-        View layout = LayoutInflater.from(context).inflate(R.layout.realtime_measure_view, this);
-
-        ImageView progressImageView = (ImageView) layout.findViewById(R.id.progressViewId);
-        progressView = (ClipDrawable) progressImageView.getDrawable();
-        indicatorView = findViewById(R.id.indicatorId);
-        countDownTextView = findViewById(R.id.countDownTextId);
-    }
-
-    @Override
-    protected void onDetachedFromWindow() {
-        super.onDetachedFromWindow();
-
-        if (countDownTimer != null) {
-            countDownTimer.cancel();
-            countDownTimer = null;
-        }
-
-    }
-
-    public void setProgressValue(int value) {
-        float percent = (float) (value/300.0);
-        percent = percent > 1 ? 1 : percent;
-        progressView.setLevel((int) (10000*percent));
-        updateIndicatorView(percent,value);
-    }
-
-    private void updateIndicatorView(float percent, int value) {
-        RelativeLayout.LayoutParams lp = (LayoutParams) indicatorView.getLayoutParams();
-        lp.bottomMargin = (int) ((-7+171*percent) * getContext().getResources().getDisplayMetrics().density);
-
-        TextView valueView = indicatorView.findViewById(R.id.indicatiorTextId);
-        valueView.setText(String.valueOf(value));
-
-        indicatorView.setLayoutParams(lp);
-    }
-
-    public void startTimerCountDown() {
-        if (countDownTimer == null) {
-            beginTime = System.currentTimeMillis();
-
-            countDownTextView.setVisibility(VISIBLE);
-            final int[] beginSeconds = {100};
-            countDownTextView.setText(String.valueOf(beginSeconds[0])+"s");
-
-            countDownTimer = new CountDownTimer(101*1000, 1*1000) {
-                @Override
-                public void onTick(long millisUntilFinished) {
-                    beginSeconds[0] = beginSeconds[0]-1;
-                    countDownTextView.setText(String.valueOf(beginSeconds[0])+"s");
-                }
-
-                @Override
-                public void onFinish() {
-                    countDownTextView.setText("0s");
-                    countDownTimer = null;
-                }
-            };
-
-            countDownTimer.start();
-        }
-    }
-
-    public float getNowTime() {
-        if (beginTime == -1) {
-            return -1;
-        }
-        long curTime = System.currentTimeMillis()-beginTime;
-        return (float) (curTime/1000.0);
-    }
-}

+ 0 - 17
TYUsbSDK/src/main/java/com/taiyi/tyusbsdk/pulse/TaiyiManager.java

@@ -11,9 +11,6 @@ import android.text.TextUtils;
 import androidx.annotation.Nullable;
 
 import com.taiyi.tyusbsdk.ResultListener;
-import com.taiyi.tyusbsdk.pulse.ui.HelpActivity;
-import com.taiyi.tyusbsdk.pulse.ui.MeasureFlowActivity;
-import com.taiyi.tyusbsdk.pulse.ui.MeasureHandsActivity;
 import com.taiyi.tyusbsdk.pulse.ui.SuccessActivity;
 import com.taiyi.tyusbsdk.pulse.util.AppManager;
 
@@ -122,18 +119,6 @@ public class TaiyiManager {
         ProxyManager.getInstance().init(_config.proxy);
     }
 
-
-    public void toDirectMeasure(String uid, Activity activity, SkipInterface skipInterface, ResultListener listener, boolean isLeft) {
-        this.uid = uid;
-        Intent intent = new Intent(activity, MeasureHandsActivity.class);
-        intent.putExtra("autoTest", true);
-        intent.putExtra("isAutoTestLeftHand", isLeft);
-        activity.startActivity(intent);
-        mSkipInterface = skipInterface;
-        setResultListener(listener);
-
-    }
-
     public void toGoMeasure(boolean isLeft) {
         if (isLeft) {
             EventBus.getDefault().post(new EventTestMaiMessage(0));
@@ -178,8 +163,6 @@ public class TaiyiManager {
 
 
     public void clearMeasure() {
-        AppManager.finishActivity(MeasureFlowActivity.class);
-        AppManager.finishActivity(HelpActivity.class);
         AppManager.finishActivity(SuccessActivity.class);
     }
 }

+ 0 - 127
TYUsbSDK/src/main/java/com/taiyi/tyusbsdk/pulse/ui/DeviceAdapter.java

@@ -1,127 +0,0 @@
-package com.taiyi.tyusbsdk.pulse.ui;
-
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-import androidx.annotation.NonNull;
-import androidx.recyclerview.widget.RecyclerView;
-
-import com.taiyi.tyusbsdk.R;
-import com.taiyi.tyusbsdk.pulse.bean.BleDeviceS;
-import com.taiyi.tyusbsdk.pulse.util.OnClickNoDoubleListener;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- * Created by zbh on 2018/11/6.
- * Version: 1.0
- */
-public class DeviceAdapter extends RecyclerView.Adapter<DeviceAdapter.ViewHolder> {
-
-    private RecyclerView mRecycler;
-    private int mPosition = -1;
-    private List<BleDeviceS> mDeviceS = new ArrayList<>();
-
-
-    @NonNull
-    @Override
-    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int root) {
-        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_choose_device, parent, false);
-        ViewHolder holder = new ViewHolder(view);
-        return holder;
-    }
-
-    @Override
-    public void onBindViewHolder(final @NonNull ViewHolder viewHolder, int i) {
-        final BleDeviceS bleDeviceS = mDeviceS.get(i);
-
-//        viewHolder.tvDevice.setText(item.getName());
-
-        if (mPosition == viewHolder.getAdapterPosition()) {
-            bleDeviceS.selected = true;
-            viewHolder.ivChoose.setImageResource(R.drawable.ic_check);
-        } else {
-            bleDeviceS.selected = false;
-            viewHolder.ivChoose.setImageResource(R.drawable.ic_uncheck);
-        }
-
-        viewHolder.itemView.setOnClickListener(new OnClickNoDoubleListener() {
-            @Override
-            public void onNoDoubleClick(View view) {
-                int position = viewHolder.getAdapterPosition();
-                if (mPosition == position) {
-                    viewHolder.ivChoose.setImageResource(R.drawable.ic_uncheck);
-                    bleDeviceS.selected = false;
-                    mPosition = -1;
-                } else if (mPosition != -1) {
-                    ViewHolder bhChecked = (ViewHolder) mRecycler.findViewHolderForLayoutPosition(mPosition);
-                    bleDeviceS.selected = true;
-                    mDeviceS.get(mPosition).selected = false;
-                    if (bhChecked != null) {//还在屏幕里
-                        ImageView imageView = bhChecked.ivChoose;
-                        imageView.setImageResource(R.drawable.ic_uncheck);
-                    }
-                    mPosition = position;
-                    viewHolder.ivChoose.setImageResource(R.drawable.ic_check);
-                } else {
-                    mPosition = position;
-                    viewHolder.ivChoose.setImageResource(R.drawable.ic_check);
-                    bleDeviceS.selected = true;
-                }
-            }
-        });
-
-
-    }
-
-    @Override
-    public int getItemCount() {
-        return mDeviceS.size();
-    }
-
-    public void addData(BleDeviceS s) {
-        if (mDeviceS == null) {
-            mDeviceS = new ArrayList<>();
-        }
-        mDeviceS.add(s);
-        notifyDataSetChanged();
-    }
-
-    public List<BleDeviceS> getData() {
-        return mDeviceS;
-    }
-
-
-    static class ViewHolder extends RecyclerView.ViewHolder {
-        public ImageView ivChoose;
-        public TextView tvDevice;
-
-        public ViewHolder(View view) {
-            super(view);
-//            ivChoose = (ImageView) view.findViewById(R.id.iv_choose);
-//            tvDevice = view.findViewById(R.id.tv_device);
-        }
-
-    }
-
-
-    public int getPosition() {
-        return mPosition;
-        //                == -1 ? 0 : mPosition;
-    }
-
-    public void setPosition(int position) {
-        mPosition = position;
-    }
-
-    public void setRecycler(RecyclerView recycler) {
-        mRecycler = recycler;
-    }
-}
-
-

+ 0 - 157
TYUsbSDK/src/main/java/com/taiyi/tyusbsdk/pulse/ui/HelpActivity.java

@@ -1,157 +0,0 @@
-package com.taiyi.tyusbsdk.pulse.ui;
-
-import android.annotation.SuppressLint;
-import android.annotation.TargetApi;
-import android.graphics.Bitmap;
-import android.net.http.SslError;
-import android.os.Build;
-import android.view.View;
-import android.webkit.CookieManager;
-import android.webkit.SslErrorHandler;
-import android.webkit.WebChromeClient;
-import android.webkit.WebSettings;
-import android.webkit.WebView;
-import android.webkit.WebViewClient;
-import android.widget.ImageView;
-import android.widget.ProgressBar;
-import android.widget.TextView;
-
-import com.taiyi.tyusbsdk.R;
-
-public class HelpActivity extends BaseActivity {
-
-
-    ProgressBar mProgress;
-    TextView mTvTitle;
-    WebView mWebView;
-    private ImageView mIvBack;
-
-    @Override
-    protected int initLayoutResId() {
-        return R.layout.activity_help;
-    }
-
-    @SuppressLint("CheckResult")
-    @Override
-    protected void init() {
-        mProgress = findViewById(R.id.progress);
-        mTvTitle = findViewById(R.id.tv_title);
-        mWebView = findViewById(R.id.web);
-        mIvBack = findViewById(R.id.iv_back);
-        setupWebView();
-
-        String url = "https://hybrid.taiyi-tech.com/help.html#/taiyimai?title=" + mTvTitle.getText().toString();
-        mWebView.loadUrl(url);
-
-        mIvBack.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                onBackPressed();
-            }
-        });
-    }
-
-    private void setupWebView() {
-        setWebViewSettings();
-        setWebClient();
-
-    }
-
-    //设置webView
-    @SuppressLint("SetJavaScriptEnabled")
-    private void setWebViewSettings() {
-        //获取一个WebSettings对象
-        //用于对设置webView的基本属性
-        WebSettings settings = mWebView.getSettings();
-        //启用Javascript
-        settings.setJavaScriptEnabled(true);
-        //显示缩放控制工具
-        settings.setBuiltInZoomControls(true);
-        settings.setDisplayZoomControls(true);
-        //设置webView支持缩放
-        settings.setSupportZoom(true);
-        //视频bug
-        fixVideoBug(settings);
-        /*
-          防止闪退:Receiver not registered: android.widget.ZoomButtonsController crash
-         */
-        mWebView.getSettings().setBuiltInZoomControls(true); // will give pinch zoom
-        mWebView.getSettings().setDisplayZoomControls(false); // but won't display the zoom buttons
-    }
-
-    @TargetApi(21)
-    private void fixVideoBug(WebSettings settings) {
-        if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) {
-            settings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
-            CookieManager.getInstance().setAcceptThirdPartyCookies(mWebView, true);
-        }
-    }
-
-    //设置WebView的WebChromeClient与WebViewClient
-    private void setWebClient() {
-        mWebView.setWebChromeClient(new WebChromeClient() {
-            @Override
-            public void onReceivedTitle(WebView view, String title) {
-                super.onReceivedTitle(view, title);
-                mTvTitle.setText(title);
-            }
-
-            @Override
-            public void onProgressChanged(WebView view, int newProgress) {
-                super.onProgressChanged(view, newProgress);
-                if (mProgress != null) {
-                    mProgress.setProgress(newProgress);
-                }
-
-            }
-        });
-        mWebView.setWebViewClient(new WebViewClient() {
-            @Override
-            public boolean shouldOverrideUrlLoading(WebView view, String url) {
-                view.loadUrl(url);
-                return true;
-            }
-
-            @Override
-            public void onPageStarted(WebView view, String url, Bitmap favicon) {
-                super.onPageStarted(view, url, favicon);
-                if (mProgress != null) {
-                    mProgress.setVisibility(View.VISIBLE);
-                }
-
-            }
-
-            @Override
-            public void onPageFinished(WebView view, String url) {
-                super.onPageFinished(view, url);
-                if (mProgress != null) {
-                    mProgress.setVisibility(View.GONE);
-                }
-
-
-            }
-
-            @Override
-            public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
-                handler.proceed();//接受证书
-                //handler.cancel(); 默认的处理方式,WebView变成空白页
-                //handleMessage(Message msg); 其他处理
-            }
-        });
-    }
-
-    @Override
-    protected void removeViewData() {
-        mWebView.removeAllViews();
-        mWebView.destroy();
-    }
-
-    @Override
-    public void onBackPressed() {
-        if (mWebView.canGoBack()) {
-            mWebView.goBack();
-        } else {
-            super.onBackPressed();
-        }
-    }
-}

+ 0 - 647
TYUsbSDK/src/main/java/com/taiyi/tyusbsdk/pulse/ui/Measure3DFlowActivity.java

@@ -1,647 +0,0 @@
-package com.taiyi.tyusbsdk.pulse.ui;
-
-import static com.taiyi.tyusbsdk.pulse.ui.MeasureHandsActivity.RESULT_MEASURE_FAIL;
-
-import android.Manifest;
-import android.annotation.SuppressLint;
-import android.app.Activity;
-import android.app.Dialog;
-import android.content.pm.PackageManager;
-import android.os.Build;
-import android.os.CountDownTimer;
-import android.speech.tts.TextToSpeech;
-import android.util.Log;
-import android.view.View;
-import android.view.WindowManager;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-import androidx.constraintlayout.widget.ConstraintLayout;
-import androidx.core.app.ActivityCompat;
-import androidx.core.content.ContextCompat;
-import androidx.recyclerview.widget.LinearLayoutManager;
-
-import com.taiyi.tyusbsdk.HandType;
-import com.taiyi.tyusbsdk.MeasureType;
-import com.taiyi.tyusbsdk.R;
-import com.taiyi.tyusbsdk.RealTimeMeasureStatus;
-import com.taiyi.tyusbsdk.TYUsbDeviceActivity;
-import com.taiyi.tyusbsdk.UsbEvent;
-import com.taiyi.tyusbsdk.pulse.TaiyiManager;
-import com.taiyi.tyusbsdk.pulse.bean.PulseParamTen;
-import com.taiyi.tyusbsdk.pulse.bean.RealtimeWaveItem;
-import com.taiyi.tyusbsdk.pulse.net.HttpUtil;
-import com.taiyi.tyusbsdk.pulse.net.TokenOverDueHttpImpl;
-import com.taiyi.tyusbsdk.pulse.util.AutoScrollRecyclerView;
-import com.taiyi.tyusbsdk.pulse.util.DialogTipUtil;
-import com.taiyi.tyusbsdk.pulse.util.LoadingView;
-import com.taiyi.tyusbsdk.pulse.util.MaiFlowAdapter;
-import com.taiyi.tyusbsdk.pulse.util.OnClickNoDoubleListener;
-import com.taiyi.tyusbsdk.pulse.util.scenery.ElectricFanLoadingRenderer;
-
-import org.greenrobot.eventbus.EventBus;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Map;
-
-public class Measure3DFlowActivity extends TYUsbDeviceActivity {
-    TextView mTvHand;
-    ImageView mIvCancel;
-    TextView mTvCun;
-    TextView mTvGuan;
-    TextView mTvChi;
-    AutoScrollRecyclerView mAsrCun;
-    AutoScrollRecyclerView mAsrGuan;
-    AutoScrollRecyclerView mAsrChi;
-    ImageView mIvHand;
-    ConstraintLayout mClLoading;
-    LoadingView mLv;
-
-    private String measureId;
-    private int hand;
-
-    private MaiFlowAdapter cunAdapter;
-    private MaiFlowAdapter guanAdapter;
-    private MaiFlowAdapter chiAdapter;
-    private int current = 4;//默认显示4张图
-    private int[] changImgIds = new int[]{R.mipmap.mai_0, R.mipmap.chang_2, R.mipmap.chang_4, R.mipmap.chang_6, R.mipmap.chang_8,
-            R.mipmap.chang_10, R.mipmap.chang_12, R.mipmap.chang_14, R.mipmap.chang_16, R.mipmap.chang_18, R.mipmap.chang_20,
-            R.mipmap.chang_25, R.mipmap.chang_30, R.mipmap.chang_35, R.mipmap.chang_40};
-    private int[] xiImgIds = new int[]{R.mipmap.mai_0, R.mipmap.xi_2, R.mipmap.xi_4, R.mipmap.xi_6, R.mipmap.xi_8, R.mipmap.xi_10,
-            R.mipmap.xi_12, R.mipmap.xi_14, R.mipmap.xi_16, R.mipmap.xi_18, R.mipmap.xi_20, R.mipmap.xi_25, R.mipmap.xi_30,
-            R.mipmap.xi_35, R.mipmap.xi_40};
-    private int[] huaImgIds = new int[]{R.mipmap.mai_0, R.mipmap.hua_2, R.mipmap.hua_4, R.mipmap.hua_6, R.mipmap.hua_8, R.mipmap.hua_10
-            , R.mipmap.hua_12, R.mipmap.hua_14, R.mipmap.hua_16, R.mipmap.hua_18, R.mipmap.hua_20, R.mipmap.hua_25, R.mipmap.hua_30,
-            R.mipmap.hua_35, R.mipmap.hua_40};
-
-    private TextToSpeech textToSpeech;
-    private CountDownTimer mCountTimer;
-    Dialog showDialog;
-
-
-    @SuppressLint("CheckResult")
-    @Override
-    protected void init() {
-        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
-
-        mTvHand = findViewById(R.id.tv_hand);
-        mIvCancel = findViewById(R.id.iv_cancel);
-        mTvCun = findViewById(R.id.tv_cun);
-        mTvGuan = findViewById(R.id.tv_guan);
-        mTvChi = findViewById(R.id.tv_chi);
-        mAsrCun = findViewById(R.id.asr_cun);
-        mAsrGuan = findViewById(R.id.asr_guan);
-        mAsrChi = findViewById(R.id.asr_chi);
-        mIvHand = findViewById(R.id.iv_hand);
-        mClLoading = findViewById(R.id.cl_loading);
-        mLv = findViewById(R.id.lv);
-
-        measureId = getIntent().getStringExtra("measureId");
-        hand = getIntent().getIntExtra("hand", 0);
-
-        mIvCancel.setColorFilter(ContextCompat.getColor(this, R.color.text_black));
-        mTvHand.setText(hand == 0 ? R.string.measure_left_hand : R.string.measure_right_hand);
-        mIvHand.setImageResource(hand == 0 ? R.mipmap.hand_left : R.mipmap.hand_right);
-
-        mIvCancel.postDelayed(new Runnable() {
-            @Override
-            public void run() {
-                startMeasure(hand == 0 ? HandType.LEFT_HAND : HandType.RIGHT_HAND, MeasureType.STEP_TYPE);
-            }
-        }, 300);
-
-        mAsrCun.post(new Runnable() {
-            @Override
-            public void run() {
-                initFlow();
-            }
-        });
-        mIvCancel.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                showCancelDialog();
-            }
-        });
-
-        ElectricFanLoadingRenderer renderer = new ElectricFanLoadingRenderer.Builder(this).build();
-        renderer.setRepeatCount(0);
-        mLv.setLoadingRenderer(renderer);
-        mLv.startAnimation();
-
-
-        mClLoading.setOnClickListener(new OnClickNoDoubleListener() {
-            @Override
-            public void onNoDoubleClick(View view) {
-
-            }
-        });
-
-        initTTS();
-    }
-
-    private void initTTS() {
-        textToSpeech = new TextToSpeech(this, new TextToSpeech.OnInitListener() {
-            @Override
-            public void onInit(int status) {
-                if (status == TextToSpeech.SUCCESS) {
-
-                    int result = textToSpeech.setLanguage(Locale.SIMPLIFIED_CHINESE);
-                    if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED) {
-                        Log.d("TextToSpeech", "Not Support Chinese");
-                        return;
-                    }
-
-                    textToSpeech.setPitch(1.0f);
-                    textToSpeech.setSpeechRate(1.0f);
-
-                } else {
-                    Log.d("TextToSpeech", "Failed");
-                }
-            }
-        });
-    }
-
-    private void changeFlowImg(AutoScrollRecyclerView asr, MaiFlowAdapter adapter, int[] data) {
-        int lastVisibleItemPosition = ((LinearLayoutManager) asr.getLayoutManager()).findLastVisibleItemPosition();
-        if (lastVisibleItemPosition != -1) {
-            int level = data[0];
-            if (level > 14) {
-                level = 14;
-            }
-            int[] imgIds;
-            switch (data[1]) {
-                case 1:
-                    imgIds = xiImgIds;
-                    break;
-                case 2:
-                    imgIds = huaImgIds;
-                    break;
-                case 0:
-                default:
-                    imgIds = changImgIds;
-            }
-            for (int i = lastVisibleItemPosition + 1; i < adapter.getData().size(); i++) {
-                adapter.getData().set(i, imgIds[level]);
-            }
-            adapter.notifyDataSetChanged();
-        }
-    }
-
-    private void changeWidth(int show) {
-        if (current != show) {
-            current = show;
-            cunAdapter.setWidth(mAsrCun.getWidth() / show);
-            guanAdapter.setWidth(mAsrGuan.getWidth() / show);
-            chiAdapter.setWidth(mAsrChi.getWidth() / show);
-        }
-    }
-
-    private void initFlow() {
-        int speed = 100;
-        LinearLayoutManager layoutCun = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
-        mAsrCun.setLayoutManager(layoutCun);
-        if (cunAdapter == null) {
-            cunAdapter = new MaiFlowAdapter(mAsrCun.getWidth() / 2);
-        }
-        ArrayList<Integer> cun = new ArrayList<>();
-        for (int i = 0; i < 1000; i++) {
-            cun.add(R.mipmap.mai_0);
-        }
-        cunAdapter.setNewData(cun);
-
-        mAsrCun.setAdapter(cunAdapter);
-        mAsrCun.openAutoScroll(speed, false);
-
-        LinearLayoutManager layoutGuan = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
-        mAsrGuan.setLayoutManager(layoutGuan);
-        if (guanAdapter == null) {
-            guanAdapter = new MaiFlowAdapter(mAsrGuan.getWidth() / 2);
-        }
-        ArrayList<Integer> guan = new ArrayList<>();
-        for (int i = 0; i < 1000; i++) {
-            guan.add(R.mipmap.mai_0);
-        }
-        guanAdapter.setNewData(guan);
-        mAsrGuan.setAdapter(guanAdapter);
-        mAsrGuan.openAutoScroll(speed, false);
-
-        LinearLayoutManager layoutChi = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
-        mAsrChi.setLayoutManager(layoutChi);
-        if (chiAdapter == null) {
-            chiAdapter = new MaiFlowAdapter(mAsrChi.getWidth() / 2);
-        }
-        ArrayList<Integer> chi = new ArrayList<>();
-        for (int i = 0; i < 1000; i++) {
-            chi.add(R.mipmap.mai_0);
-        }
-        chiAdapter.setNewData(chi);
-        mAsrChi.setAdapter(chiAdapter);
-        mAsrChi.openAutoScroll(speed, false);
-
-    }
-
-    @Override
-    public void sendMeasureStartCommand() {
-        super.sendMeasureStartCommand();
-
-    }
-
-    private void showCancelDialog() {
-
-        showDialog = DialogTipUtil.showSelectDialog(this, getString(R.string.measure_cancel), getString(R.string.measure_cancel_tip), R.string.app_cancel,
-                R.string.app_confirm, new DialogTipUtil.OptionClickCallback_I() {
-                    @Override
-                    public void leftClick() {
-                        showDialog = null;
-                    }
-
-                    @Override
-                    public void rightClick() {
-                        sendCancelMeasureCommand();
-                        finish();
-                    }
-                });
-
-
-    }
-
-
-    @Override
-    protected int initLayoutResId() {
-        return R.layout.activity_measure_3dflow;
-    }
-
-    @Override
-    protected void onRealTimeWaveGet(RealtimeWaveItem dataItem) {
-        int show = Math.round(dataItem.heart * 4 / 75f);
-        if (show < 3) {
-            show = 3;
-        }
-        if (show > 5) {
-            show = 5;
-        }
-        Log.w("MeasureFlowActivity", "heart:" + show + " heart:" + dataItem.heart * 4 / 75f);
-        changeFlowImg(mAsrCun, cunAdapter, dataItem.waveCun);
-        changeFlowImg(mAsrGuan, guanAdapter, dataItem.waveGuan);
-        changeFlowImg(mAsrChi, chiAdapter, dataItem.waveChi);
-        changeWidth(2);
-    }
-
-    @Override
-    protected void onMeasureStatusChanged(RealTimeMeasureStatus status) {
-
-
-        textToSpeech.speak(status.getDescription(), TextToSpeech.QUEUE_FLUSH, null);
-    }
-
-    @Override
-    protected void onMeasureFinished() {
-        super.onMeasureFinished();
-
-        mAsrCun.openAutoScroll(0, false);
-        mAsrGuan.openAutoScroll(0, false);
-        mAsrChi.openAutoScroll(0, false);
-
-        if (ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
-            uploadCsv();
-        } else {
-            popupPermissionTip(Manifest.permission.WRITE_EXTERNAL_STORAGE, R.string.permission_storage_2);
-        }
-
-    }
-
-
-    @Override
-    protected void onPermissionGet(int requestCode) {
-        uploadCsv();
-    }
-
-    private void uploadCsv() {
-
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                showLoading();
-            }
-        });
-        String uid = TaiyiManager.getInstance().getUid();
-        uploadCSV(uid, new OssInterface() {
-            @Override
-            public void onStartUpload() {
-
-            }
-
-            @Override
-            public void onSuccessUpload(String url) {
-                runOnUiThread(new Runnable() {
-                    @Override
-                    public void run() {
-                    }
-                });
-                PulseParamTen pulseParam = PulseParamTen
-                        .getParams("", hand, "20", "Android", Build.VERSION.SDK_INT + "", uid,
-                                uid, url, 0, "F");
-                uploadPulseData(pulseParam);
-            }
-
-            @Override
-            public void onFailedUpload() {
-                runOnUiThread(new Runnable() {
-                    @Override
-                    public void run() {
-                        DialogTipUtil.showIKnow(Measure3DFlowActivity.this, getString(R.string.unify_8), new DialogTipUtil.CommonCallback_I() {
-                            @Override
-                            public void onSuccess(String str) {
-                                setResult(RESULT_MEASURE_FAIL);
-                                finish();
-                            }
-                        });
-                    }
-                });
-
-            }
-        });
-
-    }
-
-    private void showLoading() {
-        mClLoading.setVisibility(View.VISIBLE);
-        mLv.startAnimation();
-    }
-
-    private void dismissLoading() {
-        mLv.stopAnimation();
-        mClLoading.setVisibility(View.GONE);
-    }
-
-    private void uploadPulseData(PulseParamTen pulseParam) {
-        HttpUtil.getInstance().measurePulseSave(pulseParam, new TokenOverDueHttpImpl<String>() {
-            @Override
-            public void overdue() {
-
-            }
-
-            @Override
-            public void showError(String error) {
-                showDialog = DialogTipUtil.showIKnow(Measure3DFlowActivity.this, getString(R.string.measure_data_uploading_failed),
-                        new DialogTipUtil.CommonCallback_I() {
-                            @Override
-                            public void onSuccess(String str) {
-                                setResult(RESULT_MEASURE_FAIL);
-                                finish();
-                            }
-                        });
-            }
-
-            @Override
-            public void showResponse(String response) {
-                startGetResultStatus();
-            }
-        });
-        /**
-        mTYMaiApi.saveMaiReportTen(pulseParam).compose(RxHttpResponseCompose.<BaseBean>compose())
-                .subscribe(new ProgressDialogSubscriber<BaseBean>(this) {
-                    @Override
-                    public void onNext(BaseBean baseBean) {
-                        super.onNext(baseBean);
-                        startGetResultStatus();
-                    }
-
-                    @Override
-                    public boolean isShowDialog() {
-                        return false;
-                    }
-
-                    @Override
-                    public void onError(Throwable e) {
-                        super.onError(e);
-
-                        if (e instanceof ApiException) {
-                            String code = ((ApiException) e).status_code;
-                            if (!code.equals("100002") && !code.equals("100121") && !code.equals("200125")) {
-                                DialogTipUtil.showIKnow(MeasureUSBNewDownActivity.this, getString(R.string.error_http),
-                                        new DialogTipUtil.CommonCallback_I() {
-                                            @Override
-                                            public void onSuccess(String str) {
-                                                setResult(RESULT_MEASURE_FAIL);
-                                                finish();
-                                            }
-                                        });
-                            }
-
-                        } else {
-                            DialogTipUtil.showIKnow(MeasureUSBNewDownActivity.this, e.getMessage() + ",,," + e.toString(),
-                                    new DialogTipUtil.CommonCallback_I() {
-                                        @Override
-                                        public void onSuccess(String str) {
-                                            setResult(RESULT_MEASURE_FAIL);
-                                            finish();
-                                        }
-                                    });
-                        }
-
-                    }
-
-                });
-         **/
-    }
-
-    private void startGetResultStatus() {
-        if (mCountTimer == null) {
-            mCountTimer = new CountDownTimer(26000, 3000) {
-                @Override
-                public void onTick(long millisUntilFinished) {
-                    getResultStatus();
-                }
-
-                @Override
-                public void onFinish() {
-                    showDialog = DialogTipUtil.showIKnow(Measure3DFlowActivity.this, getString(R.string.measure_data_uploading_failed),
-                            new DialogTipUtil.CommonCallback_I() {
-                                @Override
-                                public void onSuccess(String str) {
-                                    setResult(RESULT_MEASURE_FAIL);
-                                    finish();
-                                }
-                            });
-                }
-            };
-        }
-        mCountTimer.start();
-    }
-
-
-    private void getResultStatus() {
-        HttpUtil.getInstance().getMeasurePulseResult(new TokenOverDueHttpImpl<String>() {
-            @Override
-            public void overdue() {
-
-            }
-
-            @Override
-            public void showError(String error) {
-
-            }
-
-            @Override
-            public void showResponse(String usbResultStatus) {
-                if (usbResultStatus != null) {
-                    dismissLoading();
-                    Map usbResult = jsonToMap(usbResultStatus);
-                    int resultCode = Integer.valueOf((String) usbResult.get("measure_result"));
-                    if (resultCode != 0) {
-                        setResult(Activity.RESULT_OK);
-                        finish();
-                    } else {
-
-                        showDialog = DialogTipUtil.showIKnow(Measure3DFlowActivity.this, getString(R.string.measure_data_uploading_failed),
-                                new DialogTipUtil.CommonCallback_I() {
-                                    @Override
-                                    public void onSuccess(String str) {
-                                        setResult(RESULT_MEASURE_FAIL);
-                                        finish();
-                                    }
-                                });
-                    }
-                    if (mCountTimer != null) {
-                        mCountTimer.cancel();
-                        mCountTimer = null;
-                    }
-
-                }
-            }
-        });
-        /**
-        mTYMaiApi.getResultStatus(measureId, mAccessSession).compose(RxHttpResponseCompose.<USBResultStatusBean>compose())
-                .subscribe(new ProgressDialogSubscriber<USBResultStatusBean>(this) {
-                    @Override
-                    public void onNext(USBResultStatusBean usbResultStatus) {
-                        super.onNext(usbResultStatus);
-                        if (usbResultStatus.data != null) {
-                            dismissLoading();
-                            if (usbResultStatus.data.measure_result != 0) {
-                                setResult(Activity.RESULT_OK);
-                                finish();
-                            } else {
-
-                                DialogTipUtil.showIKnow(MeasureUSBNewDownActivity.this, getString(R.string.measure_data_uploading_failed),
-                                        new DialogTipUtil.CommonCallback_I() {
-                                            @Override
-                                            public void onSuccess(String str) {
-                                                setResult(RESULT_MEASURE_FAIL);
-                                                finish();
-                                            }
-                                        });
-                            }
-                            if (mCountTimer != null) {
-                                mCountTimer.cancel();
-                                mCountTimer = null;
-                            }
-
-                        }
-
-                    }
-
-                    @Override
-                    public void onError(Throwable e) {
-                        super.onError(e);
-                    }
-
-                    @Override
-                    public boolean isShowDialog() {
-                        return false;
-                    }
-                });
-         **/
-
-    }
-
-
-    @Override
-    protected void onUsbDetached() {
-        super.onUsbDetached();
-
-        showDialog = DialogTipUtil.showIKnow(this, getString(R.string.usb_detach_tip), new DialogTipUtil.CommonCallback_I() {
-            @Override
-            public void onSuccess(String str) {
-                EventBus.getDefault().post(new UsbEvent());
-                finish();
-            }
-        });
-    }
-
-
-    @Override
-    protected void onDestroy() {
-        super.onDestroy();
-        textToSpeech.stop();
-        textToSpeech.shutdown();
-        getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
-        if (showDialog != null) {
-            showDialog.dismiss();
-        }
-    }
-
-    @Override
-    protected boolean fitSystemWindows() {
-        return false;
-    }
-
-    @Override
-    protected boolean translucentStatus() {
-        return true;
-    }
-
-    @Override
-    public void onBackPressed() {
-        showCancelDialog();
-    }
-
-
-    /**
-     * @param content json字符串
-     * @return  如果转换失败返回null,
-     */
-    Map<String, Object> jsonToMap(String content) {
-        content = content.trim();
-        Map<String, Object> result = new HashMap<>();
-        try {
-            if (content.charAt(0) == '[') {
-                JSONArray jsonArray = new JSONArray(content);
-                for (int i = 0; i < jsonArray.length(); i++) {
-                    Object value = jsonArray.get(i);
-                    if (value instanceof JSONArray || value instanceof JSONObject) {
-                        result.put(i + "", jsonToMap(value.toString().trim()));
-                    } else {
-                        result.put(i + "", jsonArray.getString(i));
-                    }
-                }
-            } else if (content.charAt(0) == '{'){
-                JSONObject jsonObject = new JSONObject(content);
-                Iterator<String> iterator = jsonObject.keys();
-                while (iterator.hasNext()) {
-                    String key = iterator.next();
-                    Object value = jsonObject.get(key);
-                    if (value instanceof JSONArray || value instanceof JSONObject) {
-                        result.put(key, jsonToMap(value.toString().trim()));
-                    } else {
-                        result.put(key, value.toString().trim());
-                    }
-                }
-            }else {
-                Log.e("异常", "json2Map: 字符串格式错误");
-            }
-        } catch (JSONException e) {
-            Log.e("异常", "json2Map: ", e);
-            result = null;
-        }
-        return result;
-    }
-
-}

+ 0 - 587
TYUsbSDK/src/main/java/com/taiyi/tyusbsdk/pulse/ui/MeasureFlowActivity.java

@@ -1,587 +0,0 @@
-package com.taiyi.tyusbsdk.pulse.ui;
-
-import android.Manifest;
-import android.annotation.SuppressLint;
-import android.app.Activity;
-import android.app.Dialog;
-import android.content.pm.PackageManager;
-import android.os.Build;
-import android.os.CountDownTimer;
-import android.speech.tts.TextToSpeech;
-import android.util.Log;
-import android.view.View;
-import android.view.WindowManager;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-
-import com.jakewharton.rxbinding2.view.RxView;
-import com.taiyi.tyusbsdk.HandType;
-import com.taiyi.tyusbsdk.MeasureType;
-import com.taiyi.tyusbsdk.R;
-import com.taiyi.tyusbsdk.RealTimeAmpGraphView;
-import com.taiyi.tyusbsdk.RealTimeDataGraphView;
-import com.taiyi.tyusbsdk.RealTimeDataItem;
-import com.taiyi.tyusbsdk.RealTimeMeasureStatus;
-import com.taiyi.tyusbsdk.RealTimeMeasureView;
-import com.taiyi.tyusbsdk.TYUsbDeviceActivity;
-import com.taiyi.tyusbsdk.UsbEvent;
-import com.taiyi.tyusbsdk.pulse.TaiyiManager;
-import com.taiyi.tyusbsdk.pulse.bean.PulseParamTen;
-import com.taiyi.tyusbsdk.pulse.net.HttpUtil;
-import com.taiyi.tyusbsdk.pulse.net.TokenOverDueHttpImpl;
-import com.taiyi.tyusbsdk.pulse.util.DialogTipUtil;
-import com.taiyi.tyusbsdk.pulse.util.LoadingView;
-import com.taiyi.tyusbsdk.pulse.util.OnClickNoDoubleListener;
-import com.taiyi.tyusbsdk.pulse.util.scenery.ElectricFanLoadingRenderer;
-
-import org.greenrobot.eventbus.EventBus;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-import androidx.constraintlayout.widget.ConstraintLayout;
-import androidx.core.app.ActivityCompat;
-import androidx.core.content.ContextCompat;
-import io.reactivex.functions.Consumer;
-
-import static com.taiyi.tyusbsdk.pulse.ui.MeasureHandsActivity.RESULT_MEASURE_FAIL;
-
-public class MeasureFlowActivity extends TYUsbDeviceActivity {
-    private String measureId;
-    private int hand;
-    LinearLayout mLlBack;
-    ImageView mIvBack;
-    RealTimeMeasureView measureView;
-    RealTimeDataGraphView realtimeView;
-    RealTimeAmpGraphView ampView;
-    ConstraintLayout mClLoading;
-    LoadingView mLv;
-    TextView mTvTitle1;
-    TextView mTvTitle2;
-//    GifView gifView1;
-//    GifView gifView2;
-    private TextToSpeech textToSpeech;
-    private CountDownTimer mCountTimer;
-    Dialog showDialog;
-
-    @SuppressLint("CheckResult")
-    @Override
-    protected void init() {
-        mLlBack = findViewById(R.id.ll_back);
-        mIvBack = findViewById(R.id.iv_back);
-        measureView = findViewById(R.id.rtmv);
-        realtimeView = findViewById(R.id.rtdgv);
-        ampView = findViewById(R.id.rtagv);
-        mClLoading = findViewById(R.id.cl_loading);
-        mLv = findViewById(R.id.lv);
-        mTvTitle1 = findViewById(R.id.title_1);
-        mTvTitle2 = findViewById(R.id.title_2);
-//        gifView1 = findViewById(R.id.gifViewId1);
-//        gifView2 = findViewById(R.id.gifViewId2);
-
-        measureId = getIntent().getStringExtra("measureId");
-        hand = getIntent().getIntExtra("hand", 0);
-        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
-        mIvBack.setColorFilter(ContextCompat.getColor(this, R.color.white));
-
-        RxView.clicks(mLlBack).throttleFirst(1, TimeUnit.SECONDS).subscribe(new Consumer<Object>() {
-            @Override
-            public void accept(Object o) throws Exception {
-                showCancelDialog();
-            }
-        });
-
-        ElectricFanLoadingRenderer renderer = new ElectricFanLoadingRenderer.Builder(this).build();
-        renderer.setRepeatCount(0);
-        mLv.setLoadingRenderer(renderer);
-        mLv.startAnimation();
-
-        mClLoading.setOnClickListener(new OnClickNoDoubleListener() {
-            @Override
-            public void onNoDoubleClick(View view) {
-
-            }
-        });
-
-        mIvBack.postDelayed(new Runnable() {
-            @Override
-            public void run() {
-                startMeasure(hand == 0 ? HandType.LEFT_HAND : HandType.RIGHT_HAND, MeasureType.STEP_TYPE);
-                measureView.startTimerCountDown();
-            }
-        }, 300);
-        initTTS();
-    }
-
-    private void initTTS() {
-        textToSpeech = new TextToSpeech(this, new TextToSpeech.OnInitListener() {
-            @Override
-            public void onInit(int status) {
-                if (status == TextToSpeech.SUCCESS) {
-
-                    int result = textToSpeech.setLanguage(Locale.SIMPLIFIED_CHINESE);
-                    if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED) {
-                        Log.d("TextToSpeech", "Not Support Chinese");
-                        return;
-                    }
-
-                    textToSpeech.setPitch(1.0f);
-                    textToSpeech.setSpeechRate(1.0f);
-
-                } else {
-                    Log.d("TextToSpeech", "Failed");
-                }
-            }
-        });
-    }
-
-    @Override
-    public void sendMeasureStartCommand() {
-        super.sendMeasureStartCommand();
-
-    }
-
-    private void showCancelDialog() {
-
-        showDialog = DialogTipUtil.showSelectDialog(this, getString(R.string.measure_cancel), getString(R.string.measure_cancel_tip), R.string.app_cancel,
-                R.string.app_confirm, new DialogTipUtil.OptionClickCallback_I() {
-                    @Override
-                    public void leftClick() {
-                        showDialog = null;
-                    }
-
-                    @Override
-                    public void rightClick() {
-                        sendCancelMeasureCommand();
-                        finish();
-                    }
-                });
-
-
-    }
-
-
-    @Override
-    protected int initLayoutResId() {
-        return R.layout.activity_measure_flow;
-    }
-
-
-    @Override
-    protected void onMeasureStatusChanged(RealTimeMeasureStatus status) {
-
-        mTvTitle1.setText("");
-        mTvTitle2.setText(status.getDescription());
-        if (status == RealTimeMeasureStatus.START_MEASURE) {
-            measureView.startTimerCountDown();
-        }
-        if (status == RealTimeMeasureStatus.WAITING_INFLATE) {
-//            gifView1.setVisibility(View.VISIBLE);
-
-        } else if (status == RealTimeMeasureStatus.START_MEASURE) {
-//            gifView1.setVisibility(View.GONE);
-            measureView.startTimerCountDown();
-        } else if (status == RealTimeMeasureStatus.FINISH_MEASURE) {
-//            gifView2.setVisibility(View.VISIBLE);
-        } else if (status == RealTimeMeasureStatus.END_MEASURE) {
-//            gifView2.setVisibility(View.GONE);
-        }
-
-        textToSpeech.speak(status.getDescription(), TextToSpeech.QUEUE_FLUSH, null);
-    }
-
-
-    @Override
-    protected void onMeasureDataReceived(long currentTime, long totalTime, String[] measureData) {
-
-        measureView.setProgressValue(Integer.valueOf(measureData[98]) / 100);
-    }
-
-    @Override
-    protected void onReceiveAmplitudeData(List<Integer> indexArray) {
-        ampView.addData(indexArray, measureView.getNowTime());
-    }
-
-    @Override
-    protected void onMeasureInOtherStatus(String[] measureData) {
-        if (measureView != null) {
-            measureView.setProgressValue(Integer.valueOf(measureData[98])/100);
-        }
-
-
-    }
-    @Override
-    protected void onMeasureFinished() {
-        super.onMeasureFinished();
-
-        if (ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
-            uploadCsv();
-        } else {
-            popupPermissionTip(Manifest.permission.WRITE_EXTERNAL_STORAGE, R.string.permission_storage_2);
-        }
-
-    }
-
-    @Override
-    protected void onReceiveRealTimeData(RealTimeDataItem realtimeData) {
-        //        realtimeView.setText(realtimeData.toString());
-        realtimeView.addLinePoint(realtimeData);
-    }
-
-    @Override
-    protected void onReceivePeriodicFeatureData(List<Integer> indexArray) {
-        realtimeView.addBubblePoint(indexArray);
-    }
-
-    @Override
-    protected void onPermissionGet(int requestCode) {
-        uploadCsv();
-    }
-
-    private void uploadCsv() {
-
-        runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                showLoading();
-            }
-        });
-        String uid = TaiyiManager.getInstance().getUid();
-        uploadCSV(uid, new OssInterface() {
-            @Override
-            public void onStartUpload() {
-
-            }
-
-            @Override
-            public void onSuccessUpload(String url) {
-                runOnUiThread(new Runnable() {
-                    @Override
-                    public void run() {
-                    }
-                });
-                PulseParamTen pulseParam = PulseParamTen
-                        .getParams("", hand, "20", "Android", Build.VERSION.SDK_INT + "", uid,
-                                uid, url, 0, "F");
-                uploadPulseData(pulseParam);
-            }
-
-            @Override
-            public void onFailedUpload() {
-                runOnUiThread(new Runnable() {
-                    @Override
-                    public void run() {
-                        DialogTipUtil.showIKnow(MeasureFlowActivity.this, getString(R.string.unify_8), new DialogTipUtil.CommonCallback_I() {
-                            @Override
-                            public void onSuccess(String str) {
-                                setResult(RESULT_MEASURE_FAIL);
-                                finish();
-                            }
-                        });
-                    }
-                });
-
-            }
-        });
-
-    }
-
-    private void showLoading() {
-        mClLoading.setVisibility(View.VISIBLE);
-        mLv.startAnimation();
-    }
-
-    private void dismissLoading() {
-        mLv.stopAnimation();
-        mClLoading.setVisibility(View.GONE);
-    }
-
-    private void uploadPulseData(PulseParamTen pulseParam) {
-        HttpUtil.getInstance().measurePulseSave(pulseParam, new TokenOverDueHttpImpl<String>() {
-            @Override
-            public void overdue() {
-
-            }
-
-            @Override
-            public void showError(String error) {
-                showDialog = DialogTipUtil.showIKnow(MeasureFlowActivity.this, getString(R.string.measure_data_uploading_failed),
-                        new DialogTipUtil.CommonCallback_I() {
-                            @Override
-                            public void onSuccess(String str) {
-                                setResult(RESULT_MEASURE_FAIL);
-                                finish();
-                            }
-                        });
-            }
-
-            @Override
-            public void showResponse(String response) {
-                startGetResultStatus();
-            }
-        });
-        /**
-        mTYMaiApi.saveMaiReportTen(pulseParam).compose(RxHttpResponseCompose.<BaseBean>compose())
-                .subscribe(new ProgressDialogSubscriber<BaseBean>(this) {
-                    @Override
-                    public void onNext(BaseBean baseBean) {
-                        super.onNext(baseBean);
-                        startGetResultStatus();
-                    }
-
-                    @Override
-                    public boolean isShowDialog() {
-                        return false;
-                    }
-
-                    @Override
-                    public void onError(Throwable e) {
-                        super.onError(e);
-
-                        if (e instanceof ApiException) {
-                            String code = ((ApiException) e).status_code;
-                            if (!code.equals("100002") && !code.equals("100121") && !code.equals("200125")) {
-                                DialogTipUtil.showIKnow(MeasureUSBNewDownActivity.this, getString(R.string.error_http),
-                                        new DialogTipUtil.CommonCallback_I() {
-                                            @Override
-                                            public void onSuccess(String str) {
-                                                setResult(RESULT_MEASURE_FAIL);
-                                                finish();
-                                            }
-                                        });
-                            }
-
-                        } else {
-                            DialogTipUtil.showIKnow(MeasureUSBNewDownActivity.this, e.getMessage() + ",,," + e.toString(),
-                                    new DialogTipUtil.CommonCallback_I() {
-                                        @Override
-                                        public void onSuccess(String str) {
-                                            setResult(RESULT_MEASURE_FAIL);
-                                            finish();
-                                        }
-                                    });
-                        }
-
-                    }
-
-                });
-         **/
-    }
-
-    private void startGetResultStatus() {
-        if (mCountTimer == null) {
-            mCountTimer = new CountDownTimer(26000, 3000) {
-                @Override
-                public void onTick(long millisUntilFinished) {
-                    getResultStatus();
-                }
-
-                @Override
-                public void onFinish() {
-                    showDialog = DialogTipUtil.showIKnow(MeasureFlowActivity.this, getString(R.string.measure_data_uploading_failed),
-                            new DialogTipUtil.CommonCallback_I() {
-                                @Override
-                                public void onSuccess(String str) {
-                                    setResult(RESULT_MEASURE_FAIL);
-                                    finish();
-                                }
-                            });
-                }
-            };
-        }
-        mCountTimer.start();
-    }
-
-
-    private void getResultStatus() {
-        HttpUtil.getInstance().getMeasurePulseResult(new TokenOverDueHttpImpl<String>() {
-            @Override
-            public void overdue() {
-
-            }
-
-            @Override
-            public void showError(String error) {
-
-            }
-
-            @Override
-            public void showResponse(String usbResultStatus) {
-                if (usbResultStatus != null) {
-                    dismissLoading();
-                    Map usbResult = jsonToMap(usbResultStatus);
-                    int resultCode = Integer.valueOf((String) usbResult.get("measure_result"));
-                    if (resultCode != 0) {
-                        setResult(Activity.RESULT_OK);
-                        finish();
-                    } else {
-
-                        showDialog = DialogTipUtil.showIKnow(MeasureFlowActivity.this, getString(R.string.measure_data_uploading_failed),
-                                new DialogTipUtil.CommonCallback_I() {
-                                    @Override
-                                    public void onSuccess(String str) {
-                                        setResult(RESULT_MEASURE_FAIL);
-                                        finish();
-                                    }
-                                });
-                    }
-                    if (mCountTimer != null) {
-                        mCountTimer.cancel();
-                        mCountTimer = null;
-                    }
-
-                }
-            }
-        });
-        /**
-        mTYMaiApi.getResultStatus(measureId, mAccessSession).compose(RxHttpResponseCompose.<USBResultStatusBean>compose())
-                .subscribe(new ProgressDialogSubscriber<USBResultStatusBean>(this) {
-                    @Override
-                    public void onNext(USBResultStatusBean usbResultStatus) {
-                        super.onNext(usbResultStatus);
-                        if (usbResultStatus.data != null) {
-                            dismissLoading();
-                            if (usbResultStatus.data.measure_result != 0) {
-                                setResult(Activity.RESULT_OK);
-                                finish();
-                            } else {
-
-                                DialogTipUtil.showIKnow(MeasureUSBNewDownActivity.this, getString(R.string.measure_data_uploading_failed),
-                                        new DialogTipUtil.CommonCallback_I() {
-                                            @Override
-                                            public void onSuccess(String str) {
-                                                setResult(RESULT_MEASURE_FAIL);
-                                                finish();
-                                            }
-                                        });
-                            }
-                            if (mCountTimer != null) {
-                                mCountTimer.cancel();
-                                mCountTimer = null;
-                            }
-
-                        }
-
-                    }
-
-                    @Override
-                    public void onError(Throwable e) {
-                        super.onError(e);
-                    }
-
-                    @Override
-                    public boolean isShowDialog() {
-                        return false;
-                    }
-                });
-         **/
-
-    }
-
-
-    @Override
-    protected void onUsbDetached() {
-        super.onUsbDetached();
-
-        showDialog = DialogTipUtil.showIKnow(this, getString(R.string.usb_detach_tip), new DialogTipUtil.CommonCallback_I() {
-            @Override
-            public void onSuccess(String str) {
-                EventBus.getDefault().post(new UsbEvent());
-                finish();
-            }
-        });
-    }
-
-
-    @Override
-    protected void onDestroy() {
-        super.onDestroy();
-        textToSpeech.stop();
-        textToSpeech.shutdown();
-        getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
-        if (showDialog != null) {
-            showDialog.dismiss();
-        }
-    }
-
-    @Override
-    protected boolean fitSystemWindows() {
-        return false;
-    }
-
-    @Override
-    protected boolean translucentStatus() {
-        return true;
-    }
-
-    @Override
-    public void onBackPressed() {
-        showDialog();
-    }
-
-    private void showDialog() {
-
-        showDialog = DialogTipUtil.showSelectDialog(this, getString(R.string.measure_cancel), getString(R.string.measure_cancel_tip), R.string.app_cancel,
-                R.string.app_confirm, new DialogTipUtil.OptionClickCallback_I() {
-                    @Override
-                    public void leftClick() {
-                        showDialog = null;
-                    }
-
-                    @Override
-                    public void rightClick() {
-                        finish();
-                    }
-                });
-
-    }
-
-    /**
-     * @param content json字符串
-     * @return  如果转换失败返回null,
-     */
-    Map<String, Object> jsonToMap(String content) {
-        content = content.trim();
-        Map<String, Object> result = new HashMap<>();
-        try {
-            if (content.charAt(0) == '[') {
-                JSONArray jsonArray = new JSONArray(content);
-                for (int i = 0; i < jsonArray.length(); i++) {
-                    Object value = jsonArray.get(i);
-                    if (value instanceof JSONArray || value instanceof JSONObject) {
-                        result.put(i + "", jsonToMap(value.toString().trim()));
-                    } else {
-                        result.put(i + "", jsonArray.getString(i));
-                    }
-                }
-            } else if (content.charAt(0) == '{'){
-                JSONObject jsonObject = new JSONObject(content);
-                Iterator<String> iterator = jsonObject.keys();
-                while (iterator.hasNext()) {
-                    String key = iterator.next();
-                    Object value = jsonObject.get(key);
-                    if (value instanceof JSONArray || value instanceof JSONObject) {
-                        result.put(key, jsonToMap(value.toString().trim()));
-                    } else {
-                        result.put(key, value.toString().trim());
-                    }
-                }
-            }else {
-                Log.e("异常", "json2Map: 字符串格式错误");
-            }
-        } catch (JSONException e) {
-            Log.e("异常", "json2Map: ", e);
-            result = null;
-        }
-        return result;
-    }
-
-}

+ 0 - 597
TYUsbSDK/src/main/java/com/taiyi/tyusbsdk/pulse/ui/MeasureHandsActivity.java

@@ -1,597 +0,0 @@
-package com.taiyi.tyusbsdk.pulse.ui;
-
-import android.Manifest;
-import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.text.TextUtils;
-import android.view.View;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-import android.widget.Toast;
-
-import com.jakewharton.rxbinding2.view.RxView;
-import com.taiyi.tyusbsdk.R;
-import com.taiyi.tyusbsdk.TYDeviceConnectCallback;
-import com.taiyi.tyusbsdk.TYDeviceSoftware;
-import com.taiyi.tyusbsdk.TYError;
-import com.taiyi.tyusbsdk.TYUsbDeviceActivity;
-import com.taiyi.tyusbsdk.USBDataTemp;
-import com.taiyi.tyusbsdk.pulse.EventTestMaiMessage;
-import com.taiyi.tyusbsdk.pulse.TaiyiManager;
-import com.taiyi.tyusbsdk.pulse.bean.PulseResult;
-import com.taiyi.tyusbsdk.pulse.net.HttpImpl;
-import com.taiyi.tyusbsdk.pulse.net.HttpUtil;
-import com.taiyi.tyusbsdk.pulse.net.TokenOverDueHttpImpl;
-import com.taiyi.tyusbsdk.pulse.util.AppManager;
-import com.taiyi.tyusbsdk.pulse.util.DialogTipUtil;
-import com.taiyi.tyusbsdk.pulse.util.LogUtil;
-import com.taiyi.tyusbsdk.pulse.util.OnClickNoDoubleListener;
-import com.taiyi.tyusbsdk.pulse.util.QTimeUtil;
-
-import org.greenrobot.eventbus.EventBus;
-import org.greenrobot.eventbus.Subscribe;
-import org.greenrobot.eventbus.ThreadMode;
-
-import java.util.concurrent.TimeUnit;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.appcompat.app.AppCompatActivity;
-import androidx.core.content.ContextCompat;
-import io.reactivex.functions.Consumer;
-
-public class MeasureHandsActivity extends TYUsbDeviceActivity {
-
-    private int retryType = 0;
-    private final static int RETRY_LEFT = 201;
-    private final static int RETRY_RIGHT = 202;
-    private final static int RETRY_SAVE = 203;
-    public static final int REQUEST_MEASURE_LEFT = 101;
-    public static final int REQUEST_MEASURE_RIGHT = 102;
-    public static final int RESULT_MEASURE_FAIL = 203;
-    private String leftMaiId;
-    private String rightMaiId;
-
-    private String currentDevice;
-    private LinearLayout backBtn;
-    private TextView mTvLeft;
-    private TextView mTvRight;
-    private TextView mtvTypeLeft;
-    private TextView mtvTypeRight;
-    private TextView mTvSubmit;
-    private boolean fixMode = false;
-    private boolean isTestLeftHand = true;
-    private boolean isAutoTest = false;
-    private boolean isAutoTestLeftHand = true;
-
-    @Override
-    protected void init() {
-        backBtn = findViewById(R.id.ll_back);
-        mTvLeft = findViewById(R.id.tv_left);
-        mTvRight = findViewById(R.id.tv_right);
-        mtvTypeLeft = findViewById(R.id.tv_type_left);
-        mtvTypeRight = findViewById(R.id.tv_type_right);
-        mTvSubmit = findViewById(R.id.tv_submit);
-
-        isAutoTest = getIntent().getBooleanExtra("autoTest", false);
-        isAutoTestLeftHand = getIntent().getBooleanExtra("isAutoTestLeftHand", true);
-
-
-
-        backBtn.setOnClickListener(new OnClickNoDoubleListener() {
-            @Override
-            public void onNoDoubleClick(View view) {
-                disconnectCurrentTYDevice();
-                finish();
-            }
-        });
-
-        RxView.clicks(mTvSubmit).throttleFirst(1, TimeUnit.SECONDS).subscribe(new Consumer<Object>() {
-            @Override
-            public void accept(Object o) {
-                submit();
-            }
-        });
-
-        updateMeasureStatus();
-
-        EventBus.getDefault().register(this);
-    }
-
-
-
-    private void connectUSBMaiDevice(boolean isLeftHand) {
-        disconnectCurrentTYDevice();
-        connectAccurateTYDevice(isLeftHand, new TYDeviceConnectCallback() {
-
-            @Override
-            public void deviceConnectedSuccessCallback(String deviceName) {
-                isTestLeftHand = isLeftHand;
-                sendDeviceVersionCommand();
-                sendDeviceStatusCommad();
-
-                currentDevice = deviceName;
-//              USBDataTemp.getInstance().device_model = deviceName;
-                USBDataTemp.getInstance().device_model = "D5FBAF0E145E";
-
-            }
-
-            @Override
-            public void deviceConnectedFailureCallback(TYError error) {
-                DialogTipUtil.showSelectDialog(MeasureHandsActivity.this, getString(R.string.dialog_tip_tip), "无法连接脉诊设备。是否跳过脉诊?",
-                        R.string.measure_skip, R.string.dialog_tip_retry, new DialogTipUtil.OptionClickCallback_I() {
-                            @Override
-                            public void leftClick() {
-                                TaiyiManager.getInstance().clearMeasure();
-                                if (TaiyiManager.getInstance().getSkipInterface() != null) {
-                                    TaiyiManager.getInstance().getSkipInterface().onSkip();
-                                }
-                                finish();
-                            }
-
-                            @Override
-                            public void rightClick() {
-                                connectUSBMaiDevice(isLeftHand);
-                            }
-                        });
-            }
-        });
-
-    }
-
-    @Override
-    protected int initLayoutResId() {
-        return R.layout.activity_measure_hands;
-    }
-
-    @Override
-    protected void onUsbDetached() {
-        finish();
-    }
-
-    @Override
-    protected void onDestroy() {
-        disconnectCurrentTYDevice();
-        super.onDestroy();
-        EventBus.getDefault().unregister(this);
-    }
-
-    @Override
-    protected void onDeviceReceiveVersion(TYDeviceSoftware software) {
-        USBDataTemp.getInstance().hardware_version = software.yjversion + "";
-        USBDataTemp.getInstance().firmware_version = software.gjversion + "";
-        USBDataTemp.getInstance().alg_version = software.sjversion + "";
-
-        if (isTestLeftHand) {
-            getLeftUUID();
-        } else {
-            getRightUUID();
-        }
-    }
-
-    @Override
-    protected void onDeviceReceiveStatus(int status) {
-//        ((TextView)findViewById(R.id.statusTV)).setText("设备状态:"+String.valueOf(status));
-    }
-
-
-
-    @Override
-    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
-        if (grantResults.length == 0 || grantResults[0] != PackageManager.PERMISSION_GRANTED) {
-            popupPermissionTip(Manifest.permission.WRITE_EXTERNAL_STORAGE, R.string.permission_storage_2);
-        }
-    }
-
-    private void getToken() {
-        HttpUtil.getInstance().getRequestQueue(this).check(new HttpImpl<String>() {
-            @Override
-            public void showError(String error) {
-
-                DialogTipUtil.showSelectDialog(MeasureHandsActivity.this, getString(R.string.dialog_tip_tip), getString(R.string.measure_skip_tip_1),
-                        R.string.measure_skip, R.string.dialog_tip_retry, new DialogTipUtil.OptionClickCallback_I() {
-                            @Override
-                            public void leftClick() {
-                                TaiyiManager.getInstance().clearMeasure();
-                                if (TaiyiManager.getInstance().getSkipInterface() != null) {
-                                    TaiyiManager.getInstance().getSkipInterface().onSkip();
-                                }
-//                                finish();
-                                AppManager.getAppManager().finishAllActivity();
-                            }
-
-                            @Override
-                            public void rightClick() {
-                                getToken();
-                            }
-                        });
-            }
-
-            @Override
-            public void showResponse(String response) {
-                HttpUtil.AuthorizationValue = response;
-
-                switch (retryType) {
-                    case RETRY_LEFT:
-                        getLeftUUID();
-                        break;
-                    case RETRY_RIGHT:
-                        getRightUUID();
-                        break;
-                    case RETRY_SAVE:
-                        saveMai();
-                        break;
-                }
-
-
-            }
-        });
-
-    }
-
-    @Override
-    protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
-        super.onActivityResult(requestCode, resultCode, data);
-        if (requestCode == REQUEST_MEASURE_LEFT) {
-            if (resultCode == AppCompatActivity.RESULT_OK) {
-                leftMaiId = USBDataTemp.getInstance().measure_id;
-                fixMode = true;
-
-                mtvTypeLeft.setText(R.string.measure_succeed_tip);
-                mtvTypeLeft.setBackground(ContextCompat.getDrawable(this, R.drawable.bg_green_border_3dp));
-
-            } else if (resultCode == RESULT_MEASURE_FAIL) {
-                mtvTypeLeft.setText(R.string.measure_failed_tip);
-                mtvTypeLeft.setBackground(ContextCompat.getDrawable(this, R.drawable.bg_red_border_3dp));
-            }
-            updateMeasureStatus();
-        } else if (requestCode == REQUEST_MEASURE_RIGHT) {
-            if (resultCode == AppCompatActivity.RESULT_OK) {
-                rightMaiId = USBDataTemp.getInstance().measure_id;
-                fixMode = true;
-
-                mtvTypeRight.setText(R.string.measure_succeed_tip);
-                mtvTypeRight.setBackground(ContextCompat.getDrawable(this, R.drawable.bg_green_border_3dp));
-            } else if (resultCode == RESULT_MEASURE_FAIL) {
-                mtvTypeRight.setText(R.string.measure_failed_tip);
-                mtvTypeRight.setBackground(ContextCompat.getDrawable(this, R.drawable.bg_red_border_3dp));
-            }
-            updateMeasureStatus();
-        }
-    }
-
-    private void resetToMeasure() {
-
-        leftMaiId = null;
-        rightMaiId = null;
-        mtvTypeLeft.setText("");
-        mtvTypeLeft.setBackground(null);
-        mtvTypeRight.setText("");
-        mtvTypeRight.setBackground(null);
-        fixMode = false;
-        updateMeasureStatus();
-    }
-
-    private void getLeftUUID() {
-        HttpUtil.getInstance().getUUID(new TokenOverDueHttpImpl<String>() {
-            @Override
-            public void overdue() {
-                retryType = RETRY_LEFT;
-                getToken();
-            }
-
-            @Override
-            public void showError(String error) {
-                retryType = RETRY_LEFT;
-                DialogTipUtil.showSelectDialog(MeasureHandsActivity.this, getString(R.string.dialog_tip_tip), getString(R.string.measure_skip_tip_1),
-                        R.string.measure_skip, R.string.dialog_tip_retry, new DialogTipUtil.OptionClickCallback_I() {
-                            @Override
-                            public void leftClick() {
-                                TaiyiManager.getInstance().clearMeasure();
-                                if (TaiyiManager.getInstance().getSkipInterface() != null) {
-                                    TaiyiManager.getInstance().getSkipInterface().onSkip();
-                                }
-                                finish();
-                            }
-
-                            @Override
-                            public void rightClick() {
-                                getLeftUUID();
-                            }
-                        });
-            }
-
-            @Override
-            public void showResponse(String response) {
-                retryType = 0;
-                USBDataTemp.getInstance().measure_id = response;
-                Intent intent = new Intent(MeasureHandsActivity.this, MeasureFlowActivity.class);
-                intent.putExtra("measureId", response);
-                intent.putExtra("hand", 0);
-                startActivityForResult(intent, REQUEST_MEASURE_LEFT);
-            }
-
-        });
-
-
-    }
-
-    private void getRightUUID() {
-        HttpUtil.getInstance().getUUID(new TokenOverDueHttpImpl<String>() {
-            @Override
-            public void showResponse(String response) {
-                retryType = 0;
-                USBDataTemp.getInstance().measure_id = response;
-                Intent intent = new Intent(MeasureHandsActivity.this, MeasureFlowActivity.class);
-                intent.putExtra("measureId", response);
-                intent.putExtra("hand", 1);
-                startActivityForResult(intent, REQUEST_MEASURE_RIGHT);
-            }
-
-            @Override
-            public void overdue() {
-                retryType = RETRY_RIGHT;
-                getToken();
-            }
-
-            @Override
-            public void showError(String error) {
-                retryType = RETRY_RIGHT;
-                DialogTipUtil.showSelectDialog(MeasureHandsActivity.this, getString(R.string.dialog_tip_tip), getString(R.string.measure_skip_tip_1),
-                        R.string.measure_skip, R.string.dialog_tip_retry, new DialogTipUtil.OptionClickCallback_I() {
-                            @Override
-                            public void leftClick() {
-                                TaiyiManager.getInstance().clearMeasure();
-                                if (TaiyiManager.getInstance().getSkipInterface() != null) {
-                                    TaiyiManager.getInstance().getSkipInterface().onSkip();
-                                }
-                                finish();
-                            }
-
-                            @Override
-                            public void rightClick() {
-                                getRightUUID();
-                            }
-                        });
-            }
-
-
-        });
-    }
-
-    private void submit() {
-
-        if (leftMaiId == null || rightMaiId == null) {
-            DialogTipUtil.showSingleHandDialog(this, new DialogTipUtil.OptionClickCallback_I() {
-                @Override
-                public void leftClick() {
-                    saveMai();
-                }
-
-                @Override
-                public void rightClick() {
-
-                }
-            });
-        } else {
-            saveMai();
-        }
-
-    }
-
-    private void saveMai() {
-
-        HttpUtil.getInstance().saveCombined(leftMaiId, rightMaiId, new TokenOverDueHttpImpl<String>() {
-            @Override
-            public void overdue() {
-                retryType = RETRY_SAVE;
-                getToken();
-            }
-
-            @Override
-            public void showError(String error) {
-                retryType = RETRY_SAVE;
-                DialogTipUtil.showSelectDialog(MeasureHandsActivity.this, getString(R.string.dialog_tip_tip), getString(R.string.measure_skip_tip_1),
-                        R.string.measure_skip, R.string.dialog_tip_retry, new DialogTipUtil.OptionClickCallback_I() {
-                            @Override
-                            public void leftClick() {
-                                TaiyiManager.getInstance().clearMeasure();
-                                if (TaiyiManager.getInstance().getSkipInterface() != null) {
-                                    TaiyiManager.getInstance().getSkipInterface().onSkip();
-                                }
-                                finish();
-                            }
-
-                            @Override
-                            public void rightClick() {
-                                saveMai();
-                            }
-                        });
-            }
-
-            @Override
-            public void showResponse(String measureId) {
-                retryType = 0;
-//                Intent intent = new Intent(MeasureHandsActivity.this, SuccessActivity.class);
-//                intent.putExtra("measureId", measureId);
-//                startActivity(intent);
-//
-//                String pulseUrl = "https://hybrid.test.reborn-tech.com/";
-//                pulseUrl += "report.html#/?mid=" + measureId + "&access_session=" + HttpUtil.AuthorizationValue + "&appId=" + TaiyiManager.getInstance().getAppId();
-//                String handStyle = "";
-//                if (leftMaiId != null && rightMaiId != null) {
-//                    handStyle = "DOUBLE";
-//                } else if (leftMaiId != null) {
-//                    handStyle = "LEFT";
-//                } else if (rightMaiId != null) {
-//                    handStyle = "RIGHT";
-//                }
-//                String pr = PulseResult.create(measureId,pulseUrl,handStyle,QTimeUtil.toDatetimeStr(),"").toString();
-//                TaiyiManager.getInstance().setPulseResult(pr);
-//                resetToMeasure();
-                getCombinedReportDesc(measureId);
-            }
-        });
-
-    }
-
-    public void getCombinedReportDesc(String combiledId) {
-        HttpUtil.getInstance().getCombinedDesc(combiledId, new TokenOverDueHttpImpl<String>() {
-            @Override
-            public void overdue() {
-
-            }
-
-            @Override
-            public void showError(String error) {
-                DialogTipUtil.showSelectDialog(MeasureHandsActivity.this, getString(R.string.dialog_tip_tip), getString(R.string.measure_skip_tip_1),
-                        R.string.measure_skip, R.string.dialog_tip_retry, new DialogTipUtil.OptionClickCallback_I() {
-                            @Override
-                            public void leftClick() {
-                                TaiyiManager.getInstance().clearMeasure();
-                                if (TaiyiManager.getInstance().getSkipInterface() != null) {
-                                    TaiyiManager.getInstance().getSkipInterface().onSkip();
-                                }
-                                finish();
-                            }
-
-                            @Override
-                            public void rightClick() {
-                                getCombinedReportDesc(combiledId);
-                            }
-                        });
-            }
-
-            @Override
-            public void showResponse(String response) {
-                Intent intent = new Intent(MeasureHandsActivity.this, SuccessActivity.class);
-                intent.putExtra("measureId", combiledId);
-                startActivity(intent);
-
-                String pulseUrl = "https://hybrid.reborn-tech.com/";
-                pulseUrl += "report.html#/?mid=" + combiledId + "&access_session=" + HttpUtil.AuthorizationValue + "&appId=" + TaiyiManager.getInstance().getAppId();
-                String handStyle = "";
-                if (leftMaiId != null && rightMaiId != null) {
-                    handStyle = "DOUBLE";
-                } else if (leftMaiId != null) {
-                    handStyle = "LEFT";
-                } else if (rightMaiId != null) {
-                    handStyle = "RIGHT";
-                }
-                String pr = PulseResult.create(combiledId,pulseUrl,handStyle,QTimeUtil.toDatetimeStr(),response).toString();
-                TaiyiManager.getInstance().setPulseResult(pr);
-                resetToMeasure();
-            }
-        });
-    }
-
-    private void updateMeasureStatus() {
-        if (!TextUtils.isEmpty(leftMaiId) && !TextUtils.isEmpty(rightMaiId)) {
-            mTvLeft.setEnabled(false);
-            mTvRight.setEnabled(false);
-            leftDark();
-            rightDark();
-            mTvSubmit.setEnabled(true);
-        } else if (!TextUtils.isEmpty(leftMaiId)) {
-            mTvLeft.setEnabled(true);
-            mTvRight.setEnabled(true);
-            leftDark();
-            rightLight();
-            RxView.clicks(mTvLeft).throttleFirst(1, TimeUnit.SECONDS).subscribe(new Consumer<Object>() {
-                @Override
-                public void accept(Object o) throws Exception {
-                    Toast.makeText(MeasureHandsActivity.this, getString(R.string.measure_right_tip_1), Toast.LENGTH_SHORT).show();
-                }
-            });
-
-            RxView.clicks(mTvRight).throttleFirst(1, TimeUnit.SECONDS).subscribe(new Consumer<Object>() {
-                @Override
-                public void accept(Object o) throws Exception {
-                    connectUSBMaiDevice(false);
-                }
-            });
-
-            mTvSubmit.setEnabled(true);
-        } else if (!TextUtils.isEmpty(rightMaiId)) {
-            LogUtil.w("MainActivityB updateMeasureStatus DOUBLE", "left  null");
-            mTvLeft.setEnabled(true);
-            mTvRight.setEnabled(true);
-            leftLight();
-            rightDark();
-
-            RxView.clicks(mTvLeft).throttleFirst(1, TimeUnit.SECONDS).subscribe(new Consumer<Object>() {
-                @Override
-                public void accept(Object o) throws Exception {
-                    connectUSBMaiDevice(true);
-                }
-            });
-
-
-            RxView.clicks(mTvRight).throttleFirst(1, TimeUnit.SECONDS).subscribe(new Consumer<Object>() {
-                @Override
-                public void accept(Object o) throws Exception {
-                    Toast.makeText(MeasureHandsActivity.this, getString(R.string.measure_left_tip_1), Toast.LENGTH_SHORT).show();
-
-                }
-            });
-            mTvSubmit.setEnabled(true);
-        } else {
-            LogUtil.w("MainActivityB updateMeasureStatus DOUBLE", "left  null");
-            mTvLeft.setEnabled(true);
-            mTvRight.setEnabled(true);
-            leftLight();
-            rightLight();
-
-            RxView.clicks(mTvLeft).throttleFirst(1, TimeUnit.SECONDS).subscribe(new Consumer<Object>() {
-                @Override
-                public void accept(Object o) throws Exception {
-                    connectUSBMaiDevice(true);
-
-                }
-            });
-
-            RxView.clicks(mTvRight).throttleFirst(1, TimeUnit.SECONDS).subscribe(new Consumer<Object>() {
-                @Override
-                public void accept(Object o) throws Exception {
-                    connectUSBMaiDevice(false);
-                }
-            });
-            mTvSubmit.setEnabled(false);
-
-        }
-    }
-
-    private void leftLight() {
-        mTvLeft.setTextColor(ContextCompat.getColor(this, R.color.white));
-        mTvLeft.setBackground(ContextCompat.getDrawable(this, R.drawable.bg_fab_orange_normal));
-    }
-
-    private void leftDark() {
-        mTvLeft.setTextColor(ContextCompat.getColor(this, R.color.violet));
-        mTvLeft.setBackground(ContextCompat.getDrawable(this, R.drawable.bg_fab_orange_border));
-    }
-
-    private void rightLight() {
-        mTvRight.setTextColor(ContextCompat.getColor(this, R.color.white));
-        mTvRight.setBackground(ContextCompat.getDrawable(this, R.drawable.bg_fab_orange_normal));
-    }
-
-    private void rightDark() {
-        mTvRight.setTextColor(ContextCompat.getColor(this, R.color.violet));
-        mTvRight.setBackground(ContextCompat.getDrawable(this, R.drawable.bg_fab_orange_border));
-    }
-
-    @Subscribe(threadMode = ThreadMode.MAIN)
-    public void onReceiveMsg(EventTestMaiMessage message) {
-        if (message.getType() == 0) {
-            if (TextUtils.isEmpty(leftMaiId)) {
-                connectUSBMaiDevice(true);
-            }
-
-        } else {
-            if (TextUtils.isEmpty(rightMaiId)) {
-                connectUSBMaiDevice(false);
-            }
-        }
-    }
-}

+ 0 - 5
TYUsbSDK/src/main/res/drawable/clip_source.xml

@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<clip xmlns:android="http://schemas.android.com/apk/res/android"
-    android:clipOrientation="vertical"
-    android:drawable="@mipmap/measure_progress"
-    android:gravity="bottom" />

二進制
TYUsbSDK/src/main/res/drawable/hand_left_10.png


二進制
TYUsbSDK/src/main/res/drawable/hand_right_10.png


二進制
TYUsbSDK/src/main/res/drawable/ic_main.png


二進制
TYUsbSDK/src/main/res/drawable/ic_start.png


+ 0 - 45
TYUsbSDK/src/main/res/layout/activity_help.xml

@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
-    android:orientation="vertical"
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-    <RelativeLayout
-        android:background="@android:color/white"
-        android:layout_width="match_parent"
-        android:layout_height="50dp"
-        android:orientation="horizontal">
-
-        <ImageView
-            android:layout_centerVertical="true"
-            android:id="@+id/iv_back"
-            android:layout_width="30dp"
-            android:layout_height="38dp"
-            android:layout_marginLeft="3dp"
-            android:padding="10dp"
-            android:src="@drawable/tittlebar_back_arrow_dark"/>
-
-        <TextView
-            android:layout_centerInParent="true"
-            android:id="@id/tv_title"
-            android:layout_width="wrap_content"
-            android:text="@string/help"
-            android:layout_height="wrap_content"
-            android:ellipsize="end"
-            android:gravity="center"
-            android:maxLines="1"
-            android:textColor="@android:color/black"
-            android:textSize="17sp"/>
-    </RelativeLayout>
-
-    <ProgressBar
-        android:id="@+id/progress"
-        style="@style/Base.Widget.AppCompat.ProgressBar.Horizontal"
-        android:layout_width="match_parent"
-        android:layout_height="2dp"/>
-
-    <WebView
-        android:id="@+id/web"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"/>
-</LinearLayout>

+ 0 - 221
TYUsbSDK/src/main/res/layout/activity_measure_flow.xml

@@ -1,221 +0,0 @@
-<?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"
-    xmlns:custom="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:background="@color/gray1">
-
-    <ImageView
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:scaleType="fitXY"
-        android:src="@mipmap/ic_measure_bg_top" />
-
-    <com.taiyi.tyusbsdk.pulse.util.statusbar.StatusBarHeightView
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        app:use_type="use_padding_top">
-
-        <RelativeLayout
-            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:paddingBottom="10dp">
-
-                <RelativeLayout
-                    android:id="@+id/rl_title"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    app:layout_constraintEnd_toEndOf="parent"
-                    app:layout_constraintStart_toStartOf="parent"
-                    app:layout_constraintTop_toTopOf="parent">
-
-                    <LinearLayout
-                        android:id="@+id/ll_back"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:layout_centerVertical="true"
-                        android:gravity="center_vertical"
-                        android:orientation="horizontal"
-                        android:paddingRight="10dp">
-
-                        <ImageView
-                            android:id="@+id/iv_back"
-                            android:layout_width="30dp"
-                            android:layout_height="38dp"
-                            android:layout_marginStart="3dp"
-                            android:layout_marginLeft="3dp"
-                            android:padding="10dp"
-                            android:src="@drawable/tittlebar_back_arrow_dark"
-                            tools:ignore="ContentDescription" />
-
-
-                    </LinearLayout>
-
-
-                    <LinearLayout
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:layout_centerInParent="true"
-                        android:orientation="horizontal">
-
-                        <TextView
-                            android:id="@+id/title_1"
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:gravity="center"
-                            android:text="@string/measuring_down_tip_1"
-                            android:textColor="@color/white"
-                            android:textSize="17sp"
-                            android:textStyle="bold" />
-
-                        <TextView
-                            android:id="@+id/title_2"
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:gravity="center"
-                            android:text="@string/measuring_down_tip_2"
-                            android:textColor="@color/white"
-                            android:textSize="17sp" />
-                    </LinearLayout>
-                </RelativeLayout>
-
-
-                <androidx.constraintlayout.widget.ConstraintLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="220dp"
-                    android:layout_marginTop="3dp"
-                    android:paddingLeft="10dp"
-                    android:paddingRight="10dp"
-                    android:paddingBottom="10dp">
-
-                    <androidx.cardview.widget.CardView
-                        android:id="@+id/cv_pre"
-                        android:layout_width="0dp"
-                        android:layout_height="match_parent"
-                        android:layout_margin="1dp"
-                        app:cardBackgroundColor="@color/trans_pure"
-                        app:cardCornerRadius="10dp"
-                        app:cardElevation="0dp"
-                        app:layout_constraintLeft_toLeftOf="parent"
-                        app:layout_constraintRight_toLeftOf="@id/guide"
-                        app:layout_constraintTop_toTopOf="parent">
-
-                        <com.taiyi.tyusbsdk.RealTimeMeasureView
-                            android:id="@+id/rtmv"
-                            android:layout_width="match_parent"
-                            android:layout_height="match_parent"
-                            android:background="@color/white" />
-                    </androidx.cardview.widget.CardView>
-
-                    <androidx.constraintlayout.widget.Guideline
-                        android:id="@+id/guide"
-                        android:layout_width="match_parent"
-                        android:layout_height="match_parent"
-                        android:orientation="vertical"
-                        app:layout_constraintGuide_percent="0.45" />
-
-                    <androidx.cardview.widget.CardView
-                        android:id="@+id/cv_pulse"
-                        android:layout_width="0dp"
-                        android:layout_height="match_parent"
-                        android:layout_marginLeft="5dp"
-                        app:cardBackgroundColor="@color/trans_pure"
-                        app:cardCornerRadius="10dp"
-                        app:cardElevation="0dp"
-                        app:layout_constraintLeft_toRightOf="@id/guide"
-                        app:layout_constraintRight_toRightOf="parent"
-                        app:layout_constraintTop_toTopOf="parent">
-
-                        <com.taiyi.tyusbsdk.RealTimeAmpGraphView
-                            android:id="@+id/rtagv"
-                            android:layout_width="match_parent"
-                            android:layout_height="match_parent"
-                            android:background="@color/white" />
-                    </androidx.cardview.widget.CardView>
-
-                </androidx.constraintlayout.widget.ConstraintLayout>
-
-                <com.taiyi.tyusbsdk.RealTimeDataGraphView
-                    android:id="@+id/rtdgv"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content" />
-            </LinearLayout>
-
-            <androidx.constraintlayout.widget.ConstraintLayout
-                android:id="@+id/cl_loading"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:background="@color/trans_black"
-                android:visibility="gone">
-
-                <androidx.constraintlayout.widget.Guideline
-                    android:id="@+id/guide_1"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:orientation="horizontal"
-                    app:layout_constraintGuide_percent="0.2" />
-
-                <androidx.constraintlayout.widget.Guideline
-                    android:id="@+id/guide_2"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:orientation="horizontal"
-                    app:layout_constraintGuide_percent="0.7" />
-
-                <androidx.cardview.widget.CardView
-                    android:id="@+id/cv"
-                    android:layout_width="0dp"
-                    android:layout_height="0dp"
-                    android:layout_margin="10dp"
-                    app:cardCornerRadius="10dp"
-                    app:cardElevation="0dp"
-                    app:layout_constraintBottom_toBottomOf="@id/guide_2"
-                    app:layout_constraintLeft_toLeftOf="parent"
-                    app:layout_constraintRight_toRightOf="parent"
-                    app:layout_constraintTop_toTopOf="@id/guide_1">
-
-                    <com.taiyi.tyusbsdk.pulse.util.LoadingView
-                        android:id="@+id/lv"
-                        android:layout_width="match_parent"
-                        android:layout_height="match_parent" />
-                </androidx.cardview.widget.CardView>
-
-                <TextView
-                    android:id="@+id/tv_tip"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginBottom="70dp"
-                    android:text="@string/measure_data_uploading_1"
-                    android:textColor="@color/orange"
-                    android:textSize="14sp"
-                    app:layout_constraintBottom_toBottomOf="@id/guide_2"
-                    app:layout_constraintLeft_toLeftOf="parent"
-                    app:layout_constraintRight_toRightOf="parent" />
-            </androidx.constraintlayout.widget.ConstraintLayout>
-<!--            <com.cunoraz.gifview.library.GifView-->
-<!--                android:id="@+id/gifViewId1"-->
-<!--                android:layout_width="300dp"-->
-<!--                android:layout_height="165dp"-->
-<!--                custom:gif="@drawable/inflatable"-->
-<!--                android:layout_marginTop="50dp"-->
-<!--                android:visibility="gone"-->
-<!--                android:layout_centerInParent="true"/>-->
-<!--            <com.cunoraz.gifview.library.GifView-->
-<!--                android:id="@+id/gifViewId2"-->
-<!--                android:layout_width="300dp"-->
-<!--                android:layout_height="165dp"-->
-<!--                android:layout_marginTop="50dp"-->
-<!--                custom:gif="@drawable/deflation"-->
-<!--                android:visibility="gone"-->
-<!--                android:layout_centerInParent="true"/>-->
-        </RelativeLayout>
-    </com.taiyi.tyusbsdk.pulse.util.statusbar.StatusBarHeightView>
-</RelativeLayout>

+ 0 - 230
TYUsbSDK/src/main/res/layout/activity_measure_hands.xml

@@ -1,230 +0,0 @@
-<?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"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:id="@+id/rl_main"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <androidx.constraintlayout.widget.ConstraintLayout
-        android:id="@+id/cl_second"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent">
-
-        <LinearLayout
-            android:id="@+id/ll_title"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:gravity="center_vertical"
-            android:orientation="horizontal"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintTop_toTopOf="parent">
-
-            <LinearLayout
-                android:id="@+id/ll_back"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:gravity="center_vertical"
-                android:orientation="horizontal">
-
-                <ImageView
-                    android:layout_width="30dp"
-                    android:layout_height="38dp"
-                    android:layout_marginStart="3dp"
-                    android:layout_marginLeft="3dp"
-                    android:padding="10dp"
-                    android:src="@drawable/tittlebar_back_arrow_dark"
-                    tools:ignore="ContentDescription" />
-
-                <TextView
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:gravity="center"
-                    android:text="@string/app_back"
-                    android:textColor="@android:color/black"
-                    android:textSize="15sp" />
-            </LinearLayout>
-
-        </LinearLayout>
-
-        <androidx.constraintlayout.widget.Guideline
-            android:id="@+id/guideline1"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:orientation="vertical"
-            app:layout_constraintGuide_percent="0.25" />
-
-        <androidx.constraintlayout.widget.Guideline
-            android:id="@+id/guideline2"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:orientation="vertical"
-            app:layout_constraintGuide_percent="0.75" />
-
-
-        <androidx.constraintlayout.widget.Guideline
-            android:id="@+id/guideline3"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:orientation="horizontal"
-            app:layout_constraintGuide_percent="0.25" />
-
-        <androidx.constraintlayout.widget.Guideline
-            android:id="@+id/guideline4"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:orientation="horizontal"
-            app:layout_constraintGuide_percent="0.5" />
-
-        <ImageView
-            android:id="@+id/iv_device"
-            android:layout_width="0dp"
-            android:layout_height="0dp"
-            android:visibility="visible"
-            app:layout_constraintBottom_toTopOf="@id/guideline4"
-            app:layout_constraintLeft_toRightOf="@id/guideline1"
-            app:layout_constraintRight_toLeftOf="@id/guideline2"
-            app:layout_constraintTop_toBottomOf="@id/guideline3" />
-
-        <LinearLayout
-            android:id="@+id/ll_device_10"
-            android:layout_width="0dp"
-            android:layout_height="0dp"
-            android:gravity="center"
-            android:orientation="horizontal"
-            android:padding="10dp"
-            app:layout_constraintBottom_toTopOf="@id/guideline4"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintTop_toBottomOf="@id/guideline3">
-
-            <ImageView
-                android:layout_width="0dp"
-                android:layout_height="match_parent"
-                android:layout_weight="1"
-                android:scaleType="centerCrop"
-                android:src="@drawable/hand_left_10" />
-
-            <ImageView
-                android:layout_width="0dp"
-                android:layout_height="match_parent"
-                android:layout_marginLeft="10dp"
-                android:layout_weight="1"
-                android:scaleType="centerCrop"
-                android:src="@drawable/hand_right_10" />
-        </LinearLayout>
-
-        <androidx.constraintlayout.widget.ConstraintLayout
-            android:id="@+id/cl_hand"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:gravity="center"
-            android:orientation="vertical"
-            android:visibility="visible"
-            app:layout_constraintBottom_toTopOf="@id/ll_submit"
-            app:layout_constraintTop_toBottomOf="@id/iv_device">
-
-            <androidx.constraintlayout.widget.Guideline
-                android:id="@+id/guideline19"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:orientation="vertical"
-                app:layout_constraintGuide_percent="0.2" />
-
-            <androidx.constraintlayout.widget.Guideline
-                android:id="@+id/guideline20"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:orientation="vertical"
-                app:layout_constraintGuide_percent="0.8" />
-
-            <TextView
-                android:id="@+id/tv_left"
-                android:layout_width="64dp"
-                android:layout_height="64dp"
-                android:background="@drawable/bg_fab_orange_normal"
-                android:gravity="center"
-                android:text="@string/measure_left_hand"
-                android:textColor="@color/white"
-                android:textSize="16sp"
-                app:layout_constraintLeft_toLeftOf="@id/guideline19"
-                app:layout_constraintTop_toTopOf="parent" />
-
-            <TextView
-                android:id="@+id/tv_type_left"
-                android:layout_width="0dp"
-                android:layout_height="wrap_content"
-                android:layout_marginTop="10dp"
-                android:gravity="center"
-                android:padding="3dp"
-                android:textColor="@color/green"
-                android:textSize="10sp"
-                app:layout_constraintLeft_toLeftOf="@id/tv_left"
-                app:layout_constraintRight_toRightOf="@id/tv_left"
-                app:layout_constraintTop_toBottomOf="@id/tv_left"
-                tools:text="@string/measure_succeed_tip" />
-
-
-            <TextView
-                android:id="@+id/tv_right"
-                android:layout_width="64dp"
-                android:layout_height="64dp"
-                android:background="@drawable/bg_fab_orange_normal"
-                android:gravity="center"
-                android:text="@string/measure_right_hand"
-                android:textColor="@color/white"
-                android:textSize="16sp"
-                app:layout_constraintRight_toRightOf="@id/guideline20"
-                app:layout_constraintTop_toTopOf="parent" />
-
-            <TextView
-                android:id="@+id/tv_type_right"
-                android:layout_width="0dp"
-                android:layout_height="wrap_content"
-                android:layout_marginTop="10dp"
-                android:gravity="center"
-                android:padding="3dp"
-                android:textColor="@color/green"
-                android:textSize="10sp"
-                app:layout_constraintLeft_toLeftOf="@id/tv_right"
-                app:layout_constraintRight_toRightOf="@id/tv_right"
-                app:layout_constraintTop_toBottomOf="@id/tv_right"
-                tools:text="@string/measure_failed_tip" />
-
-        </androidx.constraintlayout.widget.ConstraintLayout>
-
-        <LinearLayout
-            android:id="@+id/ll_submit"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginBottom="20dp"
-            android:orientation="vertical"
-            android:visibility="visible"
-            app:layout_constraintBottom_toBottomOf="parent">
-
-            <TextView
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:gravity="center"
-                android:text="@string/measure_complete_and_submit_tip"
-                android:textColor="@android:color/black"
-                android:textSize="10sp" />
-
-            <TextView
-                android:id="@+id/tv_submit"
-                android:layout_width="match_parent"
-                android:layout_height="40dp"
-                android:layout_marginLeft="80dp"
-                android:layout_marginTop="10dp"
-                android:layout_marginRight="80dp"
-                android:background="@drawable/selector_btn_green_25dp"
-                android:enabled="false"
-                android:gravity="center"
-                android:text="@string/measure_complete_and_submit"
-                android:textColor="@color/white"
-                android:textSize="16sp"
-                android:visibility="visible" />
-        </LinearLayout>
-    </androidx.constraintlayout.widget.ConstraintLayout>
-
-</RelativeLayout>

+ 1 - 1
TYUsbSDK/src/main/res/layout/item_choose_device.xml

@@ -18,7 +18,7 @@
         android:ems="16"
         android:textColor="@android:color/black"
         android:textSize="16sp"
-        tools:text="隔壁家笑话"/>
+        tools:text="设备名称"/>
 
     <ImageView
         android:id="@+id/iv_choose"

+ 0 - 53
TYUsbSDK/src/main/res/layout/realtime_amp_graph_view.xml

@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <com.github.mikephil.charting.charts.LineChart
-        android:id="@+id/lineChart"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_marginBottom="10dp" />
-
-    <TextView
-        android:id="@+id/titleId"
-        android:layout_width="wrap_content"
-        android:layout_height="16dp"
-        android:layout_marginLeft="30dp"
-        android:layout_marginTop="5dp"
-        android:gravity="center_vertical"
-        android:background="@android:color/white"
-        android:text="脉力(mmHg)"
-        android:textColor="#646464"
-        android:textSize="10sp"
-        android:textStyle="bold" />
-    
-    <ImageView
-        android:id="@+id/cun"
-        android:layout_toRightOf="@+id/titleId"
-        android:layout_width="20dp"
-        android:layout_height="9dp"
-        android:layout_marginLeft="30dp"
-        android:layout_marginTop="10dp"
-        android:src="@mipmap/cun"/>
-
-    <ImageView
-        android:id="@+id/guan"
-        android:layout_toRightOf="@+id/cun"
-        android:layout_width="20dp"
-        android:layout_height="9dp"
-        android:layout_marginLeft="2dp"
-        android:layout_marginTop="10dp"
-        android:src="@mipmap/guan"/>
-
-    <ImageView
-        android:id="@+id/chi"
-        android:layout_toRightOf="@+id/guan"
-        android:layout_width="20dp"
-        android:layout_height="9dp"
-        android:layout_marginLeft="2dp"
-        android:layout_marginTop="10dp"
-        android:src="@mipmap/chi"/>
-
-</RelativeLayout>

+ 0 - 104
TYUsbSDK/src/main/res/layout/realtime_data_graph_view.xml

@@ -1,104 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    xmlns:android="http://schemas.android.com/apk/res/android">
-    <LinearLayout android:orientation="horizontal"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent">
-        <View
-            android:layout_weight="1"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:background="@mipmap/chart_bg"
-            android:layout_marginLeft="7dp"/>
-        <View
-            android:layout_width="4dp"
-            android:layout_height="match_parent"
-            android:background="@android:color/transparent"/>
-        <View
-            android:layout_weight="1"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:background="@mipmap/chart_bg"/>
-        <View
-            android:layout_width="4dp"
-            android:layout_height="match_parent"
-            android:background="@android:color/transparent"/>
-        <View
-            android:layout_weight="1"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:background="@mipmap/chart_bg"
-            android:layout_marginRight="7dp"/>
-
-    </LinearLayout>
-    <LinearLayout android:orientation="horizontal"
-        android:layout_width="match_parent"
-        android:layout_height="23dp">
-        <TextView
-            android:layout_weight="1"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:gravity="center"
-            android:text="寸"
-            android:textSize="12dp"
-            android:textColor="@android:color/white"
-            android:layout_marginLeft="18dp"/>
-        <View
-            android:layout_width="20dp"
-            android:layout_height="match_parent"
-            android:background="@android:color/transparent"/>
-        <TextView
-            android:layout_weight="1"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:gravity="center"
-            android:text="关"
-            android:textSize="12dp"
-            android:textColor="@android:color/white"/>
-        <View
-            android:layout_width="20dp"
-            android:layout_height="match_parent"
-            android:background="@android:color/transparent"/>
-        <TextView
-            android:layout_weight="1"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:text="尺"
-            android:gravity="center"
-            android:textSize="12dp"
-            android:textColor="@android:color/white"
-            android:layout_marginRight="18dp"/>
-    </LinearLayout>
-    <LinearLayout android:orientation="horizontal"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_marginTop="23dp">
-        <com.github.mikephil.charting.charts.CombinedChart
-            android:id="@+id/chart1"
-            android:layout_weight="1"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:layout_marginLeft="8dp"/>
-        <View
-            android:layout_width="8dp"
-            android:layout_height="match_parent"
-            android:background="@android:color/transparent"/>
-        <com.github.mikephil.charting.charts.CombinedChart
-            android:id="@+id/chart2"
-            android:layout_weight="1"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"/>
-        <View
-            android:layout_width="8dp"
-            android:layout_height="match_parent"
-            android:background="@android:color/transparent"/>
-        <com.github.mikephil.charting.charts.CombinedChart
-            android:id="@+id/chart3"
-            android:layout_weight="1"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:layout_marginRight="8dp"/>
-
-    </LinearLayout>
-</RelativeLayout>

+ 0 - 181
TYUsbSDK/src/main/res/layout/realtime_measure_view.xml

@@ -1,181 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="160dp"
-    android:layout_height="200dp"
-    android:layout_marginLeft="7dp">
-
-    <View
-        android:id="@+id/bgViewId"
-        android:layout_width="57dp"
-        android:layout_height="175dp"
-        android:layout_centerVertical="true"
-        android:layout_marginLeft="42dp"
-        android:background="#c5c3c3"/>
-
-    <ImageView
-        android:layout_width="53dp"
-        android:layout_height="171dp"
-        android:layout_centerVertical="true"
-        android:layout_marginLeft="44dp"
-        android:src="@mipmap/measure_bg" />
-
-    <ImageView
-        android:id="@+id/progressViewId"
-        android:layout_width="53dp"
-        android:layout_height="171dp"
-        android:layout_centerVertical="true"
-        android:layout_marginLeft="44dp"
-        android:src="@drawable/clip_source" />
-
-    <View
-        android:layout_width="53dp"
-        android:layout_height="5dp"
-        android:layout_alignLeft="@id/bgViewId"
-        android:layout_alignTop="@id/bgViewId"
-        android:layout_marginLeft="2dp"
-        android:layout_marginTop="28dp"
-        android:background="#e72d28" />
-
-    <LinearLayout
-        android:id="@+id/indicatorId"
-        android:layout_width="wrap_content"
-        android:layout_height="16dp"
-        android:layout_alignBottom="@id/progressViewId"
-        android:layout_marginBottom="-7dp"
-        android:gravity="left|center_vertical"
-        android:layout_marginLeft="2dp"
-        android:layout_toRightOf="@+id/bgViewId"
-        android:orientation="horizontal" >
-
-        <ImageView
-            android:layout_width="11dp"
-            android:layout_height="14dp"
-            android:src="@mipmap/track" />
-        <TextView
-            android:id="@+id/indicatiorTextId"
-            android:layout_width="wrap_content"
-            android:layout_height="16dp"
-            android:layout_marginLeft="3dp"
-            android:gravity="center_vertical"
-            android:text="0"
-            android:textColor="#646464"
-            android:textSize="9sp"
-            android:textStyle="bold" />
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="16dp"
-            android:layout_marginLeft="3dp"
-            android:layout_marginTop="1dp"
-            android:gravity="center"
-            android:text="mmHg"
-            android:textColor="#646464"
-            android:textSize="6sp"
-            android:textStyle="bold" />
-    </LinearLayout>
-
-    <View
-        android:id="@+id/rulerViewId"
-        android:layout_width="3dp"
-        android:layout_height="175dp"
-        android:layout_alignLeft="@id/bgViewId"
-        android:layout_centerVertical="true"
-        android:layout_marginLeft="-13dp"
-        android:background="#c5c3c3" />
-
-    <View
-        android:layout_width="6dp"
-        android:layout_height="3dp"
-        android:layout_alignLeft="@+id/rulerViewId"
-        android:layout_alignTop="@+id/rulerViewId"
-        android:layout_marginLeft="-6dp"
-        android:background="#c5c3c3" />
-
-    <View
-        android:layout_width="6dp"
-        android:layout_height="3dp"
-        android:layout_alignLeft="@+id/rulerViewId"
-        android:layout_alignTop="@+id/rulerViewId"
-        android:layout_marginLeft="-6dp"
-        android:layout_marginTop="29dp"
-        android:background="#c5c3c3" />
-
-    <View
-        android:layout_width="6dp"
-        android:layout_height="3dp"
-        android:layout_alignLeft="@+id/rulerViewId"
-        android:layout_marginLeft="-6dp"
-        android:layout_centerVertical="true"
-        android:background="#c5c3c3" />
-
-    <View
-        android:layout_width="6dp"
-        android:layout_height="3dp"
-        android:layout_alignLeft="@+id/rulerViewId"
-        android:layout_alignBottom="@+id/rulerViewId"
-        android:layout_marginLeft="-6dp"
-        android:background="#c5c3c3" />
-
-    <TextView
-        android:id="@+id/maxTextId"
-        android:layout_width="wrap_content"
-        android:layout_height="16dp"
-        android:layout_alignTop="@+id/rulerViewId"
-        android:layout_marginTop="-7dp"
-        android:layout_marginRight="20dp"
-        android:layout_toLeftOf="@+id/rulerViewId"
-        android:gravity="center_vertical"
-        android:text="300"
-        android:textColor="#555555"
-        android:textSize="9sp"
-        android:textStyle="bold" />
-
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="16dp"
-        android:layout_centerVertical="true"
-        android:layout_alignRight="@+id/maxTextId"
-        android:layout_alignTop="@+id/rulerViewId"
-        android:layout_marginTop="22dp"
-        android:gravity="center_vertical"
-        android:text="250"
-        android:textColor="#555555"
-        android:textSize="9sp"
-        android:textStyle="bold" />
-
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="16dp"
-        android:layout_centerVertical="true"
-        android:layout_alignRight="@+id/maxTextId"
-        android:gravity="center_vertical"
-        android:text="150"
-        android:textColor="#555555"
-        android:textSize="9sp"
-        android:textStyle="bold" />
-
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="16dp"
-        android:layout_alignRight="@+id/maxTextId"
-        android:layout_alignBottom="@+id/rulerViewId"
-        android:layout_marginBottom="-8dp"
-        android:text="0"
-        android:textColor="#555555"
-        android:textSize="9sp"
-        android:textStyle="bold" />
-
-    <TextView
-        android:id="@+id/countDownTextId"
-        android:layout_width="wrap_content"
-        android:layout_height="30dp"
-        android:layout_alignLeft="@+id/bgViewId"
-        android:layout_alignRight="@+id/bgViewId"
-        android:layout_centerVertical="true"
-        android:gravity="center"
-        android:text="100s"
-        android:textColor="#008fd7"
-        android:textSize="20sp"
-        android:textStyle="bold"
-        android:visibility="invisible"/>
-
-</RelativeLayout>

二進制
TYUsbSDK/src/main/res/mipmap-hdpi/chart_bg.png


二進制
TYUsbSDK/src/main/res/mipmap-hdpi/chi.png


二進制
TYUsbSDK/src/main/res/mipmap-hdpi/cun.png


二進制
TYUsbSDK/src/main/res/mipmap-hdpi/guan.png


二進制
TYUsbSDK/src/main/res/mipmap-hdpi/measure_bg.png


二進制
TYUsbSDK/src/main/res/mipmap-hdpi/measure_progress.png


二進制
TYUsbSDK/src/main/res/mipmap-hdpi/track.png


二進制
TYUsbSDK/src/main/res/mipmap-mdpi/chart_bg.png


二進制
TYUsbSDK/src/main/res/mipmap-mdpi/chi.png


二進制
TYUsbSDK/src/main/res/mipmap-mdpi/cun.png


二進制
TYUsbSDK/src/main/res/mipmap-mdpi/guan.png


二進制
TYUsbSDK/src/main/res/mipmap-mdpi/measure_bg.png


二進制
TYUsbSDK/src/main/res/mipmap-mdpi/measure_progress.png


二進制
TYUsbSDK/src/main/res/mipmap-mdpi/track.png


二進制
TYUsbSDK/src/main/res/mipmap-xhdpi/chi.png


二進制
TYUsbSDK/src/main/res/mipmap-xhdpi/cun.png


二進制
TYUsbSDK/src/main/res/mipmap-xhdpi/guan.png


二進制
TYUsbSDK/src/main/res/mipmap-xhdpi/measure_bg.png


二進制
TYUsbSDK/src/main/res/mipmap-xhdpi/measure_progress.png


二進制
TYUsbSDK/src/main/res/mipmap-xhdpi/track.png


二進制
TYUsbSDK/src/main/res/mipmap-xxhdpi/chart_bg.png


二進制
TYUsbSDK/src/main/res/mipmap-xxhdpi/chi.png


二進制
TYUsbSDK/src/main/res/mipmap-xxhdpi/cun.png


二進制
TYUsbSDK/src/main/res/mipmap-xxhdpi/guan.png


二進制
TYUsbSDK/src/main/res/mipmap-xxhdpi/ic_measure_bg_top.png


二進制
TYUsbSDK/src/main/res/mipmap-xxhdpi/measure_bg.png


二進制
TYUsbSDK/src/main/res/mipmap-xxhdpi/measure_progress.png


二進制
TYUsbSDK/src/main/res/mipmap-xxhdpi/track.png


二進制
TYUsbSDK/src/main/res/mipmap-xxxhdpi/chart_bg.png


二進制
TYUsbSDK/src/main/res/mipmap-xxxhdpi/chi.png


二進制
TYUsbSDK/src/main/res/mipmap-xxxhdpi/cun.png


二進制
TYUsbSDK/src/main/res/mipmap-xxxhdpi/guan.png


二進制
TYUsbSDK/src/main/res/mipmap-xxxhdpi/measure_bg.png


二進制
TYUsbSDK/src/main/res/mipmap-xxxhdpi/measure_progress.png


二進制
TYUsbSDK/src/main/res/mipmap-xxxhdpi/track.png


+ 0 - 17
TYUsbSDK/src/test/java/com/taiyi/tyusbsdk/ExampleUnitTest.java

@@ -1,17 +0,0 @@
-package com.taiyi.tyusbsdk;
-
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-/**
- * Example local unit test, which will execute on the development machine (host).
- *
- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
- */
-public class ExampleUnitTest {
-    @Test
-    public void addition_isCorrect() {
-        assertEquals(4, 2 + 2);
-    }
-}

+ 0 - 26
app/src/androidTest/java/com/taiyi/usbmaidemo/ExampleInstrumentedTest.java

@@ -1,26 +0,0 @@
-package com.taiyi.usbmaidemo;
-
-import android.content.Context;
-
-import androidx.test.platform.app.InstrumentationRegistry;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import static org.junit.Assert.*;
-
-/**
- * Instrumented test, which will execute on an Android device.
- *
- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
- */
-@RunWith(AndroidJUnit4.class)
-public class ExampleInstrumentedTest {
-    @Test
-    public void useAppContext() {
-        // Context of the app under test.
-        Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
-        assertEquals("com.taiyi.usbmaidemo", appContext.getPackageName());
-    }
-}

+ 0 - 101
app/src/main/res/layout/activity_third_device2.xml

@@ -1,101 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<ScrollView
-    android:layout_width="fill_parent"
-    android:layout_height="match_parent"
-    android:scrollbarStyle="outsideOverlay"
-    xmlns:android="http://schemas.android.com/apk/res/android">
-    <LinearLayout
-        android:orientation="vertical"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent">
-
-        <TextView
-            android:id="@+id/handTv"
-            android:layout_width="match_parent"
-            android:layout_height="50dp"
-            android:text="左右手状态"
-            android:textSize="25sp"
-            android:textStyle="bold"
-            android:gravity="center"/>
-
-        <ScrollView
-            android:id="@+id/scrollView"
-            android:layout_width="fill_parent"
-            android:layout_height="150dp"
-            android:scrollbarStyle="outsideOverlay"
-            android:background="@android:drawable/edit_text"
-            android:layout_marginRight="20dp"
-            android:layout_marginLeft="20dp">
-            <TextView
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:id="@+id/editTV"
-                android:textIsSelectable="true"
-                android:textSize="13sp"
-                />
-        </ScrollView>
-
-        <com.taiyi.tyusbsdk.RealTimeDataGraphView
-            android:id="@+id/realtimeView"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"/>
-
-        <ProgressBar
-            android:id="@+id/simpleProgressBar"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="10dp"
-            android:layout_marginRight="20dp"
-            android:layout_marginLeft="20dp"
-            android:max="100"
-            style="@style/Widget.AppCompat.ProgressBar.Horizontal"
-            android:progress="0"/>
-
-        <TextView
-            android:id="@+id/uploadCSV"
-            android:layout_width="match_parent"
-            android:layout_height="50dp"
-            android:layout_marginTop="25dp"
-            android:layout_marginLeft="20dp"
-            android:layout_marginRight="20dp"
-            android:text="上传CSV"
-            android:background="@color/purple_200"
-            android:gravity="center"/>
-
-        <TextView
-            android:id="@+id/openCSV"
-            android:layout_width="match_parent"
-            android:layout_height="50dp"
-            android:layout_marginTop="10dp"
-            android:layout_marginLeft="20dp"
-            android:layout_marginRight="20dp"
-            android:text="打开远程CSV文件"
-            android:background="@color/purple_200"
-            android:visibility="gone"
-            android:gravity="center"/>
-
-        <TextView
-            android:id="@+id/clearLog"
-            android:layout_width="match_parent"
-            android:layout_height="50dp"
-            android:layout_marginTop="10dp"
-            android:layout_marginLeft="20dp"
-            android:layout_marginRight="20dp"
-            android:text="清除日志"
-            android:background="@color/purple_200"
-            android:gravity="center"/>
-
-        <TextView
-            android:id="@+id/stopTV"
-            android:layout_width="match_parent"
-            android:layout_height="50dp"
-            android:layout_marginTop="10dp"
-            android:layout_marginLeft="20dp"
-            android:layout_marginRight="20dp"
-            android:layout_marginBottom="30dp"
-            android:text="停止测脉并退出"
-            android:background="@color/purple_200"
-            android:gravity="center"/>
-
-    </LinearLayout>
-</ScrollView>

+ 0 - 101
app/src/main/res/layout/activity_third_device3.xml

@@ -1,101 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<ScrollView xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="fill_parent"
-    android:layout_height="match_parent"
-    xmlns:custom="http://schemas.android.com/apk/res-auto"
-    android:scrollbarStyle="outsideOverlay"
-    xmlns:android="http://schemas.android.com/apk/res/android">
-    <RelativeLayout
-        android:layout_height="match_parent"
-        android:layout_width="match_parent">
-        <LinearLayout
-            android:orientation="vertical"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent">
-
-            <TextView
-                android:id="@+id/handTv"
-                android:layout_width="match_parent"
-                android:layout_height="50dp"
-                android:text="左右手状态"
-                android:textSize="25sp"
-                android:textStyle="bold"
-                android:gravity="center"/>
-
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:orientation="horizontal"
-                >
-                <com.taiyi.tyusbsdk.RealTimeMeasureView android:id="@+id/measureViewId" android:layout_height="wrap_content" android:layout_width="wrap_content"/>
-                <com.taiyi.tyusbsdk.RealTimeAmpGraphView android:id="@+id/ampViewId" android:layout_width="match_parent" android:layout_height="match_parent"/>
-            </LinearLayout>
-
-
-            <com.taiyi.tyusbsdk.RealTimeDataGraphView
-                android:id="@+id/realtimeView"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"/>
-
-            <ProgressBar
-                android:id="@+id/simpleProgressBar"
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:layout_marginTop="10dp"
-                android:layout_marginRight="20dp"
-                android:layout_marginLeft="20dp"
-                android:max="100"
-                style="@style/Widget.AppCompat.ProgressBar.Horizontal"
-                android:progress="0"/>
-
-            <TextView
-                android:id="@+id/uploadCSV"
-                android:layout_width="match_parent"
-                android:layout_height="50dp"
-                android:layout_marginTop="25dp"
-                android:layout_marginLeft="20dp"
-                android:layout_marginRight="20dp"
-                android:text="上传CSV"
-                android:background="@color/purple_200"
-                android:gravity="center"/>
-
-            <TextView
-                android:id="@+id/openCSV"
-                android:layout_width="match_parent"
-                android:layout_height="50dp"
-                android:layout_marginTop="10dp"
-                android:layout_marginLeft="20dp"
-                android:layout_marginRight="20dp"
-                android:text="打开远程CSV文件"
-                android:background="@color/purple_200"
-                android:visibility="gone"
-                android:gravity="center"/>
-
-            <TextView
-                android:id="@+id/clearLog"
-                android:layout_width="match_parent"
-                android:layout_height="50dp"
-                android:layout_marginTop="10dp"
-                android:layout_marginLeft="20dp"
-                android:layout_marginRight="20dp"
-                android:text="清除日志"
-                android:background="@color/purple_200"
-                android:gravity="center"/>
-
-            <TextView
-                android:id="@+id/stopTV"
-                android:layout_width="match_parent"
-                android:layout_height="50dp"
-                android:layout_marginTop="10dp"
-                android:layout_marginLeft="20dp"
-                android:layout_marginRight="20dp"
-                android:layout_marginBottom="30dp"
-                android:text="停止测脉并退出"
-                android:background="@color/purple_200"
-                android:gravity="center"/>
-
-        </LinearLayout>
-
-
-    </RelativeLayout>
-</ScrollView>

+ 0 - 17
app/src/test/java/com/taiyi/usbmaidemo/ExampleUnitTest.java

@@ -1,17 +0,0 @@
-package com.taiyi.usbmaidemo;
-
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-/**
- * Example local unit test, which will execute on the development machine (host).
- *
- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
- */
-public class ExampleUnitTest {
-    @Test
-    public void addition_isCorrect() {
-        assertEquals(4, 2 + 2);
-    }
-}

+ 0 - 25
ble/src/androidTest/java/com/taiyi/zhimai/ExampleInstrumentedTest.java

@@ -1,25 +0,0 @@
-package com.taiyi.zhimai;
-
-import android.content.Context;
-
-import androidx.test.platform.app.InstrumentationRegistry;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import static org.junit.Assert.*;
-
-/**
- * Instrumented test, which will execute on an Android device.
- *
- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
- */
-@RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest {
-    @Test
-    public void useAppContext() {
-        // Context of the app under test.
-        Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
-        assertEquals("com.taiyi.zhimai.test", appContext.getPackageName());
-    }
-}

+ 0 - 11
ble/src/main/java/com/taiyi/zhimai/common/util/DialogTipsUtil.java

@@ -1,19 +1,8 @@
 package com.taiyi.zhimai.common.util;
 
 import android.app.Dialog;
-import android.content.Context;
-import android.content.Intent;
-import android.provider.Settings;
-import android.view.Gravity;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ImageView;
-import android.widget.TextView;
 
 import com.taiyi.pulse.fastble.data.BleDevice;
-import com.taiyi.tyusbsdk.pulse.util.OnClickNoDoubleListener;
-import com.taiyi.zhimai.R;
 
 import java.util.ArrayList;
 import java.util.List;

+ 6 - 7
ble/src/main/java/com/taiyi/zhimai/ui/activity/measure/BleMeasureFlowActivity.java

@@ -1,7 +1,5 @@
 package com.taiyi.zhimai.ui.activity.measure;
 
-import static com.taiyi.tyusbsdk.pulse.ui.MeasureHandsActivity.RESULT_MEASURE_FAIL;
-
 import android.Manifest;
 import android.app.Activity;
 import android.app.Dialog;
@@ -41,7 +39,6 @@ import com.taiyi.tyusbsdk.pulse.bean.Pulsebean;
 import com.taiyi.tyusbsdk.pulse.bean.TotalPulse;
 import com.taiyi.tyusbsdk.pulse.net.HttpUtil;
 import com.taiyi.tyusbsdk.pulse.net.TokenOverDueHttpImpl;
-import com.taiyi.tyusbsdk.pulse.ui.MeasureHandsActivity;
 import com.taiyi.tyusbsdk.pulse.util.AutoScrollRecyclerView;
 import com.taiyi.tyusbsdk.pulse.util.DialogTipUtil;
 import com.taiyi.tyusbsdk.pulse.util.LoadingView;
@@ -58,7 +55,9 @@ import org.json.JSONObject;
 
 import java.util.ArrayList;
 
+
 public class BleMeasureFlowActivity extends BleStateActivity {
+    private static final int RESULT_MEASURE_FAIL = 203;
 
     TextView mTvHand;
     ImageView mIvCancel;
@@ -164,7 +163,7 @@ public class BleMeasureFlowActivity extends BleStateActivity {
                 DialogTipUtil.showIKnow(BleMeasureFlowActivity.this, getString(R.string.measure_failed), new DialogTipUtil.CommonCallback_I() {
                     @Override
                     public void onSuccess(String str) {
-                        setResult(MeasureHandsActivity.RESULT_MEASURE_FAIL);
+                        setResult(RESULT_MEASURE_FAIL);
                         finish();
                     }
                 });
@@ -181,7 +180,7 @@ public class BleMeasureFlowActivity extends BleStateActivity {
                 DialogTipUtil.showIKnow(BleMeasureFlowActivity.this, getString(R.string.measure_failed), new DialogTipUtil.CommonCallback_I() {
                     @Override
                     public void onSuccess(String str) {
-                        setResult(MeasureHandsActivity.RESULT_MEASURE_FAIL);
+                        setResult(RESULT_MEASURE_FAIL);
                         finish();
                     }
                 });
@@ -282,7 +281,7 @@ public class BleMeasureFlowActivity extends BleStateActivity {
 
 
                         DialogTipUtil.showIKnow(BleMeasureFlowActivity.this, getString(R.string.unify_8), str -> {
-                            setResult(MeasureHandsActivity.RESULT_MEASURE_FAIL);
+                            setResult(RESULT_MEASURE_FAIL);
                             finish();
                         });
                     }
@@ -513,7 +512,7 @@ public class BleMeasureFlowActivity extends BleStateActivity {
                             new DialogTipUtil.CommonCallback_I() {
                                 @Override
                                 public void onSuccess(String str) {
-                                    setResult(MeasureHandsActivity.RESULT_MEASURE_FAIL);
+                                    setResult(RESULT_MEASURE_FAIL);
                                     finish();
                                 }
                             });

+ 5 - 5
ble/src/main/java/com/taiyi/zhimai/ui/activity/measure/Measure3Activity.java

@@ -8,6 +8,8 @@ import android.widget.ImageView;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
 
+import androidx.annotation.RequiresPermission;
+
 import com.blelib.bean.SanBuJiuHou;
 import com.blelib.ble.BleController;
 import com.blelib.ble.IMeasureListener;
@@ -20,7 +22,6 @@ import com.taiyi.tyusbsdk.pulse.bean.TotalPulse;
 import com.taiyi.tyusbsdk.pulse.net.HttpImpl;
 import com.taiyi.tyusbsdk.pulse.net.HttpUtil;
 import com.taiyi.tyusbsdk.pulse.net.TokenOverDueHttpImpl;
-import com.taiyi.tyusbsdk.pulse.ui.MeasureHandsActivity;
 import com.taiyi.tyusbsdk.pulse.util.AppManager;
 import com.taiyi.tyusbsdk.pulse.util.DialogTipUtil;
 import com.taiyi.tyusbsdk.pulse.util.LogUtil;
@@ -32,10 +33,9 @@ import com.taiyi.zhimai.ui.widget.Pulse3View;
 import java.util.ArrayList;
 import java.util.Arrays;
 
-import androidx.annotation.RequiresPermission;
-
 
 public class Measure3Activity extends BleStateActivity {
+    private static final int RESULT_MEASURE_FAIL = 203;
     TextView mTvHand;
     ImageView mIc;
     RelativeLayout mRl;
@@ -165,7 +165,7 @@ public class Measure3Activity extends BleStateActivity {
                 DialogTipUtil.showIKnow(Measure3Activity.this, getString(R.string.measure_failed), new DialogTipUtil.CommonCallback_I() {
                     @Override
                     public void onSuccess(String str) {
-                        setResult(MeasureHandsActivity.RESULT_MEASURE_FAIL);
+                        setResult(RESULT_MEASURE_FAIL);
                         finish();
                     }
                 });
@@ -177,7 +177,7 @@ public class Measure3Activity extends BleStateActivity {
                 DialogTipUtil.showIKnow(Measure3Activity.this, getString(R.string.measure_timeout), new DialogTipUtil.CommonCallback_I() {
                     @Override
                     public void onSuccess(String str) {
-                        setResult(MeasureHandsActivity.RESULT_MEASURE_FAIL);
+                        setResult(RESULT_MEASURE_FAIL);
                         finish();
                     }
                 });

二進制
ble/src/main/res/drawable-xxhdpi/ic_close_violet.png


+ 0 - 5
ble/src/main/res/drawable/clip_source.xml

@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<clip xmlns:android="http://schemas.android.com/apk/res/android"
-    android:clipOrientation="vertical"
-    android:drawable="@mipmap/measure_progress"
-    android:gravity="bottom" />

二進制
ble/src/main/res/drawable/ic_main.png


二進制
ble/src/main/res/drawable/ic_start.png


二進制
ble/src/main/res/drawable/inflatable.gif


二進制
ble/src/main/res/mipmap-hdpi/chart_bg.png


二進制
ble/src/main/res/mipmap-hdpi/chi.png


二進制
ble/src/main/res/mipmap-hdpi/cun.png


二進制
ble/src/main/res/mipmap-hdpi/et_login_delete.png


二進制
ble/src/main/res/mipmap-hdpi/guan.png


二進制
ble/src/main/res/mipmap-hdpi/measure_bg.png


二進制
ble/src/main/res/mipmap-hdpi/measure_progress.png


二進制
ble/src/main/res/mipmap-hdpi/track.png


二進制
ble/src/main/res/mipmap-mdpi/chart_bg.png


二進制
ble/src/main/res/mipmap-mdpi/chi.png


二進制
ble/src/main/res/mipmap-mdpi/cun.png


二進制
ble/src/main/res/mipmap-mdpi/guan.png


二進制
ble/src/main/res/mipmap-mdpi/measure_bg.png


二進制
ble/src/main/res/mipmap-mdpi/measure_progress.png


二進制
ble/src/main/res/mipmap-mdpi/track.png


二進制
ble/src/main/res/mipmap-xhdpi/chi.png


二進制
ble/src/main/res/mipmap-xhdpi/cun.png


二進制
ble/src/main/res/mipmap-xhdpi/et_login_delete.png


二進制
ble/src/main/res/mipmap-xhdpi/guan.png


二進制
ble/src/main/res/mipmap-xhdpi/measure_bg.png


二進制
ble/src/main/res/mipmap-xhdpi/measure_progress.png


二進制
ble/src/main/res/mipmap-xhdpi/track.png


二進制
ble/src/main/res/mipmap-xxhdpi/chart_bg.png


二進制
ble/src/main/res/mipmap-xxhdpi/chi.png


二進制
ble/src/main/res/mipmap-xxhdpi/cun.png


二進制
ble/src/main/res/mipmap-xxhdpi/et_login_delete.png


二進制
ble/src/main/res/mipmap-xxhdpi/guan.png


二進制
ble/src/main/res/mipmap-xxhdpi/ic_measure_bg_top.png


二進制
ble/src/main/res/mipmap-xxhdpi/measure_bg.png


Some files were not shown because too many files changed in this diff