added a RecyclerView to 'fragmnet_shoppinglist_shoplist'

added 'fragment_shoppinglist_shoplist_item'
added some colors to the colors.xml for the shoplist-item fragment
This commit is contained in:
2024-06-02 14:18:15 +02:00
parent ddc218f4cc
commit a355301d68
3 changed files with 74 additions and 8 deletions

View File

@@ -6,14 +6,13 @@
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".ui.dashboard.tabfragment.shoppinglist.ShoplistFragment"> tools:context=".ui.dashboard.tabfragment.shoppinglist.ShoplistFragment">
<TextView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/shoplist"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:text="Einkaufszettel"
android:textAlignment="center"
android:textSize="32sp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintVertical_bias="0.5" /> app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardBackgroundColor="@color/cardview_background"
app:cardCornerRadius="20dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/shoplabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="20dp"
android:textAlignment="center"
android:textColor="@color/cardview_textcolor"
android:textSize="24sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.5" />
<ImageView
android:id="@+id/shopicon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="100dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/shoppinglistCount"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.5"
app:srcCompat="@android:drawable/toast_frame" />
<TextView
android:id="@+id/shoppinglistCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="20dp"
android:textAlignment="center"
android:textColor="@color/cardview_textcolor"
android:textSize="24sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.5" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -7,4 +7,7 @@
<color name="teal_700">#FF018786</color> <color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color> <color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color> <color name="white">#FFFFFFFF</color>
<color name="cardview_background">#444444</color>
<color name="cardview_textcolor">#FFFFFF</color>
</resources> </resources>