AndroidAPS/app/src/main/res/layout/food_item.xml

151 lines
5.8 KiB
XML
Raw Normal View History

2017-10-17 20:55:23 +02:00
<?xml version="1.0" encoding="utf-8"?>
2022-04-15 11:47:29 +02:00
<com.google.android.material.card.MaterialCardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
2021-03-19 18:49:34 +01:00
xmlns:tools="http://schemas.android.com/tools"
2022-04-15 11:47:29 +02:00
style="@style/Widget.MaterialComponents.CardView"
android:id="@+id/food_card"
2017-10-17 20:55:23 +02:00
android:layout_width="match_parent"
android:layout_height="wrap_content"
2022-04-15 11:47:29 +02:00
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_marginTop="4dp"
app:strokeWidth="1dp"
app:cardCornerRadius="4dp"
app:contentPadding="2dp"
app:cardElevation="4dp"
app:cardUseCompatPadding="true"
android:layout_gravity="center">
2017-10-17 20:55:23 +02:00
<LinearLayout
2021-12-11 04:41:09 +01:00
android:id="@+id/food_item"
2017-10-17 20:55:23 +02:00
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
2021-12-11 04:41:09 +01:00
android:id="@+id/left_right_split"
2017-10-17 20:55:23 +02:00
android:layout_width="match_parent"
android:layout_height="wrap_content"
2021-12-11 04:41:09 +01:00
android:orientation="horizontal"
android:paddingStart="3dp"
android:paddingEnd="3dp">
2017-10-17 20:55:23 +02:00
2021-12-11 04:41:09 +01:00
<LinearLayout
android:id="@+id/name_and_info_container"
android:layout_width="wrap_content"
2017-10-17 20:55:23 +02:00
android:layout_height="wrap_content"
2021-12-11 04:41:09 +01:00
android:orientation="vertical"
2017-10-17 20:55:23 +02:00
android:layout_weight="1"
2021-12-11 04:41:09 +01:00
android:gravity="start">
<LinearLayout
android:id="@+id/name_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="@+id/name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Name"
android:textStyle="bold"
android:textSize="@dimen/twenty_four_dp"
tools:ignore="HardcodedText" />
</LinearLayout>
<LinearLayout
android:id="@+id/info_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:orientation="horizontal"
android:layout_marginStart="5dp">
2021-12-11 04:41:09 +01:00
<TextView
android:id="@+id/carbs"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Carbs"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/portion"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Portion"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/fat"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Fat"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/protein"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Protein"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/energy"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Energy"
tools:ignore="HardcodedText" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/buttons_container"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
android:gravity="end">
<ImageView
android:id="@+id/ic_calculator"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:padding="2dp"
android:orientation="horizontal"
android:src="@drawable/ic_calculator" />
<ImageView
android:id="@+id/ic_remove"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:padding="2dp"
android:orientation="horizontal"
android:src="@drawable/ic_trash_outline" />
</LinearLayout>
2017-10-17 20:55:23 +02:00
</LinearLayout>
2021-03-19 18:49:34 +01:00
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:background="?android:attr/dividerHorizontal" />
2021-03-19 18:49:34 +01:00
2017-10-17 20:55:23 +02:00
</LinearLayout>
2022-04-15 11:47:29 +02:00
</com.google.android.material.card.MaterialCardView>