-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #504 from Corvus400/feature/implement_middle_secti…
…on_of_about_screen ✨ Implement Middle Section of AboutScreen
- Loading branch information
Showing
6 changed files
with
235 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
...re/about/src/main/java/io/github/droidkaigi/confsched2023/about/component/AboutContent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
package io.github.droidkaigi.confsched2023.about.component | ||
|
||
import android.content.res.Configuration | ||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material.icons.Icons | ||
import androidx.compose.material.icons.outlined.SentimentVerySatisfied | ||
import androidx.compose.material3.Divider | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Surface | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.vector.ImageVector | ||
import androidx.compose.ui.platform.testTag | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import io.github.droidkaigi.confsched2023.about.AboutStrings | ||
import io.github.droidkaigi.confsched2023.designsystem.theme.KaigiTheme | ||
|
||
@Composable | ||
fun AboutContentColumn( | ||
leadingIcon: ImageVector, | ||
label: String, | ||
testTag: String, | ||
onClickAction: () -> Unit, | ||
modifier: Modifier = Modifier, | ||
) { | ||
Column( | ||
modifier = modifier | ||
.fillMaxWidth() | ||
.height(73.dp) | ||
.testTag(testTag) | ||
.clickable { onClickAction() }, | ||
) { | ||
Row( | ||
modifier = Modifier | ||
.height(72.dp) | ||
.align( | ||
alignment = Alignment.Start, | ||
), | ||
verticalAlignment = Alignment.CenterVertically, | ||
) { | ||
Icon( | ||
imageVector = leadingIcon, | ||
contentDescription = null, | ||
modifier = Modifier | ||
.padding( | ||
horizontal = 12.dp, | ||
), | ||
) | ||
Text( | ||
text = label, | ||
style = MaterialTheme.typography.labelLarge, | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding( | ||
end = 16.dp, | ||
), | ||
) | ||
} | ||
Divider( | ||
thickness = 1.dp, | ||
color = MaterialTheme.colorScheme.outlineVariant, | ||
) | ||
} | ||
} | ||
|
||
@Preview(locale = "en", uiMode = Configuration.UI_MODE_NIGHT_NO) | ||
@Preview(locale = "ja", uiMode = Configuration.UI_MODE_NIGHT_NO) | ||
@Composable | ||
fun AboutContentColumnPreview() { | ||
KaigiTheme { | ||
Surface { | ||
AboutContentColumn( | ||
leadingIcon = Icons.Outlined.SentimentVerySatisfied, | ||
label = AboutStrings.Staff.asString(), | ||
testTag = "", | ||
onClickAction = {}, | ||
) | ||
} | ||
} | ||
} | ||
|
||
@Preview(locale = "en", uiMode = Configuration.UI_MODE_NIGHT_YES) | ||
@Preview(locale = "ja", uiMode = Configuration.UI_MODE_NIGHT_YES) | ||
@Composable | ||
fun AboutContentColumnDarkModePreview() { | ||
KaigiTheme { | ||
Surface { | ||
AboutContentColumn( | ||
leadingIcon = Icons.Outlined.SentimentVerySatisfied, | ||
label = AboutStrings.Staff.asString(), | ||
testTag = "", | ||
onClickAction = {}, | ||
) | ||
} | ||
} | ||
} |
61 changes: 44 additions & 17 deletions
61
...re/about/src/main/java/io/github/droidkaigi/confsched2023/about/component/AboutCredits.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,72 @@ | ||
package io.github.droidkaigi.confsched2023.about.component | ||
|
||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.lazy.LazyListScope | ||
import androidx.compose.material.icons.Icons | ||
import androidx.compose.material.icons.outlined.Apartment | ||
import androidx.compose.material.icons.outlined.Diversity1 | ||
import androidx.compose.material.icons.outlined.SentimentVerySatisfied | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Text | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.platform.testTag | ||
import androidx.compose.ui.unit.dp | ||
import io.github.droidkaigi.confsched2023.about.AboutStrings | ||
|
||
const val AboutCreditsSponsorsItemTestTag = "AboutCreditsSponsorsItem" | ||
const val AboutCreditsContributorsItemTestTag = "AboutCreditsContributorsItem" | ||
const val AboutCreditsStaffItemTestTag = "AboutCreditsStaffItem" | ||
const val AboutCreditsContributorsItemTestTag = "AboutCreditsContributorsItem" | ||
const val AboutCreditsSponsorsItemTestTag = "AboutCreditsSponsorsItem" | ||
|
||
fun LazyListScope.aboutCredits( | ||
onStaffItemClick: () -> Unit, | ||
onContributorsItemClick: () -> Unit, | ||
onSponsorsItemClick: () -> Unit, | ||
) { | ||
item { | ||
Text("Credits") | ||
Text( | ||
text = AboutStrings.CreditsTitle.asString(), | ||
style = MaterialTheme.typography.titleMedium, | ||
modifier = Modifier | ||
.padding( | ||
start = 16.dp, | ||
top = 32.dp, | ||
end = 16.dp, | ||
), | ||
) | ||
} | ||
item { | ||
Text( | ||
AboutContentColumn( | ||
leadingIcon = Icons.Outlined.SentimentVerySatisfied, | ||
label = AboutStrings.Staff.asString(), | ||
testTag = AboutCreditsStaffItemTestTag, | ||
onClickAction = onStaffItemClick, | ||
modifier = Modifier | ||
.testTag(AboutCreditsContributorsItemTestTag) | ||
.clickable { onContributorsItemClick() }, | ||
text = "Go to contributors screen", | ||
.padding( | ||
horizontal = 16.dp, | ||
), | ||
) | ||
} | ||
item { | ||
Text( | ||
AboutContentColumn( | ||
leadingIcon = Icons.Outlined.Diversity1, | ||
label = AboutStrings.Contributor.asString(), | ||
testTag = AboutCreditsContributorsItemTestTag, | ||
onClickAction = onContributorsItemClick, | ||
modifier = Modifier | ||
.testTag(AboutCreditsStaffItemTestTag) | ||
.clickable { onStaffItemClick() }, | ||
text = "Go to staff screen", | ||
.padding( | ||
horizontal = 16.dp, | ||
), | ||
) | ||
} | ||
item { | ||
Text( | ||
AboutContentColumn( | ||
leadingIcon = Icons.Outlined.Apartment, | ||
label = AboutStrings.Sponsor.asString(), | ||
testTag = AboutCreditsSponsorsItemTestTag, | ||
onClickAction = onSponsorsItemClick, | ||
modifier = Modifier | ||
.testTag(AboutCreditsSponsorsItemTestTag) | ||
.clickable { onSponsorsItemClick() }, | ||
text = "Go to sponsors screen", | ||
.padding( | ||
horizontal = 16.dp, | ||
), | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,7 +64,6 @@ fun AboutDroidKaigiDetail( | |
start = 16.dp, | ||
top = 12.dp, | ||
end = 16.dp, | ||
bottom = 16.dp, | ||
), | ||
) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters