Added the main fragments for the new main activity - still need to populate them and add the main menu, but swiping between them works

This commit is contained in:
Graham Jones
2023-09-01 21:43:42 +01:00
parent d2577c1e0e
commit 3ce91f89ab
15 changed files with 744 additions and 23 deletions

View File

@@ -1,21 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity2">
<!--<androidx.fragment.app.FragmentContainerView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragment_container_view"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TextView
android:id="@+id/versionTv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
-->
android:text="@string/app_name" />
<androidx.fragment.app.FragmentContainerView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragment_common_container_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<androidx.viewpager2.widget.ViewPager2
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragment_pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>

View File

@@ -0,0 +1,139 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".FragmentSdDataViewer">
<!-- TODO: Update blank fragment layout -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="253dp"
android:orientation="vertical">
<!-- TODO: Update blank fragment layout -->
<TextView
android:id="@+id/fragment_common_tv1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Fragment_System" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="OpenSeizureDetector Common Components Status" />
<TextView
android:id="@+id/versionTv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/app_name" />
<LinearLayout
android:id="@+id/statusLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/serverStatusTv"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="---" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp">
<TextView
android:id="@+id/algsTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Algorithms" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/osdAlgTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="---" />
<TextView
android:id="@+id/cnnAlgTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="---" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/hrAlgTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="---" />
<TextView
android:id="@+id/o2AlgTv"
android:layout_width="wrap_content"
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>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:baselineAligned="false">
<Button
android:id="@+id/acceptAlarmButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/AcceptAlarmBtnTxt" />
<Button
android:id="@+id/cancelAudibleButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/CancelAudibleButtonTxt" />
<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>
</androidx.appcompat.widget.LinearLayoutCompat>
</FrameLayout>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".FragmentSdDataViewer">
<!-- TODO: Update blank fragment layout -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="253dp"
android:orientation="vertical">
<!-- TODO: Update blank fragment layout -->
<TextView
android:id="@+id/fragment_data_sharing_tv1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Fragment_Data_Sharing" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Data Sharing Status" />
</androidx.appcompat.widget.LinearLayoutCompat>
</FrameLayout>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".FragmentSdDataViewer">
<!-- TODO: Update blank fragment layout -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="253dp"
android:orientation="vertical">
<!-- TODO: Update blank fragment layout -->
<TextView
android:id="@+id/fragment_ml_alg_tv1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Fragment_MlAlg" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Machine Learning Algorithm Status" />
</androidx.appcompat.widget.LinearLayoutCompat>
</FrameLayout>

View File

@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".FragmentSdDataViewer">
<!-- TODO: Update blank fragment layout -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="253dp"
android:orientation="vertical">
<!-- TODO: Update blank fragment layout -->
<TextView
android:id="@+id/fragment_system_tv1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Fragment_System" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="OpenSeizureDetector System Status" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageButton
android:id="@+id/settingsButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/ic_menu_manage" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Edit Settings" />
</LinearLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
</FrameLayout>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".FragmentSdDataViewer">
<!-- TODO: Update blank fragment layout -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="253dp"
android:orientation="vertical">
<!-- TODO: Update blank fragment layout -->
<TextView
android:id="@+id/fragment_web_server_tv1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Fragment_WebServer" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Web Server Status" />
</androidx.appcompat.widget.LinearLayoutCompat>
</FrameLayout>