Gitlab@Informatics

Skip to content
Snippets Groups Projects
Commit f6cfeeb4 authored by 62160052's avatar 62160052
Browse files

Add Recyclerview

parent 1cfba81a
No related branches found
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -4,6 +4,7 @@
<option name="filePathToZoomLevelMap">
<map>
<entry key="..\:/Users/Fair/Desktop/android-basics-kotlin-mars-photos-app-starter/app/src/main/res/drawable/ic_broken_image.xml" value="0.226" />
<entry key="..\:/Users/Fair/Desktop/android-basics-kotlin-mars-photos-app-starter/app/src/main/res/layout/fragment_overview.xml" value="0.33" />
<entry key="..\:/Users/Fair/Desktop/android-basics-kotlin-mars-photos-app-starter/app/src/main/res/layout/grid_view_item.xml" value="0.24048913043478262" />
</map>
</option>
......
......@@ -30,14 +30,20 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.android.marsphotos.overview.OverViewFragment">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{viewModel.status}"
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/photos_grid"
android:layout_width="0dp"
android:layout_height="0dp"
android:padding="6dp"
app:layoutManager=
"androidx.recyclerview.widget.GridLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
tools:itemCount="16"
tools:listitem="@layout/grid_view_item"
app:spanCount="2" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
\ No newline at end of file
......@@ -21,8 +21,8 @@
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="viewModel"
type="com.example.android.marsphotos.overview.OverviewViewModel" />
name="photo"
type="com.example.android.marsphotos.network.MarsPhoto" />
</data>
<ImageView
android:id="@+id/mars_image"
......@@ -31,6 +31,6 @@
android:scaleType="fitXY"
android:adjustViewBounds="true"
android:padding="2dp"
app:imageUrl="@{viewModel.photos.imgSrcUrl}"
app:imageUrl="@{photo.imgSrcUrl}"
tools:src="@tools:sample/backgrounds/scenic"/>
</layout>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment