mirror of
https://github.com/d4rken-org/capod.git
synced 2026-09-14 18:26:11 -04:00
- Fix navigation bar overlap issues in profile creation and list screens - Add proper edge-to-edge handling with dynamic padding for navigation bars - Improve paired device selection with "None" option and clear functionality - Add localized error messages for key validation with proper placeholders - Centralize default signal quality value in DeviceProfile companion object - Add unsaved changes detection and confirmation dialogs - Enhance drag handle touch target size with FrameLayout wrapper - Restore device address in profile editing and improve change tracking - Localize all user-facing strings following project guidelines
358 lines
17 KiB
XML
358 lines
17 KiB
XML
<?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"
|
|
android:id="@+id/root"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent">
|
|
|
|
<com.google.android.material.appbar.MaterialToolbar
|
|
android:id="@+id/toolbar"
|
|
style="@style/Widget.Material3.Toolbar"
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toTopOf="parent"
|
|
app:menu="@menu/device_profile_creation_menu"
|
|
app:navigationIcon="@drawable/ic_baseline_arrow_back_24"
|
|
app:title="@string/profiles_create_title"
|
|
app:titleMarginStart="16dp" />
|
|
|
|
<androidx.core.widget.NestedScrollView
|
|
android:id="@+id/scroll_view"
|
|
android:layout_width="0dp"
|
|
android:layout_height="0dp"
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toBottomOf="@id/toolbar">
|
|
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="vertical"
|
|
android:padding="16dp">
|
|
|
|
<!-- Basic Profile Info Card -->
|
|
<com.google.android.material.card.MaterialCardView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginBottom="16dp"
|
|
app:cardCornerRadius="12dp"
|
|
app:cardElevation="2dp">
|
|
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="vertical"
|
|
android:padding="16dp">
|
|
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="horizontal"
|
|
android:gravity="center_vertical">
|
|
|
|
<ImageView
|
|
android:layout_width="24dp"
|
|
android:layout_height="24dp"
|
|
android:layout_marginEnd="8dp"
|
|
android:src="@drawable/ic_baseline_settings_24"
|
|
android:contentDescription="@null" />
|
|
|
|
<com.google.android.material.textview.MaterialTextView
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:layout_weight="1"
|
|
android:text="@string/profiles_basic_info_title"
|
|
style="@style/TextAppearance.Material3.TitleMedium" />
|
|
|
|
</LinearLayout>
|
|
|
|
<com.google.android.material.textview.MaterialTextView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginTop="4dp"
|
|
android:layout_marginBottom="16dp"
|
|
android:text="@string/profiles_basic_info_description"
|
|
style="@style/TextAppearance.Material3.BodySmall" />
|
|
|
|
<com.google.android.material.textfield.TextInputLayout
|
|
android:id="@+id/name_input_layout"
|
|
style="@style/Widget.Material3.TextInputLayout.FilledBox"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginBottom="16dp"
|
|
android:hint="@string/profiles_name_label">
|
|
|
|
<com.google.android.material.textfield.TextInputEditText
|
|
android:id="@+id/name_input"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:inputType="text"
|
|
android:maxLines="1" />
|
|
|
|
</com.google.android.material.textfield.TextInputLayout>
|
|
|
|
<com.google.android.material.textfield.TextInputLayout
|
|
android:id="@+id/model_input_layout"
|
|
style="@style/Widget.Material3.TextInputLayout.FilledBox.ExposedDropdownMenu"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginBottom="16dp"
|
|
android:hint="@string/profiles_model_label">
|
|
|
|
<AutoCompleteTextView
|
|
android:id="@+id/model_input"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:inputType="none"
|
|
android:focusable="false"
|
|
android:cursorVisible="false" />
|
|
|
|
</com.google.android.material.textfield.TextInputLayout>
|
|
|
|
<com.google.android.material.textfield.TextInputLayout
|
|
android:id="@+id/device_input_layout"
|
|
style="@style/Widget.Material3.TextInputLayout.FilledBox.ExposedDropdownMenu"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:hint="@string/profiles_paired_device_label">
|
|
|
|
<AutoCompleteTextView
|
|
android:id="@+id/device_input"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:inputType="none"
|
|
android:focusable="false"
|
|
android:cursorVisible="false" />
|
|
|
|
</com.google.android.material.textfield.TextInputLayout>
|
|
|
|
</LinearLayout>
|
|
|
|
</com.google.android.material.card.MaterialCardView>
|
|
|
|
<!-- Signal Quality Card -->
|
|
<com.google.android.material.card.MaterialCardView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginBottom="16dp"
|
|
app:cardCornerRadius="12dp"
|
|
app:cardElevation="2dp">
|
|
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="vertical"
|
|
android:padding="16dp">
|
|
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="horizontal"
|
|
android:gravity="center_vertical">
|
|
|
|
<ImageView
|
|
android:layout_width="24dp"
|
|
android:layout_height="24dp"
|
|
android:layout_marginEnd="8dp"
|
|
android:src="@drawable/ic_baseline_signal_cellular_alt_24"
|
|
android:contentDescription="@null" />
|
|
|
|
<com.google.android.material.textview.MaterialTextView
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:layout_weight="1"
|
|
android:text="@string/profiles_signal_quality_title"
|
|
style="@style/TextAppearance.Material3.TitleMedium" />
|
|
|
|
</LinearLayout>
|
|
|
|
<com.google.android.material.textview.MaterialTextView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginTop="4dp"
|
|
android:layout_marginBottom="8dp"
|
|
android:text="@string/profiles_signal_quality_description"
|
|
style="@style/TextAppearance.Material3.BodySmall" />
|
|
|
|
<com.google.android.material.textview.MaterialTextView
|
|
android:id="@+id/signal_quality_status"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginBottom="8dp"
|
|
style="@style/TextAppearance.Material3.BodyMedium"
|
|
android:textStyle="bold"
|
|
android:gravity="center" />
|
|
|
|
<com.google.android.material.slider.Slider
|
|
android:id="@+id/signal_quality_slider"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:valueFrom="10"
|
|
android:valueTo="100"
|
|
android:stepSize="5"
|
|
android:value="20" />
|
|
|
|
</LinearLayout>
|
|
|
|
</com.google.android.material.card.MaterialCardView>
|
|
|
|
<!-- Identity Key Card -->
|
|
<com.google.android.material.card.MaterialCardView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginBottom="8dp"
|
|
app:cardCornerRadius="12dp"
|
|
app:cardElevation="2dp">
|
|
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="vertical"
|
|
android:padding="16dp">
|
|
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="horizontal"
|
|
android:gravity="center_vertical">
|
|
|
|
<ImageView
|
|
android:layout_width="24dp"
|
|
android:layout_height="24dp"
|
|
android:layout_marginEnd="8dp"
|
|
android:src="@drawable/ic_key_24"
|
|
android:contentDescription="@null" />
|
|
|
|
<com.google.android.material.textview.MaterialTextView
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:layout_weight="1"
|
|
android:text="@string/profiles_identitykey_label"
|
|
style="@style/TextAppearance.Material3.TitleMedium" />
|
|
|
|
</LinearLayout>
|
|
|
|
<com.google.android.material.textview.MaterialTextView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginTop="4dp"
|
|
android:layout_marginBottom="12dp"
|
|
android:text="@string/profiles_maindevice_identitykey_explanation"
|
|
style="@style/TextAppearance.Material3.BodySmall" />
|
|
|
|
<com.google.android.material.textfield.TextInputLayout
|
|
android:id="@+id/identity_key_input_layout"
|
|
style="@style/Widget.Material3.TextInputLayout.FilledBox"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content">
|
|
|
|
<com.google.android.material.textfield.TextInputEditText
|
|
android:id="@+id/identity_key_input"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:inputType="textCapCharacters"
|
|
android:maxLines="1"
|
|
android:fontFamily="monospace" />
|
|
|
|
</com.google.android.material.textfield.TextInputLayout>
|
|
|
|
<com.google.android.material.button.MaterialButton
|
|
android:id="@+id/identity_key_guide_button"
|
|
style="@style/Widget.Material3.Button.OutlinedButton.Icon"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_gravity="end"
|
|
android:layout_marginTop="8dp"
|
|
android:text="@string/general_guide_action"
|
|
android:textSize="12sp"
|
|
app:icon="@drawable/ic_baseline_question_mark_24"
|
|
app:iconSize="16dp" />
|
|
|
|
</LinearLayout>
|
|
|
|
</com.google.android.material.card.MaterialCardView>
|
|
|
|
<!-- Encryption Key Card -->
|
|
<com.google.android.material.card.MaterialCardView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginBottom="16dp"
|
|
app:cardCornerRadius="12dp"
|
|
app:cardElevation="2dp">
|
|
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="vertical"
|
|
android:padding="16dp">
|
|
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="horizontal"
|
|
android:gravity="center_vertical">
|
|
|
|
<ImageView
|
|
android:layout_width="24dp"
|
|
android:layout_height="24dp"
|
|
android:layout_marginEnd="8dp"
|
|
android:src="@drawable/ic_key_outline_24"
|
|
android:contentDescription="@null" />
|
|
|
|
<com.google.android.material.textview.MaterialTextView
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:layout_weight="1"
|
|
android:text="@string/profiles_maindevice_encryptionkey_label"
|
|
style="@style/TextAppearance.Material3.TitleMedium" />
|
|
|
|
</LinearLayout>
|
|
|
|
<com.google.android.material.textview.MaterialTextView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginTop="4dp"
|
|
android:layout_marginBottom="12dp"
|
|
android:text="@string/profiles_maindevice_encryptionkey_explanation"
|
|
style="@style/TextAppearance.Material3.BodySmall" />
|
|
|
|
<com.google.android.material.textfield.TextInputLayout
|
|
android:id="@+id/encryption_key_input_layout"
|
|
style="@style/Widget.Material3.TextInputLayout.FilledBox"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content">
|
|
|
|
<com.google.android.material.textfield.TextInputEditText
|
|
android:id="@+id/encryption_key_input"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:inputType="textCapCharacters"
|
|
android:maxLines="1"
|
|
android:fontFamily="monospace" />
|
|
|
|
</com.google.android.material.textfield.TextInputLayout>
|
|
|
|
<com.google.android.material.button.MaterialButton
|
|
android:id="@+id/encryption_key_guide_button"
|
|
style="@style/Widget.Material3.Button.OutlinedButton.Icon"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_gravity="end"
|
|
android:layout_marginTop="8dp"
|
|
android:text="@string/general_guide_action"
|
|
android:textSize="12sp"
|
|
app:icon="@drawable/ic_baseline_question_mark_24"
|
|
app:iconSize="16dp" />
|
|
|
|
</LinearLayout>
|
|
|
|
</com.google.android.material.card.MaterialCardView>
|
|
|
|
</LinearLayout>
|
|
|
|
</androidx.core.widget.NestedScrollView>
|
|
|
|
</androidx.constraintlayout.widget.ConstraintLayout> |