AnimalRating/app/src/main/res/layout/activity_home.xml

287 lines
12 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout 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:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:openDrawer="start">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#F7F7F7"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="24dp"
android:gravity="center_horizontal">
<!-- Menu Button (Top Right) to Open Drawer -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:layout_marginBottom="16dp">
<ImageButton
android:id="@+id/btnMenu"
android:layout_width="48dp"
android:layout_height="48dp"
android:src="@android:drawable/ic_menu_sort_by_size"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="Menu"
app:tint="#5D4037"/>
</LinearLayout>
<!-- Cow Illustration - Circular Logo -->
<androidx.cardview.widget.CardView
android:layout_width="180dp"
android:layout_height="180dp"
app:cardCornerRadius="90dp"
app:cardElevation="8dp"
app:cardBackgroundColor="#FFFFFF"
android:layout_marginBottom="24dp">
<ImageView
android:id="@+id/ivCowIllustration"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/cow_illustration_0"
android:scaleType="centerCrop"
android:contentDescription="Cow Illustration"/>
</androidx.cardview.widget.CardView>
<!-- Title -->
<TextView
android:id="@+id/tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cow Data Collector"
android:textSize="28sp"
android:textStyle="bold"
android:textColor="#3E2723"
android:textAlignment="center"
android:layout_marginBottom="8dp"/>
<!-- Subtitle -->
<TextView
android:id="@+id/tvSubtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Record and manage cow information easily."
android:textSize="16sp"
android:textColor="#6D4C41"
android:textAlignment="center"
android:layout_marginBottom="40dp"/>
<!-- Main Buttons Container -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginBottom="32dp">
<!-- Add New Cow Profile Button -->
<com.google.android.material.button.MaterialButton
android:id="@+id/btnSelectCow"
android:layout_width="match_parent"
android:layout_height="72dp"
android:text="Add New Cow Profile"
android:textSize="18sp"
android:textStyle="bold"
app:cornerRadius="16dp"
app:backgroundTint="#6D4C41"
app:icon="@android:drawable/ic_input_add"
app:iconGravity="textStart"
app:iconPadding="12dp"
android:layout_marginBottom="16dp"
android:elevation="4dp"/>
<!-- View Saved Profiles Button -->
<com.google.android.material.button.MaterialButton
android:id="@+id/btnViewGallery"
android:layout_width="match_parent"
android:layout_height="72dp"
android:text="View Saved Profiles"
android:textSize="18sp"
android:textStyle="bold"
android:textColor="#5D4037"
app:cornerRadius="16dp"
app:backgroundTint="#EFEBE9"
app:strokeColor="#5D4037"
app:strokeWidth="1dp"
app:icon="@android:drawable/ic_menu_gallery"
app:iconTint="#5D4037"
app:iconGravity="textStart"
app:iconPadding="12dp"
android:elevation="4dp"/>
</LinearLayout>
<!-- Settings Card -->
<androidx.cardview.widget.CardView
android:id="@+id/viewSettings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="16dp"
app:cardElevation="2dp"
app:cardBackgroundColor="#FFFFFF"
android:layout_marginBottom="24dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="20dp">
<TextView
android:id="@+id/tvHeaderSettings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Settings"
android:textSize="18sp"
android:textStyle="bold"
android:textColor="#3E2723"
android:layout_marginBottom="16dp"/>
<!-- Algorithm Selection -->
<TextView
android:id="@+id/tvAlgorithmLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Algorithm"
android:textSize="14sp"
android:textColor="#5D4037"
android:layout_marginBottom="8dp"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_spinner_rounded"
android:padding="4dp"
android:layout_marginBottom="20dp">
<Spinner
android:id="@+id/spinnerAlgorithm"
android:layout_width="match_parent"
android:layout_height="48dp"/>
</FrameLayout>
<!-- Threshold Slider -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_marginBottom="8dp">
<TextView
android:id="@+id/tvThresholdLabel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Match Threshold"
android:textSize="14sp"
android:textColor="#5D4037"/>
<TextView
android:id="@+id/tvThresholdValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="75%"
android:textStyle="bold"
android:textColor="#3E2723"/>
</LinearLayout>
<SeekBar
android:id="@+id/seekBarThreshold"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:max="100"
android:progressTint="#6D4C41"
android:thumbTint="#6D4C41"
android:layout_marginBottom="16dp"/>
<!-- Mask Display Toggle -->
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/switchMaskDisplay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Show Segmentation Mask"
android:textColor="#5D4037"
android:textSize="14sp"
app:thumbTint="#6D4C41"
app:trackTint="#EFEBE9"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
</ScrollView>
<!-- Navigation Drawer Content (Direct LinearLayout) -->
<LinearLayout
android:layout_width="280dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#FFFFFF"
android:orientation="vertical"
android:padding="16dp"
android:clickable="true"
android:focusable="true"
android:elevation="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Menu"
android:textSize="20sp"
android:textStyle="bold"
android:textColor="#3E2723"
android:layout_marginBottom="24dp"/>
<!-- Language Selection -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Language"
android:textColor="#5D4037"
android:layout_marginBottom="8dp"/>
<Spinner
android:id="@+id/spinnerLanguage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="8dp"
android:background="@drawable/bg_spinner_rounded"
android:layout_marginBottom="24dp"/>
<!-- Auto Capture Toggle -->
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/switchAutoCapture"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Auto Capture"
android:textColor="#5D4037"
android:textSize="14sp"
app:thumbTint="#6D4C41"
app:trackTint="#EFEBE9"
android:layout_marginBottom="16dp"/>
<!-- Enable Debug Toggle -->
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/switchEnableDebug"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Enable Debug"
android:textColor="#5D4037"
android:textSize="14sp"
app:thumbTint="#6D4C41"
app:trackTint="#EFEBE9"
android:layout_marginBottom="16dp"/>
</LinearLayout>
</androidx.drawerlayout.widget.DrawerLayout>