extend max # of DeviceCardActions from 1 to 3

This commit is contained in:
Thomas Kuehne
2025-05-02 08:30:04 +00:00
committed by José Rebelo
parent fccd1fb5af
commit 7019094f90
2 changed files with 82 additions and 9 deletions
@@ -1295,12 +1295,23 @@ public class GBDeviceAdapterv2 extends ListAdapter<GBDevice, GBDeviceAdapterv2.V
heartRateIcon = view.findViewById(R.id.device_heart_rate_status);
infoIcons = view.findViewById(R.id.device_info_icons);
customActions = new CustomActionHolder[1];
customActions[0] = new CustomActionHolder(
view.findViewById(R.id.device_custom_action_0_box),
view.findViewById(R.id.device_custom_action_0_image),
view.findViewById(R.id.device_custom_action_0_label)
);
customActions = new CustomActionHolder[]{
new CustomActionHolder(
view.findViewById(R.id.device_custom_action_0_box),
view.findViewById(R.id.device_custom_action_0_image),
view.findViewById(R.id.device_custom_action_0_label)
),
new CustomActionHolder(
view.findViewById(R.id.device_custom_action_1_box),
view.findViewById(R.id.device_custom_action_1_image),
view.findViewById(R.id.device_custom_action_1_label)
),
new CustomActionHolder(
view.findViewById(R.id.device_custom_action_2_box),
view.findViewById(R.id.device_custom_action_2_image),
view.findViewById(R.id.device_custom_action_2_label)
)
};
cardViewActivityCardLayout = view.findViewById(R.id.card_view_activity_card_layout);
+65 -3
View File
@@ -496,11 +496,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/device_image"
android:contentDescription=""
android:tooltipText=""
android:layout_margin="3dp"
android:layout_toEndOf="@id/device_action_power_off"
android:orientation="vertical">
android:contentDescription=""
android:orientation="vertical"
android:tooltipText="">
<ImageView
android:id="@+id/device_custom_action_0_image"
@@ -521,6 +521,68 @@
android:textStyle="bold"
tools:text="" />
</LinearLayout>
<LinearLayout
android:id="@+id/device_custom_action_1_box"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/device_image"
android:layout_margin="3dp"
android:layout_toEndOf="@id/device_custom_action_0_box"
android:contentDescription=""
android:orientation="vertical"
android:tooltipText="">
<ImageView
android:id="@+id/device_custom_action_1_image"
android:layout_width="40dp"
android:layout_height="40dp"
android:padding="3dp"
android:scaleType="fitXY"
card_view:srcCompat="@drawable/ic_device_unknown"
card_view:tint="@color/secondarytext" />
<TextView
android:id="@+id/device_custom_action_1_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:minWidth="36dp"
android:textColor="@color/secondarytext"
android:textStyle="bold"
tools:text="" />
</LinearLayout>
<LinearLayout
android:id="@+id/device_custom_action_2_box"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/device_image"
android:layout_margin="3dp"
android:layout_toEndOf="@id/device_custom_action_1_box"
android:contentDescription=""
android:orientation="vertical"
android:tooltipText="">
<ImageView
android:id="@+id/device_custom_action_2_image"
android:layout_width="40dp"
android:layout_height="40dp"
android:padding="3dp"
android:scaleType="fitXY"
card_view:srcCompat="@drawable/ic_device_unknown"
card_view:tint="@color/secondarytext" />
<TextView
android:id="@+id/device_custom_action_2_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:minWidth="36dp"
android:textColor="@color/secondarytext"
android:textStyle="bold"
tools:text="" />
</LinearLayout>
</com.google.android.flexbox.FlexboxLayout>
<LinearLayout