Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup #766

Merged
merged 6 commits into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
],
},
{
"groupName": "Compose Compiler unstable updates",
"groupSlug": "kotlin",
"groupName": "Compose unstable updates",
"groupSlug": "compose",
"ignoreUnstable": false,
"matchPackagePrefixes": [
"androidx.compose.compiler",
"matchPackagePatterns": [
"androidx.compose.*",
],
},
{
Expand Down
2 changes: 1 addition & 1 deletion casa-ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies {
libs.kotlin.collections.immutable,
libs.compose.activity, // needed for BackHandler
libs.compose.material3,
libs.compose.uiutil,
libs.compose.ui.util,
)
androidTestImplementation(libs.test.junit.compose)
}
25 changes: 9 additions & 16 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
gradle-android = "8.2.0-alpha08"
gradle-android = "8.2.0-alpha09"
gradle-publish-maven = "0.25.2"
gradle-dependency-handler-extensions = "1.1.0"
gradle-dependency-graph = "1.1.0"
Expand All @@ -18,8 +18,6 @@ kotlin-ktlint-source = "0.48.2"
kotlin-collections-immutable = "0.3.5"
kotlin-dataclass-nocopy = "1.0.4"

android-lint = "31.2.0-alpha07" # agp + 23

androidx-core-ktx = "1.10.1"
androidx-annotation = "1.6.0"
androidx-datastore = "1.0.0" # for Playground
Expand All @@ -28,10 +26,11 @@ androidx-profileinstaller = "1.3.1"

compose-compiler = "1.4.7"
compose-runtime = "1.4.3"
compose-uiutil = "1.4.3"
compose-foundation = "1.4.3"
compose-ui = "1.4.3"
compose-ui-core = "1.4.3"
compose-ui-util = "1.4.3"
compose-ui-text = "1.5.0-beta02"
compose-animation = "1.4.3"
compose-foundation = "1.4.3"
compose-material-ripple = "1.4.3"
compose-material3 = "1.1.0" # for Playground
compose-activity = "1.7.2"
Expand Down Expand Up @@ -86,10 +85,6 @@ kotlin-collections-immutable = { module = "org.jetbrains.kotlinx:kotlinx-collect
# This isn't strictly used but allows Renovate to see us using the ktlint artifact
kotlin-ktlint = { module = "com.pinterest:ktlint", version.ref = "kotlin-ktlint-source" }

android-lint-core = { module = "com.android.tools.lint:lint", version.ref = "android-lint" } # for testing
android-lint-api = { module = "com.android.tools.lint:lint-api", version.ref = "android-lint" } # compileOnly
android-lint-checks = { module = "com.android.tools.lint:lint-checks", version.ref = "android-lint" } # compileOnly

androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidx-core-ktx" }
androidx-annotation = { module = "androidx.annotation:annotation", version.ref = "androidx-annotation" } # needed for screenshot-matcher
androidx-datastore = { module = "androidx.datastore:datastore-preferences", version.ref = "androidx-datastore" }
Expand All @@ -100,10 +95,11 @@ androidx-profileinstaller = { module = "androidx.profileinstaller:profileinstall
compose-compiler = { module = "androidx.compose.compiler:compiler", version.ref = "compose-compiler" }

compose-runtime = { module = "androidx.compose.runtime:runtime", version.ref = "compose-runtime" }
compose-uiutil = { module = "androidx.compose.ui:ui-util", version.ref = "compose-uiutil" }
compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "compose-foundation" }
compose-ui = { module = "androidx.compose.ui:ui", version.ref = "compose-ui" }
compose-ui-core = { module = "androidx.compose.ui:ui", version.ref = "compose-ui-core" }
compose-ui-util = { module = "androidx.compose.ui:ui-util", version.ref = "compose-ui-util" }
compose-ui-text = { module = "androidx.compose.ui:ui-text", version.ref = "compose-ui-text" }
compose-animation = { module = "androidx.compose.animation:animation", version.ref = "compose-animation" }
compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "compose-foundation" }
compose-material-ripple = { module = "androidx.compose.material:material-ripple", version.ref = "compose-material-ripple" }
compose-material3 = { module = "androidx.compose.material3:material3", version.ref = "compose-material3" }
compose-activity = { module = "androidx.activity:activity-compose", version.ref = "compose-activity" }
Expand All @@ -113,7 +109,6 @@ coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil-compose
coil-gif = { module = "io.coil-kt:coil-gif", version.ref = "coil-gif" }
coil-test = { module = "io.coil-kt:coil-test", version.ref = "coil-test" }

test-android-lint = { module = "com.android.tools.lint:lint-tests", version.ref = "android-lint" }
test-kotest-framework = { module = "io.kotest:kotest-runner-junit5-jvm", version.ref = "test-kotest" }
test-kotest-assertion-core = { module = "io.kotest:kotest-assertions-core-jvm", version.ref = "test-kotest" }
test-junit-core = { module = "junit:junit", version.ref = "test-junit-core" }
Expand All @@ -132,6 +127,4 @@ test-kotlin-compilation-ksp = { module = "com.github.tschuchortdev:kotlin-compil
detekt-plugin-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "kotlin-detekt" }

[bundles]
android-lint = ["android-lint-api", "android-lint-checks"]
test-roborazzi = ["test-roborazzi-core", "test-roborazzi-rule"]
test-android-lint = ["android-lint-core", "test-android-lint"]
2 changes: 1 addition & 1 deletion material-icon/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ android {
}

dependencies {
implementation(libs.compose.ui)
implementation(libs.compose.ui.core)

testImplementations(
libs.compose.foundation,
Expand Down
2 changes: 1 addition & 1 deletion material/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dependencies {
projects.materialIcon.orArtifact(),
)
implementations(
libs.compose.uiutil,
libs.compose.ui.util,
libs.compose.material.ripple,
libs.androidx.core.ktx, // needed for androidx.core.graphics (used in SquircleShape)
projects.util.orArtifact(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ import androidx.compose.foundation.combinedClickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.material.ripple.rememberRipple
import androidx.compose.runtime.Stable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
Expand All @@ -27,21 +24,36 @@ import androidx.compose.ui.platform.debugInspectorInfo
import androidx.compose.ui.semantics.Role

/**
* 덕키에서 기본적으로 사용할 항상 ripple 표시 옵션
*
* Playground에서 [QuackAlwaysShowRipple] 편집 후 기본값으로 되돌리고 싶을 때
* 기본값으로 사용할 수 있습니다.
*/
public const val QuackDefaultAlwaysShowRipple: Boolean = false

/**
* [Modifier.quackClickable]로 실행된 클릭 이벤트에는 모두 ripple을 표시할 것인지 여부
* [Modifier.clickable]에 다양한 옵션을 부여합니다.
*
* 터치 영역 디버깅 용도로 수정을 허용합니다.
* @param role 사용자 인터페이스 요소의 유형. 접근성 서비스는 이를 사용하여 요소를
* 설명하거나 사용자 지정할 수 있습니다.
* @param rippleColor 표시될 리플의 색상. null이들어오면 [Color.Unspecified]를 사용합니다.
* @param rippleEnabled 리플을 설정할지 여부
* @param onLongClick 컴포넌트가 길게 클릭됐을 떄 실행할 람다식. null이 들어오면 long-clickable을
* 설정하지 않습니다.
* @param onClick 컴포넌트가 클릭됐을 때 실행할 람다식. null이 들어오면 빈 람다를 사용합니다.
*
* Playground에서 자유로운 편집으로 편집으로 쉬운 디버깅이 가능합니다.
* @return [Modifier.clickable] 속성이 적용된 [Modifier]
*/
public var QuackAlwaysShowRipple: Boolean by mutableStateOf(QuackDefaultAlwaysShowRipple)
@Stable
public fun Modifier.quackClickable(
role: Role? = null,
rippleColor: QuackColor? = null,
rippleEnabled: Boolean = true,
onLongClick: (() -> Unit)? = null,
onClick: (() -> Unit)?,
): Modifier =
composed {
quackClickable(
role = role,
rippleColor = rippleColor,
rippleEnabled = rippleEnabled,
interactionSource = remember { MutableInteractionSource() },
onLongClick = onLongClick,
onClick = onClick,
)
}

/**
* [Modifier.clickable]에 다양한 옵션을 부여합니다.
Expand All @@ -50,9 +62,12 @@ public var QuackAlwaysShowRipple: Boolean by mutableStateOf(QuackDefaultAlwaysSh
* 설명하거나 사용자 지정할 수 있습니다.
* @param rippleColor 표시될 리플의 색상. null이들어오면 [Color.Unspecified]를 사용합니다.
* @param rippleEnabled 리플을 설정할지 여부
* @param onClick 컴포넌트가 클릭됐을 때 실행할 람다식. null이 들어오면 빈 람다를 사용합니다. (필수 옵션)
* @param interactionSource 이 텍스트 필드의 인터랙션 스트림을 나타내는 변경 가능한 인터랙션 소스입니다.
* 인터랙션을 관찰하고 다른 인터랙션에서 이 텍스트 필드의 모양/동작을 커스터마이징하려면 자신만의 변경 가능한
* 인터랙션 소스를 생성하여 전달할 수 있습니다.
* @param onLongClick 컴포넌트가 길게 클릭됐을 떄 실행할 람다식. null이 들어오면 long-clickable을
* 설정하지 않습니다.
* @param onClick 컴포넌트가 클릭됐을 때 실행할 람다식. null이 들어오면 빈 람다를 사용합니다.
*
* @return [Modifier.clickable] 속성이 적용된 [Modifier]
*/
Expand All @@ -61,29 +76,29 @@ public fun Modifier.quackClickable(
role: Role? = null,
rippleColor: QuackColor? = null,
rippleEnabled: Boolean = true,
onClick: (() -> Unit)? = null,
interactionSource: MutableInteractionSource,
onLongClick: (() -> Unit)? = null,
onClick: (() -> Unit)?,
): Modifier =
if (onClick == null && onLongClick == null) this
else
composed(
fullyQualifiedName = "team.duckie.quackquack.material.quackClickable",
key1 = rippleColor,
key2 = rippleEnabled,
keys = arrayOf(role, rippleColor, rippleEnabled, interactionSource, onLongClick, onClick),
inspectorInfo = debugInspectorInfo {
name = "quackClickable"
properties["role"] = role
properties["rippleColor"] = rippleColor
properties["rippleEnabled"] = rippleEnabled
properties["interactionSource"] = interactionSource
properties["onClick"] = onClick
properties["onLongClick"] = onLongClick
},
) {
val ripple = rememberRipple(color = rippleColor?.value ?: Color.Unspecified)
val interactionSource = remember { MutableInteractionSource() }

combinedClickable(
indication = ripple.takeIf { QuackAlwaysShowRipple || rippleEnabled },
indication = if (rippleEnabled) ripple else null,
interactionSource = interactionSource,
role = role,
onClick = onClick ?: {},
Expand Down
2 changes: 1 addition & 1 deletion runtime/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ android {

dependencies {
implementations(
libs.compose.ui,
libs.compose.ui.core,
projects.util.orArtifact(),
)
testImplementations(
Expand Down
3 changes: 0 additions & 3 deletions screenshot-matcher/README.md

This file was deleted.

18 changes: 0 additions & 18 deletions screenshot-matcher/build.gradle.kts

This file was deleted.

8 changes: 0 additions & 8 deletions screenshot-matcher/src/main/AndroidManifest.xml

This file was deleted.

This file was deleted.

Loading