From cb8a1a6cf89d8f6d35996c54bfd6ead5c32619be Mon Sep 17 00:00:00 2001 From: YXWang <19281171@bjtu.edu.cn> Date: Sat, 31 Jul 2021 22:31:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E4=BA=86=E6=8C=89=E9=92=AE=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E5=92=8C=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../leavesc/compose_tetris/ui/TetrisButton.kt | 70 +++++++++------ .../leavesc/compose_tetris/ui/theme/Color.kt | 6 +- daemon/7.0/registry.bin | Bin 93 -> 51 bytes daemon/7.0/registry.bin.lock | Bin 17 -> 17 bytes ...rofile => 2021-07-31-22-20-09-318.profile} | 85 ++++++++++++------ 5 files changed, 106 insertions(+), 55 deletions(-) rename kotlin-profile/{2021-07-31-16-29-13-118.profile => 2021-07-31-22-20-09-318.profile} (41%) diff --git a/app/src/main/java/github/leavesc/compose_tetris/ui/TetrisButton.kt b/app/src/main/java/github/leavesc/compose_tetris/ui/TetrisButton.kt index cf78167..3f496a4 100644 --- a/app/src/main/java/github/leavesc/compose_tetris/ui/TetrisButton.kt +++ b/app/src/main/java/github/leavesc/compose_tetris/ui/TetrisButton.kt @@ -75,45 +75,61 @@ fun TetrisButton( ) { val (leftBtn, rightBtn, fastDownBtn, rotateBtn, fallBtn) = createRefs() val innerMargin = 24.dp - PlayButton(icon = "◀", modifier = Modifier.constrainAs(leftBtn) { - start.linkTo(anchor = parent.start) - top.linkTo(anchor = parent.top) - end.linkTo(anchor = rightBtn.start, margin = innerMargin) - }) { - playListener.onTransformation(Left) - } - PlayButton(icon = "▶", modifier = Modifier.constrainAs(rightBtn) { - start.linkTo(anchor = leftBtn.end, margin = innerMargin) - top.linkTo(anchor = leftBtn.top) - bottom.linkTo(anchor = leftBtn.bottom) - }) { - playListener.onTransformation(Right) - } PlayButton( icon = "Rotate", fontSize = 18.sp, modifier = Modifier.constrainAs(rotateBtn) { - top.linkTo(anchor = rightBtn.top) - start.linkTo(anchor = rightBtn.end, margin = innerMargin) + /* + start: 左 + end: 右 + top: 上 + bottom: 下 + margin: 内边距 + */ + start.linkTo(anchor = leftBtn.start) + end.linkTo(anchor = rightBtn.end) + top.linkTo(anchor = parent.top) + bottom.linkTo(anchor = leftBtn.top) }) { playListener.onTransformation(Rotate) } - PlayButton(icon = "▼", modifier = Modifier.constrainAs(fastDownBtn) { - top.linkTo(anchor = leftBtn.bottom) - start.linkTo(anchor = leftBtn.start) - end.linkTo(anchor = rightBtn.end) - }) { - playListener.onTransformation(FastDown) - } PlayButton( - icon = "▼\n▼", + icon = "✔", modifier = Modifier.constrainAs(fallBtn) { - top.linkTo(anchor = fastDownBtn.top) - start.linkTo(anchor = rightBtn.end) - end.linkTo(anchor = rotateBtn.start) + start.linkTo(anchor = rotateBtn.end, margin = innerMargin) + top.linkTo(anchor = parent.top) }) { playListener.onTransformation(Fall) } + PlayButton( + icon = "◀", + modifier = Modifier.constrainAs(leftBtn) { + start.linkTo(anchor = parent.start) + end.linkTo(anchor = rightBtn.start, margin = innerMargin) + top.linkTo(anchor = rotateBtn.bottom) + }) { + playListener.onTransformation(Left) + } + PlayButton( + icon = "▶", + modifier = Modifier.constrainAs(rightBtn) { + start.linkTo(anchor = leftBtn.end, margin = innerMargin) + top.linkTo(anchor = leftBtn.top) + bottom.linkTo(anchor = leftBtn.bottom) + }) { + playListener.onTransformation(Right) + } + + PlayButton( + icon = "▼", + modifier = Modifier.constrainAs(fastDownBtn) { + start.linkTo(anchor = rightBtn.end, margin = innerMargin) + top.linkTo(anchor = leftBtn.top) + bottom.linkTo(anchor = leftBtn.bottom) + }) { + playListener.onTransformation(FastDown) + } + } } diff --git a/app/src/main/java/github/leavesc/compose_tetris/ui/theme/Color.kt b/app/src/main/java/github/leavesc/compose_tetris/ui/theme/Color.kt index 42da582..8b047c2 100644 --- a/app/src/main/java/github/leavesc/compose_tetris/ui/theme/Color.kt +++ b/app/src/main/java/github/leavesc/compose_tetris/ui/theme/Color.kt @@ -9,8 +9,8 @@ val Teal200 = Color(0xFF03DAC5) val BodyBackground = Color(0xF2FFD600) val ScreenBackground = Color(0xff9ead86) -val PlayButtonColor = Color(0xFF388E3C) -val PlayButtonColor2 = Color(0xFF00796B) -val PlayButtonColor3 = Color(0xFF26A69A) +val PlayButtonColor = Color(0xF2FDDF3A) +val PlayButtonColor2 = Color(0xF2C5A708) +val PlayButtonColor3 = Color(0xF2947C01) val BrickAlpha = Color.Black.copy(alpha = 0.2f) val BrickFill = Color.Black.copy(alpha = 0.9f) \ No newline at end of file diff --git a/daemon/7.0/registry.bin b/daemon/7.0/registry.bin index 1fb06042815eb2a856bcab99af77d1c032115ad0..e2328cf2d2c0c05417611bd46af4d363578a7214 100644 GIT binary patch literal 51 xcmZQ%fB;4Y2F9vCKT295T(%92OpFYo#U=R#3d#Aoxruox3Pq{OshMS|DFE(-3}yfT literal 93 zcmZQ%fB+^22F9x28_tM9xY}