From 72df1b6810a1e46e7767107e7c193474060a7163 Mon Sep 17 00:00:00 2001 From: Florian Date: Tue, 1 Sep 2020 10:43:48 -0700 Subject: [PATCH 1/8] End of part 2 --- .../imagesearchapp/UnsplashPhoto.kt | 30 +++++++++++ app/src/main/res/drawable/gradient.xml | 10 ++++ app/src/main/res/layout/fragment_gallery.xml | 51 +++++++++++++++++++ .../main/res/layout/item_unsplash_photo.xml | 33 ++++++++++++ 4 files changed, 124 insertions(+) create mode 100644 app/src/main/java/com/codinginflow/imagesearchapp/UnsplashPhoto.kt create mode 100644 app/src/main/res/drawable/gradient.xml create mode 100644 app/src/main/res/layout/fragment_gallery.xml create mode 100644 app/src/main/res/layout/item_unsplash_photo.xml diff --git a/app/src/main/java/com/codinginflow/imagesearchapp/UnsplashPhoto.kt b/app/src/main/java/com/codinginflow/imagesearchapp/UnsplashPhoto.kt new file mode 100644 index 0000000..2062674 --- /dev/null +++ b/app/src/main/java/com/codinginflow/imagesearchapp/UnsplashPhoto.kt @@ -0,0 +1,30 @@ +package com.codinginflow.imagesearchapp + +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +@Parcelize +data class UnsplashPhoto( + val id: String, + val description: String?, + val urls: UnsplashPhotoUrls, + val user: UnsplashUser +) : Parcelable { + + @Parcelize + data class UnsplashPhotoUrls( + val raw: String, + val full: String, + val regular: String, + val small: String, + val thumb: String, + ) : Parcelable + + @Parcelize + data class UnsplashUser( + val name: String, + val username: String + ) : Parcelable { + val attributionUrl get() = "https://unsplash.com/$username?utm_source=ImageSearchApp&utm_medium=referral" + } +} \ No newline at end of file diff --git a/app/src/main/res/drawable/gradient.xml b/app/src/main/res/drawable/gradient.xml new file mode 100644 index 0000000..674f6c9 --- /dev/null +++ b/app/src/main/res/drawable/gradient.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_gallery.xml b/app/src/main/res/layout/fragment_gallery.xml new file mode 100644 index 0000000..78e1ce0 --- /dev/null +++ b/app/src/main/res/layout/fragment_gallery.xml @@ -0,0 +1,51 @@ + + + + + + + + + +