Add bio to AuthorEntity

Change-Id: Idea9873e2a3107a03f6d30e888e27ba78466ca69
pull/2/head
Adetunji Dahunsi 2 years ago committed by Don Turner
parent e2c1bbe754
commit 9ffa4d0a20

@ -25,4 +25,5 @@ fun NetworkAuthor.asEntity() = AuthorEntity(
imageUrl = imageUrl,
twitter = twitter,
mediumPage = mediumPage,
bio = bio,
)

@ -71,6 +71,7 @@ fun NetworkNewsResource.authorEntityShells() =
imageUrl = "",
twitter = "",
mediumPage = "",
bio = "",
)
}

@ -53,6 +53,7 @@ class FakeAuthorsRepository @Inject constructor(
imageUrl = it.imageUrl,
twitter = it.twitter,
mediumPage = it.mediumPage,
bio = it.bio,
)
}
)

@ -37,6 +37,7 @@ class NetworkEntityKtTest {
imageUrl = "something",
twitter = "twitter",
mediumPage = "mediumPage",
bio = "bio",
)
val entity = networkModel.asEntity()

@ -35,6 +35,7 @@ class TestAuthorDao : AuthorDao {
imageUrl = "imageUrl",
twitter = "twitter",
mediumPage = "mediumPage",
bio = "bio",
)
)
)

@ -123,6 +123,7 @@ private fun NewsResourceEntity.asPopulatedNewsResource() = PopulatedNewsResource
imageUrl = "imageUrl",
twitter = "twitter",
mediumPage = "mediumPage",
bio = "bio",
)
),
topics = listOf(

@ -54,6 +54,7 @@ class PopulatedEpisodeKtTest {
imageUrl = "imageUrl",
twitter = "twitter",
mediumPage = "mediumPage",
bio = "bio",
)
),
)
@ -87,6 +88,7 @@ class PopulatedEpisodeKtTest {
imageUrl = "imageUrl",
twitter = "twitter",
mediumPage = "mediumPage",
bio = "bio",
)
),
),

@ -52,6 +52,7 @@ class PopulatedNewsResourceKtTest {
imageUrl = "imageUrl",
twitter = "twitter",
mediumPage = "mediumPage",
bio = "bio",
)
),
topics = listOf(
@ -84,6 +85,7 @@ class PopulatedNewsResourceKtTest {
imageUrl = "imageUrl",
twitter = "twitter",
mediumPage = "mediumPage",
bio = "bio",
)
),
topics = listOf(

@ -0,0 +1,445 @@
{
"formatVersion": 1,
"database": {
"version": 9,
"identityHash": "9294402ce9ec4e6bf008b0a1f5383ecd",
"entities": [
{
"tableName": "authors",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `image_url` TEXT NOT NULL, `twitter` TEXT NOT NULL DEFAULT '', `medium_page` TEXT NOT NULL DEFAULT '', `bio` TEXT NOT NULL DEFAULT '', PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "imageUrl",
"columnName": "image_url",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "twitter",
"columnName": "twitter",
"affinity": "TEXT",
"notNull": true,
"defaultValue": "''"
},
{
"fieldPath": "mediumPage",
"columnName": "medium_page",
"affinity": "TEXT",
"notNull": true,
"defaultValue": "''"
},
{
"fieldPath": "bio",
"columnName": "bio",
"affinity": "TEXT",
"notNull": true,
"defaultValue": "''"
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "episodes_authors",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`episode_id` TEXT NOT NULL, `author_id` TEXT NOT NULL, PRIMARY KEY(`episode_id`, `author_id`), FOREIGN KEY(`episode_id`) REFERENCES `episodes`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`author_id`) REFERENCES `authors`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "episodeId",
"columnName": "episode_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "authorId",
"columnName": "author_id",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"episode_id",
"author_id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_episodes_authors_episode_id",
"unique": false,
"columnNames": [
"episode_id"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_episodes_authors_episode_id` ON `${TABLE_NAME}` (`episode_id`)"
},
{
"name": "index_episodes_authors_author_id",
"unique": false,
"columnNames": [
"author_id"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_episodes_authors_author_id` ON `${TABLE_NAME}` (`author_id`)"
}
],
"foreignKeys": [
{
"table": "episodes",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"episode_id"
],
"referencedColumns": [
"id"
]
},
{
"table": "authors",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"author_id"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "episodes",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `publish_date` INTEGER NOT NULL, `alternate_video` TEXT, `alternate_audio` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "publishDate",
"columnName": "publish_date",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "alternateVideo",
"columnName": "alternate_video",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "alternateAudio",
"columnName": "alternate_audio",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "news_resources_authors",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`news_resource_id` TEXT NOT NULL, `author_id` TEXT NOT NULL, PRIMARY KEY(`news_resource_id`, `author_id`), FOREIGN KEY(`news_resource_id`) REFERENCES `news_resources`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`author_id`) REFERENCES `authors`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "newsResourceId",
"columnName": "news_resource_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "authorId",
"columnName": "author_id",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"news_resource_id",
"author_id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_news_resources_authors_news_resource_id",
"unique": false,
"columnNames": [
"news_resource_id"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_news_resources_authors_news_resource_id` ON `${TABLE_NAME}` (`news_resource_id`)"
},
{
"name": "index_news_resources_authors_author_id",
"unique": false,
"columnNames": [
"author_id"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_news_resources_authors_author_id` ON `${TABLE_NAME}` (`author_id`)"
}
],
"foreignKeys": [
{
"table": "news_resources",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"news_resource_id"
],
"referencedColumns": [
"id"
]
},
{
"table": "authors",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"author_id"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "news_resources",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `episode_id` TEXT NOT NULL, `title` TEXT NOT NULL, `content` TEXT NOT NULL, `url` TEXT NOT NULL, `header_image_url` TEXT, `publish_date` INTEGER NOT NULL, `type` TEXT NOT NULL, PRIMARY KEY(`id`), FOREIGN KEY(`episode_id`) REFERENCES `episodes`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "episodeId",
"columnName": "episode_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "content",
"columnName": "content",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "headerImageUrl",
"columnName": "header_image_url",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "publishDate",
"columnName": "publish_date",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": [
{
"table": "episodes",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"episode_id"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "news_resources_topics",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`news_resource_id` TEXT NOT NULL, `topic_id` TEXT NOT NULL, PRIMARY KEY(`news_resource_id`, `topic_id`), FOREIGN KEY(`news_resource_id`) REFERENCES `news_resources`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`topic_id`) REFERENCES `topics`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "newsResourceId",
"columnName": "news_resource_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "topicId",
"columnName": "topic_id",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"news_resource_id",
"topic_id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_news_resources_topics_news_resource_id",
"unique": false,
"columnNames": [
"news_resource_id"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_news_resources_topics_news_resource_id` ON `${TABLE_NAME}` (`news_resource_id`)"
},
{
"name": "index_news_resources_topics_topic_id",
"unique": false,
"columnNames": [
"topic_id"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_news_resources_topics_topic_id` ON `${TABLE_NAME}` (`topic_id`)"
}
],
"foreignKeys": [
{
"table": "news_resources",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"news_resource_id"
],
"referencedColumns": [
"id"
]
},
{
"table": "topics",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"topic_id"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "topics",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `shortDescription` TEXT NOT NULL, `longDescription` TEXT NOT NULL DEFAULT '', `url` TEXT NOT NULL DEFAULT '', `imageUrl` TEXT NOT NULL DEFAULT '', PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "shortDescription",
"columnName": "shortDescription",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "longDescription",
"columnName": "longDescription",
"affinity": "TEXT",
"notNull": true,
"defaultValue": "''"
},
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": true,
"defaultValue": "''"
},
{
"fieldPath": "imageUrl",
"columnName": "imageUrl",
"affinity": "TEXT",
"notNull": true,
"defaultValue": "''"
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '9294402ce9ec4e6bf008b0a1f5383ecd')"
]
}
}

@ -358,7 +358,8 @@ private fun testAuthorEntity(
name = name,
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
)
private fun testTopicEntity(

@ -44,7 +44,7 @@ import com.google.samples.apps.nowinandroid.core.database.util.NewsResourceTypeC
NewsResourceTopicCrossRef::class,
TopicEntity::class,
],
version = 8,
version = 9,
autoMigrations = [
AutoMigration(from = 1, to = 2),
AutoMigration(from = 2, to = 3, spec = DatabaseMigrations.Schema2to3::class),
@ -53,6 +53,7 @@ import com.google.samples.apps.nowinandroid.core.database.util.NewsResourceTypeC
AutoMigration(from = 5, to = 6),
AutoMigration(from = 6, to = 7),
AutoMigration(from = 7, to = 8),
AutoMigration(from = 8, to = 9),
],
exportSchema = true,
)

@ -38,6 +38,8 @@ data class AuthorEntity(
val twitter: String,
@ColumnInfo(name = "medium_page", defaultValue = "")
val mediumPage: String,
@ColumnInfo(defaultValue = "")
val bio: String,
)
fun AuthorEntity.asExternalModel() = Author(
@ -46,4 +48,5 @@ fun AuthorEntity.asExternalModel() = Author(
imageUrl = imageUrl,
twitter = twitter,
mediumPage = mediumPage,
bio = bio,
)

@ -25,4 +25,5 @@ data class Author(
val imageUrl: String,
val twitter: String,
val mediumPage: String,
val bio: String,
)

@ -2717,462 +2717,528 @@ object FakeDataSource {
"name": "Márton Braun",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "2",
"name": "Greg Hartrell",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "3",
"name": "Simona Stojanovic",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "4",
"name": "Andrew Flynn",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "5",
"name": "Jon Boekenoogen",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "6",
"name": "Florina Muntenescu",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "7",
"name": "Lidia Gaymond",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "8",
"name": "Vicki Amin",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "9",
"name": "Marcel Pintó",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "10",
"name": "Krish Vitaldevara",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "11",
"name": "Gerry Fan",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "12",
"name": "Pietro Maggi",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "13",
"name": "Rohan Shah",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "14",
"name": "Dave Burke",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "15",
"name": "Meghan Mehta",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "16",
"name": "Anna Bernbaum",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "17",
"name": "Adarsh Fernando",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "18",
"name": "Madan Ankapura",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "19",
"name": "Kateryna Semenova",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "20",
"name": "Rahul Ravikumar",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "21",
"name": "Chris Craik",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "22",
"name": "Marcel Pintó Biescas",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "23",
"name": "Alex Vanyo",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "24",
"name": "Manuel Vicente Vivo",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "25",
"name": "Arjun Dayal",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "26",
"name": "Murat Yener",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "27",
"name": "Alex Saveau",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "28",
"name": "Paul Lammertsma",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "29",
"name": "Caren Chang",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "30",
"name": "Mayuri Khinvasara Khabya",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "31",
"name": "Romain Guy",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "32",
"name": "Chet Hasse",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "33",
"name": "Tor Norbye",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "34",
"name": "Nicole Laure",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "35",
"name": "Yigit Boyar",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "36",
"name": "Sean McQuillan",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "37",
"name": "Ben Weiss",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "38",
"name": "Chet Haase",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "39",
"name": "Carmen Jackson",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "40",
"name": "Manuel Vivo",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "41",
"name": "TJ Dahunsi",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "42",
"name": "Shailen Tuli",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "43",
"name": "Murat",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "44",
"name": "Kailiang Chen",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "45",
"name": "Meghan",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "46",
"name": "Jeremy Walker",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "47",
"name": "Don Turner",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "48",
"name": "Lilian Young",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "49",
"name": "Wenhung Teng",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "50",
"name": "Charcoal Chen",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "51",
"name": "Mike Yerou",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "52",
"name": "Peter Visontay",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "53",
"name": "Marcelo Hernandez",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "54",
"name": "Daniel Santiago",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "55",
"name": "Brad Corso",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "56",
"name": "Jonathan Koren",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "57",
"name": "Anna-Chiara Bellini",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "58",
"name": "Amanda Alexander",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "59",
"name": "Android Developers Backstage",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "60",
"name": "Nicole Borrelli",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "61",
"name": "Dan Saadati",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "62",
"name": "Nick Butcher",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "63",
"name": "Ian Lake",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "64",
"name": "Diana Wong",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "65",
"name": "Patricia Correa",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
},
{
"id": "66",
"name": "The Modern Android Development Team",
"mediumPage": "",
"twitter": "",
"imageUrl": ""
"imageUrl": "",
"bio": ""
}
]
""".trimIndent()

@ -29,4 +29,5 @@ data class NetworkAuthor(
val imageUrl: String,
val twitter: String,
val mediumPage: String,
val bio: String,
)

@ -315,6 +315,7 @@ private val newsResource = NewsResource(
imageUrl = "",
twitter = "",
mediumPage = "",
bio = "",
)
),
topics = listOf(

@ -236,7 +236,8 @@ private val testAuthors = listOf(
name = "Android Dev",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = true
),
@ -246,7 +247,8 @@ private val testAuthors = listOf(
name = "Android Dev 2",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -256,7 +258,8 @@ private val testAuthors = listOf(
name = "Android Dev 3",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
)

@ -202,7 +202,8 @@ private val testInputAuthors = listOf(
name = "Android Dev",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = true
),
@ -212,7 +213,8 @@ private val testInputAuthors = listOf(
name = "Android Dev 2",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -222,7 +224,8 @@ private val testInputAuthors = listOf(
name = "Android Dev 3",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
)
@ -235,7 +238,8 @@ private val testOutputAuthors = listOf(
name = "Android Dev",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = true
),
@ -245,7 +249,8 @@ private val testOutputAuthors = listOf(
name = "Android Dev 2",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = true
),
@ -255,7 +260,8 @@ private val testOutputAuthors = listOf(
name = "Android Dev 3",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
)

@ -114,7 +114,8 @@ class ForYouScreenTest {
name = "Android Dev",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -124,7 +125,8 @@ class ForYouScreenTest {
name = "Android Dev 2",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -215,7 +217,8 @@ class ForYouScreenTest {
name = "Android Dev",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -225,7 +228,8 @@ class ForYouScreenTest {
name = "Android Dev 2",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -322,7 +326,8 @@ class ForYouScreenTest {
name = "Android Dev",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -332,7 +337,8 @@ class ForYouScreenTest {
name = "Android Dev 2",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -429,7 +435,8 @@ class ForYouScreenTest {
name = "Android Dev",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = true
),
@ -439,7 +446,8 @@ class ForYouScreenTest {
name = "Android Dev 2",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),

@ -132,15 +132,36 @@ fun AuthorCarouselPreview() {
AuthorsCarousel(
authors = listOf(
FollowableAuthor(
Author("1", "Android Dev", "", "", ""),
Author(
id = "1",
name = "Android Dev",
imageUrl = "",
twitter = "",
mediumPage = "",
bio = "",
),
false
),
FollowableAuthor(
Author("2", "Android Dev2", "", "", ""),
true
author = Author(
id = "2",
name = "Android Dev2",
imageUrl = "",
twitter = "",
mediumPage = "",
bio = "",
),
isFollowed = true
),
FollowableAuthor(
Author("3", "Android Dev3", "", "", ""),
Author(
id = "3",
name = "Android Dev3",
imageUrl = "",
twitter = "",
mediumPage = "",
bio = "",
),
false
)
),
@ -156,7 +177,14 @@ fun AuthorItemPreview() {
MaterialTheme {
Surface {
AuthorItem(
author = Author("0", "Android Dev", "", "", ""),
author = Author(
id = "0",
name = "Android Dev",
imageUrl = "",
twitter = "",
mediumPage = "",
bio = "",
),
following = true,
onAuthorClick = { }
)

@ -406,7 +406,8 @@ fun ForYouScreenTopicSelection() {
name = "Android Dev",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -416,7 +417,8 @@ fun ForYouScreenTopicSelection() {
name = "Android Dev 2",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -426,7 +428,8 @@ fun ForYouScreenTopicSelection() {
name = "Android Dev 3",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
)

@ -66,12 +66,13 @@ class ForYouViewModelTest {
val feedState: ForYouFeedState,
)
private val ForYouViewModel.uiState get() =
combine(
interestsSelectionState,
feedState,
::ForYouUiState
)
private val ForYouViewModel.uiState
get() =
combine(
interestsSelectionState,
feedState,
::ForYouUiState
)
@Test
fun stateIsInitiallyLoading() = runTest {
@ -208,7 +209,8 @@ class ForYouViewModelTest {
name = "Android Dev",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -218,7 +220,8 @@ class ForYouViewModelTest {
name = "Android Dev 2",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -228,7 +231,8 @@ class ForYouViewModelTest {
name = "Android Dev 3",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
)
@ -302,7 +306,8 @@ class ForYouViewModelTest {
name = "Android Dev",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -312,7 +317,8 @@ class ForYouViewModelTest {
name = "Android Dev 2",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -322,7 +328,8 @@ class ForYouViewModelTest {
name = "Android Dev 3",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
)
@ -481,7 +488,8 @@ class ForYouViewModelTest {
name = "Android Dev",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -491,7 +499,8 @@ class ForYouViewModelTest {
name = "Android Dev 2",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -501,7 +510,8 @@ class ForYouViewModelTest {
name = "Android Dev 3",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
)
@ -559,7 +569,8 @@ class ForYouViewModelTest {
name = "Android Dev",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -569,7 +580,8 @@ class ForYouViewModelTest {
name = "Android Dev 2",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -579,7 +591,8 @@ class ForYouViewModelTest {
name = "Android Dev 3",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
)
@ -635,7 +648,8 @@ class ForYouViewModelTest {
name = "Android Dev",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -645,7 +659,8 @@ class ForYouViewModelTest {
name = "Android Dev 2",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -655,7 +670,8 @@ class ForYouViewModelTest {
name = "Android Dev 3",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
)
@ -741,7 +757,8 @@ class ForYouViewModelTest {
name = "Android Dev",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -751,7 +768,8 @@ class ForYouViewModelTest {
name = "Android Dev 2",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = true
),
@ -761,7 +779,8 @@ class ForYouViewModelTest {
name = "Android Dev 3",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
)
@ -819,7 +838,8 @@ class ForYouViewModelTest {
name = "Android Dev",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -829,7 +849,8 @@ class ForYouViewModelTest {
name = "Android Dev 2",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = true
),
@ -839,7 +860,8 @@ class ForYouViewModelTest {
name = "Android Dev 3",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
)
@ -895,7 +917,8 @@ class ForYouViewModelTest {
name = "Android Dev",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -905,7 +928,8 @@ class ForYouViewModelTest {
name = "Android Dev 2",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = true
),
@ -915,7 +939,8 @@ class ForYouViewModelTest {
name = "Android Dev 3",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
)
@ -999,7 +1024,8 @@ class ForYouViewModelTest {
name = "Android Dev",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -1009,7 +1035,8 @@ class ForYouViewModelTest {
name = "Android Dev 2",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -1019,7 +1046,8 @@ class ForYouViewModelTest {
name = "Android Dev 3",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
)
@ -1094,7 +1122,8 @@ class ForYouViewModelTest {
name = "Android Dev",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -1104,7 +1133,8 @@ class ForYouViewModelTest {
name = "Android Dev 2",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -1114,7 +1144,8 @@ class ForYouViewModelTest {
name = "Android Dev 3",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
)
@ -1317,7 +1348,8 @@ class ForYouViewModelTest {
name = "Android Dev",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -1327,7 +1359,8 @@ class ForYouViewModelTest {
name = "Android Dev 2",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -1337,7 +1370,8 @@ class ForYouViewModelTest {
name = "Android Dev 3",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
)
@ -1418,7 +1452,8 @@ class ForYouViewModelTest {
name = "Android Dev",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -1428,7 +1463,8 @@ class ForYouViewModelTest {
name = "Android Dev 2",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
),
@ -1438,7 +1474,8 @@ class ForYouViewModelTest {
name = "Android Dev 3",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
isFollowed = false
)
@ -1496,21 +1533,24 @@ private val sampleAuthors = listOf(
name = "Android Dev",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
Author(
id = "1",
name = "Android Dev 2",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
),
Author(
id = "2",
name = "Android Dev 3",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
)
)
@ -1570,7 +1610,8 @@ private val sampleNewsResources = listOf(
name = "Android Dev",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
)
)
),
@ -1601,7 +1642,8 @@ private val sampleNewsResources = listOf(
name = "Android Dev 2",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
)
)
),
@ -1630,7 +1672,8 @@ private val sampleNewsResources = listOf(
name = "Android Dev 2",
imageUrl = "",
twitter = "",
mediumPage = ""
mediumPage = "",
bio = "",
)
)
),

Loading…
Cancel
Save