1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-04 16:02:55 +01:00
Gadgetbridge/app/src/main/res/layout/device_itemv2.xml
Daniele Gobbetti 7c918ee191 Add UI to invoke device specific settings Activity
Currently the icon in the card is hidden for all devices, since the
functionality is not implemented yet
2019-04-21 15:59:39 +02:00

356 lines
16 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal">
<androidx.cardview.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:foreground="?android:attr/selectableItemBackground"
card_view:cardCornerRadius="4dp"
card_view:cardElevation="4dp"
card_view:contentPadding="8dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/device_item_infos_box"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginBottom="8dp"
android:focusable="false"
android:visibility="gone">
<ListView
android:id="@+id/device_item_infos"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_toStartOf="@+id/device_action_remove"
android:focusable="false"
android:scrollbars="none" />
<ImageView
android:id="@+id/device_action_remove"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:layout_marginTop="8dp"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:contentDescription="@string/controlcenter_delete_device"
android:tint="?attr/textColorTertiary"
card_view:srcCompat="@drawable/ic_remove_device"
android:focusable="true" />
</RelativeLayout>
<ImageView
android:id="@+id/device_image"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentStart="true"
android:layout_below="@id/device_item_infos_box"
android:contentDescription="@string/candidate_item_device_image"
android:clickable="true"
android:longClickable="true"
android:background="?android:attr/selectableItemBackground"
android:src="@drawable/ic_device_pebble"
android:layout_marginTop="2dp"
android:focusable="true" />
<TextView
android:id="@+id/device_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/device_image"
android:layout_alignParentEnd="true"
android:layout_marginEnd="48dp"
android:layout_below="@id/device_item_infos_box"
android:gravity="center"
android:maxLines="1"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
tools:text="My Pebble Watch" />
<TextView
android:id="@+id/device_status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/device_name"
android:layout_toEndOf="@id/device_image"
android:layout_alignParentEnd="true"
android:layout_marginEnd="48dp"
android:gravity="center"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
tools:text="@string/connecting" />
<ImageView
android:id="@+id/device_info_image"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_alignParentEnd="true"
android:layout_below="@id/device_item_infos_box"
android:layout_marginBottom="8dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="0dp"
android:layout_marginTop="8dp"
android:clickable="true"
android:contentDescription="@string/candidate_item_device_image"
android:tint="@color/secondarytext"
android:background="?android:attr/selectableItemBackground"
card_view:srcCompat="@drawable/ic_more_vert"
android:focusable="true" />
<LinearLayout
android:id="@+id/device_battery_status_box"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/device_image"
android:layout_alignParentStart="true"
android:layout_margin="4dp"
android:orientation="vertical">
<ImageView
android:id="@+id/device_battery_status"
android:layout_width="40dp"
android:layout_height="40dp"
android:padding="4dp"
android:scaleType="fitXY"
android:tint="@color/secondarytext"
card_view:srcCompat="@drawable/level_list_battery" />
<TextView
android:id="@+id/battery_status"
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="100%" />
</LinearLayout>
<ImageView
android:id="@+id/device_specific_settings"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_below="@id/device_image"
android:layout_marginStart="4dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="4dp"
android:layout_marginBottom="4dp"
android:layout_toEndOf="@id/device_battery_status_box"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:padding="4dp"
android:scaleType="fitXY"
android:tint="@color/secondarytext"
card_view:srcCompat="@drawable/ic_settings" />
<LinearLayout
android:id="@+id/device_fm_frequency_box"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/device_image"
android:layout_toEndOf="@id/device_specific_settings"
android:layout_margin="4dp"
android:orientation="vertical">
<ImageView
android:id="@+id/device_fm_frequency"
android:layout_width="40dp"
android:layout_height="40dp"
android:padding="4dp"
android:scaleType="fitXY"
android:tint="@color/secondarytext"
card_view:srcCompat="@drawable/ic_radio" />
<TextView
android:id="@+id/fm_frequency"
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="107.8" />
</LinearLayout>
<ImageView
android:id="@+id/device_led_color"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_below="@id/device_image"
android:layout_margin="4dp"
android:layout_toEndOf="@id/device_fm_frequency_box"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:padding="4dp"
android:scaleType="fitXY"
card_view:srcCompat="@drawable/ic_led_color"
android:focusable="true" />
<LinearLayout
android:id="@+id/device_action_fetch_activity_box"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/device_image"
android:layout_margin="4dp"
android:layout_toEndOf="@id/device_led_color"
android:gravity="center_vertical"
android:minWidth="36dp"
android:orientation="vertical">
<ImageView
android:id="@+id/device_action_fetch_activity"
android:layout_width="40dp"
android:layout_height="40dp"
android:padding="4dp"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:contentDescription="@string/controlcenter_fetch_activity_data"
android:scaleType="fitXY"
android:tint="@color/secondarytext"
card_view:srcCompat="@drawable/ic_action_fetch_activity_data"
android:focusable="true" />
<ProgressBar
android:id="@+id/device_busy_indicator"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="4dp"
android:indeterminate="true"
android:visibility="visible"
tools:visibility="visible" />
</LinearLayout>
<ImageView
android:id="@+id/device_action_take_screenshot"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_below="@id/device_image"
android:layout_margin="4dp"
android:layout_toEndOf="@id/device_action_fetch_activity_box"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:contentDescription="@string/controlcenter_take_screenshot"
android:padding="4dp"
android:scaleType="fitXY"
android:tint="@color/secondarytext"
card_view:srcCompat="@drawable/ic_screenshot"
android:focusable="true" />
<ImageView
android:id="@+id/device_action_manage_apps"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_below="@id/device_image"
android:layout_margin="4dp"
android:layout_toEndOf="@id/device_action_take_screenshot"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:contentDescription="@string/title_activity_appmanager"
android:padding="4dp"
android:scaleType="fitXY"
android:tint="@color/secondarytext"
card_view:srcCompat="@drawable/ic_action_manage_apps"
android:focusable="true" />
<ImageView
android:id="@+id/device_action_set_alarms"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_below="@id/device_image"
android:layout_margin="4dp"
android:layout_toEndOf="@id/device_action_manage_apps"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:contentDescription="@string/controlcenter_start_configure_alarms"
android:padding="4dp"
android:scaleType="fitXY"
android:tint="@color/secondarytext"
card_view:srcCompat="@drawable/ic_device_set_alarms"
android:focusable="true" />
<ImageView
android:id="@+id/device_action_show_activity_graphs"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_below="@id/device_image"
android:layout_margin="4dp"
android:layout_toEndOf="@id/device_action_set_alarms"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:contentDescription="@string/controlcenter_start_activitymonitor"
android:padding="4dp"
android:scaleType="fitXY"
android:tint="@color/secondarytext"
card_view:srcCompat="@drawable/ic_activity_graphs"
android:focusable="true" />
<ImageView
android:id="@+id/device_action_show_activity_tracks"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_below="@id/device_image"
android:layout_margin="4dp"
android:layout_toEndOf="@id/device_action_show_activity_graphs"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:contentDescription="@string/controlcenter_start_activity_tracks"
android:padding="4dp"
android:scaleType="fitXY"
android:tint="@color/secondarytext"
card_view:srcCompat="@drawable/ic_activity_tracks"
android:focusable="true" />
<ImageView
android:id="@+id/device_action_find"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_below="@id/device_image"
android:layout_margin="4dp"
android:layout_toEndOf="@id/device_action_show_activity_tracks"
android:clickable="true"
android:contentDescription="@string/controlcenter_find_device"
android:padding="4dp"
android:scaleType="fitXY"
android:tint="@color/secondarytext"
card_view:srcCompat="@drawable/ic_action_find_lost_device"
android:focusable="true" />
<ImageView
android:id="@+id/device_action_calibrate"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_below="@id/device_image"
android:layout_margin="4dp"
android:layout_toEndOf="@id/device_action_find"
android:clickable="true"
android:contentDescription="@string/controlcenter_calibrate_device"
android:padding="4dp"
android:scaleType="fitXY"
android:tint="@color/secondarytext"
card_view:srcCompat="@drawable/ic_activity_unknown"
android:focusable="true" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>