Skip to content

Commit cf48721

Browse files
committed
Making the Device Details activity pretty
1 parent e28d698 commit cf48721

12 files changed

Lines changed: 436 additions & 90 deletions

sample_app/libs/merge-1.0.1.jar

8.93 KB
Binary file not shown.

sample_app/libs/sacklist-1.0.0.jar

2.57 KB
Binary file not shown.

sample_app/res/layout/activity_details.xml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,9 @@
77
android:paddingRight="@dimen/activity_horizontal_margin"
88
android:paddingTop="@dimen/activity_vertical_margin" >
99

10-
<ScrollView
10+
<ListView
11+
android:id="@android:id/list"
1112
android:layout_width="fill_parent"
1213
android:layout_height="wrap_content" >
13-
14-
<TextView
15-
android:id="@+id/tvDetails"
16-
android:layout_width="fill_parent"
17-
android:layout_height="wrap_content"
18-
android:textSize="12sp"
19-
android:typeface="monospace" />
20-
</ScrollView>
21-
14+
</ListView>
2215
</RelativeLayout>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent"
4+
android:layout_height="wrap_content"
5+
android:gravity="top"
6+
android:orientation="vertical"
7+
android:paddingBottom="5dp" >
8+
9+
<TextView
10+
android:id="@+id/title"
11+
android:layout_width="match_parent"
12+
android:layout_height="wrap_content"
13+
android:textSize="12sp"
14+
android:textStyle="bold" />
15+
16+
<GridLayout
17+
android:layout_width="match_parent"
18+
android:layout_height="wrap_content"
19+
android:columnCount="2"
20+
android:useDefaultMargins="true" >
21+
22+
<TextView
23+
style="@style/GridLayoutTitleTextView"
24+
android:layout_width="wrap_content"
25+
android:layout_height="wrap_content"
26+
android:text="As String:" />
27+
28+
<TextView
29+
android:id="@+id/data_as_string"
30+
style="@style/GridLayoutDataTextViewMonospace" />
31+
32+
<TextView
33+
style="@style/GridLayoutTitleTextView"
34+
android:layout_width="wrap_content"
35+
android:layout_height="wrap_content"
36+
android:text="As Array:" />
37+
38+
<TextView
39+
android:id="@+id/data_as_array"
40+
style="@style/GridLayoutDataTextViewMonospace" />
41+
</GridLayout>
42+
43+
</LinearLayout>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent"
4+
android:layout_height="wrap_content"
5+
android:gravity="top"
6+
android:orientation="vertical"
7+
android:paddingBottom="5dp" >
8+
9+
<GridLayout
10+
android:layout_width="match_parent"
11+
android:layout_height="wrap_content"
12+
android:columnCount="2"
13+
android:useDefaultMargins="true" >
14+
15+
<TextView
16+
style="@style/GridLayoutTitleTextView"
17+
android:layout_width="wrap_content"
18+
android:layout_height="wrap_content"
19+
android:text="Device Name:" />
20+
21+
<TextView
22+
android:id="@+id/deviceName"
23+
style="@style/GridLayoutDataTextView" />
24+
25+
<TextView
26+
style="@style/GridLayoutTitleTextView"
27+
android:layout_width="wrap_content"
28+
android:layout_height="wrap_content"
29+
android:text="Device Address" />
30+
31+
<TextView
32+
android:id="@+id/deviceAddress"
33+
style="@style/GridLayoutDataTextView" />
34+
35+
<TextView
36+
style="@style/GridLayoutTitleTextView"
37+
android:layout_width="wrap_content"
38+
android:layout_height="wrap_content"
39+
android:text="Device Class:" />
40+
41+
<TextView
42+
android:id="@+id/deviceClass"
43+
style="@style/GridLayoutDataTextView" />
44+
45+
<TextView
46+
style="@style/GridLayoutTitleTextView"
47+
android:layout_width="wrap_content"
48+
android:layout_height="wrap_content"
49+
android:text="Bonding State" />
50+
51+
<TextView
52+
android:id="@+id/deviceBondingState"
53+
style="@style/GridLayoutDataTextView" />
54+
</GridLayout>
55+
56+
</LinearLayout>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent"
4+
android:layout_height="wrap_content"
5+
android:gravity="top"
6+
android:orientation="vertical"
7+
android:paddingBottom="5dp" >
8+
9+
<TextView
10+
android:id="@+id/title"
11+
android:layout_width="match_parent"
12+
android:layout_height="wrap_content"
13+
android:textAllCaps="true"
14+
android:textColor="@android:color/holo_blue_dark"
15+
android:textSize="14sp"
16+
android:textStyle="bold" />
17+
18+
<View
19+
android:layout_width="match_parent"
20+
android:layout_height="1dp"
21+
android:background="@android:color/holo_blue_dark" />
22+
23+
</LinearLayout>
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent"
4+
android:layout_height="wrap_content"
5+
android:gravity="top"
6+
android:orientation="vertical"
7+
android:paddingBottom="5dp" >
8+
9+
<GridLayout
10+
android:layout_width="match_parent"
11+
android:layout_height="wrap_content"
12+
android:columnCount="2"
13+
android:useDefaultMargins="true" >
14+
15+
<TextView
16+
style="@style/GridLayoutTitleTextView"
17+
android:layout_width="wrap_content"
18+
android:layout_height="wrap_content"
19+
android:text="Company ID:" />
20+
21+
<TextView
22+
android:id="@+id/companyId"
23+
style="@style/GridLayoutDataTextView" />
24+
25+
<TextView
26+
style="@style/GridLayoutTitleTextView"
27+
android:layout_width="wrap_content"
28+
android:layout_height="wrap_content"
29+
android:text="Advertisement:" />
30+
31+
<TextView
32+
android:id="@+id/advertisement"
33+
style="@style/GridLayoutDataTextView" />
34+
35+
<TextView
36+
style="@style/GridLayoutTitleTextView"
37+
android:layout_width="wrap_content"
38+
android:layout_height="wrap_content"
39+
android:text="UUID:" />
40+
41+
<TextView
42+
android:id="@+id/uuid"
43+
style="@style/GridLayoutDataTextView" />
44+
45+
<TextView
46+
style="@style/GridLayoutTitleTextView"
47+
android:layout_width="wrap_content"
48+
android:layout_height="wrap_content"
49+
android:text="Major:" />
50+
51+
<TextView
52+
android:id="@+id/major"
53+
style="@style/GridLayoutDataTextView" />
54+
55+
<TextView
56+
style="@style/GridLayoutTitleTextView"
57+
android:layout_width="wrap_content"
58+
android:layout_height="wrap_content"
59+
android:text="Minor:" />
60+
61+
<TextView
62+
android:id="@+id/minor"
63+
style="@style/GridLayoutDataTextView" />
64+
65+
<TextView
66+
style="@style/GridLayoutTitleTextView"
67+
android:layout_width="wrap_content"
68+
android:layout_height="wrap_content"
69+
android:text="TX Power:" />
70+
71+
<TextView
72+
android:id="@+id/txpower"
73+
style="@style/GridLayoutDataTextView" />
74+
</GridLayout>
75+
76+
</LinearLayout>
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent"
4+
android:layout_height="wrap_content"
5+
android:gravity="top"
6+
android:orientation="vertical"
7+
android:paddingBottom="5dp" >
8+
9+
<GridLayout
10+
android:layout_width="match_parent"
11+
android:layout_height="wrap_content"
12+
android:columnCount="2"
13+
android:useDefaultMargins="true" >
14+
15+
<TextView
16+
style="@style/GridLayoutTitleTextView"
17+
android:layout_width="wrap_content"
18+
android:layout_height="wrap_content"
19+
android:text="First Timestamp:" />
20+
21+
<TextView
22+
android:id="@+id/firstTimestamp"
23+
style="@style/GridLayoutDataTextView" />
24+
25+
<TextView
26+
style="@style/GridLayoutTitleTextView"
27+
android:layout_width="wrap_content"
28+
android:layout_height="wrap_content"
29+
android:text="First RSSI:" />
30+
31+
<TextView
32+
android:id="@+id/firstRssi"
33+
style="@style/GridLayoutDataTextView" />
34+
35+
<TextView
36+
style="@style/GridLayoutTitleTextView"
37+
android:layout_width="wrap_content"
38+
android:layout_height="wrap_content"
39+
android:text="Last Timestamp:" />
40+
41+
<TextView
42+
android:id="@+id/lastTimestamp"
43+
style="@style/GridLayoutDataTextView" />
44+
45+
<TextView
46+
style="@style/GridLayoutTitleTextView"
47+
android:layout_width="wrap_content"
48+
android:layout_height="wrap_content"
49+
android:text="Last RSSI:" />
50+
51+
<TextView
52+
android:id="@+id/lastRssi"
53+
style="@style/GridLayoutDataTextView" />
54+
55+
<TextView
56+
style="@style/GridLayoutTitleTextView"
57+
android:layout_width="wrap_content"
58+
android:layout_height="wrap_content"
59+
android:text="Running Average RSSI:" />
60+
61+
<TextView
62+
android:id="@+id/runningAverageRssi"
63+
style="@style/GridLayoutDataTextView" />
64+
</GridLayout>
65+
66+
</LinearLayout>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent"
4+
android:layout_height="wrap_content"
5+
android:gravity="top"
6+
android:orientation="vertical"
7+
android:paddingBottom="5dp" >
8+
9+
<TextView
10+
android:id="@+id/data"
11+
style="@style/GridLayoutDataTextViewMonospace" />
12+
13+
</LinearLayout>

sample_app/res/values/strings.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,12 @@
4444
<string name="exporter_email_subject">Bluetooth LE Scan Results (%s)</string>
4545
<string name="exporter_email_body">Please find attached the scan results.</string>
4646
<string name="exporter_email_picker_text">Please select your email client:</string>
47+
<string name="header_ibeacon_data">iBeacon Data</string>
48+
<string name="header_raw_ad_records">Raw Ad Records</string>
49+
<string name="header_scan_record">Scan Record</string>
50+
<string name="header_rssi_info">RSSI Info</string>
51+
<string name="header_device_info">Device Info</string>
52+
<string name="invalid_device_data">Invalid Device Data!</string>
53+
<string name="unknown">unknown</string>
4754

4855
</resources>

0 commit comments

Comments
 (0)