1
0
mirror of https://github.com/flutter/samples.git synced 2026-07-08 18:13:21 +00:00

add thumbnails to the books example to make memory leaks easier to test

This commit is contained in:
Xiao Yu
2022-07-28 23:53:57 -07:00
parent fa72a85887
commit 8f4d9e9305
6 changed files with 118 additions and 26 deletions

View File

@@ -20,6 +20,7 @@ android {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig debug.signingConfig
}
}
compileOptions {

View File

@@ -94,6 +94,9 @@ class MainActivity : AppCompatActivity() {
book.summary = volumeInfoJson.get("description").asString
book.publishDate = volumeInfoJson.get("publishedDate").asString
book.pageCount = volumeInfoJson.get("pageCount").asLong
val thumbnail = Api.Thumbnail()
thumbnail.url = volumeInfoJson.getAsJsonObject("imageLinks").get("thumbnail").asString
book.thumbnail = thumbnail
books.add(book)
} catch (e: Exception) {
println("Failed to parse book:")