mirror of
https://github.com/d4rken-org/capod.git
synced 2026-09-16 11:16:12 -04:00
Introduce ApplePods.Flags and UI for key status
This commit introduces a new `Flags` data class within `ApplePods` to store boolean flags related to the device, specifically `isIRKMatch`. This flag is now passed during the creation of `ApplePods` instances in all `ApplePodsFactory` implementations and the central `AppleFactory`. The UI has been updated to display a key icon in the overview cards (`DualPodsCardVH` and `SinglePodsCardVH`): - The icon is only visible if `flags.isIRKMatch` is true. - The icon changes to a filled key (`ic_key_24`) if `payload.private` is not null (indicating successful decryption), otherwise an outline key (`ic_key_outline_24`) is shown. - Minor layout adjustments were made in `overview_pods_single_item.xml` and `overview_pods_dual_item.xml` to accommodate the new key icon.
This commit is contained in:
@@ -17,10 +17,10 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/device_icon"
|
||||
style="@style/PodInfoItemIcon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="16dp"
|
||||
style="@style/PodInfoItemIcon"
|
||||
app:layout_constraintBottom_toBottomOf="@id/name"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/name"
|
||||
@@ -71,13 +71,13 @@
|
||||
style="@style/TextAppearance.Material3.LabelMedium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:gravity="center"
|
||||
app:layout_constraintBottom_toBottomOf="@id/name"
|
||||
app:layout_constraintBottom_toBottomOf="@id/key_icon"
|
||||
app:layout_constraintEnd_toStartOf="@id/reception_icon"
|
||||
app:layout_constraintStart_toEndOf="@id/name"
|
||||
app:layout_constraintTop_toTopOf="@+id/name"
|
||||
app:layout_constraintTop_toTopOf="@+id/reception_icon"
|
||||
tools:text="Yours (RSSI -61)" />
|
||||
|
||||
<ImageView
|
||||
@@ -87,15 +87,25 @@
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:gravity="center"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/reception"
|
||||
app:layout_constraintBottom_toTopOf="@id/key_icon"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/reception"
|
||||
app:layout_constraintTop_toTopOf="@+id/reception"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_baseline_settings_input_antenna_24"
|
||||
tools:text="Yours (RSSI -61)" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/key_icon"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@drawable/ic_key_outline_24"
|
||||
app:layout_constraintEnd_toEndOf="@id/reception_icon"
|
||||
app:layout_constraintStart_toStartOf="@id/reception_icon"
|
||||
app:layout_constraintTop_toBottomOf="@id/reception_icon" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/barrier_top"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/device_icon"
|
||||
style="@style/PodInfoItemIcon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
style="@style/PodInfoItemIcon"
|
||||
android:layout_marginStart="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/name"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -59,13 +59,13 @@
|
||||
style="@style/TextAppearance.Material3.LabelMedium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:gravity="center"
|
||||
app:layout_constraintBottom_toBottomOf="@id/name"
|
||||
app:layout_constraintBottom_toBottomOf="@id/key_icon"
|
||||
app:layout_constraintEnd_toStartOf="@id/reception_icon"
|
||||
app:layout_constraintStart_toEndOf="@id/name"
|
||||
app:layout_constraintTop_toTopOf="@+id/name"
|
||||
app:layout_constraintTop_toTopOf="@+id/reception_icon"
|
||||
tools:text="Yours (RSSI -61)" />
|
||||
|
||||
<ImageView
|
||||
@@ -73,17 +73,26 @@
|
||||
style="@style/TextAppearance.Material3.LabelMedium"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:gravity="center"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/reception"
|
||||
app:layout_constraintBottom_toTopOf="@id/key_icon"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/reception"
|
||||
app:layout_constraintTop_toTopOf="@+id/reception"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_baseline_settings_input_antenna_24"
|
||||
tools:text="Yours (RSSI -61)" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/key_icon"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@drawable/ic_key_outline_24"
|
||||
app:layout_constraintEnd_toEndOf="@id/reception_icon"
|
||||
app:layout_constraintStart_toStartOf="@id/reception_icon"
|
||||
app:layout_constraintTop_toBottomOf="@id/reception_icon" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/barrier_top"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
Reference in New Issue
Block a user