Major UI and UX update
This commit is contained in:
@@ -14,6 +14,7 @@ import android.text.format.Time;
|
||||
|
||||
public class FragmentCommon extends FragmentOsdBaseClass {
|
||||
String TAG = "FragmentCommon";
|
||||
private long mUiAlarmStartMillis = 0;
|
||||
|
||||
public FragmentCommon() {
|
||||
// Required empty public constructor
|
||||
@@ -79,6 +80,13 @@ public class FragmentCommon extends FragmentOsdBaseClass {
|
||||
}
|
||||
});
|
||||
}
|
||||
private String formatDuration(long elapsedMillis) {
|
||||
long totalSeconds = elapsedMillis / 1000;
|
||||
long minutes = totalSeconds / 60;
|
||||
long seconds = totalSeconds % 60;
|
||||
|
||||
return String.format("%02d:%02d", minutes, seconds);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateUi() {
|
||||
@@ -107,10 +115,23 @@ public class FragmentCommon extends FragmentOsdBaseClass {
|
||||
|
||||
|
||||
tv = (TextView) mRootView.findViewById(R.id.alarmTv);
|
||||
TextView durationTv = (TextView) mRootView.findViewById(R.id.seizureDurationTv);
|
||||
|
||||
boolean seizureAlarmActive = mConnection.mSdServer.mSdData.alarmStanding;
|
||||
boolean fallAlarmActive = mConnection.mSdServer.mSdData.fallAlarmStanding;
|
||||
|
||||
if (!seizureAlarmActive && !fallAlarmActive) {
|
||||
mUiAlarmStartMillis = 0;
|
||||
if (durationTv != null) {
|
||||
durationTv.setVisibility(View.GONE);
|
||||
durationTv.setText("");
|
||||
}
|
||||
}
|
||||
|
||||
if ((mConnection.mSdServer.mSdData.alarmState == 0)
|
||||
&& !mConnection.mSdServer.mSdData.alarmStanding
|
||||
&& !mConnection.mSdServer.mSdData.fallAlarmStanding) {
|
||||
tv.setText(getString(R.string.okBtnTxt));
|
||||
&& !seizureAlarmActive
|
||||
&& !fallAlarmActive) {
|
||||
tv.setText("Monitoring active");
|
||||
tv.setBackgroundColor(okColour);
|
||||
tv.setTextColor(okTextColour);
|
||||
}
|
||||
@@ -126,13 +147,25 @@ public class FragmentCommon extends FragmentOsdBaseClass {
|
||||
tv.setBackgroundColor(warnColour);
|
||||
tv.setTextColor(warnTextColour);
|
||||
}
|
||||
if (mConnection.mSdServer.mSdData.alarmStanding) {
|
||||
tv.setText(getString(R.string.Alarm) + "\n" + mConnection.mSdServer.mSdData.alarmCause);
|
||||
if (seizureAlarmActive) {
|
||||
if (mUiAlarmStartMillis == 0) {
|
||||
mUiAlarmStartMillis = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
tv.setText("SEIZURE DETECTED");
|
||||
tv.setBackgroundColor(alarmColour);
|
||||
tv.setTextColor(alarmTextColour);
|
||||
|
||||
if (durationTv != null) {
|
||||
long elapsedMillis = System.currentTimeMillis() - mUiAlarmStartMillis;
|
||||
durationTv.setText("Seizure duration: " + formatDuration(elapsedMillis));
|
||||
durationTv.setVisibility(View.VISIBLE);
|
||||
durationTv.setBackgroundColor(alarmColour);
|
||||
durationTv.setTextColor(alarmTextColour);
|
||||
}
|
||||
if (mConnection.mSdServer.mSdData.fallAlarmStanding) {
|
||||
tv.setText(R.string.Fall);
|
||||
}
|
||||
if (fallAlarmActive) {
|
||||
tv.setText("FALL DETECTED");
|
||||
tv.setBackgroundColor(alarmColour);
|
||||
tv.setTextColor(alarmTextColour);
|
||||
}
|
||||
|
||||
@@ -89,6 +89,33 @@ public class FragmentOsdAlg extends FragmentOsdBaseClass {
|
||||
pbDrawable = mContext.getDrawable(R.drawable.progress_bar_red);
|
||||
pb.setProgressDrawable(pbDrawable);
|
||||
|
||||
TextView currentHrTv = (TextView) mRootView.findViewById(R.id.osd_current_hr_tv);
|
||||
TextView avgHrTv = (TextView) mRootView.findViewById(R.id.osd_avg_hr_tv);
|
||||
TextView hrStatusTv = (TextView) mRootView.findViewById(R.id.osd_hr_status_tv);
|
||||
|
||||
if (currentHrTv != null && avgHrTv != null && hrStatusTv != null) {
|
||||
short currentHr = (short) mConnection.mSdServer.mSdData.mHR;
|
||||
short avgHr = (short) mConnection.mSdServer.mSdData.mAdaptiveHrAverage;
|
||||
|
||||
if (currentHr > 0) {
|
||||
currentHrTv.setText(currentHr + " bpm");
|
||||
avgHrTv.setText(avgHr + " bpm");
|
||||
|
||||
if (mConnection.mSdServer.mSdData.mAdaptiveHrAlarmStanding) {
|
||||
hrStatusTv.setText("Heart-rate alarm active");
|
||||
hrStatusTv.setTextColor(Color.RED);
|
||||
} else {
|
||||
hrStatusTv.setText("Heart rate normal");
|
||||
hrStatusTv.setTextColor(Color.WHITE);
|
||||
}
|
||||
} else {
|
||||
currentHrTv.setText("-- bpm");
|
||||
avgHrTv.setText("Avg --");
|
||||
hrStatusTv.setText("Waiting for heart-rate data");
|
||||
hrStatusTv.setTextColor(Color.GRAY);
|
||||
}
|
||||
}
|
||||
|
||||
((TextView) mRootView.findViewById(R.id.spectrumTv)).setText(getString(R.string.SpectrumRatioEquals) + specRatio +
|
||||
" (" + getString(R.string.Threshold) + "=" + mConnection.mSdServer.mSdData.alarmRatioThresh + ")");
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import android.view.Gravity;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
@@ -87,6 +89,27 @@ public class MainActivity2 extends AppCompatActivity {
|
||||
mUtil.writeToSysLogFile("MainActivity2.onCreate()");
|
||||
mContext = this;
|
||||
mHandler = new Handler();
|
||||
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
TextView title = new TextView(this);
|
||||
title.setText("FLOGA");
|
||||
title.setTextColor(Color.BLACK);
|
||||
title.setTextSize(22);
|
||||
title.setGravity(Gravity.CENTER);
|
||||
title.setPadding(48, 0, 0, 0);
|
||||
title.setTypeface(null, android.graphics.Typeface.BOLD);
|
||||
|
||||
ActionBar.LayoutParams params = new ActionBar.LayoutParams(
|
||||
ActionBar.LayoutParams.MATCH_PARENT,
|
||||
ActionBar.LayoutParams.MATCH_PARENT,
|
||||
Gravity.CENTER
|
||||
);
|
||||
|
||||
actionBar.setDisplayShowTitleEnabled(false);
|
||||
actionBar.setDisplayShowCustomEnabled(true);
|
||||
actionBar.setCustomView(title, params);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -112,8 +135,7 @@ public class MainActivity2 extends AppCompatActivity {
|
||||
|
||||
TextView tv;
|
||||
tv = (TextView) findViewById(R.id.versionTv);
|
||||
String versionName = mUtil.getAppVersionName();
|
||||
tv.setText(getString(R.string.AppTitleText) + " " + versionName);
|
||||
tv.setText("FLOGA");
|
||||
tv.setBackgroundColor(okColour);
|
||||
tv.setTextColor(okTextColour);
|
||||
|
||||
|
||||
@@ -48,6 +48,8 @@ import android.view.WindowManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import android.view.Gravity;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
@@ -134,6 +136,26 @@ public class StartupActivity extends AppCompatActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
Log.i(TAG, "onCreate()");
|
||||
setContentView(R.layout.startup_activity);
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
TextView title = new TextView(this);
|
||||
title.setText("FLOGA");
|
||||
title.setTextColor(Color.BLACK);
|
||||
title.setTextSize(22);
|
||||
title.setGravity(Gravity.CENTER);
|
||||
title.setPadding(48, 0, 0, 0);
|
||||
title.setTypeface(null, android.graphics.Typeface.BOLD);
|
||||
|
||||
ActionBar.LayoutParams params = new ActionBar.LayoutParams(
|
||||
ActionBar.LayoutParams.MATCH_PARENT,
|
||||
ActionBar.LayoutParams.MATCH_PARENT,
|
||||
Gravity.CENTER
|
||||
);
|
||||
|
||||
actionBar.setDisplayShowTitleEnabled(false);
|
||||
actionBar.setDisplayShowCustomEnabled(true);
|
||||
actionBar.setCustomView(title, params);
|
||||
}
|
||||
|
||||
// Set our custom uncaught exception handler to report issues.
|
||||
//Thread.setDefaultUncaughtExceptionHandler(new OsdUncaughtExceptionHandler(StartupActivity.this));
|
||||
@@ -269,7 +291,7 @@ public class StartupActivity extends AppCompatActivity {
|
||||
|
||||
String versionName = mUtil.getAppVersionName();
|
||||
tv = (TextView) findViewById(R.id.appNameTv);
|
||||
tv.setText("OpenSeizureDetector V" + versionName);
|
||||
tv.setText("Seizure monitoring");
|
||||
|
||||
// Display the DataSource name
|
||||
SharedPreferences SP = PreferenceManager
|
||||
@@ -285,6 +307,7 @@ public class StartupActivity extends AppCompatActivity {
|
||||
} else {
|
||||
tv.setText(String.format("%s = %s", getString(R.string.DataSource), mSdDataSourceName));
|
||||
}
|
||||
setStartupStatus("Checking app setup...");
|
||||
|
||||
|
||||
if (mUtil.isServerRunning()) {
|
||||
@@ -346,6 +369,12 @@ public class StartupActivity extends AppCompatActivity {
|
||||
* If everything is ok, we close this activity and open the main user interface
|
||||
* activity.
|
||||
*/
|
||||
private void setStartupStatus(String message) {
|
||||
TextView statusTv = (TextView) findViewById(R.id.startupCurrentStatusTv);
|
||||
if (statusTv != null) {
|
||||
statusTv.setText(message);
|
||||
}
|
||||
}
|
||||
final Runnable serverStatusRunnable = new Runnable() {
|
||||
public void run() {
|
||||
Boolean allOk = true;
|
||||
@@ -438,6 +467,7 @@ public class StartupActivity extends AppCompatActivity {
|
||||
tv.setTextColor(alarmTextColour);
|
||||
pb.setIndeterminate(true);
|
||||
allOk = false;
|
||||
setStartupStatus("Waiting for required permissions...");
|
||||
requestPermissions(StartupActivity.this);
|
||||
}
|
||||
|
||||
@@ -466,6 +496,7 @@ public class StartupActivity extends AppCompatActivity {
|
||||
tv.setTextColor(alarmTextColour);
|
||||
pb.setIndeterminateDrawable(getResources().getDrawable(R.drawable.start_server));
|
||||
pb.setProgressDrawable(getResources().getDrawable(R.drawable.start_server));
|
||||
setStartupStatus("Starting monitoring service...");
|
||||
mMode = MODE_START_SERVER;
|
||||
} else {
|
||||
tv.setText(getString(R.string.ServerRunningOK));
|
||||
@@ -500,6 +531,7 @@ public class StartupActivity extends AppCompatActivity {
|
||||
tv.setBackgroundColor(alarmColour);
|
||||
tv.setTextColor(alarmTextColour);
|
||||
pb.setIndeterminate(true);
|
||||
setStartupStatus("Connecting to monitoring service...");
|
||||
allOk = false;
|
||||
}
|
||||
|
||||
@@ -517,6 +549,7 @@ public class StartupActivity extends AppCompatActivity {
|
||||
tv.setBackgroundColor(alarmColour);
|
||||
tv.setTextColor(alarmTextColour);
|
||||
pb.setIndeterminate(true);
|
||||
setStartupStatus("Waiting for watch connection...");
|
||||
allOk = false;
|
||||
}
|
||||
|
||||
@@ -535,6 +568,7 @@ public class StartupActivity extends AppCompatActivity {
|
||||
tv.setBackgroundColor(alarmColour);
|
||||
tv.setTextColor(alarmTextColour);
|
||||
pb.setIndeterminate(true);
|
||||
setStartupStatus("Waiting for detector data...");
|
||||
allOk = false;
|
||||
}
|
||||
|
||||
@@ -553,6 +587,7 @@ public class StartupActivity extends AppCompatActivity {
|
||||
tv.setBackgroundColor(alarmColour);
|
||||
tv.setTextColor(alarmTextColour);
|
||||
pb.setIndeterminate(true);
|
||||
setStartupStatus("Waiting for detector data...");
|
||||
allOk = false;
|
||||
}
|
||||
|
||||
@@ -563,6 +598,7 @@ public class StartupActivity extends AppCompatActivity {
|
||||
if (!mDialogDisplayed && !mBatteryOptDialogDisplayed) {
|
||||
if (!mStartedMainActivity) {
|
||||
Log.i(TAG, "serverStatusRunnable() - starting main activity...");
|
||||
setStartupStatus("Ready. Opening dashboard...");
|
||||
mUtil.writeToSysLogFile("StartupActivity.serverStatusRunnable - all checks ok - starting main activity.");
|
||||
try {
|
||||
Boolean useNewUi = SP.getBoolean("UseNewUi", true);
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
<TextView
|
||||
android:id="@+id/versionTv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/app_name" />
|
||||
android:layout_height="0dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
|
||||
@@ -3,42 +3,92 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#101418"
|
||||
tools:context=".FragmentOsdBaseClass">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="@color/okBackgroundColor"
|
||||
>
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingTop="14dp"
|
||||
android:paddingBottom="12dp">
|
||||
|
||||
<!-- Main alarm/status card -->
|
||||
<TextView
|
||||
android:id="@+id/alarmTv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="96dp"
|
||||
android:gravity="center"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:text="---"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/seizureDurationTv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center"
|
||||
android:text=""
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone" />
|
||||
|
||||
<!-- Simple user-facing status area.
|
||||
Java still writes technical text here for now; we will simplify
|
||||
the text in a later Java-only pass. -->
|
||||
<LinearLayout
|
||||
android:id="@+id/dashboardStatusCard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:orientation="vertical"
|
||||
android:background="#1B222A"
|
||||
android:padding="14dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/serverStatusTv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="---" />
|
||||
android:text="---"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dataSourceInfoTv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="---" />
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="---"
|
||||
android:textColor="#B8C1CC"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/data_time_tv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="---" />
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="---"
|
||||
android:textColor="#8E99A6"
|
||||
android:textSize="13sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Keep algorithm views available for Java, but hide them from the
|
||||
normal user dashboard for now. -->
|
||||
<LinearLayout
|
||||
android:id="@+id/statusLayout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/algsTv"
|
||||
@@ -75,56 +125,45 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="---" />
|
||||
|
||||
<!--<TextView
|
||||
android:id="@+id/fallAlgTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=""
|
||||
android:visibility="gone"/>
|
||||
-->
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/alarmTv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="---"
|
||||
android:textSize="32sp" />
|
||||
|
||||
|
||||
<!-- Action buttons -->
|
||||
<LinearLayout
|
||||
android:id="@+id/dashboardActionButtons"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:baselineAligned="false">
|
||||
android:layout_marginTop="14dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<Button
|
||||
android:id="@+id/acceptAlarmButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/AcceptAlarmBtnTxt" />
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:text="@string/AcceptAlarmBtnTxt"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/cancelAudibleButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/CancelAudibleButtonTxt" />
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/CancelAudibleButtonTxt"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/manualAlarmButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:backgroundTint="#ff0000"
|
||||
android:text="@string/ManualAlarmBtnTxt" />
|
||||
</LinearLayout>
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:backgroundTint="#C62828"
|
||||
android:text="@string/ManualAlarmBtnTxt"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
@@ -3,69 +3,228 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#101418"
|
||||
tools:context=".FragmentOsdBaseClass">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="@color/okBackgroundColor">
|
||||
android:paddingStart="14dp"
|
||||
android:paddingEnd="14dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fragment_osdalg_tv2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/okTextColor"
|
||||
android:text="OSD Algorithm Status" />
|
||||
android:gravity="center"
|
||||
android:text="Detection status"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="21sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<!-- First row: motion power and spectrum ratio -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- Motion power card -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:background="#1B222A"
|
||||
android:padding="10dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="Motion power"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/powerTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/okTextColor"
|
||||
android:text="---" />
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center"
|
||||
android:maxLines="2"
|
||||
android:text="---"
|
||||
android:textColor="#B8C1CC"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/powerProgressBar"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="6dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:minHeight="6dp"
|
||||
android:maxHeight="6dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Spectrum card -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="5dp"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:background="#1B222A"
|
||||
android:padding="10dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="20dp" />
|
||||
android:gravity="center"
|
||||
android:text="Spectrum"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/spectrumTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/okTextColor"
|
||||
android:text="---" />
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center"
|
||||
android:maxLines="2"
|
||||
android:text="---"
|
||||
android:textColor="#B8C1CC"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/spectrumProgressBar"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="6dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:indeterminate="false"
|
||||
android:minHeight="20dp" />
|
||||
android:minHeight="6dp"
|
||||
android:maxHeight="6dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Second row: current HR and average HR -->
|
||||
<LinearLayout
|
||||
android:id="@+id/hrStatusCard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- Current HR card -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:background="#1B222A"
|
||||
android:padding="10dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="Current HR"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/osd_current_hr_tv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:gravity="center"
|
||||
android:text="-- bpm"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="25sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Average HR card -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="5dp"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:background="#1B222A"
|
||||
android:padding="10dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="Average HR"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/osd_avg_hr_tv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:gravity="center"
|
||||
android:text="-- bpm"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="25sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Kept for Java compatibility, hidden from this simplified page. -->
|
||||
<TextView
|
||||
android:id="@+id/osd_hr_status_tv"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="1dp"
|
||||
android:visibility="gone"
|
||||
android:text="Waiting for heart-rate data" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pSeizureTvM2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/seizure_probability"
|
||||
android:textColor="@color/okTextColor" />
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="1dp"
|
||||
android:visibility="gone"
|
||||
android:text="@string/seizure_probability" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/pSeizureProgressBarM2"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="1dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<com.github.mikephil.charting.charts.BarChart
|
||||
android:id="@+id/chart1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="1dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</FrameLayout>
|
||||
@@ -2,181 +2,240 @@
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:background="#101418"
|
||||
android:fillViewport="true">
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:context="uk.org.openseizuredetector.StartupActivity"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:paddingTop="32dp"
|
||||
android:paddingBottom="24dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="72dp"
|
||||
android:layout_height="72dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:contentDescription="@string/app_name"
|
||||
app:srcCompat="@drawable/star_of_life_48x48" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:text="OpenSeizureDetector"
|
||||
android:id="@+id/appNameTv"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:text="@string/StartingTitle"
|
||||
android:layout_marginTop="14dp"
|
||||
android:text="FLOGA"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dataSourceTextView"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/StartingTitle"
|
||||
android:textColor="#B8C1CC"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
<TextView
|
||||
android:id="@+id/startupMessageTv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<Button
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:text="Help"
|
||||
android:id="@+id/instructionsButton"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
android:layout_marginTop="24dp"
|
||||
android:gravity="center"
|
||||
android:text="Getting monitoring ready..."
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="22sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<Button
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
<ProgressBar
|
||||
android:id="@+id/startupLoadingProgressBar"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="6dp"
|
||||
android:layout_marginTop="18dp"
|
||||
android:indeterminate="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/startupCurrentStatusTv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:text="Trouble-\nshooting"
|
||||
android:id="@+id/troubleshootingButton"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
||||
<Button
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:text="@string/edit_settings"
|
||||
android:id="@+id/settingsButton"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
android:layout_marginTop="14dp"
|
||||
android:gravity="center"
|
||||
android:text="Starting..."
|
||||
android:textColor="#B8C1CC"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/startupChecklistContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="18dp"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="fill_parent">
|
||||
android:background="#1B222A"
|
||||
android:padding="14dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
android:layout_height="52dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/progressBar1" />
|
||||
android:id="@+id/progressBar1"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="fill_parent"
|
||||
android:id="@+id/textItem1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="12dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="New Text"
|
||||
android:id="@+id/textItem1" />
|
||||
android:text="Checking app permissions..."
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="52dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/progressBar2" />
|
||||
android:id="@+id/progressBar2"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="fill_parent"
|
||||
android:id="@+id/textItem2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="12dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="New Text"
|
||||
android:id="@+id/textItem2" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/progressBar3" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:text="New Text"
|
||||
android:id="@+id/textItem3" />
|
||||
|
||||
android:text="Starting monitoring service..."
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<ProgressBar
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/progressBar5" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="New Text"
|
||||
android:layout_height="52dp"
|
||||
android:gravity="center_vertical"
|
||||
android:id="@+id/textItem5" />
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar3"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textItem3"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="12dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="Connecting to watch..."
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar5"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textItem5"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="12dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="Waiting for detector data..."
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/installOsdAppButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/install_watch_app"
|
||||
android:id="@+id/installOsdAppButton" />
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<ProgressBar
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/progressBar6" />
|
||||
<TextView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="New Text"
|
||||
android:autoLink="web"
|
||||
android:id="@+id/textItem6" />
|
||||
</LinearLayout>
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar6"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textItem6"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="12dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="Loading detector settings..."
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="16sp"
|
||||
android:autoLink="web" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/startupHelpTitleTv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="26dp"
|
||||
android:gravity="center"
|
||||
android:text="Taking too long?"
|
||||
android:textColor="#B8C1CC"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/settingsButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/edit_settings"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/instructionsButton"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="1dp"
|
||||
android:visibility="invisible"
|
||||
android:text="Help" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/troubleshootingButton"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="1dp"
|
||||
android:visibility="invisible"
|
||||
android:text="Troubleshooting" />
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
Reference in New Issue
Block a user