Set the current page of both the ViewPager and indicator.
27 | * 28 | *This must be used if you need to set the page before 29 | * the views are drawn on screen (e.g., default start page).
30 | * 31 | * @param item 32 | */ 33 | void setCurrentItem(int item); 34 | 35 | /** 36 | * Set a page change listener which will receive forwarded events. 37 | * 38 | * @param listener 39 | */ 40 | void setOnPageChangeListener(ViewPager.OnPageChangeListener listener); 41 | 42 | /** 43 | * Notify the indicator that the fragment list has changed. 44 | */ 45 | void notifyDataSetChanged(); 46 | } 47 | -------------------------------------------------------------------------------- /HeartRate/src/com/sherchen/heartrate/views/FullShowListView.java: -------------------------------------------------------------------------------- 1 | package com.sherchen.heartrate.views; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.widget.ListView; 6 | 7 | /** 8 | * The description of use: 9 | *
6 |
7 | /**the view width as 9 weights*/
8 | private static final int WIDTH_TOTAL_WEIGHTS = 9;
9 | /**the view height as 9 weights*/
10 | private static final int HEIGHT_TOTAL_WEIGHTS = 9;
11 |
12 |
13 | //The peak point, all of numbers are weight, such as (4/total_width_weight)*width, (0/total_height_weight)*height
14 | //(8,7) to (6,0)
15 |
16 | //need to draw line by other software
17 |
18 | //draw the wave peak when the valid heartrate is gotten.
19 | //LLL 0 1 2 3 4 5 6 7 8 9
20 | //0 (7,0)[2]
21 | //1
22 | //2
23 | //3
24 | //4
25 | //5
26 | //6
27 | //7 (0, 6)[5] (4,6)[4]
28 | //8
29 | //9 (8,6)[1]
30 | //10 (5,9)[3]
31 |
32 |
33 | //here you can change the weight to make difference shape of wave
34 | private static final int[][] m_WavePeak_Weight = new int[][]{
35 | new int[]{4, 0, 6, 6},
36 | new int[]{5, 4, HEIGHT_TOTAL_WEIGHTS, 6},
37 | new int[]{7, 5, 0, HEIGHT_TOTAL_WEIGHTS},
38 | new int[]{WIDTH_TOTAL_WEIGHTS, 7, 6, 0}
39 | };
40 |
41 | //draw the line when the heartrate is not gotten.
42 |
43 | //LLL 0 1 2 3 4 5 6 7 8 9
44 | //0
45 | //1
46 | //2
47 | //3
48 | //4
49 | //5
50 | //6
51 | //7 (0, 6)[2]<<<<<<<<<<<<(8, 6)[1]
52 | //8
53 | //9
54 | //10
55 | private static final int[] m_WaveLine_Weight = new int[]{WIDTH_TOTAL_WEIGHTS, 0, 6, 6};
56 |
57 |
58 |
--------------------------------------------------------------------------------