Added data sharing status text field to main activity
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="uk.org.openseizuredetector"
|
package="uk.org.openseizuredetector"
|
||||||
android:versionCode="92"
|
android:versionCode="92"
|
||||||
android:versionName="4.0.0b">
|
android:versionName="4.0.0c">
|
||||||
<!-- android:allowBackup="false" -->
|
<!-- android:allowBackup="false" -->
|
||||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:networkSecurityConfig="@xml/network_security_config"
|
android:networkSecurityConfig="@xml/network_security_config"
|
||||||
android:theme="@style/AppTheme">
|
android:theme="@style/AppTheme">
|
||||||
<activity android:name=".AuthenticateActivity"></activity>
|
<activity android:name=".AuthenticateActivity"/>
|
||||||
<!-- @android:style/Theme.Holo.Light" -->
|
<!-- @android:style/Theme.Holo.Light" -->
|
||||||
<activity android:name=".BLEScanActivity" />
|
<activity android:name=".BLEScanActivity" />
|
||||||
<activity android:name=".ExportDataActivity" /> <!-- android:usesCleartextTraffic="true" -->
|
<activity android:name=".ExportDataActivity" /> <!-- android:usesCleartextTraffic="true" -->
|
||||||
|
|||||||
@@ -568,6 +568,42 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
tv.setBackgroundColor(okColour);
|
tv.setBackgroundColor(okColour);
|
||||||
tv.setTextColor(okTextColour);
|
tv.setTextColor(okTextColour);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mConnection.mSdServer.mLogData) {
|
||||||
|
if (mConnection.mSdServer.mLogDataRemote) {
|
||||||
|
if (mConnection.mSdServer.mLm.mWac.isLoggedIn()) {
|
||||||
|
tv = (TextView) findViewById(R.id.remoteDbTv);
|
||||||
|
tv.setText(getString(R.string.data_sharing_status)
|
||||||
|
+": "
|
||||||
|
+getString(R.string.data_sharing_setup_ok));
|
||||||
|
tv.setBackgroundColor(okColour);
|
||||||
|
tv.setTextColor(okTextColour);
|
||||||
|
} else {
|
||||||
|
tv = (TextView) findViewById(R.id.remoteDbTv);
|
||||||
|
tv.setText(getString(R.string.data_sharing_status)
|
||||||
|
+": "
|
||||||
|
+getString(R.string.not_logged_in));
|
||||||
|
tv.setBackgroundColor(warnColour);
|
||||||
|
tv.setTextColor(warnTextColour);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
tv = (TextView) findViewById(R.id.remoteDbTv);
|
||||||
|
tv.setText(getString(R.string.data_sharing_status)
|
||||||
|
+": "
|
||||||
|
+getString(R.string.not_sharing_logged_data));
|
||||||
|
tv.setBackgroundColor(warnColour);
|
||||||
|
tv.setTextColor(warnTextColour);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
tv = (TextView) findViewById(R.id.remoteDbTv);
|
||||||
|
tv.setText(getString(R.string.data_sharing_status)
|
||||||
|
+": "
|
||||||
|
+getString(R.string.not_logging_data));
|
||||||
|
tv.setBackgroundColor(warnColour);
|
||||||
|
tv.setTextColor(warnTextColour);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Set ProgressBars to show margin to alarm.
|
// Set ProgressBars to show margin to alarm.
|
||||||
long powerPc;
|
long powerPc;
|
||||||
if (mConnection.mSdServer.mSdData.alarmThresh != 0)
|
if (mConnection.mSdServer.mSdData.alarmThresh != 0)
|
||||||
@@ -664,7 +700,6 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
tv.setBackgroundColor(warnColour);
|
tv.setBackgroundColor(warnColour);
|
||||||
tv.setTextColor(warnTextColour);
|
tv.setTextColor(warnTextColour);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else { // Not bound to server
|
} else { // Not bound to server
|
||||||
tv = (TextView) findViewById(R.id.alarmTv);
|
tv = (TextView) findViewById(R.id.alarmTv);
|
||||||
tv.setText(R.string.Dashes);
|
tv.setText(R.string.Dashes);
|
||||||
@@ -694,6 +729,11 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
tv.setText(getString(R.string.WatchBatteryEquals)+" ---%");
|
tv.setText(getString(R.string.WatchBatteryEquals)+" ---%");
|
||||||
tv.setBackgroundColor(warnColour);
|
tv.setBackgroundColor(warnColour);
|
||||||
tv.setTextColor(warnTextColour);
|
tv.setTextColor(warnTextColour);
|
||||||
|
|
||||||
|
tv = (TextView) findViewById(R.id.remoteDbTv);
|
||||||
|
tv.setText("---");
|
||||||
|
tv.setBackgroundColor(warnColour);
|
||||||
|
tv.setTextColor(warnTextColour);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e(TAG, "ServerStatusRunnable: Exception - ");
|
Log.e(TAG, "ServerStatusRunnable: Exception - ");
|
||||||
|
|||||||
@@ -134,8 +134,8 @@ public class SdServer extends Service implements SdDataReceiver {
|
|||||||
|
|
||||||
// Data Logging Parameters
|
// Data Logging Parameters
|
||||||
private boolean mLogAlarms = true;
|
private boolean mLogAlarms = true;
|
||||||
private boolean mLogData = false;
|
public boolean mLogData = false;
|
||||||
private boolean mLogDataRemote = false;
|
public boolean mLogDataRemote = false;
|
||||||
private boolean mLogDataRemoteMobile = false;
|
private boolean mLogDataRemoteMobile = false;
|
||||||
private String mAuthToken = null;
|
private String mAuthToken = null;
|
||||||
private long mEventDuration = 120; // event duration in seconds - uploads datapoints that cover this time range centred on the event time.
|
private long mEventDuration = 120; // event duration in seconds - uploads datapoints that cover this time range centred on the event time.
|
||||||
|
|||||||
@@ -20,16 +20,16 @@
|
|||||||
android:id="@+id/serverStatusTv"
|
android:id="@+id/serverStatusTv"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center"
|
|
||||||
android:layout_weight="0.5"
|
android:layout_weight="0.5"
|
||||||
|
android:gravity="center"
|
||||||
android:text="textView1" />
|
android:text="textView1" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/serverIpTv"
|
android:id="@+id/serverIpTv"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
|
||||||
android:layout_weight="0.5"
|
android:layout_weight="0.5"
|
||||||
|
android:gravity="center"
|
||||||
android:text="textView2" />
|
android:text="textView2" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@@ -86,6 +86,11 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/remoteDbTv"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="----" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/powerTv"
|
android:id="@+id/powerTv"
|
||||||
@@ -132,6 +137,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:text="@string/CancelAudibleButtonTxt" />
|
android:text="@string/CancelAudibleButtonTxt" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/manualAlarmButton"
|
android:id="@+id/manualAlarmButton"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
|||||||
@@ -330,4 +330,9 @@
|
|||||||
<string name="register">Register New User</string>
|
<string name="register">Register New User</string>
|
||||||
<string name="reset_password">Reset Password</string>
|
<string name="reset_password">Reset Password</string>
|
||||||
<string name="login_to_osdapi">Log in to osdApi Remote Database</string>
|
<string name="login_to_osdapi">Log in to osdApi Remote Database</string>
|
||||||
|
<string name="data_sharing_status">Data Sharing Status</string>
|
||||||
|
<string name="not_logging_data">Not Logging Data</string>
|
||||||
|
<string name="not_sharing_logged_data">Not Sharing Logged Data</string>
|
||||||
|
<string name="not_logged_in">Not Logged In</string>
|
||||||
|
<string name="data_sharing_setup_ok">Data Sharing Setup OK</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user