Updated WebApiConnection to use callbacks rather than interfaces, moved the shared preference handling code into SdServer so it is all together. Updated the various activities to use the single instance of LogManager and WebApiConnection in SdServer rather than creating new instances which are likely to resuld in duplicate data being uploaded.

This commit is contained in:
Graham Jones
2022-01-23 22:13:38 +00:00
parent 4d1c217109
commit bdd7b49358
26 changed files with 278 additions and 520 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="eventType"
android:id="@+id/eventSubTypeTv" />
</LinearLayout>

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:text="eventType"
android:id="@+id/eventTypeTv" />
</LinearLayout>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -3,6 +3,4 @@
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="fragment_horizontal_margin">16dp</dimen>
<dimen name="fragment_vertical_margin">16dp</dimen>
</resources>

View File

@@ -7,11 +7,5 @@
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>

View File

@@ -1,129 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<CheckBoxPreference
android:key="LatchAlarms"
android:title="@string/latch_alarms_title"
android:summary="@string/latch_alarms_summary"
android:defaultValue="false" />
<CheckBoxPreference
android:key="AudibleAlarm"
android:title="@string/enable_audible_alarm_title"
android:summary="@string/enable_audible_alarm_summary"
android:defaultValue="true" />
<CheckBoxPreference
android:key="AudibleWarning"
android:title="@string/enable_audible_warning_title"
android:summary="@string/enable_audible_warning_summary"
android:defaultValue="true" />
<CheckBoxPreference
android:key="SMSAlarm"
android:title="@string/enable_sms_alarm_title"
android:summary="@string/enable_sms_alarm_summary"
android:defaultValue="false" />
<EditTextPreference
android:key="SMSNumbers"
android:title="@string/sms_numbers_title"
android:summary="@string/sms_numbers_summary"
android:defaultValue="" />
<EditTextPreference
android:key="SMSMsg"
android:title="@string/sms_message_title"
android:summary="@string/sms_message_summary"
android:defaultValue="**SEIZURE DETECTED**" />
<CheckBoxPreference
android:key="AudibleFaultWarning"
android:title="@string/enable_audible_fault_title"
android:summary="@string/enable_audible_fault_summary"
android:defaultValue="true" />
<CheckBoxPreference
android:key="LogAlarms"
android:title="@string/log_alarms_title"
android:summary="@string/log_alarms_summary"
android:defaultValue="true" />
<CheckBoxPreference
android:key="LogData"
android:title="@string/log_data_title"
android:summary="@string/log_data_summary"
android:defaultValue="false" />
<!-- <CheckBoxPreference
android:key="PreventSleep"
android:title="Prevent the screen from blanking."
android:summary="Prevent the screen from blanking while the application is running."
android:defaultValue="false" />
<EditTextPreference
android:key="UpdatePeriod"
android:title="Display Update Period (ms)."
android:summary="Display update period in miliseconds."
android:defaultValue="1000" />
-->
<EditTextPreference
android:key="AlarmFreqMin"
android:title="@string/alarm_freq_min_title"
android:summary="@string/alarm_freq_min_summary"
android:defaultValue="5" />
<EditTextPreference
android:key="AlarmFreqMax"
android:title="@string/alarm_freq_max_title"
android:summary="@string/alarm_freq_max_summary"
android:defaultValue="10" />
<EditTextPreference
android:key="WarnTime"
android:title="@string/warn_time_title"
android:summary="@string/warn_time_summary"
android:defaultValue="5" />
<EditTextPreference
android:key="AlarmTime"
android:title="@string/alarm_time_title"
android:summary="@string/alarm_time_summary"
android:defaultValue="10" />
<EditTextPreference
android:key="AlarmThresh"
android:title="@string/alarm_threshold_title"
android:summary="@string/alarm_threshold_summary"
android:defaultValue="100" />
<EditTextPreference
android:key="AlarmRatioThresh"
android:title="@string/alarm_ratio_thresh_title"
android:summary="@string/alarm_ratio_thresh_summary"
android:defaultValue="30" />
<CheckBoxPreference
android:key="FallActive"
android:title="@string/fall_detect_active_title"
android:summary=""
android:defaultValue="false" />
<EditTextPreference
android:key="FallThreshMin"
android:title="@string/fall_thresh_min_title"
android:summary=""
android:defaultValue="200" />
<EditTextPreference
android:key="FallThreshMax"
android:title="@string/fall_thresh_max_title"
android:summary=""
android:defaultValue="1200" />
<EditTextPreference
android:key="FallWindow"
android:title="@string/fall_window_title"
android:summary=""
android:defaultValue="1500" />
<EditTextPreference
android:key="AppRestartTimeout"
android:title="@string/app_restart_timeout_title"
android:summary="@string/app_restart_timeout_summary"
android:numeric="integer"
android:defaultValue="10" />
<EditTextPreference
android:key="FaultTimerPeriod"
android:title="@string/fault_timer_period_title"
android:summary="@string/fault_timer_period_summary"
android:numeric="integer"
android:defaultValue="30" />
</PreferenceScreen>