0
Good morning, I created a Recyclerview with Cardview to show some photos that are stored in Firebase, but when bringing the photos to the screen the same does not fit in cardView I left the image as android:layout_width="match_parent" android:layout_height="match_parent"I want the picture to take all the space I’ve reserved for her on cardView, someone could help me?
Layout of the Cardview
<?xml version="1.0" encoding="utf-8"?>
<ImageView
android:id="@+id/imageId"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
android:orientation="vertical"
android:layout_margin="8dp"
android:layout_gravity="bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/titleId"
android:text="@string/title"
android:textSize="18sp"
android:textColor="@color/text"
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/subTitleId"
android:text="@string/subtitle"
android:textColor="@color/text"
android:textSize="14sp"
android:layout_marginTop="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
My mainactivity, I show only the call from Firebase.
private void prepareCard() {
databaseReference = firebaseDatabase.getReference("Data");
databaseReference.addChildEventListener(new ChildEventListener() {
@Override
public void onChildAdded(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {
Item data = dataSnapshot.getValue(Item.class);
cardList.add(data);
recyclerView.setAdapter(mAdapter);
}