From adba8b1ce75cc9a3acbf87647616fb6b3c595491 Mon Sep 17 00:00:00 2001 From: Rohan Mighty Date: Wed, 11 Oct 2023 20:26:36 +0530 Subject: [PATCH] PetFinder Sample: Add domain models --- .../squareup/sample/petfinder/MainActivity.kt | 2 +- .../sample/petfinder/domain/Address.kt | 10 +++++++ .../sample/petfinder/domain/Adoption.kt | 6 +++++ .../sample/petfinder/domain/Animal.kt | 26 +++++++++++++++++++ .../sample/petfinder/domain/Attributes.kt | 9 +++++++ .../sample/petfinder/domain/Breeds.kt | 8 ++++++ .../sample/petfinder/domain/Colors.kt | 7 +++++ .../sample/petfinder/domain/Contact.kt | 7 +++++ .../sample/petfinder/domain/Environment.kt | 7 +++++ .../squareup/sample/petfinder/domain/Hours.kt | 11 ++++++++ .../sample/petfinder/domain/Organization.kt | 17 ++++++++++++ .../squareup/sample/petfinder/domain/Photo.kt | 8 ++++++ .../sample/petfinder/domain/SocialMedia.kt | 9 +++++++ .../squareup/sample/petfinder/domain/Video.kt | 5 ++++ .../sample/petfinder/{ui => }/theme/Color.kt | 4 +-- .../sample/petfinder/{ui => }/theme/Theme.kt | 2 +- .../sample/petfinder/{ui => }/theme/Type.kt | 4 +-- settings.gradle.kts | 1 + 18 files changed, 137 insertions(+), 6 deletions(-) create mode 100644 samples/petfinder/src/main/java/com/squareup/sample/petfinder/domain/Address.kt create mode 100644 samples/petfinder/src/main/java/com/squareup/sample/petfinder/domain/Adoption.kt create mode 100644 samples/petfinder/src/main/java/com/squareup/sample/petfinder/domain/Animal.kt create mode 100644 samples/petfinder/src/main/java/com/squareup/sample/petfinder/domain/Attributes.kt create mode 100644 samples/petfinder/src/main/java/com/squareup/sample/petfinder/domain/Breeds.kt create mode 100644 samples/petfinder/src/main/java/com/squareup/sample/petfinder/domain/Colors.kt create mode 100644 samples/petfinder/src/main/java/com/squareup/sample/petfinder/domain/Contact.kt create mode 100644 samples/petfinder/src/main/java/com/squareup/sample/petfinder/domain/Environment.kt create mode 100644 samples/petfinder/src/main/java/com/squareup/sample/petfinder/domain/Hours.kt create mode 100644 samples/petfinder/src/main/java/com/squareup/sample/petfinder/domain/Organization.kt create mode 100644 samples/petfinder/src/main/java/com/squareup/sample/petfinder/domain/Photo.kt create mode 100644 samples/petfinder/src/main/java/com/squareup/sample/petfinder/domain/SocialMedia.kt create mode 100644 samples/petfinder/src/main/java/com/squareup/sample/petfinder/domain/Video.kt rename samples/petfinder/src/main/java/com/squareup/sample/petfinder/{ui => }/theme/Color.kt (73%) rename samples/petfinder/src/main/java/com/squareup/sample/petfinder/{ui => }/theme/Theme.kt (97%) rename samples/petfinder/src/main/java/com/squareup/sample/petfinder/{ui => }/theme/Type.kt (95%) diff --git a/samples/petfinder/src/main/java/com/squareup/sample/petfinder/MainActivity.kt b/samples/petfinder/src/main/java/com/squareup/sample/petfinder/MainActivity.kt index a350bedce..98129374c 100644 --- a/samples/petfinder/src/main/java/com/squareup/sample/petfinder/MainActivity.kt +++ b/samples/petfinder/src/main/java/com/squareup/sample/petfinder/MainActivity.kt @@ -10,7 +10,7 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview -import com.squareup.sample.petfinder.ui.theme.WorkflowTheme +import com.squareup.sample.petfinder.theme.WorkflowTheme class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { diff --git a/samples/petfinder/src/main/java/com/squareup/sample/petfinder/domain/Address.kt b/samples/petfinder/src/main/java/com/squareup/sample/petfinder/domain/Address.kt new file mode 100644 index 000000000..5fdda7f39 --- /dev/null +++ b/samples/petfinder/src/main/java/com/squareup/sample/petfinder/domain/Address.kt @@ -0,0 +1,10 @@ +package com.squareup.sample.petfinder.domain + +data class Address ( + val address1: Any? = null, + val address2: Any? = null, + val city: String, + val state: String, + val postcode: String, + val country: String +) diff --git a/samples/petfinder/src/main/java/com/squareup/sample/petfinder/domain/Adoption.kt b/samples/petfinder/src/main/java/com/squareup/sample/petfinder/domain/Adoption.kt new file mode 100644 index 000000000..edda0d382 --- /dev/null +++ b/samples/petfinder/src/main/java/com/squareup/sample/petfinder/domain/Adoption.kt @@ -0,0 +1,6 @@ +package com.squareup.sample.petfinder.domain + +data class Adoption ( + val policy: String? = null, + val url: String? = null +) diff --git a/samples/petfinder/src/main/java/com/squareup/sample/petfinder/domain/Animal.kt b/samples/petfinder/src/main/java/com/squareup/sample/petfinder/domain/Animal.kt new file mode 100644 index 000000000..7b0565193 --- /dev/null +++ b/samples/petfinder/src/main/java/com/squareup/sample/petfinder/domain/Animal.kt @@ -0,0 +1,26 @@ +package com.squareup.sample.petfinder.domain + +data class Animal ( + val id: Long, + val organizationId: String, + val url: String, + val type: String, + val species: String, + val breeds: Breeds, + val colors: Colors, + val age: String, + val gender: String, + val size: String, + val coat: String, + val name: String, + val description: String, + val photos: List, + val videos: List