Skip to content

Commit f33cb69

Browse files
committed
feat(HomeScreen): minor layout adjustments
1 parent 9e80857 commit f33cb69

File tree

4 files changed

+45
-48
lines changed

4 files changed

+45
-48
lines changed

app/src/main/kotlin/com/aliucord/manager/ui/screens/home/HomeScreen.kt

+35-46
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import androidx.compose.runtime.*
1515
import androidx.compose.ui.Alignment
1616
import androidx.compose.ui.Modifier
1717
import androidx.compose.ui.draw.alpha
18-
import androidx.compose.ui.draw.shadow
1918
import androidx.compose.ui.res.stringResource
2019
import androidx.compose.ui.unit.dp
2120
import androidx.compose.ui.unit.sp
@@ -131,6 +130,7 @@ fun PresentInstallsContent(
131130

132131
item(key = "ADD_INSTALL_BUTTON") {
133132
InstallButton(
133+
secondaryInstall = true,
134134
onClick = onClickInstall,
135135
modifier = Modifier
136136
.fillMaxWidth()
@@ -141,7 +141,7 @@ fun PresentInstallsContent(
141141
item(key = "SUPPORTED_VERSION") {
142142
AnimatedVersionDisplay(
143143
version = model.supportedVersion,
144-
modifier = Modifier.padding(bottom = 22.dp),
144+
modifier = Modifier.padding(bottom = 30.dp),
145145
)
146146
}
147147

@@ -166,6 +166,21 @@ fun PresentInstallsContent(
166166
)
167167
}
168168
}
169+
170+
item(key = "END_INDICATOR") {
171+
Box(
172+
contentAlignment = Alignment.Center,
173+
modifier = Modifier
174+
.alpha(.6f)
175+
.padding(top = 12.dp)
176+
.fillMaxWidth(),
177+
) {
178+
Text(
179+
text = "...",
180+
style = MaterialTheme.typography.labelSmall,
181+
)
182+
}
183+
}
169184
}
170185
}
171186

@@ -185,6 +200,7 @@ fun NoInstallsContent(
185200
ProjectHeader()
186201

187202
InstallButton(
203+
secondaryInstall = false,
188204
onClick = onClickInstall,
189205
modifier = Modifier
190206
.fillMaxWidth()
@@ -193,54 +209,27 @@ fun NoInstallsContent(
193209

194210
AnimatedVersionDisplay(
195211
version = supportedVersion,
196-
modifier = Modifier.padding(bottom = 22.dp),
212+
modifier = Modifier.padding(bottom = 30.dp),
197213
)
198214

199-
Box(
200-
modifier = Modifier.fillMaxSize(),
215+
Column(
216+
verticalArrangement = Arrangement.spacedBy(12.dp, Alignment.CenterVertically),
217+
horizontalAlignment = Alignment.CenterHorizontally,
218+
modifier = Modifier
219+
.alpha(.7f)
220+
.padding(bottom = 90.dp)
221+
.fillMaxSize()
201222
) {
202-
Column(
203-
verticalArrangement = Arrangement.spacedBy(6.dp),
204-
modifier = Modifier
205-
.alpha(.1f)
206-
.fillMaxSize()
207-
) {
208-
for (i in 0..<3) key(i) {
209-
Surface(
210-
content = {},
211-
shape = MaterialTheme.shapes.medium,
212-
tonalElevation = 2.dp,
213-
modifier = Modifier
214-
.fillMaxWidth()
215-
.height(195.dp)
216-
.shadow(
217-
clip = false,
218-
elevation = 2.dp,
219-
shape = MaterialTheme.shapes.medium,
220-
),
221-
)
222-
}
223-
}
224-
225-
Column(
226-
verticalArrangement = Arrangement.spacedBy(14.dp),
227-
horizontalAlignment = Alignment.CenterHorizontally,
228-
modifier = Modifier
229-
.alpha(.8f)
230-
.align(Alignment.Center)
231-
.padding(bottom = 80.dp),
232-
) {
233-
Text(
234-
text = """ /ᐠﹷ ‸ ﹷ ᐟ\ノ""",
235-
style = MaterialTheme.typography.labelLarge
236-
.copy(fontSize = 38.sp),
237-
)
223+
Text(
224+
text = """ /ᐠﹷ ‸ ﹷ ᐟ\ノ""",
225+
style = MaterialTheme.typography.labelLarge
226+
.copy(fontSize = 38.sp),
227+
)
238228

239-
Text(
240-
text = stringResource(R.string.installs_no_installs),
241-
style = MaterialTheme.typography.labelMedium,
242-
)
243-
}
229+
Text(
230+
text = stringResource(R.string.installs_no_installs),
231+
style = MaterialTheme.typography.labelLarge,
232+
)
244233
}
245234
}
246235
}

app/src/main/kotlin/com/aliucord/manager/ui/screens/home/components/InstallButton.kt

+8
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,19 @@ import com.aliucord.manager.R
1414
@Composable
1515
fun InstallButton(
1616
enabled: Boolean = true,
17+
secondaryInstall: Boolean,
1718
onClick: () -> Unit,
1819
modifier: Modifier = Modifier,
1920
) {
2021
FilledTonalIconButton(
2122
shape = MaterialTheme.shapes.medium,
23+
colors = IconButtonDefaults.filledTonalIconButtonColors(
24+
containerColor = if (secondaryInstall) {
25+
MaterialTheme.colorScheme.secondaryContainer
26+
} else {
27+
MaterialTheme.colorScheme.primary
28+
},
29+
),
2230
enabled = enabled,
2331
onClick = onClick,
2432
modifier = modifier,

app/src/main/kotlin/com/aliucord/manager/ui/screens/home/components/InstalledItemCard.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fun InstalledItemCard(
4343
)
4444
) {
4545
Column(
46-
verticalArrangement = Arrangement.spacedBy(20.dp),
46+
verticalArrangement = Arrangement.spacedBy(24.dp),
4747
modifier = Modifier.padding(20.dp),
4848
) {
4949
Row(

app/src/main/res/values/strings.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<string name="permissions_grant_title">Grant Permissions</string>
3535
<string name="permissions_grant_body">In order for Aliucord Manager to function, file permissions are required. Since shared data is stored in ~/Aliucord, permissions are required in order to access it.</string>
3636

37-
<string name="installs_no_installs">No installations founds!</string>
37+
<string name="installs_no_installs">No installations found!</string>
3838
<string name="launch_aliucord_fail">Failed to launch Aliucord</string>
3939

4040
<string name="settings_theme">Theme</string>

0 commit comments

Comments
 (0)