Skip to content

Commit 7d70003

Browse files
committed
feat: Update project description layout
ref: #555 Signed-off-by: Hu Shenghao <dede.hu@qq.com>
1 parent a8dfe8d commit 7d70003

File tree

2 files changed

+1
-56
lines changed

2 files changed

+1
-56
lines changed

app/src/main/java/com/dede/android_eggs/views/main/compose/EasterEggItems.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fun EasterEggHighestItem(
5656
EasterEggHelp.ApiLevelFormatter.create(egg.apiLevelRange).format(context)
5757
}
5858
val dateFormat = remember(egg, context.resources.configuration) {
59-
AppLocaleDateFormatter.getInstance("MM yyyy")
59+
AppLocaleDateFormatter.getInstance("MMM yyyy")
6060
}
6161

6262
Card(
Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
1-
@file:OptIn(ExperimentalLayoutApi::class)
2-
31
package com.dede.android_eggs.views.main.compose
42

5-
import androidx.annotation.StringRes
63
import androidx.compose.foundation.clickable
74
import androidx.compose.foundation.interaction.MutableInteractionSource
8-
import androidx.compose.foundation.layout.Arrangement
95
import androidx.compose.foundation.layout.Column
10-
import androidx.compose.foundation.layout.ExperimentalLayoutApi
11-
import androidx.compose.foundation.layout.FlowRow
12-
import androidx.compose.foundation.layout.FlowRowScope
136
import androidx.compose.foundation.layout.Row
147
import androidx.compose.foundation.layout.Spacer
158
import androidx.compose.foundation.layout.fillMaxWidth
169
import androidx.compose.foundation.layout.height
1710
import androidx.compose.foundation.layout.padding
1811
import androidx.compose.foundation.layout.size
1912
import androidx.compose.material3.MaterialTheme.colorScheme
20-
import androidx.compose.material3.MaterialTheme.shapes
2113
import androidx.compose.material3.MaterialTheme.typography
2214
import androidx.compose.material3.Text
2315
import androidx.compose.material3.ripple
@@ -27,45 +19,22 @@ import androidx.compose.runtime.remember
2719
import androidx.compose.runtime.setValue
2820
import androidx.compose.ui.Alignment
2921
import androidx.compose.ui.Modifier
30-
import androidx.compose.ui.draw.clip
31-
import androidx.compose.ui.platform.LocalContext
3222
import androidx.compose.ui.res.stringResource
33-
import androidx.compose.ui.text.font.FontWeight
3423
import androidx.compose.ui.tooling.preview.Preview
3524
import androidx.compose.ui.unit.dp
3625
import com.dede.android_eggs.BuildConfig
3726
import com.dede.android_eggs.R
38-
import com.dede.android_eggs.util.CustomTabsBrowser
3927
import com.dede.android_eggs.resources.R as StringsR
4028

41-
@Composable
42-
private fun FlowRowScope.ChipItem2(
43-
@StringRes textRes: Int,
44-
onClick: () -> Unit,
45-
) {
46-
Text(
47-
text = stringResource(textRes),
48-
style = typography.titleSmall,
49-
color = colorScheme.secondary,
50-
modifier = Modifier
51-
.align(Alignment.CenterVertically)
52-
.clip(shapes.extraSmall)
53-
.clickable(onClick = onClick)
54-
.padding(horizontal = 2.dp)
55-
)
56-
}
57-
5829
@Preview(showBackground = true)
5930
@Composable
6031
fun ProjectDescription() {
61-
val context = LocalContext.current
6232
var konfettiState by LocalKonfettiState.current
6333

6434
Column(
6535
modifier = Modifier
6636
.fillMaxWidth()
6737
.padding(horizontal = 18.dp)
68-
.then(Modifier.padding(bottom = 20.dp))
6938
) {
7039
Row(
7140
verticalAlignment = Alignment.CenterVertically,
@@ -105,29 +74,5 @@ fun ProjectDescription() {
10574
style = typography.bodyMedium
10675
)
10776
Wavy(res = R.drawable.ic_wavy_line_1, true, colorScheme.secondaryContainer)
108-
FlowRow(
109-
modifier = Modifier.fillMaxWidth(),
110-
horizontalArrangement = Arrangement.spacedBy(12.dp),
111-
verticalArrangement = Arrangement.spacedBy(8.dp)
112-
) {
113-
Text(
114-
text = stringResource(StringsR.string.app_name),
115-
style = typography.titleSmall,
116-
modifier = Modifier.align(Alignment.CenterVertically),
117-
fontWeight = FontWeight.SemiBold
118-
)
119-
ChipItem2(StringsR.string.label_privacy_policy) {
120-
CustomTabsBrowser.launchUrl(context, R.string.url_privacy)
121-
}
122-
ChipItem2(StringsR.string.label_license) {
123-
CustomTabsBrowser.launchUrl(context, R.string.url_license)
124-
}
125-
ChipItem2(StringsR.string.label_github) {
126-
CustomTabsBrowser.launchUrl(context, R.string.url_github)
127-
}
128-
ChipItem2(StringsR.string.label_feedback) {
129-
CustomTabsBrowser.launchUrl(context, R.string.url_github_issues)
130-
}
131-
}
13277
}
13378
}

0 commit comments

Comments
 (0)