Commit f978b849 authored by SusanneFischer's avatar SusanneFischer
Browse files

fixed layout

parent c83445a6
Pipeline #3590 failed with stages
in 0 seconds
package de.asta.hochschule.trier.verleih.rental.adapter
import android.view.*
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.recyclerview.widget.RecyclerView
import com.firebase.ui.database.*
import com.google.firebase.storage.FirebaseStorage
......@@ -27,6 +28,10 @@ class RentalItemChoiceAdapter(
override fun onBindViewHolder(holder: ViewHolder, position: Int, model: RentalObject) {
holder.itemBinding.itemNameText.text = model.name?.capitalize(Locale.getDefault())
val width = holder.itemView.context.resources.displayMetrics.widthPixels / 3
val height = holder.itemView.context.resources.displayMetrics.heightPixels / 3
holder.itemBinding.itemImageView.layoutParams = ConstraintLayout.LayoutParams(width, height)
val storageRef =
FirebaseStorage.getInstance().reference.child("objects/big/${model.picture_name}.jpg")
GlideApp.with(holder.itemView.context).load(storageRef)
......
......@@ -18,10 +18,11 @@
android:id="@+id/items_recyclerview"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="16dp"
android:layout_marginTop="8dp"
android:isScrollContainer="true"
android:overScrollMode="ifContentScrolls"
android:scrollbars="vertical"
android:padding="4dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
......
......@@ -4,7 +4,7 @@
android:id="@+id/item_choice_card"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:layout_margin="4dp"
android:elevation="10dp">
<androidx.constraintlayout.widget.ConstraintLayout
......@@ -13,12 +13,13 @@
<ImageView
android:id="@+id/item_image_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:src="@drawable/placeholder"
android:scaleType="centerInside"
app:layout_constraintBottom_toTopOf="@id/item_footer_layout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
......@@ -39,7 +40,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="8dp"
android:layout_marginEnd="16dp"
android:layout_marginEnd="8dp"
android:ellipsize="end"
android:gravity="center_vertical|start"
android:maxLines="1"
......@@ -52,9 +53,8 @@
android:id="@+id/item_information_button"
android:layout_width="42dp"
android:layout_height="match_parent"
android:layout_marginEnd="8dp"
android:background="@android:color/transparent"
android:padding="8dp"
android:padding="12dp"
android:scaleType="fitCenter"
android:src="@drawable/ic_info"
app:layout_constraintBottom_toBottomOf="parent"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment