Skip to content

Commit

Permalink
Wrapping up initial Withings work.
Browse files Browse the repository at this point in the history
* Added System Status generator.
  • Loading branch information
audaciouscode committed May 18, 2017
1 parent 5635519 commit 45c5dd8
Show file tree
Hide file tree
Showing 62 changed files with 811 additions and 30 deletions.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added res/drawable-hdpi/ic_pdk_system_status.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added res/drawable-mdpi/ic_pdk_system_status.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added res/drawable-xhdpi/ic_pdk_system_status.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added res/drawable-xxhdpi/ic_pdk_system_status.png
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added res/drawable-xxxhdpi/ic_pdk_system_status.png
File renamed without changes
2 changes: 1 addition & 1 deletion res/layout/card_generator_app_event.xml
Expand Up @@ -21,7 +21,7 @@
android:background="#424242"
android:padding="8dp"
android:baselineAligned="false">
<ImageView android:src="@drawable/ic_app_events"
<ImageView android:src="@drawable/ic_pdk_app_events"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginRight="8dp" />
Expand Down
2 changes: 1 addition & 1 deletion res/layout/card_generator_device_battery.xml
Expand Up @@ -21,7 +21,7 @@
android:background="@color/generator_battery_header"
android:padding="8dp"
android:baselineAligned="false">
<ImageView android:src="@drawable/ic_device_battery"
<ImageView android:src="@drawable/ic_pdk_device_battery"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginRight="8dp" />
Expand Down
70 changes: 70 additions & 0 deletions res/layout/card_generator_diagnostics_system_status.xml
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
card_view:cardCornerRadius="4dp"
android:layout_margin="8dp">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/generator_system_status_header"
android:padding="8dp"
android:baselineAligned="false">
<ImageView android:src="@drawable/ic_pdk_system_status"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginRight="8dp" />
<TextView android:text="@string/generator_diagnostics_system_status"
android:gravity="center_vertical|start"
android:layout_width="0dp"
android:layout_height="24dp"
android:layout_weight="1"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="@android:color/white" />
<TextView android:id="@+id/generator_data_point_date"
android:gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:textSize="12sp"
android:textColor="@android:color/white"
android:layout_marginRight="8dp"/>
</LinearLayout>
<LinearLayout android:id="@+id/card_content"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="0dp">
<com.github.mikephil.charting.charts.LineChart
android:id="@+id/system_status_chart"
android:layout_width="match_parent"
android:layout_height="160dp"
android:layout_marginBottom="0dp"/>
<TextView android:id="@+id/system_status_runtime"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="12sp"
android:textColor="@android:color/white"
android:background="@color/generator_system_status_header"
android:padding="8dp"/>
</LinearLayout>
<TextView android:id="@+id/card_empty"
android:text="@string/message_generator_diagnostics_system_status_empty"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="16dp" />
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
2 changes: 1 addition & 1 deletion res/layout/card_generator_microsoft_band.xml
Expand Up @@ -20,7 +20,7 @@
android:background="#0075DA"
android:padding="8dp"
android:baselineAligned="false">
<ImageView android:src="@drawable/ic_microsoft_band"
<ImageView android:src="@drawable/ic_pdk_microsoft_band"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginRight="8dp" />
Expand Down
2 changes: 1 addition & 1 deletion res/layout/card_generator_phone_calls.xml
Expand Up @@ -21,7 +21,7 @@
android:background="#FF9800"
android:padding="8dp"
android:baselineAligned="false">
<ImageView android:src="@drawable/ic_phone_calls"
<ImageView android:src="@drawable/ic_pdk_phone_calls"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginRight="8dp" />
Expand Down
2 changes: 1 addition & 1 deletion res/layout/card_generator_screen_state.xml
Expand Up @@ -21,7 +21,7 @@
android:background="#607D8B"
android:padding="8dp"
android:baselineAligned="false">
<ImageView android:src="@drawable/ic_screen_state"
<ImageView android:src="@drawable/ic_pdk_screen_state"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginRight="8dp" />
Expand Down
2 changes: 1 addition & 1 deletion res/layout/card_generator_sensors_ambient_light.xml
Expand Up @@ -21,7 +21,7 @@
android:background="@color/generator_ambient_light_header"
android:padding="8dp"
android:baselineAligned="false">
<ImageView android:src="@drawable/ic_ambient_light"
<ImageView android:src="@drawable/ic_pdk_ambient_light"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginRight="8dp" />
Expand Down
2 changes: 1 addition & 1 deletion res/layout/card_generator_text_messages.xml
Expand Up @@ -21,7 +21,7 @@
android:background="#9C27B0"
android:padding="8dp"
android:baselineAligned="false">
<ImageView android:src="@drawable/ic_text_messages"
<ImageView android:src="@drawable/ic_pdk_text_messages"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginRight="8dp" />
Expand Down
174 changes: 167 additions & 7 deletions res/layout/card_generator_withings_body_page.xml
@@ -1,13 +1,173 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView android:id="@+id/content_info"
android:text="TODO: BODY PAGE"
android:layout_width="match_parent"
<LinearLayout android:orientation="vertical"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:gravity="center"
android:padding="16dp" />
android:layout_margin="8dp">
<TextView android:layout_width="match_parent"
android:textStyle="bold"
android:gravity="center"
android:layout_weight="1"
android:layout_height="0dp"
android:text="@string/generator_withings_body_title"
android:layout_marginBottom="8dp"/>
<LinearLayout android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="0dp">
<TextView android:id="@+id/label_body_one"
android:layout_width="0dp"
android:layout_weight="1"
android:textStyle="bold"
android:gravity="right"
android:layout_height="match_parent"
android:text="@string/generator_withings_body_placeholder" />
<TextView android:id="@+id/value_body_one"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_marginLeft="8dp"
android:layout_height="match_parent"
android:text="@string/generator_withings_body_placeholder" />
</LinearLayout>
<LinearLayout android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="0dp">
<TextView android:id="@+id/label_body_two"
android:layout_width="0dp"
android:layout_weight="1"
android:textStyle="bold"
android:gravity="right"
android:layout_height="match_parent"
android:text="@string/generator_withings_body_placeholder" />
<TextView android:id="@+id/value_body_two"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_marginLeft="8dp"
android:layout_height="match_parent"
android:text="@string/generator_withings_body_placeholder" />
</LinearLayout>
<LinearLayout android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="0dp">
<TextView android:id="@+id/label_body_three"
android:layout_width="0dp"
android:layout_weight="1"
android:textStyle="bold"
android:gravity="right"
android:layout_height="match_parent"
android:text="@string/generator_withings_body_placeholder" />
<TextView android:id="@+id/value_body_three"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_marginLeft="8dp"
android:layout_height="match_parent"
android:text="@string/generator_withings_body_placeholder" />
</LinearLayout>
<LinearLayout android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="0dp">
<TextView android:id="@+id/label_body_four"
android:layout_width="0dp"
android:layout_weight="1"
android:textStyle="bold"
android:gravity="right"
android:layout_height="match_parent"
android:text="@string/generator_withings_body_placeholder" />
<TextView android:id="@+id/value_body_four"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_marginLeft="8dp"
android:layout_height="match_parent"
android:text="@string/generator_withings_body_placeholder" />
</LinearLayout>
</LinearLayout>
<LinearLayout android:orientation="vertical"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent">
<View android:layout_width="match_parent"
android:textStyle="bold"
android:layout_weight="1"
android:layout_height="0dp"
android:layout_marginBottom="8dp" />
<LinearLayout android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="0dp">
<TextView android:id="@+id/label_body_five"
android:layout_width="0dp"
android:layout_weight="1"
android:textStyle="bold"
android:gravity="right"
android:layout_height="match_parent"
android:text="@string/generator_withings_body_placeholder" />
<TextView android:id="@+id/value_body_five"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_marginLeft="8dp"
android:layout_height="match_parent"
android:text="@string/generator_withings_body_placeholder" />
</LinearLayout>
<LinearLayout android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="0dp">
<TextView android:id="@+id/label_body_six"
android:layout_width="0dp"
android:layout_weight="1"
android:textStyle="bold"
android:gravity="right"
android:layout_height="match_parent"
android:text="@string/generator_withings_body_placeholder" />
<TextView android:id="@+id/value_body_six"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_marginLeft="8dp"
android:layout_height="match_parent"
android:text="@string/generator_withings_body_placeholder" />
</LinearLayout>
<LinearLayout android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="0dp">
<TextView android:id="@+id/label_body_seven"
android:layout_width="0dp"
android:layout_weight="1"
android:textStyle="bold"
android:gravity="right"
android:layout_height="match_parent"
android:text="@string/generator_withings_body_placeholder" />
<TextView android:id="@+id/value_body_seven"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_marginLeft="8dp"
android:layout_height="match_parent"
android:text="@string/generator_withings_body_placeholder" />
</LinearLayout>
<LinearLayout android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="0dp">
<TextView android:id="@+id/label_body_eight"
android:layout_width="0dp"
android:layout_weight="1"
android:textStyle="bold"
android:gravity="right"
android:layout_height="match_parent"
android:text="@string/generator_withings_body_placeholder" />
<TextView android:id="@+id/value_body_eight"
android:layout_width="0dp"
android:layout_marginLeft="8dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:text="@string/generator_withings_body_placeholder" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
2 changes: 1 addition & 1 deletion res/layout/card_generator_withings_device.xml
Expand Up @@ -20,7 +20,7 @@
android:background="#009BBF"
android:padding="8dp"
android:baselineAligned="false">
<ImageView android:src="@drawable/ic_withings_device"
<ImageView android:src="@drawable/ic_pdk_withings_device"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginRight="8dp" />
Expand Down
3 changes: 1 addition & 2 deletions res/layout/card_generator_withings_intraday_page.xml
Expand Up @@ -45,8 +45,7 @@
<LinearLayout android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="24dp">
android:layout_marginTop="8dp">
<TextView android:text="@string/label_withings_steps"
android:layout_width="0dp"
android:layout_weight="1"
Expand Down
3 changes: 3 additions & 0 deletions res/values/databases.xml
Expand Up @@ -37,4 +37,7 @@

<!-- Accelerometer Sensor Generator -->
<string name="pdk_generator_accelerometer_create_history_table">CREATE TABLE history(_id INTEGER PRIMARY KEY AUTOINCREMENT, fetched INTEGER, transmitted INTEGER, observed INTEGER, x REAL, y REAL, z REAL, raw_timestamp BIGINT, accuracy INTEGER);</string>

<!-- System Status Generator -->
<string name="pdk_generator_diagnostics_system_status_create_history_table">CREATE TABLE history(_id INTEGER PRIMARY KEY AUTOINCREMENT, fetched INTEGER, transmitted INTEGER, observed INTEGER, runtime INTEGER, storage_app INTEGER, storage_other INTEGER, storage_available INTEGER, storage_total INTEGER, storage_path TEXT);</string>
</resources>
18 changes: 18 additions & 0 deletions res/values/generators.xml
Expand Up @@ -7,7 +7,12 @@
<!-- <item>com.audacious_software.passive_data_kit.generators.wearables.MicrosoftBand</item> -->
<!-- <item>com.audacious_software.passive_data_kit.generators.services.GoogleAwareness</item> -->
<!-- <item>com.audacious_software.passive_data_kit.generators.vr.DaydreamViewController</item> -->
<item>com.audacious_software.passive_data_kit.generators.device.Battery</item>
<item>com.audacious_software.passive_data_kit.generators.sensors.Accelerometer</item>
<item>com.audacious_software.passive_data_kit.generators.sensors.AmbientLight</item>
<item>com.audacious_software.passive_data_kit.generators.device.ForegroundApplication</item>
<item>com.audacious_software.passive_data_kit.generators.wearables.WithingsDevice</item>
<item>com.audacious_software.passive_data_kit.generators.diagnostics.SystemStatus</item>
</string-array>

<string-array name="pdk_app_generators"></string-array>
Expand Down Expand Up @@ -142,6 +147,9 @@
<string name="generator_withings_elevation_label">Elevation</string>
<string name="generator_withings_elevation_value">%1$.2f m</string>

<string name="generator_withings_body_placeholder">-</string>
<string name="generator_withings_body_title">Body Measures</string>

<!-- Device Battery -->
<string name="generator_device_battery">Device Battery</string>
<string name="message_generator_device_battery_empty">No battery levels have been reported yet.</string>
Expand Down Expand Up @@ -176,5 +184,15 @@
<color name="generator_accelerometer_y_high">#ff4CAF50</color>
<color name="generator_accelerometer_z_low">#802196F3</color>
<color name="generator_accelerometer_z_high">#ff2196F3</color>

<!-- System Status -->
<string name="generator_diagnostics_system_status">System Status</string>
<string name="message_generator_diagnostics_system_status_empty">No status information has been collected yet.</string>
<color name="generator_system_status_header">#616161</color>
<color name="generator_system_status_free">#2E7D32</color>
<color name="generator_system_status_app">#FAFAFA</color>
<color name="generator_system_status_other">#757575</color>
<string name="generator_system_status_runtime">Continuous Runtime: %1$s</string>
<string name="generator_system_status_runtime_formatted">%1$dd %2$s:%3$s:%4$s.%5$s</string>
</resources>

0 comments on commit 45c5dd8

Please sign in to comment.