143: Use FlowLayout for TagRow and cleanup testing infra r=msfjarvis a=msfjarvis

bors r+

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
bors[bot] 2021-03-09 14:47:01 +00:00 committed by GitHub
commit bdf5cb7a2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 10 additions and 5 deletions

View file

@ -53,6 +53,7 @@ dependencies {
implementation(Dependencies.AndroidX.Lifecycle.viewmodelKtx) implementation(Dependencies.AndroidX.Lifecycle.viewmodelKtx)
implementation(Dependencies.Kotlin.Coroutines.android) implementation(Dependencies.Kotlin.Coroutines.android)
implementation(Dependencies.ThirdParty.accompanist) implementation(Dependencies.ThirdParty.accompanist)
implementation(Dependencies.ThirdParty.composeFlowLayout)
implementation(Dependencies.ThirdParty.Moshi.lib) implementation(Dependencies.ThirdParty.Moshi.lib)
implementation(Dependencies.ThirdParty.Retrofit.moshi) implementation(Dependencies.ThirdParty.Retrofit.moshi)
implementation(Dependencies.ThirdParty.SQLDelight.androidDriver) implementation(Dependencies.ThirdParty.SQLDelight.androidDriver)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Before After
Before After

View file

@ -2,8 +2,8 @@ package dev.msfjarvis.lobsters.ui.posts
import androidx.compose.foundation.background import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.asAndroidBitmap import androidx.compose.ui.graphics.asAndroidBitmap
@ -28,7 +28,7 @@ class HeaderTest : ScreenshotTest {
modifier = Modifier modifier = Modifier
.background(color = Color(0xffffff)) .background(color = Color(0xffffff))
.fillMaxWidth() .fillMaxWidth()
.fillMaxHeight(), .wrapContentHeight(),
) { ) {
MonthHeader(month = Month.AUGUST) MonthHeader(month = Month.AUGUST)
} }

View file

@ -30,6 +30,7 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import coil.transform.CircleCropTransformation import coil.transform.CircleCropTransformation
import com.star_zero.compose.flowlayout.FlowLayout
import dev.chrisbanes.accompanist.coil.CoilImage import dev.chrisbanes.accompanist.coil.CoilImage
import dev.msfjarvis.lobsters.R import dev.msfjarvis.lobsters.R
import dev.msfjarvis.lobsters.data.api.LobstersApi import dev.msfjarvis.lobsters.data.api.LobstersApi
@ -131,11 +132,12 @@ fun TagRow(
tags: List<String>, tags: List<String>,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
) { ) {
Row( FlowLayout(
modifier = Modifier.then(modifier), modifier = Modifier.then(modifier),
horizontalArrangement = Arrangement.spacedBy(8.dp), horizontalSpacing = 8.dp,
verticalSpacing = 8.dp,
) { ) {
tags.take(3).forEach { tag -> tags.forEach { tag ->
Text( Text(
text = tag, text = tag,
modifier = Modifier modifier = Modifier

View file

@ -77,6 +77,7 @@ internal fun BaseAppModuleExtension.configureAndroidApplicationOptions(project:
setProguardFiles(listOf("proguard-android-optimize.txt", "proguard-rules.pro")) setProguardFiles(listOf("proguard-android-optimize.txt", "proguard-rules.pro"))
} }
named("debug") { named("debug") {
applicationIdSuffix = ".debug"
versionNameSuffix = "-debug" versionNameSuffix = "-debug"
isMinifyEnabled = false isMinifyEnabled = false
} }

View file

@ -66,6 +66,7 @@ object Dependencies {
object ThirdParty { object ThirdParty {
const val accompanist = "dev.chrisbanes.accompanist:accompanist-coil:0.6.1" const val accompanist = "dev.chrisbanes.accompanist:accompanist-coil:0.6.1"
const val composeFlowLayout = "com.star-zero:compose-flowlayout:0.0.1"
object Moshi { object Moshi {