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

Fix incorrect ripple on About section #284

Merged
merged 1 commit into from
Apr 18, 2024
Merged
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 @@ -5,19 +5,20 @@ import androidx.compose.foundation.clickable
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Card
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
Expand Down Expand Up @@ -132,27 +133,24 @@ private fun SocialCard(
.padding(top = 8.dp),
horizontalArrangement = Arrangement.spacedBy(16.dp),
) {
IconButton(
SocialIcon(
onClick = onXLogoClick,
modifier = Modifier.size(64.dp)
) {
Icon(
modifier = Modifier.size(36.dp),
modifier = Modifier.padding(12.dp),
painter = painterResource(MR.images.ic_network_x),
tint = if (darkMode) {
Color.White
} else {
Color.Black
},
Color.Black },
contentDescription = "X"
)
}
IconButton(
modifier = Modifier.size(64.dp),
}
SocialIcon(
onClick = onYouTubeLogoClick
) {
Image(
modifier = Modifier.size(48.dp),
modifier = Modifier.padding(8.dp),
painter = painterResource(MR.images.ic_network_youtube),
contentDescription = "YouTube"
)
Expand All @@ -162,6 +160,22 @@ private fun SocialCard(
}
}

@Composable
private fun SocialIcon(
onClick: () -> Unit,
content: @Composable () -> Unit,
) {
Button(
modifier = Modifier.size(64.dp),
onClick = onClick,
shape = CircleShape,
contentPadding = PaddingValues(4.dp),
colors = ButtonDefaults.textButtonColors()
) {
content()
}
}

@Composable
private fun ClickableText(
text: String,
Expand Down
Loading