-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add install options screen (#70)
- Loading branch information
1 parent
cd517b8
commit 9d6cdf2
Showing
64 changed files
with
771 additions
and
625 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
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
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
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
36 changes: 36 additions & 0 deletions
36
app/src/main/kotlin/com/aliucord/manager/ui/components/AnimatedVersionDisplay.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,36 @@ | ||
package com.aliucord.manager.ui.components | ||
|
||
import androidx.compose.animation.* | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.draw.alpha | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.text.SpanStyle | ||
import androidx.compose.ui.text.font.FontWeight | ||
import androidx.compose.ui.text.withStyle | ||
import com.aliucord.manager.R | ||
import com.aliucord.manager.ui.util.DiscordVersion | ||
|
||
@Composable | ||
fun AnimatedVersionDisplay( | ||
version: DiscordVersion, | ||
modifier: Modifier = Modifier, | ||
) { | ||
AnimatedVisibility( | ||
enter = fadeIn() + slideInVertically { it * -2 }, | ||
exit = fadeOut() + slideOutVertically { it * -2 }, | ||
visible = version !is DiscordVersion.None, | ||
modifier = modifier, | ||
) { | ||
VersionDisplay( | ||
version = version, | ||
prefix = { | ||
withStyle(SpanStyle(fontWeight = FontWeight.Bold)) { | ||
append(stringResource(R.string.version_supported)) | ||
append(" ") | ||
} | ||
}, | ||
modifier = Modifier.alpha(.5f), | ||
) | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
app/src/main/kotlin/com/aliucord/manager/ui/components/ResetToDefaultButton.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,28 @@ | ||
package com.aliucord.manager.ui.components | ||
|
||
import androidx.compose.animation.AnimatedVisibility | ||
import androidx.compose.material3.* | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.res.stringResource | ||
import com.aliucord.manager.R | ||
import com.aliucord.manager.ui.util.mirrorVertically | ||
|
||
@Composable | ||
fun ResetToDefaultButton( | ||
enabled: Boolean, | ||
onClick: () -> Unit, | ||
modifier: Modifier = Modifier, | ||
) { | ||
AnimatedVisibility(visible = enabled, modifier = modifier) { | ||
IconButton(onClick = onClick) { | ||
Icon( | ||
painter = painterResource(R.drawable.ic_refresh), | ||
tint = MaterialTheme.colorScheme.secondary, | ||
contentDescription = stringResource(R.string.action_reset_default), | ||
modifier = Modifier.mirrorVertically(), | ||
) | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
app/src/main/kotlin/com/aliucord/manager/ui/components/TextDivider.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,33 @@ | ||
package com.aliucord.manager.ui.components | ||
|
||
import androidx.compose.foundation.layout.* | ||
import androidx.compose.material3.* | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.text.font.FontWeight | ||
import androidx.compose.ui.unit.dp | ||
|
||
@Composable | ||
fun TextDivider( | ||
text: String, | ||
modifier: Modifier = Modifier, | ||
) { | ||
Row( | ||
horizontalArrangement = Arrangement.spacedBy(6.dp, Alignment.CenterHorizontally), | ||
verticalAlignment = Alignment.CenterVertically, | ||
modifier = modifier | ||
.fillMaxWidth(), | ||
) { | ||
HorizontalDivider(Modifier.weight(1f)) | ||
|
||
Text( | ||
text = text, | ||
style = MaterialTheme.typography.bodySmall, | ||
color = MaterialTheme.colorScheme.outline, | ||
fontWeight = FontWeight.SemiBold, | ||
) | ||
|
||
HorizontalDivider(Modifier.weight(1f)) | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...screens/home/components/VersionDisplay.kt → ...d/manager/ui/components/VersionDisplay.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
109 changes: 0 additions & 109 deletions
109
app/src/main/kotlin/com/aliucord/manager/ui/components/dialogs/InstallerDialog.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.