[android] Fix editor socket dialog and re-enable socket cardview in the editor

Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
Co-authored by: Séverin Lemaignan <severin@guakamole.org>
This commit is contained in:
Jean-Baptiste
2025-11-26 07:18:26 +01:00
committed by x7z4w
parent 7174d697d4
commit c6ac2919fa
5 changed files with 26 additions and 15 deletions

View File

@@ -355,8 +355,7 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
{
hasChargeSockets = hasChargeSockets || (type == Metadata.MetadataType.FMD_CHARGE_SOCKETS.toInt());
}
// Hide socket until https://codeberg.org/comaps/comaps/issues/2368 is fixed
//UiUtils.showIf(hasChargeSockets, mCardChargingStation);
UiUtils.showIf(hasChargeSockets, mCardChargingStation);
setCardVisibility(mCardDetails, mDetailsBlocks, editableDetails);
setCardVisibility(mCardSocialMedia, mSocialMediaBlocks, editableDetails);

View File

@@ -37,15 +37,18 @@
android:id="@+id/edit_socket_power_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp">
android:layout_marginBottom="8dp"
style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
android:hint="@string/charge_socket_power">
<com.google.android.material.textfield.MaterialAutoCompleteTextView
android:id="@+id/edit_socket_power"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:completionThreshold="1"
android:gravity="end"
android:hint="@string/charge_socket_power"
android:gravity="center|end"
android:minHeight="35dp"
android:paddingEnd="@dimen/margin_half"
android:inputType="numberDecimal"
app:simpleItems="@array/charge_sockets_common_powers" />
</com.google.android.material.textfield.TextInputLayout>
@@ -53,15 +56,18 @@
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/edit_socket_count_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
android:hint="@string/charge_socket_count">
<com.google.android.material.textfield.MaterialAutoCompleteTextView
android:id="@+id/edit_socket_count"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:completionThreshold="1"
android:gravity="end"
android:hint="@string/charge_socket_count"
android:gravity="center|end"
android:minHeight="35dp"
android:paddingEnd="@dimen/margin_half"
android:inputType="numberDecimal"
app:simpleItems="@array/charge_sockets_common_counts" />
</com.google.android.material.textfield.TextInputLayout>

View File

@@ -2,7 +2,7 @@
<com.google.android.material.button.MaterialButton
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
style="?attr/materialButtonOutlinedStyle"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:id="@+id/button_socket_type"
android:checkable="true"
android:layout_width="0dp"
@@ -13,6 +13,7 @@
android:paddingBottom="8dp"
android:text="@string/charge_socket_unknown_other"
app:icon="@drawable/ic_charge_socket_unknown"
app:iconSize="@null"
app:iconGravity="textTop"
android:textAppearance="@style/MwmTextAppearance.Body5"
/>

View File

@@ -24,17 +24,20 @@
android:layout_width="0dp"
android:paddingStart="4dp"
android:paddingEnd="4dp"
style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
android:layout_weight="1"
android:hint="@string/charge_socket_power"
android:layout_height="wrap_content">
<com.google.android.material.textfield.MaterialAutoCompleteTextView
android:id="@+id/edit_socket_power"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:gravity="center|end"
android:minHeight="35dp"
android:paddingEnd="@dimen/margin_half"
android:completionThreshold="1"
android:inputType="numberDecimal"
android:hint="@string/charge_socket_power"
app:simpleItems="@array/charge_sockets_common_powers"
/>
</com.google.android.material.textfield.TextInputLayout>
@@ -45,16 +48,19 @@
android:paddingStart="4dp"
android:paddingEnd="4dp"
android:layout_weight="1"
style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
android:hint="@string/charge_socket_count"
android:layout_height="wrap_content">
<com.google.android.material.textfield.MaterialAutoCompleteTextView
android:id="@+id/edit_socket_count"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:gravity="center|end"
android:minHeight="35dp"
android:paddingEnd="@dimen/margin_half"
android:completionThreshold="1"
android:inputType="numberDecimal"
android:hint="@string/charge_socket_count"
app:simpleItems="@array/charge_sockets_common_counts"
/>
</com.google.android.material.textfield.TextInputLayout>

View File

@@ -64,8 +64,7 @@
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/cv__charging_station"
style="@style/MwmWidget.M3.Editor.CardView"
android:visibility="gone">
style="@style/MwmWidget.M3.Editor.CardView">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"