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

Remove some warnings #356

Merged
merged 1 commit into from
Sep 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
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private class ComposableBackHandler(enabled: Boolean) : OnBackPressedCallback(en
}

@Composable
internal fun handler(
internal fun Handler(
enabled: Boolean = true,
onBackPressed: () -> Unit
) {
Expand Down Expand Up @@ -65,7 +65,7 @@ internal fun BackButtonHandler(
CompositionLocalProvider(
LocalBackPressedDispatcher provides context as ComponentActivity
) {
handler {
Handler {
onBackPressed()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import androidx.compose.material.Card
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
Expand Down Expand Up @@ -62,8 +61,8 @@ internal fun ComponentCard(
) {
val composableModifier = Modifier.generateComposableModifier(metadata)
val composableContainerModifier = Modifier.generateContainerModifier(onClick)
Card() {
Box() {
Card {
Box {
Column(modifier = composableModifier) {
metadata.component()
}
Expand All @@ -76,13 +75,15 @@ internal fun ComponentCard(
modifier = Modifier
.matchParentSize()
.then(composableContainerModifier)
){}
) {}
}

}
}

private fun Modifier.generateContainerModifier(onClick: (() -> Unit)?) = composed { onClick?.let {
fillMaxWidth()
.clickable(onClick = onClick)
} ?: fillMaxWidth() }
private fun Modifier.generateContainerModifier(onClick: (() -> Unit)?) =
onClick?.let {
fillMaxWidth()
.clickable(onClick = onClick)
} ?: fillMaxWidth()

Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import com.airbnb.android.showkase.models.ShowkaseBrowserScreenMetadata
import com.airbnb.android.showkase.models.ShowkaseCurrentScreen
import com.airbnb.android.showkase.models.clear
import com.airbnb.android.showkase.models.clearActiveSearch
import java.util.Locale

@Composable
internal fun ShowkaseColorsInAGroupScreen(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ internal fun ShowkaseComponentDetailScreen(
ShowkaseComponentCardType.values().forEach { showkaseComponentCardType ->
when (showkaseComponentCardType) {
ShowkaseComponentCardType.BASIC -> {
if (!metadata.componentKDoc.isBlank()) {
if (metadata.componentKDoc.isNotBlank()) {
DocumentationPanel(metadata.componentKDoc)
}
BasicComponentCard(metadata)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import com.airbnb.android.showkase.models.ShowkaseCurrentScreen
import com.airbnb.android.showkase.models.clear
import com.airbnb.android.showkase.models.clearActiveSearch
import com.airbnb.android.showkase.models.update
import java.util.Locale

@Composable
internal fun ShowkaseComponentsInAGroupScreen(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.padding
import androidx.compose.material.Snackbar
import androidx.compose.ui.unit.dp

@Composable
internal fun ShowkaseErrorScreen(errorText: String) {
Expand Down
Loading