Skip to content

Commit

Permalink
Merge pull request #465 from fornewid/goodbye-constraintlayout
Browse files Browse the repository at this point in the history
Remove constraintlayout-compose for Kotlin Multiplatform Compatibility
  • Loading branch information
takahirom authored Aug 14, 2023
2 parents 772cbfd + 7acc7f8 commit 498e4a6
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 40 deletions.
1 change: 0 additions & 1 deletion feature/about/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ dependencies {
implementation(libs.composeUiToolingPreview)
implementation(libs.androidxLifecycleLifecycleRuntimeKtx)
implementation(libs.androidxActivityActivityCompose)
implementation(libs.composeConstraintLayout)
implementation(libs.composeMaterialIcon)
androidTestImplementation(libs.composeUiTestJunit4)
debugImplementation(libs.composeUiTooling)
Expand Down
1 change: 0 additions & 1 deletion feature/floor-map/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ dependencies {
implementation(libs.composeUiToolingPreview)
implementation(libs.androidxLifecycleLifecycleRuntimeKtx)
implementation(libs.androidxActivityActivityCompose)
implementation(libs.composeConstraintLayout)
implementation(libs.composeMaterialIcon)
androidTestImplementation(libs.composeUiTestJunit4)
debugImplementation(libs.composeUiTooling)
Expand Down
1 change: 0 additions & 1 deletion feature/sessions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ dependencies {
implementation(libs.composeUiToolingPreview)
implementation(libs.androidxLifecycleLifecycleRuntimeKtx)
implementation(libs.androidxActivityActivityCompose)
implementation(libs.composeConstraintLayout)
implementation(libs.composeMaterialIcon)
androidTestImplementation(libs.composeUiTestJunit4)
debugImplementation(libs.composeUiTooling)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package io.github.droidkaigi.confsched2023.sessions.section

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyListState
Expand All @@ -21,7 +23,6 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.constraintlayout.compose.ConstraintLayout
import io.github.droidkaigi.confsched2023.model.TimetableItem
import io.github.droidkaigi.confsched2023.sessions.BookmarkScreenUiState
import io.github.droidkaigi.confsched2023.sessions.BookmarkScreenUiState.Empty
Expand Down Expand Up @@ -77,54 +78,42 @@ fun BookmarkSheet(

@Composable
private fun EmptyView() {
ConstraintLayout(
Column(
modifier = Modifier.fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
) {
val (emptyText, icon) = createRefs()
Box(
modifier = Modifier
.size(84.dp)
.background(
color = Color(0xFFCEE9DB),
shape = RoundedCornerShape(24.dp),
)
.constrainAs(icon) {
start.linkTo(parent.start)
end.linkTo(parent.end)
bottom.linkTo(emptyText.top, margin = 24.dp)
},
),
contentAlignment = Alignment.Center,
) {
Icon(
imageVector = Icons.Default.Bookmark,
contentDescription = null,
)
}
Column(
modifier = Modifier.constrainAs(emptyText) {
start.linkTo(parent.start)
end.linkTo(parent.end)
top.linkTo(parent.top)
bottom.linkTo(parent.bottom)
},
horizontalAlignment = Alignment.CenterHorizontally,
) {
Text(
text = BookmarkedItemNotFound.asString(),
fontSize = 16.sp,
fontWeight = FontWeight.Medium,
lineHeight = 24.sp,
color = Color(0xFF191C1A),
)
Spacer(modifier = Modifier.size(8.dp))
Text(
text = BookmarkedItemNotFoundSideNote.asString(),
fontSize = 14.sp,
lineHeight = 20.sp,
letterSpacing = 0.25.sp,
textAlign = TextAlign.Center,
color = Color(0xFF404944),
)
}
Spacer(modifier = Modifier.height(24.dp))
Text(
text = BookmarkedItemNotFound.asString(),
fontSize = 16.sp,
fontWeight = FontWeight.Medium,
lineHeight = 24.sp,
color = Color(0xFF191C1A),
)
Spacer(modifier = Modifier.size(8.dp))
Text(
text = BookmarkedItemNotFoundSideNote.asString(),
fontSize = 14.sp,
lineHeight = 20.sp,
letterSpacing = 0.25.sp,
textAlign = TextAlign.Center,
color = Color(0xFF404944),
)
Spacer(modifier = Modifier.height(108.dp))
}
}
1 change: 0 additions & 1 deletion feature/sponsors/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ dependencies {
implementation(libs.composeUiToolingPreview)
implementation(libs.androidxLifecycleLifecycleRuntimeKtx)
implementation(libs.androidxActivityActivityCompose)
implementation(libs.composeConstraintLayout)
implementation(libs.composeMaterialIcon)
androidTestImplementation(libs.composeUiTestJunit4)
debugImplementation(libs.composeUiTooling)
Expand Down
1 change: 0 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ composeUiTestManifest = { module = "androidx.compose.ui:ui-test-manifest", versi
composeHiltNavigtation = { module = "androidx.hilt:hilt-navigation-compose", version.ref = "composeHiltNavigatiaon" }
composeLintCheck = { module = "com.slack.lint.compose:compose-lint-checks", version = "1.2.0" }
composeCoil = { module = "io.coil-kt:coil-compose", version = "2.4.0" }
composeConstraintLayout = { module = "androidx.constraintlayout:constraintlayout-compose", version = "1.0.1" }
composeImageLoader = { module = "io.github.qdsfdhvh:image-loader", version = "1.6.4" }
accompanistSystemUiController = { module = "com.google.accompanist:accompanist-systemuicontroller", version.ref = "accompanist" }

Expand Down

0 comments on commit 498e4a6

Please sign in to comment.