I am new to android development and I am developing an app where the app downloads pictures from server and show them in a gridView. But some extra spaces are coming up when the
for those who want to do it in the xml layout (recyclerView item) file you can use a ConstraintLayout by combining
android:layout_width="match_parent"
android:layout_height="wrap_content"
and the following code for having a square item
app:layout_constraintDimensionRatio="4:4"
and don't forget to provide all the constraint that way you can set
android:layout_width="0dp"
android:layout_height="0dp"
hence the complete code will be as follow